Linux Audio Latency: JACK, ALSA & PipeWire Guide

Linux offers the lowest audio latency of any operating system—if you configure it right. But the Linux audio stack is complex. You’ve got ALSA at the bottom, PipeWire or JACK in the middle, and your DAW on top. Each layer adds latency or reduces it depending on settings. Get one wrong and you’re stuck at 100ms of latency when 5ms is possible.

Understanding Linux Audio Layers

ALSA (Advanced Linux Sound Architecture)

The kernel driver layer. Handles direct hardware access and buffering. With careful tuning, ALSA can achieve sub-5ms latency, even under 3ms with 64-sample buffers at 48kHz.

PipeWire (Default Since 2022)

Modern session manager replacing both PulseAudio and JACK. Runs on top of ALSA. Balances low latency with compatibility. Typical latency: 10–20ms out of the box, tunable down to under 10ms.

JACK (Advanced Users)

Low-latency audio server designed for professional music production. When running standalone with ALSA, achieves under 5ms consistently. But incompatible with PulseAudio apps and requires more setup.

Comparison:

  • ALSA alone: Sub-5ms (lowest, but direct hardware access only)
  • JACK with ALSA: Under 5ms (professional standard for music)
  • PipeWire: 10–20ms default, tunable to under 10ms (modern, balanced)
  • PipeWire with JACK apps: Varies, usually 10–20ms

Most home studios on Linux now use PipeWire as it handles both low-latency JACK apps and casual desktop audio. We’ll focus on tuning PipeWire, then touch on JACK.

Reducing Latency with PipeWire

PipeWire defaults to stability and compatibility. If you’re recording or monitoring, you’ll want lower latency. The key is the quantum—PipeWire’s term for buffer size.

Step 1: Install PipeWire and WirePlumber

Most modern Linux distributions (Fedora, Ubuntu 22.04+, Arch, openSUSE) ship with PipeWire by default. Confirm it’s installed:

sudo apt install pipewire wireplumber

Then restart the PipeWire daemon:

systemctl --user restart wireplumber
systemctl --user restart pipewire

Step 2: Lower the Quantum (Buffer Size)

PipeWire’s default quantum is 2048 samples, which at 48kHz is 42.6ms latency. Way too high for recording.

Create or edit the PipeWire config:

mkdir -p ~/.config/pipewire/pipewire.conf.d/
nano ~/.config/pipewire/pipewire.conf.d/10-low-latency.conf

Add this:

context.properties = {
    default.clock.quantum = 128
    default.clock.min-quantum = 64
    default.clock.max-quantum = 256
}

This sets the default quantum to 128 samples (2.67ms at 48kHz), with a floor of 64 (1.3ms) and ceiling of 256 (5.3ms).

Save the file and restart PipeWire:

systemctl --user restart pipewire

Your DAW or recording app should now see lower latency. 128 samples is stable on most systems; 64 is aggressive and may cause crackling (XRUNs) if your CPU or USB bus is under load.

Step 3: Configure WirePlumber for ALSA Low-Latency

WirePlumber manages ALSA configuration. Tune it to disable batch mode and set period sizes:

mkdir -p ~/.config/wireplumber/wireplumber.conf.d/
nano ~/.config/wireplumber/wireplumber.conf.d/51-alsa-low-latency.conf

Add this Lua rule:

monitor.alsa.rules = [
  {
    matches = [
      { node.name = "~alsa_output.*" }
      { node.name = "~alsa_input.*" }
    ]
    actions = {
      update-props = {
        api.alsa.disable-batch = true
        api.alsa.headroom = 0
        api.alsa.period-size = 128
        api.alsa.period-num = 2
      }
    }
  }
]

This disables batch mode (which adds buffering), sets the period size to 128 samples, and removes headroom. Restart WirePlumber:

systemctl --user restart wireplumber

Step 4: Enable Realtime Scheduling

To achieve consistent low latency without dropouts, your user needs realtime priority. Install RealtimeKit:

sudo apt install rtkit

It handles realtime privileges automatically. On some systems, add your user to the audio group:

sudo usermod -a -G audio $USER

Log out and back in for the group change to take effect.

Step 5: Test Your Latency

Use pw-top to monitor XRUNs (audio drops):

pw-top

The ERR column shows XRUN count. If it’s climbing during recording, your buffer is too small. Increase the quantum in the config:

default.clock.quantum = 256

and restart. Or use JACK’s latency measurement:

PIPEWIRE_QUANTUM=128/48000 jack_iodelay

This tool plays a click, records it back, and measures round-trip latency. Typical output: “latency = 5.9 ms” or similar.

Reducing Latency with JACK (Standalone)

For dedicated music production rigs, standalone JACK is still the gold standard. It bypasses PipeWire’s complexity and talks directly to ALSA.

Step 1: Install JACK

sudo apt install jackd2

Step 2: Start JACK with Low-Latency Settings

jackd -R -d alsa -d hw:0 -p 128 -n 2 -r 48000

