As others have pointed out, must use a good power supply. I use the 24V auxiliary output on a Cioks DC7 and it's dead quiet. Best pedal board power supply ever made. I just got a cheapo 19V from amazon and it whines. Now I need to see if there is a remedy for that...
After some testing, the problem is direct power supply noise. The TPA3118 module itself is rejecting this noise. Very quiet until I attach the preamp. Found no evidence of ground loop or RFI getting into the preamp. Purely power supply noise. Solution is simple. The preamp draws very little current, so adding a 470-ohm resistor in series with the supply line to the preamp solves the problem. The RC filter of 470 ohm and the on-board 10uf resolves the noise completely.
Post above has been updated with corrected schematic and PCB.
Still have a problem. It's quiet with the cheapo power supply and a guitar plugged in directly and sounds nice on it's own. Fendery clean with the choice of EQ in the preamp. But, married with my pedal board at large, some of the whine comes back if I use the cheapo power supply. Still dead quiet using the Cioks DC7, of course. My guess is differential ground noise between the board and the amp with the cheapo supply. Next step is to see if I can get a solid, clean ground across all the pedals with a cheapo power supply in the mix.
And again... Further testing. My choice of cheapo supply has a 3-prong, grounded power cord. The earth ground of the mains line is directly connected to the negative of it's 19V output. This allows the cheapo supply to directly insert it's ground noise into a ground loop when connected to the pedal board. The solution to this problem is to ensure one, and only one, connection of your pedal supplies back to mains earth ground. My pedal board is already earth grounded via the Cioks DC7. The added grounding via the cheapo supply causes the noise. Removing the earth ground on the cheapo supply mains line eliminates the noise. Finally clean and works really well.
Summary of my learning building these things...
- TPA3118 is great. Flat frequency response (which is too dark on it's own, IMO). And rejects the noise of a cheapo power supply very well.
- Need a preamp to boost guitar/pedal/instrument level up to line level to drive the TPA3118 well.
- Fender-like EQ choice for the preamp works really well. Flat response from 20hz up to ~1kHz and then passive high-pass to boost the top end above ~1khz. (See C5/R6 and C6 in the schematic. Tweak to taste.)
- Cheapo power supply can work. TPA3118 can handle it but the preamp cannot. Need a good RC filter or better regulator to get clean power to a preamp. With ~20V available, an RC filter is fine for a simple preamp like this drawing under a mA.
- Don't allow more than one path from circuit ground back to mains earth from your pedal board supplies, especially if using a cheapo supply for the TPA3118. Do make sure you have ONE solid earth ground from your pedal board for safety, of course.
- Cioks DC7 is awesome and can drive the TPA3118 using it's auxiliary 24V output. (I was already doing this with a quilter amp, which is also really nice).
Next up... I've ordered three different EQ boards from here to make some bigger, more full featured pedal board amps. I have a "Cold Turkey", "Box and All" and a "6 band EQ (Pot version)" boards that all arrived today. Nice timing.
And I have a couple 100W TPA3116 boards to try out.