DC brick powered TPA3118 hums with a guitar.

I have one of these boards (a clone of the TI example) running from a guitar preamp and it sounds great to my ears. BUT... it hums when I have the guitar volume turned up (magnetic pickups). No hum with guitar volume at ZERO. I was initially thinking it was my cables, but I noticed that when I unplug the supply (24VDC switch mode brick) the hum goes away for a second and the signal comes through just fine until the filter caps discharge.

So I'm thinking PSU issue.

But... is there something I could be overlooking? Do I need to just add more filtering?
 
The frequency of the noise can be tracked or calculated.
870 uF is too much for those frequencies, which is why I said use 100 pf and a larger nF cap in parallel with the rails as filters.
A choke might work.
If you can, charge the batteries, and use it on battery while listening to music.
Then no noise...
 
Rotate around, meaning point North-South-East-West with your guitar plugged and humming.
If hum changes significantly, your pickups are picking some magnetic interference , which might even come from the PSU itself.

You can use your pickups as detectors to find the hum source.
 
For anyone wondering, the solution turns out that the DC brick must have a 3rd prong earth ground. I tried connecting earth to amp chassis ground (2.1mm barrel power plug) and the hum is gone. Some bricks have ground fed to the outside barrel of the 2.1mm power connector. This solves the issue.

Someone pointed out the problem in ny twin to this thread in "Class D" forums. Apparently, guitars need to be earthed at the amplifier or PSU noise feeding through the pickups will result. I also notice noise when recording guitar direct through a modeller. Maybe this earthing will fix that as well.