OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
audio-input medium common DISPUTE

Fix audio crackling and stuttering when a second stream starts

omarchyarchendeavouroscachyosmanjarohyprlandwaylandpipewirelaptopdesktop
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

The configuration in this record is right and the defect class the re-audit was hunting is absent. On this workstation, pipewire 1:1.6.8-1 and wireplumber 0.5.15-1, the drop-in path ~/.config/wireplumber/wireplumber.conf.d/ is a real directory that Omarchy itself writes into (/usr/share/omarchy/install/user/hardware/asus/fix-audio-mixer.sh copies a drop-in there), not a symlink into /usr/share, and it is not a superseded full-file override. Both property names exist in the shipped ALSA plugin: strings /usr/lib/spa-0.2/alsa/libspa-alsa.so lists api.alsa.period-size and api.alsa.headroom. WirePlumber 0.5.15 ships the very same stanza at /usr/share/wireplumber/wireplumber.conf.d/alsa-vm.conf, using monitor.alsa.rules with api.alsa.period-size = 1024 and headroom 2048 or 8192, so the key name and the values are upstream's own. The Arch wiki section 'Audio cutting out when multiple streams start playing' and the upstream PipeWire troubleshooting wiki both still carry this exact fix with the exact UNDERFLOW line the symptom quotes. What was wrong is Omarchy specialisation. The restart line restarts only pipewire.service and wireplumber.service, which leaves pipewire-pulse.service untouched even though pipewire-pulse is what logs the underrun, and Omarchy ships omarchy-restart-audio (omarchy restart audio) which restarts all three and then recovers a USB audio device left in SETUP. I read that script rather than running it. Second, rtkit is not installed and is not in omarchy-base.packages or omarchy-other.packages, so libpipewire-module-rt has no RTKit bus to fall back to and realtime-privileges is the only path on Omarchy, which makes that half of the fix more load-bearing here, not less. I also confirmed by reading /usr/bin/omarchy-update-pacman-guard that the ALPM guard aborts only when both -S and -u are present, so sudo pacman -S realtime-privileges is allowed and is not a defect. Finally I checked the quantum names the fix might escalate to and kept them straight: the daemon reads default.clock.quantum, default.clock.min-quantum and default.clock.max-quantum from /usr/share/pipewire/pipewire.conf, while the pulse server reads pulse.min.quantum, pulse.min.req and pulse.default.req from /usr/share/pipewire/pipewire-pulse.conf, and the record correctly does not mix them. NOT exercised: I did not write the drop-in, did not restart any audio unit and did not install realtime-privileges, so the readback of the properties after the drop-in applies is unverified. pw-dump on this machine shows the property names in the node param list but no value, so I did not publish it as a verify step.

The cause above was not rewritten and may still contain the error described. The fix below is the corrected version.
RISK

Larger period-size/headroom adds output latency, noticeable if you do low-latency music production or competitive gaming. Halve the values if latency becomes a problem.

Symptom

Audio crackles, stutters, or cuts out, especially when a second stream starts (a Discord notification over music, a browser tab starting playback). journalctl --user -u pipewire-pulse.service shows lines like pulse-server 0x...: [Nightly] UNDERFLOW channel:0 offset:370676 underrun:940 or spa.alsa: front:0p: snd_pcm_avail after recover: Broken pipe.

Cause

The ALSA buffer/headroom PipeWire requests is too small for the device or the scheduling latency of the machine, so the ring buffer underruns each time a new stream forces a re-negotiation of the graph quantum.

Fix

The configuration is identical on Omarchy 4 and plain Arch, because both run PipeWire 1.6.8 and WirePlumber 0.5.15 and both read the same drop-in directory. Only the restart differs.

Add a WirePlumber drop-in. This is a drop-in directory, not a full-file override, so it survives a WirePlumber upgrade:


mkdir -p ~/.config/wireplumber/wireplumber.conf.d

# ~/.config/wireplumber/wireplumber.conf.d/alsa-config.conf
monitor.alsa.rules = [
  {
    matches = [
      { node.name = "~alsa_output.*" }
    ]
    actions = {
      update-props = {
        api.alsa.period-size   = 1024
        api.alsa.headroom      = 8192
      }
    }
  }
]

Then restart audio.

On Omarchy 4, use the shipped command. It restarts pipewire.service, pipewire-pulse.service and wireplumber.service together, and if PipeWire still does not answer it resets a USB audio device left stuck in SETUP:


omarchy restart audio

On plain Arch, restart all three yourself. Restarting only pipewire.service and wireplumber.service leaves pipewire-pulse.service on its old connection, and pipewire-pulse is the process that logs the UNDERFLOW:


systemctl --user restart pipewire.service pipewire-pulse.service wireplumber.service

Realtime priority is a second, independent cause of the same symptom. Omarchy does not install rtkit, so PipeWire's libpipewire-module-rt has no RTKit bus to fall back to and depends entirely on the rlimits that realtime-privileges grants. If journalctl --user -u pipewire.service shows RTKit error: org.freedesktop.DBus.Error.AccessDenied, or Failed to mlock memory ... consider increasing RLIMIT_MEMLOCK:


sudo pacman -S realtime-privileges
sudo gpasswd -a "$USER" realtime

Log out and back in for the group to take effect. Omarchy's ALPM guard aborts only a transaction carrying both -S and -u, so a plain pacman -S is allowed. If the sync databases are stale, run omarchy update first. Never use pacman -Sy <pkg>, which is a partial upgrade.

Two things to know before reaching further:

  • Inside a virtual machine you do not need this drop-in at all. WirePlumber already ships the same stanza at /usr/share/wireplumber/wireplumber.conf.d/alsa-vm.conf for PCI audio under any hypervisor.
  • If you escalate to quantum settings, those are PipeWire daemon settings rather than WirePlumber ones, and the daemon and the Pulse server use different names for them. The daemon reads default.clock.quantum, default.clock.min-quantum and default.clock.max-quantum from ~/.config/pipewire/pipewire.conf.d/. The Pulse server reads pulse.min.quantum, pulse.min.req and pulse.default.req from ~/.config/pipewire/pipewire-pulse.conf.d/. Setting one and expecting the other to move is the usual dead end.

Watch it live with pw-top. The ERR column is the underrun counter.

Verify

pw-top shows the ERR column staying at 0 while music plays and a notification fires, and no new UNDERFLOW lines appear in journalctl --user -u pipewire-pulse.service -f. Confirm the drop-in was parsed rather than skipped, because a WirePlumber file with a syntax error is ignored and the symptom then does not change: journalctl --user -u wireplumber.service -b | grep -iE 'parse|invalid' should print nothing.

Sources

audio-crackling-underruns-multiple-streams