
PipeWire Quantum: Choose and Test Your Buffer Size
PipeWire quantum is the number of frames processed per graph cycle. Start with a setting that handles your actual workload, then lower it only if you need faster software monitoring or cue response.
Compare buffer periods
Divide the quantum by the sample rate and multiply by 1,000 to get milliseconds per graph cycle. For example, 128 frames at 48,000 Hz is about 2.67 ms, not a measured round trip. At 96,000 Hz the same 128 frames gives about 1.33 ms per cycle, but the graph must process more samples per second and meet deadlines more often.
| Frames | Period at 48 kHz | When to try it |
|---|---|---|
| 64 | 1.33 ms | When monitoring delay is still a problem and the rest of the session is stable. |
| 128 | 2.67 ms | A candidate for tracking or cueing; verify with the whole session running. |
| 256 | 5.33 ms | A practical first comparison for a loaded recording or DJ graph. |
| 512 | 10.67 ms | A starting point for mixing or editing without live software monitoring. |
PipeWire quantum calculator
Enter whole numbers: 1 to 262,144 frames and 8,000 to 768,000 Hz.
| Quantum (frames) | Period (ms) |
|---|---|
| 64 | 1.333 |
| 128 | 2.667 |
| 256 | 5.333 |
| 512 | 10.667 |
Optional session test log
Record observed settings, not just requested ones. Added rows stay on this page until you save them in this browser or export them. The tool does not send log entries anywhere.
No test rows yet.
If you are editing a track made with an AI music generator, test playback with the full effects chain rather than optimising an empty project for live monitoring you do not need. For tracking, apply the buffer setting in REAPER and check that you are listening through only the intended monitoring path. Hardware direct monitoring and DAW software monitoring are different paths; combining them can sound like a delay even with no errors.
Change one variable and verify the driver
Start playback or recording on the intended interface. Read the driver and follower rows in pw-top and record the driver's QUANT and RATE, not just the DAW request. The app may request a value the graph does not adopt. A follower's suggested quantum alone tells you neither the driver period nor whether resampling is happening.
Use the application's or distribution's buffer control first. The PipeWire runtime settings manual distinguishes a client request from a forced server value. Before temporarily forcing a quantum, inspect pw-metadata -n settings and record whether an override already exists. On a PipeWire session you control, and with no live recording in progress, you can run:
pw-metadata -n settings 0 clock.force-quantum 256
This affects the running server, not just one app. Verify the outcome with pw-top. Set clock.force-quantum to 0 to return to automatic selection if that was the previous state; otherwise restore the value you recorded. If changing the setting interrupts audio, recheck the routing before resuming a session.
Before making anything permanent, close and reopen the relevant app and confirm the setting still behaves as expected. Prefer a saved application or distribution preference when one workload needs a different buffer. A server default and a forced override are not the same thing: a client can still request a different value from a default. Record how to revert any saved change before relying on it.
Make the test repeatable
- Fix the interface, clock source, rate, routing, project and plugin settings. Pick a representative hard passage: armed monitoring tracks, the busiest mix, or both DJ decks with key lock and cue enabled.
- Record the initial
ERRvalue on the relevant driver or node, then run the same passage for the same duration. Record the difference, not the sum of displayed totals. Note audible glitches even if a counter did not move. - Repeat each setting and check what happens when starting transport or loading effects. If a node restarts or its count resets, use a new baseline rather than treating the drop as an improvement.
- Keep headroom for the real session. A clean short run at 64 frames does not make 64 safe on your next set. Lower the quantum only if you can name the monitoring problem it solves.
Make a fixed playback control
If you need the same uncompressed file on two runs, the following uses Python 3's standard library to make a 15-second stereo WAV at 48 kHz. Run it in a writable test directory. It refuses to overwrite an existing file. Start at a low listening level: a steady tone is more intrusive than music.
python3 - <<'PY'
import math
import struct
import wave
rate = 48000
with open("linuxdj-test-48k.wav", "xb") as output, wave.open(output, "wb") as wav:
wav.setparams((2, 2, rate, 0, "NONE", "not compressed"))
second = b"".join(
struct.pack("<hh", sample, sample)
for frame in range(rate)
for sample in [round(1500 * math.sin(2 * math.pi * 440 * frame / rate))]
)
for _second in range(15):
wav.writeframesraw(second)
PY
Import that file into the same test project and play the same section at each setting. Use it to distinguish a repeatable basic playback fault from one that only occurs with your own project. The test tone is not a substitute for a representative plugin, recording or DJ workload, and does not measure analogue round-trip latency.
Decide which result to keep
Suppose 128 frames passes two runs but adds an error in the third while 256 passes all three. Report those as observations for that workload, not a universal safe threshold. Repeat the earlier 256-frame run after the 128-frame failure: if it now fails too, temperature, routing or background activity may have changed. A stable short run at a fixed graph rate also tells you nothing about an app that requests a different rate after you relaunch it.
Physical round-trip latency also includes device, converter and other buffering delays. Use an output-to-input loopback if you need the actual time through that path. The calculator and log do not measure it or choose a universally stable setting. If changing the quantum did not address the fault, use the low-latency setup checklist to check device detection, routing and clocking without signing up.
- PipeWire
- Quantum
- Buffer Size
- XRuns
- Linux Audio
- 2026