This has not been my experience at all. For my 5" powered studio monitors, the _only_ way to get a interference-free signal from my desktop computer was with an optical cable to an external DAC.
As others replied, you may have grounding problems, that is, either the lack of grounding or too much of it (ground loop). An effective way to solve the problem is to isolate the signal by putting an audio transformer in between the outputs and the amplifier (or amplified speakers), one for each output. I've done this for desktops and laptops and it brought the noises to zero. Just make sure the transformers are of decent quality and suitable for audio.
That's probably a grounding problem, and was probably just coincidentally broken since optical cables don't carry electrical signals, and hence can't be a part of ground loops.
You're giving me flashbacks to the stupid amount of time it took for me to identify a coil whine issue on my motherboard that gets worse when the CPU is in power saving mode.
I 'worked around' the issue for the longest time by leaving covid based processing going on folding@home, which would force my CPU into turbo mode.
Eventually I found out that if I disabled cstates, it mostly went away.
Can you please tell me what optical cable you used? Struggled with this issue for years and if an optical cable somewhere in the chain can fix my problem i'd love to buy one.
there's basically only one kind of optical cable used in consumer audio (S/PDIF+TOSLINK, or however you want to refer to it). the trick is to arranging for both ends to use it.
GP probably has a sound card with optical output and speakers with optical input. This is usually called Toslink or SP/DIF (the latter may refer to a coax link - wired so won't help with ground loops).
The fiber is standard and you don't need any fancy Monster fiber costing $100 a foot.
This has not been my experience at all. For my 5" powered studio monitors, the _only_ way to get a interference-free signal from my desktop computer was with an optical cable to an external DAC.