LE8.2.2 RPi3 USB DAC crackling

  • Hi!

    I have a RPi3 + 5.1 USB DAC setup in my living room wich i recently updated from OpenElec 7.x to LibreElec 8.2.2. Since the update the DAC started to make strange crackling noises.

    The pops seem to happen mostly when there is silence in the video i'm watching / music i'm playing.

    I have tried everything that came to my mind to fix it but nothing helped. I have tested the setup with multiple different power supplies, another RPi3 board, an RPi2 model B and another SD card. I even tried connecting the DAC through a USB HUB.

    I tried to load the snd_usb_audio kernel module with the parameter nrpacks=1.

    I played with various USB kernel command line parameters that have been known to fix sound card issues in the past. Eg:

    dwc_otg.fiq_enable = 0, dwc_otg.fiq_fsm_enable = 0 and dwc_otg.fiq_fsm_mask with all the possible combinations made the situation worse. Changing the dwc_otg.nak_holdoff value did not have an effect.

    dwc_otg.speed = 1 seems to remedy the problem but makes the ethernet connection run unacceptably slow.

    I also tried to change the CPU governor to "performance".

    If i change the channel config in kodi to 4.0 the crackling stops but then i have no center/sub channel.

    Setting anything else (fixed sample rate, keeping the audio device on, etc...) in the audio menu did not have an effect.

    The audio codec and media source does not matter, it happens with flac, aac, and ac3, with local files and pvr.

    The strangest thing is that sometimes the system just changes it's mind and theres no noise for 10-20 minutes then it starts again.

    So far the only way i could stop the crackling without undesirable side effects was to downgrade to OE 7.0.1. That version works perfectly on the same hardware.

    Details about my setup:

    Sound card: Creative SB X-Fi 041e:30df Creative Technology, Ltd

    lsusb -v pastebin: y3b1Ls8y

    I run the RPi3 with stock settings, no overclocking. I use a clean LE install with "factory default" settings.

    I found nothing in dmesg or kodi debug log related to the issue.


    Any suggestions?

  • I installed raspbian stretch 2017-11-29 (kernel version: 4.9.59-v7). For some reason aplay did not like my test files so i installed VLC. It works perfectly, no noise there.

    I also tried to install Kodi (17.5 Git: 20171024-42caaae) on top of raspbian. Using the same audio settings as in LibreELEC i still can hear a pop from time to time but only when there is absolute silence in the audio track played. Overall it behaves much better than when it is running on LE.

    Is there something else i should try?

  • Yes, setting dwc_otg.speed to 1 resolves the problem on raspbian too.

    Thinking that it might be related to Kodi's CPU usage i tried to play music in vlc while running stress --cpu 3 and then stress --cpu 4 but the audio was still good.

  • Thanks for the suggestion! I will record some samples of the issue and then i will report it there too.

    In the meantime i wanted to implement a quick fix. I really like Kodi 17 and the "new" Estuary skin so i tested some early 7.9* alpha builds in the hopes that maybe one of them will turn out to be working fine. I went all the way back to 7.9.001. Unfortunately the crackling is present in all of the tested versions too.

    Then i did something sick. I unpacked the SYSTEM file from both 8.2.2 and 7.0.3, copied the kernel modules from the 7.0.3 /lib/modules folder into the unpacked 8.2.2 folder and repacked it. Then i replaced the SYSTEM file with this new squashfs in the 7.0.3 image.

    The resulting system complains about the modification of the cmdline.txt file but after a 60 second delay it boots up and works perfectly without significant audio issues.

    When there is absolute silence during playback there is still some background noise. It has the same "pattern" as on the newer versions but it is so quiet that i have to stand directly in front of the speakers to hear it. It may have been there in the "pure" 7.0.3 version of LibreELEC, maybe i just never noticed it.

    Because of my findings i assume something went really bad between the 4.4.3 kernel and the one 7.9.001 uses (i can't remember which one it was exactly).