Speaking of ground loops, I encountered a one several years ago that I solved but never understood why it worked.
I built a stepped attenuator "preamp" using a pair (1 per channel) of Goldpoint 24-position switches loaded with metal film resistors. Resistor values selected so that every position had a 10 kOhm load to the source, and they were 2 dB apart. All standard unbalanced RCA. It worked great, but there was a low level hum. Long story short, I changed the wiring so that one channel (the left, but it shouldn't matter which) had its signal ground wired to the frame. As originally built, I wired both + and - for each channel straight through, both isolated from the metal frame of the attenuator. I only guessed at the solution of asymmetric grounding, connecting 1 but not both to the frame. It worked (eliminated the hum), though I never knew exactly why. Later when I built a phono headamp from the DACT CT-100 (powered by 12 V batteries, not connected to the wall), I encountered the same problem and the same technique (applied to the high level output, not the low level input) fixed it. Then, in a different house, I encountered a low level hum from the phono amp that was fixed by doing the opposite: connecting the grounds to each other so both were latched to frame.