I have had several situations where everything is hum free, but when I disconnect or power down the signal source (smart phone, computer etc..) I start hearing annoying humming noise. The noise goes away when the signal source is plugged in and powered.
Latest example was some cheap multimedia speakers connected to USB sound card. Everything work pretty much hum free when used, but when the USB sound card gets powered down when computer goes to sleep, a very annoying strong distorted humming noise from speaker starts if I have left the speakers on.
I found out that those speaker make strong noise also when their built-in sound cable is not plugged to anything. It seems that this speaker starts picking noise though the 3.5 mm plug and the cable going to to speaker.
The powered speaker has quite high input impedance, so if the cable is not very well shielded, it will pick very easily capacitively mains humming noise when not connected to anything. In my case it seemed that the shielding was not very good in this cheap Biltema speaker, and the cable was fixed to the speaker (cannot be changed easily).
The same cable is relatively noise free when connected to a signal source that has quite low output impedance (like sound card speaker/headphone audio out). The low source impedance pretty effectively seems to “eat” the humming noise coupled to cable almost completely.
But when the signal source is not powered, it becomes high impedance, and the speaker cable lets the noise pass through.
To reduce the noise problem I tried several things to bring down the source impedance when the actual source is powered down. I tried an audio isolation transformer. It helped somewhat, but not well enough.
I tried also few kilo-ohms resistors from L channel to ground and R channel to ground, that had helped on one earlier case. But still not enough noise reduction.
The final idea I tried was to use 3.5 mm Y cable connected to the headphone output. On one output I connected small 32 ohms headphones you put normally into your ear. The other side was connected to the speakers. This 32 ohms headphone impedance was low enough to keep noise out when USB sound card is not powered or not connected at all. When I need to hear sound, the headphone output will nicely drive both the headphones and high impedance amplified speakers input.
This worked well as my temporary solution. I know that the load caused by the headphones can affect somewhat negatively on the sound quality that goes to the speaker, but for this application the resulting quality was “good enough” and did not make the sound quality noticeably worse on those speakers.
There is saying: If It Looks Stupid But Works, It Ain’t Stupid.