Linux Low Latency Audio PipeWire - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
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.
- Understanding Low-Latency Audio
- Checking Your Current Setup
- Installing PipeWire (If Needed)
- Enabling Real-Time Scheduling
- Configuring PipeWire for Low Latency
- Using JACK-Compatible Settings
- System Optimization
- Testing Your Latency
- Troubleshooting Common Issues
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
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
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)
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.
PipeWire is the default audio server on most modern Linux distributions (2025).
Let's check if it's already running:
systemctl --user status pipewireWhat 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)
PipeWire can work with PulseAudio applications. Let's check:
systemctl --user status pipewire-pulseWhat 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)
Wireplumber manages PipeWire sessions. Let's check:
systemctl --user status wireplumberWhat 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)
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)
Before we continue, let's make sure audio works at all:
# Test audio (this will play a sound)
speaker-test -t wav -c 2What 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 + Cto 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
You only need to install PipeWire if:
- The status check showed it's not running
- You got "command not found" errors
- You're on an older Linux distribution
Most modern Linux distributions (2025) already have PipeWire installed and running.
First, we need to know which Linux distribution you're using:
cat /etc/os-releaseWhat 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.
If you're on Arch Linux or CachyOS:
Step 2a: Check if PipeWire is already installed:
pacman -Q pipewireWhat 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 -SyuWhat 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-alsaWhat 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 pavucontrolWhat 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 wireplumberWhat 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 pipewireYou should see:
● pipewire.service - PipeWire Multimedia Service
Active: active (running)
**If you see this, PipeWire is installed and running! **
If you're on Ubuntu or Debian:
Step 3a: Check if PipeWire is installed:
dpkg -l | grep pipewireWhat 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 updateWhat 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-jackWhat 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 pavucontrolStep 3e: Enable and start PipeWire:
systemctl --user enable --now pipewire pipewire-pulse wireplumberStep 3f: Verify installation:
systemctl --user status pipewire**You should see "active (running)" **
If you're on Fedora:
Step 4a: Check if PipeWire is installed:
rpm -q pipewireIf 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-kitWhat 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 pavucontrolStep 4d: Enable and start PipeWire:
systemctl --user enable --now pipewire pipewire-pulse wireplumberStep 4e: Verify installation:
systemctl --user status pipewire**You should see "active (running)" **
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.
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
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:
groupsWhat 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 $USERWhat 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:
groupsYou 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 **
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.confWhat 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 + Oto save (you'll be asked for filename - just press Enter) - Press
Ctrl + Xto exit
Step 2c: Verify the file was created:
cat /etc/security/limits.d/99-audio.confWhat 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.
Let's check if real-time scheduling is actually enabled:
ulimit -rWhat 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:
-
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
-
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)
- Make sure you logged out and back in:
- Limits only apply after new login
- Try logging out and back in again
-
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
Before we configure, let's understand what we're changing:
Key concepts:
- 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
- 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
- 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
PipeWire looks for user configuration in a specific directory. Let's create it:
mkdir -p ~/.config/pipewire/pipewire.conf.dWhat 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 **
Now we'll create a configuration file with low-latency settings:
nano ~/.config/pipewire/pipewire.conf.d/99-lowlatency.confWhat 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:
- Press
Ctrl + O(that's the letter O, not zero) - Press
Enterto confirm filename - Press
Ctrl + Xto 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.confYou should see the configuration you just added.
Client configuration affects how applications connect to PipeWire:
nano ~/.config/pipewire/client.confAdd 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 + O→Enter→Ctrl + X
Configuration changes only take effect after restarting PipeWire:
systemctl --user restart pipewire pipewire-pulse wireplumberWhat 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 wireplumberYou 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 **
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 clockYou should see clock-related settings.
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
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-jackUbuntu/Debian:
sudo apt install pipewire-jackFedora:
sudo dnf install pipewire-jack-audio-connection-kitTo use JACK applications with PipeWire, use the pw-jack wrapper:
Basic usage:
pw-jack application-nameWhat 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 qjackctlWhat this does:
- Launches QJackCtl
- QJackCtl thinks it's controlling JACK
- Actually controlling PipeWire
Example 2: Launch Ardour (DAW):
pw-jack ardour5Or if Ardour is installed differently:
pw-jack ardourExample 3: Launch Reaper (DAW):
pw-jack reaperExample 4: Launch Audacity with JACK:
pw-jack audacityThen in Audacity:
- Edit → Preferences → Audio
- Audio Host: JACK
- Device: System
Some applications look for JACK configuration. Let's create it:
Step 3a: Create JACK config directory:
mkdir -p ~/.config/jackStep 3b: Create JACK config file:
nano ~/.config/jack/conf.xmlAdd 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 + O→Enter→Ctrl + X
Let's verify JACK compatibility is working:
pw-jack jack_lspWhat 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 **
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
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 -1What 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 performanceWhat 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 -1You 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 cpupowerUbuntu/Debian:
sudo apt install linux-cpupowerFedora:
sudo dnf install kernel-toolsEnable cpupower service:
sudo systemctl enable --now cpupower.serviceCreate configuration file:
Arch/CachyOS:
sudo nano /etc/default/cpupowerAdd:
governor='performance'
Ubuntu/Debian:
sudo nano /etc/default/cpupowerAdd:
GOVERNOR="performance"
Save and exit:
-
Ctrl + O→Enter→Ctrl + X
Restart the service:
sudo systemctl restart cpupower.serviceVerify 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.
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-headersWhat 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-headersOr real-time kernel (even lower latency):
sudo apt install linux-rt linux-rt-headersInstall real-time kernel (Fedora):
sudo dnf install kernel-rt kernel-rt-develAfter installing:
- Reboot your computer
- Select the new kernel from boot menu (usually automatic, but check)
- Verify:
uname -rYou 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 **
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/grubStep 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 + O→Enter→Ctrl + X
Step 3e: Update GRUB:
Arch/CachyOS:
sudo grub-mkconfig -o /boot/grub/grub.cfgUbuntu/Debian/Fedora:
sudo update-grubStep 3f: Reboot:
sudo rebootAfter reboot, the changes take effect.
Note: Your computer will use more power and run hotter. Monitor temperatures if concerned.
Other programs can interfere with audio. Let's see what's running:
systemctl --user list-units --type=service --state=runningWhat 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 bluetoothUpdate services (temporarily):
systemctl --user disable --now packagekitNote: Only disable services you don't need. Don't disable essential system services.
To re-enable later:
systemctl --user enable --now service-nameTesting helps you:
- Verify your configuration is working
- Find the best settings for your system
- Identify problems before they affect your work
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 **
Check PipeWire's reported latency:
pw-metadata | grep latencyThis shows latency information from PipeWire.
Install test tools:
Arch/CachyOS:
sudo pacman -S pipewire-jack jack2-toolsUbuntu/Debian:
sudo apt install pipewire-jack jack-toolsFedora:
sudo dnf install pipewire-jack-audio-connection-kit jack-audio-connection-kit-toolsRun latency test:
pw-jack jack_latencyWhat 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)
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
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.confFind this line:
default.clock.quantum = 128Change to:
default.clock.quantum = 256Or even:
default.clock.quantum = 512Save and restart:
systemctl --user restart pipewire pipewire-pulse wireplumberTest again. If dropouts stop, your CPU needs a larger buffer.
Solution 2: Check CPU usage
htopWhat 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 performanceThis 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
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.confFind:
default.clock.quantum = 128Change to:
default.clock.quantum = 64Save and restart:
systemctl --user restart pipewire pipewire-pulse wireplumberWarning: Smaller buffer = more CPU usage. If you get dropouts, increase it back.
Solution 2: Verify real-time priority
ulimit -rShould 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).
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 wireplumberAll should show "active (running)".
If not, restart:
systemctl --user restart pipewire pipewire-pulse wireplumberSolution 2: Check audio devices
pactl list short sinksWhat 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 sinksYou'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-stereoReplace with your actual device name.
Solution 4: Use GUI to check
pavucontrolThis opens a graphical audio control panel.
Check:
- Output Devices tab
- Make sure your device is not muted
- Make sure volume is up
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-nameExample:
pw-jack ardour5This makes the app use PipeWire's JACK compatibility.
Solution 2: Set environment variable
Add to your shell configuration:
nano ~/.bashrcOr if using zsh:
nano ~/.zshrcAdd this line:
export PIPEWIRE_LATENCY=128/48000Save and reload:
source ~/.bashrcOr 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
Symptoms:
-
ulimit -rshows-1 - Audio dropouts persist
- Real-time priority not available
Solutions:
Solution 1: Verify limits file
cat /etc/security/limits.d/99-audio.confShould 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 audioShould show audio in the list.
If not:
sudo usermod -aG audio $USERThen 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 -rShould 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
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.confLook for:
- Missing brackets
{ } - Missing commas
- Typos in setting names
Common mistakes:
- Forgetting commas between settings
- Missing closing brackets
- Typos:
quantumnotquantam
Solution 3: Restart all PipeWire services
systemctl --user stop pipewire pipewire-pulse wireplumber
systemctl --user start pipewire pipewire-pulse wireplumberOr:
systemctl --user restart pipewire pipewire-pulse wireplumberSolution 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.
This comprehensive guide covered achieving low-latency audio with PipeWire:
- Understanding Low-Latency Audio - What it is and why it matters
- Checking Your Current Setup - Verifying PipeWire is installed and running
- Installing PipeWire - Step-by-step installation for all major distributions
- Enabling Real-Time Scheduling - Giving audio processes priority
- Configuring PipeWire - Setting buffer sizes and sample rates for low latency
- Using JACK Compatibility - Running professional audio applications
- System Optimization - CPU settings, kernels, and performance tuning
- Testing Latency - Multiple methods to verify your setup
- 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
- Audio Configuration - General audio setup and troubleshooting
- PipeWire Guide - Complete PipeWire guide (if it exists)
- Professional Audio - Advanced audio production topics
- MIDI Configuration - MIDI setup and configuration
- ArchWiki Professional Audio: https://wiki.archlinux.org/title/Professional_audio
- ArchWiki PipeWire: https://wiki.archlinux.org/title/PipeWire
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
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
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.