Hi! I was just wondering if anybody else has come across this, basically I’m trying to build a media player, and what I have is my main program (Arduino) running on core 1, and a background task on core 0 that constantly monitors a ring buffer for audio data, and sends anything in there to the DAC.

My issue is with starting and stopping playback. While audio is playing, it sounds fine. But if I stop audio (ie stop feeding the ring buffer), and then start it again, I get a half-second horrible sounding glitch before it sounds normal again.

My research has led me to think this is some sort of auto-shutdown feature of the PCM5102, and when data resumes, it tries to “lock on” to it again, producing the glitch. My idea was to try to keep it alive by filling in the buffer with 0s (silence) while no audio is being played back. Is there maybe a better way of doing this, or am I on the right track here?