Solved spdif pcm stereo crackling
#1
Hi Folks,

i just had a strange issue and just want to share my findings, in case anyone else has the same problem.

I use a LogiLink 7.1 USB Sound Box (see on LogiLink.com) to output SPDIF audio via Toslink to my Yamaha RX-V775. AC3 and DTS Passthrough work fine, but PCM 2.0 stereo puts some crackles above the music. But: If i connect the analog output of the Sound Box to my AVR, stereo is fine. So audio in principle arrives fine in the usb box, but still somehow the PCM output is messed up.

The Problem was choosing the correct audio device. My USB Sound Box is offered by kodi in three variants:

USB Sound Device (@:CARD=Device,DEV=0), Analog
USB Sound Device (surround21:CARD=Device,DEV=0) Analog
USB Sound Device, S/PDIF

Initially I chose the last one, S/PDIF, because I thought this was what I wanted.
After switching to the first one, everything works fine. The last one is still chosen as Passthrough device, of course. Clean 2.0 PCM sound and working passthrough multichannel audio. There is a downside though: The first device only offers 48000 Hz Sampling rate, hence all my 44100 Hz audio files will suffer from resampling... The second device offers also 44100, but sounds really strange.

So i guess the snd_usb_audio does not know this device really well...

Edit: I just had a look into the datasheet of the device found at the link above, and it clearly states the S/PDIF output to support only 48kHz. So when the "USB Sound Device, S/PDIF"-device offers 44100 Hz, this really is wrong and results in bad audio if played back at 44100 Hz. If I set it t the "USB Sound Device, S/PDIF"-Device to a fixed 48kHz, Stereo works fine, but passthrough is disabled. So in the end i am quite lucky that the first "USB Sound Device (@:CARD=Device,DEV=0), Analog" is indeed correct in reporting only 48 kHz so that it uses only 48 kHz even if not set to 'fixed' while still allowing passthrough (and AC3 transcoding if set to only 2.0 analog connections)
Reply
#2
Just wanted to add to this, since I ran into the same issue:

The device that is talked about here is indeed the LogiLink 7.1 (reported in lsusb as "C-Media Electronics, Inc. CM106 Like Sound Device").

To set this device up: Run pavucontrol and under configuration set the output to the digital stereo output (yes, stereo). Then under the tab Output devices you can click on Advanced and enable AC3 and DTS. This makes sure that Kodi knows that the Logilink device supports these options.

Then in Kodi just choose the S/PDIF device (reported as CM106 Like Sound Device), enable passthrough and enable DTS and AC3. I did not select the DTS transcoding, but depending on your AVR you may have to.

Up to this point everything worked, but indeed the stereo sound was crackling / noisy. The problem is that you, as OP said, you want to set the resampling frequency to a max of 48 Khz. If you set it to Fixed in Kodi you cannot enable passthrough, so that's not desirable.

You can fix this by:
sudo nano /etc/pulse/daemon.conf
And add this:
default-sample-rate = 48000
alternate-sample-rate = 48000
Then:
pulseaudio -k
pulseaudio --start
(no sudo).

Et voila, no more crackling issues and all your audio will go through your AVR (you can turn on stereo upmix if you want).
Reply

Logout Mark Read Team Forum Stats Members Help
spdif pcm stereo crackling0