This starts JACK with:

  • -p 128: Period size (buffer) of 128 samples
  • -n 2: Two periods (double-buffering for stability)
  • -r 48000: Sample rate 48kHz

At 48kHz with 128 samples and 2 periods, round-trip latency is around 5.3ms.

Step 3: Monitor for XRUNs

In another terminal:

jack_cpu_load

This shows CPU load. If it spikes above 80%, XRUNs are likely. Try increasing the period to 256:

jackd -R -d alsa -d hw:0 -p 256 -n 2 -r 48000

Larger buffers = more latency but more stability.

Common Latency Problems on Linux

XRUNs (Underruns/Overruns)

Audio buffer runs out of data (underrun) or fills with no space (overrun). Causes clicks and pops.

Causes:

  • Buffer too small for your CPU
  • USB interface on a hub or sharing bandwidth
  • Background processes stalling the kernel
  • CPU frequency scaling dropping clock speed mid-buffer

Fixes:

  • Increase quantum from 64 to 128 or 256 samples
  • Move USB interface to its own root port (not a hub)
  • Close unnecessary apps
  • Set CPU governor to “performance” instead of “powersave”

Kernel Scheduling

Old kernels can’t reliably hit strict timing deadlines for small buffers. Upgrade to the latest kernel:

sudo apt update && sudo apt upgrade

Or install a low-latency kernel variant if available (usually has “lowlatency” in the name on Ubuntu/Debian).

USB Controller Overload

If your USB audio interface shares a bus with cameras, wireless keyboards, or other high-bandwidth devices, latency spikes. Check USB topology:

lsusb -t

Move your audio interface to a different USB controller if possible.

Sample Rate Mismatch

If your DAW is 48kHz but your interface defaults to 44.1kHz, resampling adds latency. Confirm all components match:

  • Check your interface’s sample rate: cat /proc/asound/card0/pcm0p/sub0/hw_params | grep rate
  • Set PipeWire to match: add default.clock.rate = 48000 to PipeWire config
  • Set your DAW to match

Monitoring Latency in Real-Time

PipeWire Tools

pw-top

Shows latency and XRUN count for each device. Watch while recording.

ALSA Tools

cat /proc/asound/card0/pcm0p/sub0/status

Shows current buffer position and XRUN count.

DAW Reporting

Most DAWs (Ardour, Reaper, Cakewalk) report round-trip latency in milliseconds during playback. Aim for under 10ms for comfortable real-time monitoring.

Which Audio Server Should You Use?

For Casual Desktop Use: PipeWire with default settings (10–20ms latency is fine)

For Music Production: PipeWire with tuned quantum (sub-10ms) or standalone JACK (sub-5ms)

For Live Performance: JACK on a low-latency kernel (sub-5ms with rock-solid uptime)

For Hybrid Workflows: PipeWire with pw-jack wrapper to run JACK apps (10–20ms, easier setup than standalone JACK)

Real Numbers: Latency by Configuration

  • ALSA direct, 64 samples at 48kHz: 1.3ms
  • ALSA direct, 256 samples at 48kHz: 5.3ms
  • JACK, 128 samples, 2 periods at 48kHz: 5.3ms
  • PipeWire, 64 quantum at 48kHz: ~1.5ms
  • PipeWire, 128 quantum at 48kHz: ~2.7ms
  • PipeWire, 256 quantum at 48kHz: ~5.3ms

All of these are music-production-ready. Below 10ms feels responsive for real-time monitoring.

Testing with Your DAW

Open your DAW (Ardour, REAPER, Cakewalk) and check the latency readout:

  1. Start recording with a loopback (cable from output back to input).
  2. DAW should report round-trip latency in ms.
  3. If it’s above 10ms, lower your quantum or buffer size.
  4. Test by playing a metronome through your interface and tapping in sync—a tap test tool can measure actual latency vs. reported.

Troubleshooting: When Nothing Works

  1. Update everything: kernel, PipeWire, WirePlumber, JACK, driver firmware.
  2. Test with different USB ports. Sometimes one port has better latency than another.
  3. Disable CPU frequency scaling: echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
  4. Use a low-latency kernel: Ubuntu ships -lowlatency kernel variants.
  5. Try standalone JACK if PipeWire is misbehaving.

Quick Linux Audio Latency Checklist

  • [ ] Confirm you’re running PipeWire or JACK
  • [ ] Tune PipeWire quantum to 64–256 samples (start at 128)
  • [ ] Configure WirePlumber ALSA rules for low-latency
  • [ ] Enable realtime scheduling with rtkit
  • [ ] Test with pw-top and confirm no XRUNs
  • [ ] Set all devices (interface, DAW) to 48kHz
  • [ ] Use JACK if PipeWire isn’t low-latency enough for your use case
  • [ ] Check that your audio interface is on USB 3.0 and its own root port

Linux audio latency is lower than Windows or Mac when tuned properly. Once dialed in, you can track with sub-5ms latency—faster than most commercial systems—and your computer will be rock-solid.


Scroll to Top