How about your common grounds. Is the grounds connected when using battery, or just when using USB ?
I don't use a battery, I'm using a 200mA 9V power supply, I just connected GND to ground but I think I also tried connecting it to GND1 also.
The 5V coming through USB is filtered. Though the 9V should not be noisy enough to create what you are describing.
You can try adding 0.1uF and/or 4.7uF caps between Pos and Neg close to the battery.
This also applies to a power supply?
If the regulator went to thermal shutdown, it would be off for a while.
But if there was not a common ground, it cold produce such symptoms.
Where's the OP. Maby they have a hopping weekend, and left us till Monday. LOL
why a thermal shutdown? It's not that the Nano goes off, it just produces a noise audio output. Also tried a blink program and it works fine with the power supply only.
Could it be that is a noise power supply? Is there a way to reduce that? Maybe with a capacitor as said above?
I'm sorry, I haven't been in the PC all this time to answer!!!
The strange thing is that when I touch the USB input of the Nano with the outside of the mini USB plug that is connected to the PC it works fine
That means you haven't got a common ground between your arduino and your audio circuits.
No no, everything has common ground! Im using only the one on the power supply, also I'm probing on the audio output of the schematic (on the right)