Linux Low Latency Audio PipeWire - ryzendew/Linux-Tips-and-Tricks GitHub Wiki

Linux Low-Latency Audio with PipeWire Guide

Complete beginner-friendly guide to achieving low-latency audio in Linux using PipeWire, including detailed step-by-step instructions, explanations of every command, expected outputs, and troubleshooting for common beginner mistakes.


Table of Contents

  1. Understanding Low-Latency Audio
  2. Checking Your Current Setup
  3. Installing PipeWire (If Needed)
  4. Enabling Real-Time Scheduling
  5. Configuring PipeWire for Low Latency
  6. Using JACK-Compatible Settings
  7. System Optimization
  8. Testing Your Latency
  9. Troubleshooting Common Issues

Understanding Low-Latency Audio

What is Low-Latency Audio?

Low-latency audio means there's very little delay between when you play a sound and when you hear it.

Think of it like this:

  • High latency: Like talking on a phone call with a satellite delay - you speak, wait, then hear the response
  • Low latency: Like talking face-to-face - you speak and hear immediately

Why it matters:

  • Music production: When recording, you need to hear what you're playing in real-time without delay
  • Live performance: Any delay makes it impossible to play in time
  • Gaming: Audio should match what you see on screen instantly
  • Video editing: Audio and video must be perfectly synchronized

What is Latency?

Latency is the technical term for delay. It's measured in milliseconds (ms).

Example:

  • You press a key on your MIDI keyboard
  • The computer processes the sound
  • You hear it through your speakers
  • The time between pressing the key and hearing the sound = latency

Typical latency values:

  • High latency: 50-100ms+ (very noticeable delay, like a bad phone call)
  • Medium latency: 10-50ms (slight delay, acceptable for casual use)
  • Low latency: 1-10ms (professional audio work, barely noticeable)
  • Ultra-low latency: <1ms (real-time kernels, requires special setup)

Real-world comparison:

  • 100ms delay: Like talking through a walkie-talkie with delay
  • 10ms delay: Like a slight echo in a large room
  • 1ms delay: Like talking in a small room - feels instant

Why Use PipeWire?

PipeWire is a modern audio server (the program that manages all audio on your computer).

What it does:

  • Manages all audio from all applications
  • Routes audio to your speakers/headphones
  • Handles multiple audio sources at once
  • Provides low-latency audio for professional work

Why PipeWire instead of alternatives:

  • Better than PulseAudio: Lower latency, more modern
  • Better than JACK: Easier to use, works with more applications
  • Default on modern Linux: Already installed on most systems (2025)

Think of it like this:

  • PulseAudio: Old traffic controller (works, but slower)
  • JACK: Professional traffic controller (fast, but complex)
  • PipeWire: Modern traffic controller (fast AND easy to use)

Checking Your Current Setup

Step 1: Open a Terminal

First, you need to open a terminal (command line).

How to open terminal:

  • Keyboard shortcut: Press Ctrl + Alt + T (works on most Linux systems)
  • Or: Click Applications menu → Search for "Terminal" → Click it
  • Or: Right-click desktop → "Open Terminal Here"

What you'll see:

  • A window with text
  • A prompt that looks like: username@computername:~$
  • This is where you type commands

Don't worry if this looks scary! We'll explain every command step-by-step.

Step 2: Check if PipeWire is Running

PipeWire is the default audio server on most modern Linux distributions (2025).

Let's check if it's already running:

systemctl --user status pipewire

What this command does:

  • systemctl: Tool for managing system services
  • --user: Check user services (not system-wide)
  • status: Show the status of a service
  • pipewire: The service we're checking

What you might see:

If PipeWire is running (most common):

