Should a PAM8403 be directly fed from a CHIP GPIO audio signal?
Connecting the potmeter at the output is a no-go. That will simply not work (assuming you want "decent" volume control). You have to regulate the volume at the input of the amplifier.

The 100 nF capacitor is there to prevent any DC coming out of the C.H.I.P. module to disturb the amplifier.

Also improve the supply arrangement by using separate wires for each module and 1 uF capacitors near the supply connections of the modules.







simulate this circuit &ndash; Schematic created using CircuitLab

Next time please educate yourself on "how things are done" regarding audio amplifiers and volume control. There are plenty of examples to be found if you just search for it. "Trying" things out in electronics seldom gives the result you want and only feeds frustration and can also damage components.