[SOLVED] Audio Crackling, Popping & Stuttering with PipeWire & Gamescope on Linux
When gaming on Linux (Steam Deck, Bazzite, Fedora, Arch) through Gamescope or Proton, players often notice metallic clicking, static pops, or sound cutting out (audio crackling). This annoyance is rooted in xruns (buffer underruns), where PipeWire fails to deliver rendered audio buffers within the tight deadline demanded by the sound card.
Quick Diagnostics
Step-by-Step Solution
-
1
Step 1: Detect Audio Buffer Underruns (xruns) Live
Run the interactive PipeWire performance profiler while your game is active:
BASHpw-topObserve the ERR column. If counter values increment in tandem with audible pops, your system is dropping audio frames due to buffer starvation.
-
2
Step 2: Configure a Resilient Audio Quantum Latency Profile
Create a dedicated configuration drop-in file to enforce stable buffer sizes:
BASHmkdir -p ~/.config/pipewire/pipewire.conf.d/ nano ~/.config/pipewire/pipewire.conf.d/99-quantum-latency.confAdd the following blocks:
PLAINTEXTcontext.properties = { default.clock.rate = 48000 default.clock.quantum = 1024 default.clock.min-quantum = 512 default.clock.max-quantum = 2048 } -
3
Step 3: Tune ALSA and Proton Wine Audio Emulation
Games running under Proton interface through ALSA or PulseAudio bridges. Prevent resampling distortions:
BASHmkdir -p ~/.config/pipewire/client.conf.d/ nano ~/.config/pipewire/client.conf.d/alsa-resample.confPaste:
PLAINTEXTalsa.properties = { alsa.deny = false alsa.format = "S16LE" alsa.rate = 48000 }Apply the adjustments by restarting user audio daemons:
BASHsystemctl --user restart pipewire pipewire-pulse wireplumber
Frequently Asked Questions
Does a 1024 quantum introduce noticeable input lag?
At 48 kHz, a 1024 sample window equals approximately 21 milliseconds of total audio latency—completely unnoticeable during gameplay while eliminating pops.
How do I revert custom PipeWire overrides?
Delete the custom files in ~/.config/pipewire/ and reload with systemctl --user restart pipewire.
Prevention Advice
Recommended security practices:
- Avoid forcing ultralow latency buffers (64 or 128) during intensive 3D gaming.
- Ensure
rtkitis running to grant PipeWire real-time scheduling priority under load.