Audio Noise on I2S

I'm using a MKRZero to play audio files via I2S using an UDA1334 I2S DAC as an amp.

I've been having a few issues with the quality of the audio playback - initially I was getting stuttering on the playback which I think was caused by a buffer underrun or something. I've solved this by using a different SD card (though I'm still a bit unclear why this worked as the better card is technically the slower one!)

My remaining issue is that when an audio file isn't being played I'm getting a lot of low level white noise on the output. This immediately disappears when a file is played.

I assume it's due to floating levels or something, but I'm not sure how to stop it.

I am using the Arduinosound library and I've noticed it starts by playing a short 'burst' of silence which seems to force the levels low (I assume) and stops the noise.

So I assume I need to decouple something (not sure how to do this) or ground something perhaps? Or is there a simple way to 'hold the output low' to create the silence as per the Audiosound library?

Any suggestions would be gratefully received!

Perhaps the library doesn't start driving I2S till first played sample.

Normally the I2S clocks must be driven all the time for a DAC to function properly. If you
stop driving the clocks the DAC will shutdown to standby and the outputs may float - this happens
with phones and mp3 players in my experience.

The output of the UDA1334 is opamp driven, so if those opamps are powered you can't eliminate
the noise - however if they are powered down (no idea, you'd need to experiment), then adding some
extra load to ground on the outputs might help (after the DC-coupling capacitor). Perhaps a few k.

This will reduce the output level somewhat, note.

To solve the problem:

Either rewrite the code, so it delivers data continuously

Or add a 1k R from each I2S line to GND. This is a pulldown of the digital signal lines, to keep them from floating when inactive

HTH
Andreas Gaunitz
Electric Gaunitz