[Solved] Pops and Clicks with RoonBridge

Hi all
I am new to DietPi, so please bear with me if I am overlooking the obvious.
Hi all
I have issues with pops and clicks when playing back DSD files. My setup is as follows:

  • Roon Core on PC with AMD Ryzen 7 1800X, plenty of RAM, Music on RAID0 array


  • Roon Bridge on Odroid C2 (installed via latest dietpi)


  • Aune S16 DAC connected to the Odroid C2 via USB (capable of PCM384 and DSD128)

The operation of the Odroid C2 and the Aune has been verified at all sample rates with Volumio for over a year.

With dietpi / RoonBridge PCM files up to 352.8 work without issues, no pops and clicks. With DSD64 and DSD128 impossible to listen to music, constant pops and clicks (in around 1 second intervals). The signal path in roon shows purple dot, no DSP engaged

I was wondering if anyone else has run into this issue and knows a solution.
I have also posted the question in the Roon Forum, but have not received any feedback.
https://community.roonlabs.com/t/pops-and-clicks-with-dsd-on-odroid-c2/48740
Thanks a lot

Maybe this will help

https://community.roonlabs.com/t/many-pops-and-clicks-resolved-switched-router-to-5ghz-network/25423/2
https://community.roonlabs.com/t/odroid-c2-roonbridge-dietpi-sound-issues/25888/3

Thanks, WarHawk
your second URL pointed in the right direction. Of course I had no idea how to change the CPU affinity for interrupt 63.
A friendly Volumio Developer then told me how this is done in Volumio, by adding the following two line to rc.local before “exit 0”:

/bin/echo 4 > /proc/irq/63/smp_affinity
/bin/echo 8 > /proc/irq/62/smp_affinity

That actually solved the problem. Smooth playback now.

@dietpi Developers. Could this be coded into the dietpi images for Odroid C2?
Thanks a lot

Hi,

Is it possible to get an ETA from the dev’s as to when they will be able to integrate the changes to the CPU affinity into the Dietpi kernal? I’m running an Audiophonics I2S streamer with Roon that is having same popping sound happening continually.

scumbag jacobacci
dietpi-process_tool actually allows to edit CPU affinities, but just for hard coded process names. But it looks like this is not a process but on firmware level? (Sorry really no idea about Roon or audio :stuck_out_tongue:!)

Otherwise could you guys please show a screen of htop while playback, showing the processes and applied affinities?

/bin/echo 4 > /proc/irq/63/smp_affinity
/bin/echo 8 > /proc/irq/62/smp_affinity

Looks a bid random. So basically the idea is to “attach” those two to different CPUs/threads, right? Would 1 and 3 work as well?

Issue opened: https://github.com/Fourdee/DietPi/issues/2101

  • I hope Fourdee has some more insight (and device to test) and can quickly implement.

Thanks for opening a issue. I see that the issue has since been closed / fixed.
Unfortunately with my Odroid C2 / dietpi 6.17 setup, pops and clicks still abound. DSD128 is covered in a sauce of pops and clicks.
My DAC is an Aune S16 connected via USB.
This is not the case with Volumio / UPnP, so its unlikely that the issue is with my hardware.
Has the fix been rolled out in 6.17, or is the rollout in a later upcoming version?
Thanks a lot

I’d love to get an answer to this as well. My issue running an Audiophonics I2S / PI3 streamer is not as bad perhaps as other’s on this thread but the constant pops and clicks are distracting. I’ve stopped using my unit at the moment and I’m using another device until this is fixed.

I have now updated dietpi to 6.19 and the pops and clocks issue with Roon Bridge is still there. Will the fix be included in the next release?

Hmm the above fix should be actually applied on Odroid C2 when selecting USB DAC sound: https://github.com/Fourdee/DietPi/blob/master/dietpi/func/dietpi-set_hardware#L1748-L1757

Can you verify:
cat /var/lib/dietpi/postboot.d/c2_smp.sh
cat /proc/irq/63/smp_affinity
cat /proc/irq/62/smp_affinity

Thanks MichaIng
This is what I’m getting when issuing the three commands:

login as: root
root@192.168.0.153's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
 ────────────────────────────────────────────────
 DietPi | Sat 26/01/19 - 22:46
 ────────────────────────────────────────────────
 v6.19.7 | Odroid C2 (aarch64)
 ────────────────────────────────────────────────
 eth0 | 192.168.0.153
 ────────────────────────────────────────────────
 DietPi Team     : Daniel Knight (founder), MichaIng, K-Plan
 Image           : DietPi Core Team (pre-image: Meveric)
 Web             : https://DietPi.com | https://twitter.com/dietpi_
 Patreon Legends : PINE64 community
 Donate          : https://DietPi.com/#donate
 DietPi Hosting  : Powered by https://MyVirtualServer.com

 dietpi-launcher  = All the DietPi programs in one place.
 dietpi-config    = Feature rich configuration tool for your device.
 dietpi-software  = Select optimized software for installation.
 htop             = Resource monitor.
 cpu              = Shows CPU information and stats.

root@DietPi:~#