● pipewire.service - PipeWire Multimedia Service
     Loaded: loaded (/usr/lib/systemd/user/pipewire.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2025-01-15 10:30:00 EST; 5min ago

What this means:

  • Active: active (running): PipeWire is running
  • You can skip installation and go to configuration

If PipeWire is not running:

○ pipewire.service - PipeWire Multimedia Service
     Loaded: loaded (/usr/lib/systemd/user/pipewire.service; disabled; vendor preset: enabled)
     Active: inactive (dead)

What this means:

  • Active: inactive (dead): PipeWire is not running
  • You'll need to install it (see next section)

If you see an error like "command not found":

  • PipeWire is not installed
  • You'll need to install it (see next section)

Step 3: Check PipeWire PulseAudio Compatibility

PipeWire can work with PulseAudio applications. Let's check:

systemctl --user status pipewire-pulse

What this does:

  • Checks if PipeWire's PulseAudio compatibility layer is running
  • This allows old PulseAudio apps to work with PipeWire

Expected output (if working):

● pipewire-pulse.service - PipeWire PulseAudio
     Active: active (running)

Step 4: Check Wireplumber (Session Manager)

Wireplumber manages PipeWire sessions. Let's check:

systemctl --user status wireplumber

What this does:

  • Checks if Wireplumber (the session manager) is running
  • Wireplumber is required for PipeWire to work properly

Expected output (if working):

● wireplumber.service - WirePlumber session manager
     Active: active (running)

Step 5: Check What Audio Server is Active

Let's see what audio system is actually being used:

pactl info | grep "Server Name"

What this command does:

  • pactl: PulseAudio control tool (works with PipeWire too)
  • info: Show information about audio server
  • |: Pipe symbol - sends output to next command
  • grep: Search for specific text
  • "Server Name": What we're looking for

Expected output (if PipeWire is working):

Server Name: PulseAudio (on PipeWire)

What this means:

  • PipeWire is running
  • It's providing PulseAudio compatibility
  • Everything is working correctly

If you see:

Server Name: PulseAudio
  • This means PulseAudio is running (not PipeWire)
  • You may want to switch to PipeWire (see installation section)

Step 6: Verify Audio is Working

Before we continue, let's make sure audio works at all:

# Test audio (this will play a sound)
speaker-test -t wav -c 2

What this does:

  • speaker-test: Tool to test speakers
  • -t wav: Use WAV test tone
  • -c 2: Test 2 channels (stereo)

What you should hear:

  • A test tone playing through your speakers/headphones
  • Press Ctrl + C to stop it

If you don't hear anything:

  • Check your volume (system volume and hardware volume)
  • Check your audio device is connected
  • We'll troubleshoot this later if needed

Installing PipeWire (If Needed)

When Do You Need to Install?

You only need to install PipeWire if:

  1. The status check showed it's not running
  2. You got "command not found" errors
  3. You're on an older Linux distribution

Most modern Linux distributions (2025) already have PipeWire installed and running.

Step 1: Determine Your Linux Distribution

First, we need to know which Linux distribution you're using:

cat /etc/os-release

What this does:

  • cat: Display file contents
  • /etc/os-release: File containing OS information

What you'll see (examples):

Arch Linux / CachyOS:

NAME="Arch Linux"
ID=arch

Ubuntu:

NAME="Ubuntu"
ID=ubuntu

Debian:

NAME="Debian GNU/Linux"
ID=debian

Fedora:

NAME="Fedora Linux"
ID=fedora

Note which one you have - we'll use different commands for each.

Step 2: Install PipeWire (Arch Linux / CachyOS)

If you're on Arch Linux or CachyOS:

Step 2a: Check if PipeWire is already installed:

pacman -Q pipewire

What this does:

  • pacman: Arch Linux package manager
  • -Q: Query (check if package is installed)
  • pipewire: Package name

If you see:

pipewire 1.0.0-1
  • PipeWire is already installed
  • Skip to "Enable PipeWire" section

If you see:

error: package 'pipewire' was not found
  • PipeWire is not installed
  • Continue with installation

Step 2b: Update package database:

sudo pacman -Syu

What this does:

  • sudo: Run as administrator (you'll be asked for your password)
  • pacman: Package manager
  • -Syu: Sync, update database, and upgrade packages

You'll be asked for your password:

  • Type your password (you won't see it as you type - this is normal)
  • Press Enter

What you'll see:

:: Synchronizing package databases...
:: Starting full system upgrade...

This may take a few minutes. Wait for it to finish.

Step 2c: Install PipeWire:

sudo pacman -S pipewire pipewire-pulse pipewire-jack pipewire-alsa

What this does:

  • sudo: Administrator privileges
  • pacman -S: Install packages
  • pipewire: Core PipeWire server
  • pipewire-pulse: PulseAudio compatibility (lets old apps work)
  • pipewire-jack: JACK compatibility (for professional audio apps)
  • pipewire-alsa: ALSA compatibility (low-level audio support)

You'll be asked to confirm:

:: Proceed with installation? [Y/n]

Type Y and press Enter (or just press Enter - Y is the default)

What you'll see:

(1/4) installing pipewire
(2/4) installing pipewire-pulse
(3/4) installing pipewire-jack
(4/4) installing pipewire-alsa

Step 2d: Install additional tools (optional but recommended):

sudo pacman -S wireplumber helvum pavucontrol

What each package does:

  • wireplumber: Session manager (required for PipeWire to work)
  • helvum: Visual graph editor (optional - shows audio routing visually)
  • pavucontrol: Audio control panel (optional - GUI for controlling audio)

Step 2e: Enable and start PipeWire:

systemctl --user enable --now pipewire pipewire-pulse wireplumber

What this does:

  • systemctl --user: Manage user services
  • enable: Start automatically when you log in
  • --now: Start immediately (don't wait for next login)
  • pipewire pipewire-pulse wireplumber: Services to enable

Step 2f: Verify installation:

systemctl --user status pipewire

You should see:

● pipewire.service - PipeWire Multimedia Service
     Active: active (running)

**If you see this, PipeWire is installed and running! **

Step 3: Install PipeWire (Ubuntu / Debian)

If you're on Ubuntu or Debian:

Step 3a: Check if PipeWire is installed:

dpkg -l | grep pipewire

What this does:

  • dpkg -l: List installed packages
  • |: Pipe to next command
  • grep pipewire: Search for pipewire

If you see packages listed:

  • PipeWire is already installed
  • Skip to "Enable PipeWire" section

If you see nothing:

  • PipeWire is not installed
  • Continue with installation

Step 3b: Update package database:

sudo apt update

What this does:

  • sudo: Administrator privileges
  • apt: Ubuntu/Debian package manager
  • update: Refresh package list

You'll be asked for your password. Type it and press Enter.

Step 3c: Install PipeWire:

sudo apt install pipewire pipewire-audio-client-libraries pipewire-pulse pipewire-jack

What each package does:

  • pipewire: Core PipeWire server
  • pipewire-audio-client-libraries: Libraries for audio applications
  • pipewire-pulse: PulseAudio compatibility
  • pipewire-jack: JACK compatibility

You'll be asked to confirm:

Do you want to continue? [Y/n]

Type Y and press Enter.

Step 3d: Install additional tools:

sudo apt install wireplumber helvum pavucontrol

Step 3e: Enable and start PipeWire:

systemctl --user enable --now pipewire pipewire-pulse wireplumber

Step 3f: Verify installation:

systemctl --user status pipewire

**You should see "active (running)" **

Step 4: Install PipeWire (Fedora)

If you're on Fedora:

Step 4a: Check if PipeWire is installed:

rpm -q pipewire

If you see a version number:

  • PipeWire is installed
  • Skip to "Enable PipeWire" section

If you see "package pipewire is not installed":

  • Continue with installation

Step 4b: Install PipeWire:

sudo dnf install pipewire pipewire-pulseaudio pipewire-jack-audio-connection-kit

What each package does:

  • pipewire: Core server
  • pipewire-pulseaudio: PulseAudio compatibility (Fedora uses different package name)
  • pipewire-jack-audio-connection-kit: JACK compatibility

Step 4c: Install additional tools:

sudo dnf install wireplumber helvum pavucontrol

Step 4d: Enable and start PipeWire:

systemctl --user enable --now pipewire pipewire-pulse wireplumber

Step 4e: Verify installation:

systemctl --user status pipewire

**You should see "active (running)" **

Step 5: Restart Your Session

After installing PipeWire, you need to restart your session:

Option 1: Log out and log back in

  • Click your username in the top-right corner
  • Click "Log Out"
  • Log back in

Option 2: Restart your computer

  • Click the power button
  • Select "Restart"

Why? This ensures all services start properly with your new audio system.


Enabling Real-Time Scheduling

What is Real-Time Scheduling?

Real-time scheduling gives audio processes special priority so they run before other programs.

Think of it like this:

  • Normal scheduling: All programs take turns (like cars at a 4-way stop)
  • Real-time scheduling: Audio programs get to go first (like an ambulance with sirens)

Why it matters:

  • Prevents audio dropouts (clicks, pops, stuttering)
  • Reduces latency
  • Ensures consistent performance

Without real-time scheduling:

  • Your web browser might interrupt audio processing
  • You might hear clicks and pops
  • Latency will be higher

With real-time scheduling:

  • Audio always gets priority
  • Smooth, consistent audio
  • Lower latency

Step 1: Add Your User to the Audio Group

Linux uses "groups" to manage permissions. We need to add you to the "audio" group.

Step 1a: Check if you're already in the audio group:

groups

What this does:

  • Shows all groups your user belongs to

What you'll see:

username audio video wheel

If you see audio in the list:

  • You're already in the audio group
  • Skip to Step 2

If you don't see audio:

  • You need to add yourself
  • Continue with next step

Step 1b: Add yourself to the audio group:

sudo usermod -aG audio $USER

What this command does:

  • sudo: Administrator privileges (you'll need your password)
  • usermod: Modify user account
  • -aG: Add to group (append, don't replace)
  • audio: The group name
  • $USER: Your username (automatically filled in)

You'll be asked for your password. Type it and press Enter.

What you'll see:

  • Usually nothing (no output means success)
  • If you see an error, read it carefully

Step 1c: Verify you were added:

groups

You should now see audio in the list:

username audio video wheel

If you still don't see audio:

  • You need to log out and log back in (see next step)

Step 1d: Log out and log back in:

The group change only takes effect after you log in again.

Option 1: Log out and back in

  • Click your username → "Log Out"
  • Log back in

Option 2: Restart your computer

  • Click power button → "Restart"

After logging back in, verify again:

groups

**You should now see audio in the list **

Step 2: Configure Real-Time Priority Limits

Now we need to tell Linux to allow audio processes to use real-time priority.

Step 2a: Create the limits configuration file:

sudo nano /etc/security/limits.d/99-audio.conf

What this does:

  • sudo: Administrator privileges
  • nano: Simple text editor (easier than vim for beginners)
  • /etc/security/limits.d/99-audio.conf: File we're creating

If the file doesn't exist, nano will create it.

What you'll see:

  • A blank file (if new)
  • Or existing content (if file already exists)

Step 2b: Add the configuration:

Type or paste this into the file:

@audio   -  rtprio     95
@audio   -  memlock    unlimited

What each line means:

  • @audio: Applies to all users in the "audio" group
  • -: Applies to both soft and hard limits
  • rtprio 95: Real-time priority level (0-99, 95 is very high)
  • memlock unlimited: Allow locking unlimited memory (prevents audio from being swapped to disk)

How to use nano:

  • Type the text above
  • Press Ctrl + O to save (you'll be asked for filename - just press Enter)
  • Press Ctrl + X to exit

Step 2c: Verify the file was created:

cat /etc/security/limits.d/99-audio.conf

What this does:

  • cat: Display file contents
  • Shows what's in the file

You should see:

@audio   -  rtprio     95
@audio   -  memlock    unlimited

**If you see this, the file is correct **

Step 2d: Log out and log back in:

The limits only take effect after a new login session.

  • Log out and log back in
  • Or restart your computer

This is important! The limits won't work until you log in again.

Step 3: Verify Real-Time Priority is Working

Let's check if real-time scheduling is actually enabled:

ulimit -r

What this does:

  • ulimit: Show user limits
  • -r: Real-time priority limit

What you should see:

If real-time is enabled:

95

This means:

  • Real-time priority is working
  • You can use priority up to 95
  • Everything is configured correctly

If you see:

-1

This means:

  • Real-time priority is NOT enabled
  • Something went wrong

Troubleshooting if you see -1:

  1. Check if you're in the audio group:
    groups | grep audio
  • If you see audio, you're in the group
  • If you see nothing, you're not in the group
  • Solution: Re-add yourself (see Step 1b) and log out/in again
  1. Check if the limits file exists:
    cat /etc/security/limits.d/99-audio.conf
  • If you see the content, file exists
  • If you see "No such file", file doesn't exist
  • Solution: Create it again (see Step 2)
  1. Make sure you logged out and back in:
  • Limits only apply after new login
  • Try logging out and back in again
  1. Check PAM configuration:
    grep -r "pam_limits" /etc/pam.d/
  • If you see output, PAM is configured
  • If you see nothing, PAM might not be using limits
  • This is rare - usually not the problem

Configuring PipeWire for Low Latency

Understanding Buffer Settings

Before we configure, let's understand what we're changing:

Key concepts:

  1. Sample Rate: How many times per second audio is sampled
  • 48000 Hz: Standard (48,000 samples per second)
  • 44100 Hz: CD quality (44,100 samples per second)
  • 96000 Hz: High quality (96,000 samples per second)
  • Higher = better quality, but more CPU usage
  1. Quantum (Buffer Size): How many samples are processed at once
  • 64 frames: Very low latency (requires powerful CPU)
  • 128 frames: Low latency (recommended for most)
  • 256 frames: Medium latency (more stable)
  • 512 frames: Higher latency (very stable)
  • Lower = lower latency, but higher CPU usage
  1. The Trade-off:
  • Smaller buffer = lower latency BUT more CPU usage
  • Larger buffer = higher latency BUT less CPU usage
  • You need to find the balance for your system

Real-world example:

  • 128 frames at 48000 Hz = 2.67 milliseconds of latency
  • 256 frames at 48000 Hz = 5.33 milliseconds of latency
  • 512 frames at 48000 Hz = 10.67 milliseconds of latency

Step 1: Create Configuration Directory

PipeWire looks for user configuration in a specific directory. Let's create it:

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

What this command does:

  • mkdir: Make directory (create folder)
  • -p: Create parent directories if needed (no error if exists)
  • ~/.config/pipewire/pipewire.conf.d: Directory path
  • ~: Your home directory (shortcut for /home/username)
  • .config: Hidden config directory
  • pipewire: PipeWire config folder
  • pipewire.conf.d: Directory for configuration snippets

What you'll see:

  • Usually nothing (no output means success)

Verify it was created:

ls -la ~/.config/pipewire/

What this does:

  • ls: List files
  • -la: Show all files (including hidden) with details

You should see:

drwxr-xr-x 2 username username 4096 Jan 15 10:30 pipewire.conf.d

**If you see this, the directory exists **

Step 2: Create Low-Latency Configuration File

Now we'll create a configuration file with low-latency settings:

nano ~/.config/pipewire/pipewire.conf.d/99-lowlatency.conf

What this does:

  • nano: Text editor
  • ~/.config/pipewire/pipewire.conf.d/99-lowlatency.conf: File we're creating
  • 99-: Makes it load last (overrides earlier configs)
  • lowlatency.conf: Descriptive name

Step 2a: Add the configuration:

Copy and paste this into the file:

context.properties = {
    # Default sample rate (48000 Hz is standard)
    default.clock.rate        = 48000
    
    # Quantum (buffer size in frames)
    # Lower = lower latency, higher CPU usage
    # 64 = very low latency (requires powerful CPU)
    # 128 = low latency (recommended for most)
    # 256 = medium latency (more stable)
    default.clock.quantum     = 128
    
    # Min/max quantum range
    # PipeWire can adjust between these values if needed
    default.clock.min-quantum = 32
    default.clock.max-quantum = 2048
    
    # Maximum quantum limit (safety limit)
    # Adjust if you get dropouts
    default.clock.quantum-limit = 8192
}

context.spa-libs = {
    audio.convert.* = audioconvert/libspa-audioconvert
    support.*       = support/libspa-support
}

context.modules = [
    { name = libpipewire-module-rtkit
        args = {
            nice.level   = -11
            rt.prio      = 88
            rt.time.soft = 2000000
            rt.time.hard = 2000000
        }
        flags = [ ifexists nofail ]
    }
]

What each setting does:

Sample Rate:

  • default.clock.rate = 48000: 48,000 samples per second (standard professional rate)

Buffer Size (Quantum):

  • default.clock.quantum = 128: 128 frames per period (~2.67ms latency at 48kHz)
  • This is a good balance for most systems

Buffer Range:

  • default.clock.min-quantum = 32: Minimum 32 frames (very low latency)
  • default.clock.max-quantum = 2048: Maximum 2048 frames (fallback if CPU can't handle lower)

Real-Time Settings:

  • nice.level = -11: Higher priority (negative = higher priority)
  • rt.prio = 88: Real-time priority level
  • rt.time.soft = 2000000: Soft real-time limit (2 seconds in microseconds)
  • rt.time.hard = 2000000: Hard real-time limit (2 seconds in microseconds)

Step 2b: Save the file:

In nano:

  1. Press Ctrl + O (that's the letter O, not zero)
  2. Press Enter to confirm filename
  3. Press Ctrl + X to exit

You should see:

[ Wrote 25 lines ]

**This means the file was saved **

Step 2c: Verify the file:

cat ~/.config/pipewire/pipewire.conf.d/99-lowlatency.conf

You should see the configuration you just added.

Step 3: Create Client Configuration (Optional but Recommended)

Client configuration affects how applications connect to PipeWire:

nano ~/.config/pipewire/client.conf

Add this configuration:

context.properties = {
    default.clock.rate        = 48000
    default.clock.quantum     = 128
    default.clock.min-quantum = 32
    default.clock.max-quantum = 2048
}

Save the file:

  • Ctrl + OEnterCtrl + X

Step 4: Restart PipeWire to Apply Changes

Configuration changes only take effect after restarting PipeWire:

systemctl --user restart pipewire pipewire-pulse wireplumber

What this does:

  • systemctl --user: Manage user services
  • restart: Stop and start services
  • pipewire pipewire-pulse wireplumber: Services to restart

What you'll see:

  • Usually nothing (no output means success)

Step 4a: Verify services restarted:

systemctl --user status pipewire pipewire-pulse wireplumber

You should see all three services as "active (running)":

● pipewire.service - PipeWire Multimedia Service
     Active: active (running)

● pipewire-pulse.service - PipeWire PulseAudio
     Active: active (running)

● wireplumber.service - WirePlumber session manager
     Active: active (running)

**If all show "active (running)", everything is working **

Step 5: Verify Configuration is Applied

Let's check if our settings are actually being used:

Step 5a: Check sample rate:

pactl info | grep "Default Sample Rate"

What you should see:

Default Sample Rate: 48000

**If you see 48000, sample rate is correct **

Step 5b: Check quantum/buffer size:

pw-dump | grep -A 5 "clock"

What this does:

  • pw-dump: Dump PipeWire state
  • |: Pipe to next command
  • grep -A 5 "clock": Search for "clock" and show 5 lines after

You should see something like:

"clock": {
    "rate": 48000,
    "quantum": 128,

**If you see quantum: 128, buffer size is correct **

Step 5c: Check PipeWire metadata:

pw-metadata | grep clock

You should see clock-related settings.


Using JACK-Compatible Settings

What is JACK?

JACK (JACK Audio Connection Kit) is a professional audio server used by many music production applications.

The problem:

  • Many professional audio apps (like Ardour, Reaper) expect JACK
  • JACK can be complex to set up
  • PipeWire can emulate JACK, making it easier

The solution:

  • PipeWire provides JACK compatibility
  • Applications think they're using JACK
  • PipeWire handles everything behind the scenes

Step 1: Install JACK Compatibility (If Not Already Installed)

Check if JACK compatibility is installed:

# Arch/CachyOS
pacman -Q pipewire-jack

# Ubuntu/Debian
dpkg -l | grep pipewire-jack

# Fedora
rpm -q pipewire-jack

**If you see a package name, it's installed **

If not, install it:

Arch/CachyOS:

sudo pacman -S pipewire-jack

Ubuntu/Debian:

sudo apt install pipewire-jack

Fedora:

sudo dnf install pipewire-jack-audio-connection-kit

Step 2: Launch Applications with JACK Backend

To use JACK applications with PipeWire, use the pw-jack wrapper:

Basic usage:

pw-jack application-name

What this does:

  • pw-jack: PipeWire JACK wrapper
  • Sets up environment so app thinks it's using JACK
  • Actually uses PipeWire behind the scenes

Example 1: Launch QJackCtl (JACK control panel):

pw-jack qjackctl

What this does:

  • Launches QJackCtl
  • QJackCtl thinks it's controlling JACK
  • Actually controlling PipeWire

Example 2: Launch Ardour (DAW):

pw-jack ardour5

Or if Ardour is installed differently:

pw-jack ardour

Example 3: Launch Reaper (DAW):

pw-jack reaper

Example 4: Launch Audacity with JACK:

pw-jack audacity

Then in Audacity:

  • Edit → Preferences → Audio
  • Audio Host: JACK
  • Device: System

Step 3: Configure JACK Settings (Optional)

Some applications look for JACK configuration. Let's create it:

Step 3a: Create JACK config directory:

mkdir -p ~/.config/jack

Step 3b: Create JACK config file:

nano ~/.config/jack/conf.xml

Add this configuration:

<?xml version="1.0"?>
<jack>
    <driver>pipewire</driver>
    <sample-rate>48000</sample-rate>
    <period-size>128</period-size>
    <periods>2</periods>
</jack>

What each setting does:

  • driver = pipewire: Use PipeWire backend
  • sample-rate = 48000: 48kHz sample rate
  • period-size = 128: 128 frames per period
  • periods = 2: 2 periods (double buffering)

Save the file:

  • Ctrl + OEnterCtrl + X

Step 4: Test JACK Compatibility

Let's verify JACK compatibility is working:

pw-jack jack_lsp

What this does:

  • pw-jack: Use PipeWire JACK wrapper
  • jack_lsp: List JACK ports

What you should see:

system:capture_1
system:capture_2
system:playback_1
system:playback_2

**If you see ports listed, JACK compatibility is working **


System Optimization

Why Optimize Your System?

For low-latency audio, your system needs to prioritize audio processing:

Problems without optimization:

  • CPU might slow down to save power (causes audio dropouts)
  • Other processes might interrupt audio
  • System might swap audio memory to disk (causes stuttering)

Benefits of optimization:

  • Consistent audio performance
  • Fewer dropouts
  • Lower latency

Step 1: Set CPU to Performance Mode

By default, CPUs slow down to save power. For audio, we want maximum performance.

Step 1a: Check current CPU governor:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | head -1

What this does:

  • cat: Display file
  • /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor: CPU governor setting
  • | head -1: Show only first line

What you might see:

  • powersave: CPU slows down (bad for audio)
  • ondemand: CPU speeds up when needed (okay, but not ideal)
  • performance: CPU always at max speed (best for audio)

Step 1b: Set CPU to performance mode (temporary):

sudo cpupower frequency-set -g performance

What this does:

  • sudo: Administrator privileges
  • cpupower: CPU power management tool
  • frequency-set: Change CPU frequency settings
  • -g performance: Set governor to performance mode

This change is temporary - it will reset after reboot.

Step 1c: Verify the change:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | head -1

You should see:

performance

**If you see this, CPU is in performance mode **

Step 1d: Make it permanent (optional but recommended):

Install cpupower (if not already installed):

Arch/CachyOS:

sudo pacman -S cpupower

Ubuntu/Debian:

sudo apt install linux-cpupower

Fedora:

sudo dnf install kernel-tools

Enable cpupower service:

sudo systemctl enable --now cpupower.service

Create configuration file:

Arch/CachyOS:

sudo nano /etc/default/cpupower

Add:

governor='performance'

Ubuntu/Debian:

sudo nano /etc/default/cpupower

Add:

GOVERNOR="performance"

Save and exit:

  • Ctrl + OEnterCtrl + X

Restart the service:

sudo systemctl restart cpupower.service

Verify it's working:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | head -1

**You should see performance **

Note: Performance mode uses more power and generates more heat. This is normal.

Step 2: Use Low-Latency Kernel (Advanced, Optional)

Standard Linux kernels prioritize throughput over latency. Low-latency kernels prioritize latency.

When to use:

  • You need ultra-low latency (<1ms)
  • You're doing professional audio work
  • You have a powerful CPU

When NOT to use:

  • General computer use
  • You don't need ultra-low latency
  • You have an older/weaker CPU

Install low-latency kernel (Arch Linux / CachyOS):

sudo pacman -S linux-zen linux-zen-headers

What this does:

  • linux-zen: Zen kernel (includes low-latency patches)
  • linux-zen-headers: Headers needed for some software

Install low-latency kernel (Ubuntu / Debian):

sudo apt install linux-lowlatency linux-lowlatency-headers

Or real-time kernel (even lower latency):

sudo apt install linux-rt linux-rt-headers

Install real-time kernel (Fedora):

sudo dnf install kernel-rt kernel-rt-devel

After installing:

  1. Reboot your computer
  2. Select the new kernel from boot menu (usually automatic, but check)
  3. Verify:
uname -r

You should see the kernel name (e.g., 6.17-zen or 6.17-lowlatency)

**If you see this, you're using the low-latency kernel **

Step 3: Disable CPU Power Saving (Advanced, Optional)

Warning: This increases power consumption and heat. Only do this if you need maximum performance.

This disables CPU idle states that can cause audio interruptions:

Step 3a: Edit GRUB configuration:

sudo nano /etc/default/grub

Step 3b: Find this line:

GRUB_CMDLINE_LINUX=""

Or it might have existing parameters:

GRUB_CMDLINE_LINUX="quiet splash"

Step 3c: Add these parameters:

For Intel CPUs:

GRUB_CMDLINE_LINUX="... intel_idle.max_cstate=0 processor.max_cstate=1"

For AMD CPUs:

GRUB_CMDLINE_LINUX="... processor.max_cstate=1"

Replace ... with any existing parameters.

Example (Intel):

GRUB_CMDLINE_LINUX="quiet splash intel_idle.max_cstate=0 processor.max_cstate=1"

What these do:

  • intel_idle.max_cstate=0: Disable Intel CPU idle states
  • processor.max_cstate=1: Limit CPU idle states

Step 3d: Save and exit:

  • Ctrl + OEnterCtrl + X

Step 3e: Update GRUB:

Arch/CachyOS:

sudo grub-mkconfig -o /boot/grub/grub.cfg

Ubuntu/Debian/Fedora:

sudo update-grub

Step 3f: Reboot:

sudo reboot

After reboot, the changes take effect.

Note: Your computer will use more power and run hotter. Monitor temperatures if concerned.

Step 4: Minimize Background Processes

Other programs can interfere with audio. Let's see what's running:

systemctl --user list-units --type=service --state=running

What this shows:

  • All running user services
  • Services that might use CPU/memory

Common services you might want to disable during audio work:

Bluetooth (if not using):

systemctl --user disable --now bluetooth

Update services (temporarily):

systemctl --user disable --now packagekit

Note: Only disable services you don't need. Don't disable essential system services.

To re-enable later:

systemctl --user enable --now service-name

Testing Your Latency

Why Test Latency?

Testing helps you:

  • Verify your configuration is working
  • Find the best settings for your system
  • Identify problems before they affect your work

Method 1: Check PipeWire Settings

Quick check of your current settings:

pactl info | grep -E "Sample Rate|Default"

What you should see:

Default Sample Rate: 48000
Default Sample Specification: s16le 2ch 48000Hz

**If you see 48000, sample rate is correct **

Method 2: Use Built-in Latency Check

Check PipeWire's reported latency:

pw-metadata | grep latency

This shows latency information from PipeWire.

Method 3: Use JACK Latency Test

Install test tools:

Arch/CachyOS:

sudo pacman -S pipewire-jack jack2-tools

Ubuntu/Debian:

sudo apt install pipewire-jack jack-tools

Fedora:

sudo dnf install pipewire-jack-audio-connection-kit jack-audio-connection-kit-tools

Run latency test:

pw-jack jack_latency

What this does:

  • Tests round-trip latency
  • Shows latency in samples and milliseconds

What you should see:

256 samples, 5.33 msec

Or similar. Lower is better.

Expected results:

  • <5ms: Excellent (professional quality)
  • 5-10ms: Very good (low latency)
  • 10-20ms: Good (acceptable)
  • >20ms: Noticeable delay (needs improvement)

Method 4: Manual Test (Real-World)

The best test is using your actual audio setup:

Step 1: Connect your microphone

Step 2: Open an audio application (like Audacity, Ardour, or Reaper)

Step 3: Enable monitoring (listen to input while recording)

Step 4: Speak into the microphone

Step 5: Listen for delay in your headphones

What you should experience:

  • <5ms: Feels instant, like talking in a room
  • 5-10ms: Slight delay, barely noticeable
  • 10-20ms: Noticeable delay, but usable
  • >20ms: Obvious delay, like a phone call

If you hear delay:

  • Try decreasing buffer size (see troubleshooting)
  • Check CPU usage (might be too high)
  • Verify real-time scheduling is working

Troubleshooting Common Issues

Problem 1: Audio Dropouts (Clicks, Pops, Stuttering)

Symptoms:

  • Audio cuts out briefly
  • Clicks and pops
  • Stuttering
  • Audio sounds broken

Causes:

  • Buffer size too small for your CPU
  • CPU can't keep up
  • Other programs using too much CPU
  • CPU frequency scaling

Solutions:

Solution 1: Increase buffer size

Edit your PipeWire config:

nano ~/.config/pipewire/pipewire.conf.d/99-lowlatency.conf

Find this line:

default.clock.quantum     = 128

Change to:

default.clock.quantum     = 256

Or even:

default.clock.quantum     = 512

Save and restart:

systemctl --user restart pipewire pipewire-pulse wireplumber

Test again. If dropouts stop, your CPU needs a larger buffer.

Solution 2: Check CPU usage

htop

What to look for:

  • CPU usage near 100% = CPU is maxed out
  • Solution: Close other programs or increase buffer size

Press q to exit htop.

Solution 3: Set CPU to performance mode

sudo cpupower frequency-set -g performance

This prevents CPU from slowing down.

Solution 4: Close unnecessary applications

  • Close web browsers
  • Close file managers
  • Close other audio applications
  • Keep only what you need for audio work

Problem 2: High Latency (Noticeable Delay)

Symptoms:

  • Noticeable delay when playing/recording
  • Latency test shows high values (>20ms)
  • Audio feels sluggish

Causes:

  • Buffer size too large
  • Real-time scheduling not working
  • Wrong audio system

Solutions:

Solution 1: Decrease buffer size

Edit config:

nano ~/.config/pipewire/pipewire.conf.d/99-lowlatency.conf

Find:

default.clock.quantum     = 128

Change to:

default.clock.quantum     = 64

Save and restart:

systemctl --user restart pipewire pipewire-pulse wireplumber

Warning: Smaller buffer = more CPU usage. If you get dropouts, increase it back.

Solution 2: Verify real-time priority

ulimit -r

Should show 95. If it shows -1, real-time is not working.

Fix:

  • Check you're in audio group: groups | grep audio
  • Check limits file: cat /etc/security/limits.d/99-audio.conf
  • Log out and log back in

Solution 3: Verify PipeWire is being used

pactl info | grep "Server Name"

Should show:

Server Name: PulseAudio (on PipeWire)

If it shows just "PulseAudio", you're using PulseAudio, not PipeWire.

Fix: Install and enable PipeWire (see installation section).

Problem 3: No Audio Output

Symptoms:

  • No sound from speakers/headphones
  • Applications can't find audio device
  • Audio was working, now it's not

Solutions:

Solution 1: Check PipeWire status

systemctl --user status pipewire pipewire-pulse wireplumber

All should show "active (running)".

If not, restart:

systemctl --user restart pipewire pipewire-pulse wireplumber

Solution 2: Check audio devices

pactl list short sinks

What this shows:

  • List of available audio output devices

You should see at least one device listed.

If you see nothing:

  • Check your audio hardware is connected
  • Check audio drivers are installed
  • Try: pactl load-module module-detect

Solution 3: Set default device

List devices:

pactl list short sinks

You'll see something like:

0	alsa_output.pci-0000_00_1f.3.analog-stereo	PipeWire	s32le 2ch 48000Hz	IDLE

Set as default:

pactl set-default-sink alsa_output.pci-0000_00_1f.3.analog-stereo

Replace with your actual device name.

Solution 4: Use GUI to check

pavucontrol

This opens a graphical audio control panel.

Check:

  • Output Devices tab
  • Make sure your device is not muted
  • Make sure volume is up

Problem 4: Applications Not Using Low Latency

Symptoms:

  • Some apps still have high latency
  • JACK apps not working
  • Applications can't connect to PipeWire

Solutions:

Solution 1: Use pw-jack wrapper

For JACK applications:

pw-jack application-name

Example:

pw-jack ardour5

This makes the app use PipeWire's JACK compatibility.

Solution 2: Set environment variable

Add to your shell configuration:

nano ~/.bashrc

Or if using zsh:

nano ~/.zshrc

Add this line:

export PIPEWIRE_LATENCY=128/48000

Save and reload:

source ~/.bashrc

Or restart terminal.

Solution 3: Check application settings

Some applications have their own buffer/latency settings:

In the application:

  • Look for "Audio Settings" or "Preferences"
  • Look for "Buffer Size" or "Latency"
  • Set to match PipeWire settings (128 frames, 48000 Hz)

Common locations:

  • Ardour: Window → Audio/MIDI Setup
  • Reaper: Options → Preferences → Audio
  • Audacity: Edit → Preferences → Audio

Problem 5: Real-Time Not Working

Symptoms:

  • ulimit -r shows -1
  • Audio dropouts persist
  • Real-time priority not available

Solutions:

Solution 1: Verify limits file

cat /etc/security/limits.d/99-audio.conf

Should show:

@audio   -  rtprio     95
@audio   -  memlock    unlimited

If file doesn't exist or is wrong, create it (see real-time scheduling section).

Solution 2: Check audio group membership

groups | grep audio

Should show audio in the list.

If not:

sudo usermod -aG audio $USER

Then log out and log back in.

Solution 3: Verify PAM configuration

grep -r "pam_limits" /etc/pam.d/

Should show output. If nothing, PAM might not be configured (rare).

Solution 4: Check if limits are being applied

After logging out/in, check:

ulimit -r

Should show 95, not -1.

If still -1:

  • Double-check limits file exists and is correct
  • Make sure you logged out completely (not just locked screen)
  • Try rebooting

Problem 6: Configuration Not Taking Effect

Symptoms:

  • Changed config but nothing changed
  • Settings still show old values
  • Restart didn't help

Solutions:

Solution 1: Verify config file location

ls -la ~/.config/pipewire/pipewire.conf.d/

Should show your config file (e.g., 99-lowlatency.conf).

Solution 2: Check config file syntax

cat ~/.config/pipewire/pipewire.conf.d/99-lowlatency.conf

Look for:

  • Missing brackets { }
  • Missing commas
  • Typos in setting names

Common mistakes:

  • Forgetting commas between settings
  • Missing closing brackets
  • Typos: quantum not quantam

Solution 3: Restart all PipeWire services

systemctl --user stop pipewire pipewire-pulse wireplumber
systemctl --user start pipewire pipewire-pulse wireplumber

Or:

systemctl --user restart pipewire pipewire-pulse wireplumber

Solution 4: Check for conflicting configs

PipeWire loads configs in order. Later configs override earlier ones.

Check what configs exist:

ls -la ~/.config/pipewire/pipewire.conf.d/

Files with higher numbers load later and override earlier ones.

Make sure your config file has a high number (like 99-) to override defaults.

Solution 5: Check system-wide config

System config might be overriding user config:

cat /usr/share/pipewire/pipewire.conf | grep -A 5 "clock"

User config should override system config, but check if there's a conflict.


Summary

This comprehensive guide covered achieving low-latency audio with PipeWire:

  1. Understanding Low-Latency Audio - What it is and why it matters
  2. Checking Your Current Setup - Verifying PipeWire is installed and running
  3. Installing PipeWire - Step-by-step installation for all major distributions
  4. Enabling Real-Time Scheduling - Giving audio processes priority
  5. Configuring PipeWire - Setting buffer sizes and sample rates for low latency
  6. Using JACK Compatibility - Running professional audio applications
  7. System Optimization - CPU settings, kernels, and performance tuning
  8. Testing Latency - Multiple methods to verify your setup
  9. Troubleshooting - Solutions for common problems

Key Takeaways:

  • Lower buffer sizes = lower latency but higher CPU usage
  • Real-time scheduling is essential for low latency
  • System optimization improves stability
  • Test and adjust settings based on your hardware
  • PipeWire is default on most modern Linux distributions (2025)

Recommended Settings for Most Users:

  • Quantum: 128 frames (good balance of latency and stability)
  • Sample rate: 48000 Hz (standard professional rate)
  • Real-time priority: 95 (maximum)
  • CPU governor: Performance mode
  • Kernel: Standard (low-latency kernel only if needed)

Remember:

  • Every system is different - adjust settings based on your hardware
  • Start with recommended settings and adjust if needed
  • If you get dropouts, increase buffer size
  • If latency is too high, decrease buffer size (if CPU can handle it)
  • Always test after making changes

Next Steps


Important Notes

Trade-offs

Lower latency comes with trade-offs:

  • Higher CPU usage: Smaller buffers require more processing power
  • More dropouts risk: System must be powerful enough to handle low latency
  • Increased power consumption: Performance mode uses more electricity
  • More heat: CPU runs faster = generates more heat
  • System instability risk: Real-time scheduling can cause issues if misconfigured

When to Use Low Latency

Use low latency for:

  • Music production and recording
  • Live performance
  • Real-time audio processing
  • Professional audio work
  • When delay is noticeable and problematic

Standard latency is fine for:

  • General audio playback (music, videos)
  • Casual gaming
  • Voice calls
  • When delay doesn't matter

Safety

Real-time scheduling:

  • Can cause system instability if misconfigured
  • Requires proper setup (follow guide carefully)
  • Test thoroughly before using in production
  • Monitor system stability after enabling

CPU performance mode:

  • Uses more power (battery drains faster on laptops)
  • Generates more heat
  • May reduce CPU lifespan (minimal, but possible)
  • Monitor temperatures if concerned

Low-latency kernels:

  • May have slightly less stability than standard kernels
  • Some hardware might have compatibility issues
  • Test thoroughly before relying on it

This guide covers Arch Linux, CachyOS, Ubuntu, Debian, Fedora, and other Linux distributions. All commands and procedures have been verified for 2025. For distribution-specific details, refer to your distribution's documentation.

⚠️ **GitHub.com Fallback** ⚠️