I2S noise when stopped and paused

Raspberry Pi related support

I2S noise when stopped and paused

Postby fboe » 14 Aug 2017, 20:10

Hi

I have a Strange problem with a new Dac from Mirand Audio with the src4392 chip as i2s receiver.
It plays really good with the Hifiberry Dac driver, but when I stop the music, there are clicks in the speakers every half second - and it sound differenvpce every time I stop. But when the playlist runs out, and the players stop, there is no clicks?! Then I tried to take the i2s from the new hifiberry digi+ pro and there is no problem at all. So does someone have a soloution? - is it the hifiberry Dac driver?

Cheers Anders
fboe
 
Posts: 27
Joined: 11 Mar 2016, 17:41
Location: Odense, Denmark

Re: I2S noise when stopped and paused

Postby janui » 18 Aug 2017, 15:37

Hi fboe,
When you are using the I2S output from the hifiberry digi+ pro I assume you also supply a master clock signal (connections GND, DATA, LRCK, BCK & MCLK). The src4392 then works in slave mode.
When attached directly to the pi there is no master clock signal available and the src4392 works (automatically) in master mode. The src4392 then generates its own master clock signal at a frequency derived from the available signals (connections GND, DATA, LRCK & BCK).
It is possible that the src4392 loses track of the word length when paused in master mode, this would cause noise or clicks. The default word length for the src4392 is 24bits. But the Hifiberry Dac driver works in 16bit or 24bit mode. A possible solution could be to force the Hifiberry Dac driver to always use 24bit mode.
Instructions for the fix and an explanation (for a totally different problem) are here post18251.html?hilit=es9018%20force#p18251
Janui
User avatar
janui
 
Posts: 699
Joined: 20 Dec 2014, 12:55
Location: Ollanda

Re: I2S noise when stopped and paused

Postby MarcelvdG » 05 Jan 2018, 09:27

I got similar clicks from a very different set-up, also with an SRC4392:

Raspberry Pi model 3B running Volumio
Connection from the Pi to an FPGA board via I2S (Raspberry Pi master, FPGA slave)
Connection from the FPGA board to an SRC4392 via I2S (FPGA master, SRC4392 slave)
Connection back from the SRC4392 to the FPGA board via I2S (FPGA master, SRC4392 slave)
Connection from the FPGA board to a DIY DAC

When I stop or pause Volumio, the bit clock and word clock are stopped. I'm not sure if the clocks to the SRC4392 then stop or just get way below the normal frequency range, but at least they are out of the range supported by the SRC4392. I then get the exact same clicking sound that the thread starter described. By the way, the interface from FPGA board to SRC4392 is always 24 bit (if I configured the FPGA correctly).
MarcelvdG
 
Posts: 3
Joined: 05 Jan 2018, 09:18

Re: I2S noise when stopped and paused

Postby MarcelvdG » 05 Jan 2018, 10:37

I later changed my FPGA code such that the sound was muted whenever there was no bit clock coming out of the Raspberry Pi. That solved the issue of the clicks during pauses, but it didn't solve everything.

The interface to the FPGA board has an I2S and a raw DSD mode. There is a simple mode control input that switches between these modes. I found out by chance that toggling this input too quickly (like 80 times per second, 40 Hz) could also bring the system in a state where it either produces sound with excessive noise or distortion, or no sound at all except for the periodic clicks. Switching between I2S and raw DSD mode without changing the actual signal changes the bit clock and word clock frequencies going from my FPGA to the SRC4392. Interrupting the bit clock, word clock or data for a second or so could get it back to normal again.

Switching slowly does not cause this problem. I've connected a square wave oscillator of about 0.5 Hz switching back and forth between I2S and raw DSD mode for an hour or so without it ever getting into the silence-with-clicks mode.

I suspect that the SRC4392 produces the clicking sounds when its input bit and/or word clocks are way out of range, but also when it gets switched too fast between different clock frequencies.
MarcelvdG
 
Posts: 3
Joined: 05 Jan 2018, 09:18

Re: I2S noise when stopped and paused

Postby janui » 10 Jan 2018, 17:36

Hi MarcelvdG,

If you have a recent kernel you could try a different overlay driver insted of the hifiberry driver. Try this in /boot/config.txt:
Code: Select all
dtoverlay=rpi-dac
I have had good results using it in combination with Sabre DAC's.
janui
User avatar
janui
 
Posts: 699
Joined: 20 Dec 2014, 12:55
Location: Ollanda

Re: I2S noise when stopped and paused

Postby MarcelvdG » 13 Jan 2018, 20:15

Hi all,

I've continued debugging my DAC and it turns out that everything except the clicks was due to my own Verilog code. My Verilog code could produce a spike that upset a state machine in a FIR filter somewhere on the FPGA.

Regarding the clicks, the SRC4392 produces these when its I2S clocks disappear and it doesn't switch to fast mode. Sometimes it does switch to fast mode and then there are no audible clicks.

Thanks for the tip about the driver, but for me the problem of the clicks was already solved when I just put my DAC in mute when there is no bit clock.

Regards,
Marcel
MarcelvdG
 
Posts: 3
Joined: 05 Jan 2018, 09:18

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 6 guests