PipeWire Low Latency on Linux

·

Linux audio used to mean choosing between consumer convenience (PulseAudio) and pro routing (JACK). PipeWire aims to replace both with one graph that can hit low latency without abandoning desktop apps. This guide compares the stacks, shows how to lower quantum, and covers monitoring with pw-top. For a quick reality check in the browser, use our online audio latency test in Chrome or Firefox.

PipeWire vs PulseAudio vs JACK

  • ALSA talks to the hardware. Everything else usually sits on top.
  • PulseAudio made desktop mixing easy but often added substantial buffering — ballpark 50–100 ms class experiences were common on untuned systems.
  • JACK is built for realtime pro audio graphs with small buffers and explicit connections. Excellent latency; steeper workflow for casual apps.
  • PipeWire provides Pulse and JACK compatibility layers while targeting roughly 10–20 ms desktop latency out of the box, with headroom to go lower when configured carefully. Optimized ALSA alone can still be under ~5 ms for specialized setups.

On modern distros (including SteamOS-class devices), PipeWire is increasingly the default. Migrating from Pulse is usually: install PipeWire + wireplumber + pipewire-pulse session replacements, then reboot and retest.

Quantum, Rate, and Latency

PipeWire’s quantum is the graph period in samples — conceptually like a buffer size. Latency scales with quantum / rate. Example at 48 kHz:

  • quantum 1024 ≈ 21.3 ms period
  • quantum 512 ≈ 10.7 ms
  • quantum 256 ≈ 5.3 ms
  • quantum 128 ≈ 2.7 ms
  • quantum 64 ≈ 1.3 ms

Extra buffering in clients, Bluetooth adapters, and hardware can still add delay on top. Quantum is necessary but not sufficient for “feels instant.”

Lowering Quantum Safely

Prefer drop-in config fragments instead of editing the entire main file. Example approach:

  1. Create a directory such as /etc/pipewire/pipewire.conf.d/ (or the equivalent under ~/.config/pipewire/ for per-user overrides).
  2. Add a file like 10-lowlatency.conf adjusting clock properties, for example setting a lower default.clock.quantum (256 is a sensible first target; try 128 only after stability is proven).
  3. Optionally set default.clock.min-quantum so apps cannot request absurdly tiny periods that xrun constantly.
  4. Restart PipeWire user services (systemctl --user restart pipewire pipewire-pulse wireplumber — exact units vary by distro).

Do not jump straight to 32 samples on a stock laptop while compiling Chromium in the background. Earn each step down.

Realtime Permissions

Small quanta need reliable scheduling:

  • Add your user to the appropriate realtime/audio group used by your distro (often realtime or via rtkit limits).
  • Ensure limits conf allows higher rtprio / memlock as documented by your distribution’s PipeWire or JACK guides.
  • Log out and back in after group changes.

Without realtime privileges, lowering quantum mostly produces crackles.

Monitoring with pw-top

pw-top shows nodes, quantum, rate, and error counters. Use it while reproducing your workload (DAW, game, browser test):

  • Watch for rising XRun / error columns when you lower quantum.
  • Confirm the active rate (44100 vs 48000) matches what you expect.
  • Identify heavy nodes (browsers, Electron apps) that force larger graphs.

Complement with pw-cli info / graph tools when debugging odd device routes. For JACK-style loopback measurement, advanced users still reach for jack_iodelay on JACK-compatible setups.

Bluetooth and Laptops

PipeWire can manage Bluetooth endpoints, but codec physics still apply: SBC remains high latency; better codecs help only when hardware supports them. For Steam Deck-class devices, expect built-in speaker and 3.5 mm paths in roughly the teens-to-thirties ms region in many real-world browser tests, while Bluetooth follows codec norms (SBC 150–200 ms class, aptX 60–80 ms when available).

Caveats and Recovery

  • Xruns after suspend: restart PipeWire user services; check USB device power management.
  • App still on Pulse compatibility with large buffers: some clients request high latency — per-app properties or filter chains may be needed.
  • Pro session needs JACK exclusivity: PipeWire’s JACK layer covers many cases; niche workflows may still prefer dedicated JACK with clear hardware access.
  • Distro differences: Fedora, Ubuntu, Arch packaging paths differ — follow your distro’s PipeWire docs for unit names and config locations.

Practical Tuning Sequence

  1. Measure baseline in Firefox/Chrome with the online audio latency test.
  2. Confirm you are actually on PipeWire (pactl info often shows PipeWire as server name when pipewire-pulse is active).
  3. Lower default quantum to 256; retest stability with pw-top under load.
  4. Add realtime group/limits if xruns appear immediately.
  5. Only then try 128. Stop where audio stays clean during your real workload.
  6. Keep a known-good config snippet so a distro update cannot erase a working setup without backup.

PipeWire makes low-latency Linux realistic for daily drivers — as long as you treat quantum, realtime permissions, and measurement as one workflow instead of random config folklore.