Linux DJ

Low-Latency Linux Audio: Setup and Troubleshooting

Get the interface and application talking at a comfortable buffer before trying to reduce latency. Then test the smallest setting that survives your real workload, and leave headroom for recording or live work. Change the kernel only if the evidence points to scheduling rather than routing, device support or graph load.

1. Start with one interface and one application

On your normal desktop session, run aplay -l for ALSA playback devices, arecord -l for ALSA capture devices and, on a PipeWire setup with WirePlumber, wpctl status for the session’s devices and nodes. ALSA and PipeWire lists answer different questions. A FireWire interface may need a different path: distinguish FireWire driver and mixer support before treating a missing device as a buffer issue.

Choose the intended backend inside the application, route one input and one output, and confirm both with a simple test track at a safe level. If you use REAPER, follow the low-latency REAPER setup to verify that the JACK client is on the intended graph.

Check the functions the session depends on, not just the number of connectors. A class-compliant USB device may pass audio while its mixer, DSP routing or firmware updater needs separate software. If stereo works but the cue or multichannel outputs are missing, verify the selected profile and interface mixer before blaming the bus. Test the intended cable and port at the same settings before adding a hub or another interface.

2. Set a baseline, then lower the buffer

Begin at a conservative setting such as 512 frames at a rate your device supports. Use the session you actually need to run: the same tracks, plugins, monitoring and other applications. If it is stable, test your PipeWire buffer size one step at a time. Read the observed driver settings after each change rather than assuming the requested setting took effect.

At 48 kHz, 256 frames give the graph about 5.33 ms per cycle; 128 frames halve that deadline. Neither value is a measured delay from input to output. Replaying an empty project only tests the empty project: include the point where transport starts, the busiest passage and a take with monitoring enabled. Write down where a glitch first appears as well as the counter delta, then go back to the last stable setting.

Choose the buffer for the task. For a dry vocal cue, hardware direct monitoring can remove the DAW from the performer’s monitoring path without forcing a small buffer. For a live software instrument or an effects chain the performer needs to hear, test the entire path at the intended setting. For editing or mixing, use the extra processing margin unless you still need to perform against the project. There is no single delay below which every performer and monitoring arrangement feels the same.

3. Find what failed before tuning anything else

  • No device or signal: verify the correct device, profile and ports. Raising priority cannot restore a missing connection.
  • Clicks and dropouts: compare pw-top error counters before and after replaying the same passage. Try the same project without the suspected plugin or competing workload before changing system settings.
  • Stable playback but delayed monitoring: check plugin delay, hardware direct monitoring and actual loopback delay before trying another kernel.

4. Check scheduling and interrupts without guessing at priorities

A real-time scheduling policy lets an eligible audio thread run ahead of ordinary tasks, but it does not make a busy plugin finish its work faster. SCHED_FIFO and SCHED_RR are real-time policies; round-robin time-slices threads of equal priority. Inspect the individual threads of the audio process during playback, rather than drawing a conclusion from the policy of its main thread:

# Replace 1234 with the PID of the audio process you are inspecting.
ps -L -p 1234 -o pid,tid,cls,rtprio,comm

Read this alongside your distribution’s audio service documentation. It is normal for housekeeping threads and the audio-processing thread to use different policies. If the expected real-time path is missing, investigate your audio stack’s supported RTKit, portal or limits configuration. Do not copy a priority number from another workstation: making a user thread outrank work it depends on can make the problem worse.

Interrupts are how devices ask the CPU for attention. /proc/interrupts can help identify activity on a USB host controller or other relevant device while recreating a fault, but a rising count is not itself evidence of harmful timing. Check whether the glitch follows a particular device or competing workload before adjusting CPU affinity. Avoid forcing all audio and device work onto one core or overriding interrupt balancing without an identified bottleneck, a before-and-after test and a rollback plan.

Modern Linux can be built with real-time preemption; that does not mean every distribution kernel enables it. See the kernel scheduler documentation for context around the historical PREEMPT_RT patch set. A real-time kernel can reduce some sources of scheduling delay, but cannot fix unstable device clocking, a missing channel or firmware stalls. Compare against the known working kernel only after the basic recording path is sound.

5. Separate power and connection problems from graph load

If the failure occurs after idle or waking the machine, look for a device disappearing and returning before interpreting it as a buffer fault. Compare wpctl status and the system’s USB messages before and after the event. A direct port test can rule out a hub or dock variable. USB runtime autosuspend and the whole machine entering sleep are different events; disabling the former is not a fix for the latter.

If the same passage fails on battery but not on mains power, compare the current power policy under otherwise matching conditions. Use your distribution’s power controls for one reversible change. Leave enough time for the machine to warm up: a policy that looks better for thirty seconds may behave differently once the cooling system settles. Keep the change only if it solves a repeatable problem, and restore the original policy outside the test.

6. Pick the measurement that can change your next decision

Use the separate guide to measure scheduling, graph or physical latency. A time series can show when stalls happen: the Latency Graph archive note explains how to plot one without relying on the unverified legacy download. A spike near the start of a new workload gives you a test to repeat, not a diagnosis. If the system records without new errors under representative conditions and monitoring feels right, stop tuning and save that configuration.

For other community reference material, return to the LAD resource index. For a separate sound-design workflow, see the guide to AI voice and audio tools.