HifiBerry Audio Issue - Solved
Posted: Sat Dec 06, 2025 12:18 am
Hi, I'm running on an RPi 4B (Trixie) with HifiBerry ADC+DAC, and had more or less severe issues with crackling sound under medium load, especially when having AA active. Bluetooth only profile was much better. I found a solution to my problem and wanted to share:
Basically I have seen two problems with pipewire and the hifiberry:
To force the quantum setting in pipewire i added this file:
~/.config/pipewire/pipewire.conf.d/custom.conf
Add this at the end to make core 3 exclusive:
/boot/firmware/cmdline.txt
Then create a new file, which ties pipewire-pulse to core 3:
~/.config/systemd/user/pipewire-pulse.service.d/cpu.conf
I also tried to put pipewire to core 3, but it at AA launch I had little crackling the first second. I just made a additional file (~/.config/systemd/user/pipewire.service.d/cpu.conf) and tied it to core 2 in the same way, while tying my python-widget-stuff to core 1... Works flawless now, pw-top shows no more errors!
Basically I have seen two problems with pipewire and the hifiberry:
- alsa_input.platform-soc_sound.stereo-fallback needs clock.quantum > 256 to not get packet loss. so a higher value, like 1024 works perfectly fine
- on the other hand there seems to be a problem with the echo-cancelling module, which exclusively works with clock.quantum=480. If the alsa_input.platform-soc_sound.stereo-fallback has another quantum set, packets get lost there also.
To force the quantum setting in pipewire i added this file:
~/.config/pipewire/pipewire.conf.d/custom.conf
Code: Select all
context.properties = {
default.clock.quantum = 480
default.clock.min-quantum = 480
default.clock.max-quantum = 480
}
node.rules = [
{
matches = [{ node.name = "alsa_input.platform-soc_sound.stereo-fallback"}]
actions = {update-props = {node.force-quantum = 480}}
}
]/boot/firmware/cmdline.txt
Code: Select all
isolcpus=3 nohz_full=3 rcu_nocbs=3~/.config/systemd/user/pipewire-pulse.service.d/cpu.conf
Code: Select all
[Service]
CPUAffinity=3