Audio output on some hardware may exhibit noticeable delay, popping, cracking, etc.
To conserve energy, audio is suspended after a short delay when inactive. When waking from suspend, some audio sinks (commonly consumer TVs) can “lag” and send unwanted audio feedback.
Disable audio sleep by adding a drop-in config.
Create the text file ~/.config/wireplumber/main.lua.d/51-disable-suspension.lua
with the following:
table.insert(alsa_monitor.rules, {
matches = {
{
{ "node.name", "matches", "alsa_input.*" },
},
{
{ "node.name", "matches", "alsa_output.*" },
},
},
apply_properties = {
["session.suspend-timeout-seconds"] = 0,
},
})
Then, restart audio:
systemctl restart --now --user pipewire.service pipewire-pulse.service
Additionally, you may experience noticeable delay, popping, cracking, after waking from standby.
This is caused by a known real-time priority bug that manifests between PipeWire and rtkit.
Administrators can disable the real-time canary by editing the systemd service file.
Edit the service file:
sudo systemctl edit --full rtkit-daemon.service
Edit the line starting with ExecStart=
, appending the --no-canary
flag to the daemon.
Old:
ExecStart=/usr/libexec/rtkit-daemon
New:
ExecStart=/usr/libexec/rtkit-daemon --no-canary
You should see a message such as:
Successfully installed edited file '/etc/systemd/system/rtkit-daemon.service'.
Restart rtkit:
sudo systemctl restart --now rtkit-daemon.service
Check the daemon status with:
systemctl status rtkit-daemon.service
Your output should show something similar to the following:
CGroup: /system.slice/rtkit-daemon.service
└─11154 /usr/libexec/rtkit-daemon --no-canary
Sources
ArchWiki - PipeWire - Noticeable audio delay or audible pop/crack when starting playback
ArchWiki - PipeWire - Missing realtime priority/crackling under load after suspend
GitHub - heftig/rtkit - Canary thread “starves” after s2idle
License
This work is marked with CC0 1.0