root@DietPi:/# cat /var/lib/dietpi/postboot.d/c2_smp.sh
cat: /var/lib/dietpi/postboot.d/c2_smp.sh: No such file or directory
root@DietPi:/# cat /proc/irq/63/smp_affinity
f
root@DietPi:/# cat /proc/irq/62/smp_affinity
f

It is not quite clear to me what you mean by “when selecting USB DAC sound”

How did you enable the USB sound card? Via dietpi-config > Audio options or manually?

From the OT I get the you use an “Aune S16 DAC connected to the Odroid C2 via USB”. So via dietpi-config you should be able to select it from the list as “usb-dac-something”. If you do so from an Odroid C2, the above fix will be applied. But we did not patch this automatically (with DietPi v6.17) on update, so one needed to re-select the sound card.

If you did not re-select or manually enabled the sound card, do:

# Automatically apply on boot
cat << _EOF_ > /var/lib/dietpi/postboot.d/c2_smp.sh
#!/bin/bash
echo 4 > /proc/irq/63/smp_affinity
echo 8 > /proc/irq/62/smp_affinity
_EOF_

# And to apply now
echo 4 > /proc/irq/63/smp_affinity
echo 8 > /proc/irq/62/smp_affinity

Thanks, this time it worked
I was able to select the USB DAC as soundcard in dietpi-config and the clicks and pops are indeed gone.
The result of the commands is:

root@DietPi:~# cat /var/lib/dietpi/postboot.d/c2_smp.sh
#!/bin/bash
echo 4 > /proc/irq/63/smp_affinity
echo 8 > /proc/irq/62/smp_affinity
root@DietPi:~# cat /proc/irq/63/smp_affinity
4
root@DietPi:~# cat /proc/irq/62/smp_affinity
8
root@DietPi:~#

Thanks a million.

Hello
I am sad to report that i have updated my audiophonics kali i2s streamer running dietpi with roon and i still getting the popping and clicking sounds as well. This thread is marked as solved but the issue has not been solved.

scumbag
Hmm your audio device is no USB DAC and according to how much I understood the solution provided it should just have an effect on USB devices.

However just to sort it out, could you try this out and see if it solves your pops and clicks as well:

echo 4 > /proc/irq/63/smp_affinity
echo 8 > /proc/irq/62/smp_affinity

Sorry that I didn’t see this earlier, you using I²S DAC while the others use an USB DAC.

Hi,

Sorry for the belated response. I’ve been having some health issues that have been sucking up my energy of late.
OK, I am a total noob. How do I apply the commands as per your last response? I assume it is via the command line but I have zero idea how to log in to that and apply the changes. I have played in MS DOS but that’s the extent of my experience with the command line :wink:

Mark (Scumbag)

Well no reply.
Let me also add that I am unable to update Dietpi as it corrupts my installation. Also if I install the latest OS, my DAC is not included in the build and it has to be manually installed. I have no idea how to do that.
I am basically going to give up on Dietpi if I don’t hear anything back on this thread soon. I’ll have to try to find another OS that works with Roon. If I can’t find one then I am going to sell my PI3 device - this is too much hacking for me when I can buy an (admittedly more expensive) solution that simply works without months of fudging around on forums.

I am afraid using is2 is not the best of approaches if you don’t like fudging around on forums. Contrary to USB, is2 is not standardized and it is a protocol designed for very short distance communication between chips. Audiophile nerds use is2 (contrary to the purpose it was designed for) to connect physically separate components, but that is far from a plug and play approach. I would very strongly advise you to use something out of the box and use USB or SPDIF to connect your DAC.

Well that got a speedy response. Pity there wasn’t anything to help me fix the issue.
This is not isolated to I2S. Have a look at the references to pops and clicks in Dietpi and you’ll find a range of devices that have the issue. It seems to be related to CPU affinity. I reached out for help about a month ago and then about a week ago to get a solution.
But I think you’re confirmed what I thought. Dietpi is not for me. I’m of to try another OS.

I don’t believe it will be any easier with another OS. All the stuff on Raspberries is based on Linux, so you will have to go through the same learning curve with all of them.
What you need to do here is to SSH into your RP:

  • Get Putty


  • Determine the IP address of your RP using Advanced IP Scanner


  • connect to the RP using Putty


  • login with Userid root, PWD dietpi


  • apply the commands in question

Hope this helps

scumbag
Lets fix hat update issue you have first. I guess you tried to update to v6.20 some time ago which failed? Please try the following to update to v6.21. Yeah for this either connect a keyboard + monitor to your Odroid or use PuTTY on Windows to log in via SSH by providing your local network IP address of the Odroid in the program. Login at best with root user, default password “dietpi” or whatever you chose on initial install. Then run, by typing these lines one by one to your terminal or when using SSH/PuTTY simply copy & paste everything into the cmd window and press return:

> /DietPi/dietpi/.update_stage
> /etc/profile.d/dietpi-unsupported_terminal.sh
echo 1 > /DietPi/dietpi/.install_stage
dietpi-update 1

To test resolving the pops and clicks, do the same with the low commands:

echo 4 > /proc/irq/63/smp_affinity
echo 8 > /proc/irq/62/smp_affinity