Este site também está em português.Ler em português

Case study

PreSonus Quantum ES 2: 1.241 ms round trip (192 kHz)

USB audio round trip on a Pi 500, with a single interface: what changed, the numbers by sample rate, how it was measured and what is still unexplained.

Overview

The PreSonus Quantum ES 2 is a USB audio interface. Here it is connected to a Raspberry Pi 500 running LeanOS: main output 1 is cabled to input 1, and what is measured is how long a sample takes to go out and come back. The best measured value is 1.241 ms at 192 kHz (indication), and 1.564 ms at 48 kHz (indication).

For a player, this round trip is the delay between the gesture and the sound heard when monitoring through the computer: the lower it is, the closer the sound comes to the hand. For a system builder, it is the measurement that says how much of the delay comes from software and how much from USB and the interface hardware. Every number here has a package and date of origin, and values for other systems are only those published by third parties, with a source.

Lowest round trip, same interface, on each system

Same interface (PreSonus Quantum ES 2), round trip; different computers, settings and methodologies; sources below. LeanOS: direct transport, no DSP chain, user-space rig; best measured value 1.241 ms (192 kHz, guard 0 (indication)) and, at 48 kHz, 1.564 ms. LeanOS does not yet have a curve by buffer size with the chain on.

Now: round trip by sample rate

User-space rig on the regular kernel, empty chain (pass-through, no DSP), screen off. Pi 500 and PreSonus Quantum ES 2 over USB 2.0 high-speed, loopback from main output 1 to input 1, block of one USB microframe (125 µs) at all three rates, p50.

125 microsecond guard: direct, p50

Zero guard: direct, p50

The 0 guard was measured with 17 clicks per step and no failures: an indication, not proof; a long run is still to be done.

The full numbers

Rate / blockGuardDirect p50 / p99Empty chain p50 / p99Added p50 / p99Errors / underruns / drops
48 kHz / N=6125 µs1669 / 17311874 / 1875205 / 2490 / 0 / 0
0 indication1564 / 16071749 / 1750186 / 2480 / 0 / 0
96 kHz / N=12125 µs indication1523 / 15751625 / 1750102 / 3010 / 0 / 0
0 indication1388 / 14291500 / 1625111 / 2900 / 0 / 0
192 kHz / N=24125 µs1414 / 15011500 / 162586 / 2630 / 0 / 0
0 indication1241 / 12781375 / 1375133 / 2060 / 0 / 0

Values in µs. Direct: from the written click to the first return. Empty chain: to the second return, through capture, a chain with no DSP and the rig output. Added: chain minus direct. Sweep of the guard from 1000 µs to 0, 27 valid steps, all stable, with 0 errors, 0 underruns and 0 drops. No NAM, IR or gain has been measured on this path yet.

What each rate shows

  • A higher rate lowers the floor. At guard 0, direct goes from 1564 µs (48 kHz), 1388 µs (96 kHz) and 1241 µs (192 kHz); at the 125 µs guard, from 1669 µs (48 kHz), 1523 µs (96 kHz) and 1414 µs (192 kHz).
  • The rig software costs close to zero. At guard 0: chain and write call up to 1 µs; block wait 57 to 72 µs; loop software 0 to 7 µs (p50, breakdown of package #0175).
  • Most of the time is in USB and the Quantum. The part from the write to the second return (queue, USB, hardware and back) measures 1627, 1499 and 1253 µs at 48, 96 and 192 kHz, out of a total of 1749, 1500 and 1375 µs (package #0175).
  • The block is one 125 µs microframe at all three rates, with packets of 6–7, 12–13 and 24–25 frames. At all three, the chain p50 drops 125 µs at each guard step (#0175 sweep).
  • Rates. The Quantum clock accepts 44.1, 48, 88.2, 96, 176.4 and 192 kHz; LeanOS switches the rate at run time and runs up to 192 kHz.

Values depend on the setup (hardware, cable, port, screen off). Quantum ES 2 on usb0 xhci0@0x1f00200000, port 2. Package of the best value: #0175.

1. The problem: round-trip latency

When you play an instrument and hear it through the computer, the sound goes through three stages: it enters the interface, is processed by the computer and returns to the interface output. The sum of those times is the round-trip latency. The larger it is, the harder it is to play in time.

With the same interface, values published by third parties on other systems range from 4.00 to 6.583 ms (the context section further down gives each source). The goal of LeanOS on this path is to measure how far the system can lower that time and whether the audio stays free of failures while doing so: so, along with time, the measurement records errors, underruns (the output ran out of data in time) and drops (samples that did not arrive).

2. The equipment and the setup
  • Computer: Raspberry Pi 500, with LeanOS on the regular kernel, one boot per measurement.
  • Interface: PreSonus Quantum ES 2, USB Audio Class 2, USB 2.0 high-speed, on controller usb0 xhci0@0x1f00200000, port 2. The keyboard is on another controller (usb1, xhci1, port 2).
  • Wiring: loopback, cable from main output 1 to input 1.
  • Rig screen off during the measurement, and a warm-up lap before counting.

How LeanOS handles audio on this path:

  • Core 3 reserved. Only the audio thread runs there; the rest of the system uses the other three.
  • Tick off on that core while low-latency mode is on.
  • Polling. The thread spins on the xHCI event ring, without sleeping and without going through the scheduler.
  • 125 µs packets. The lead is one packet, one USB microframe.
  • Write aligned to the microframe. The output is written right after the input packet arrives; without that alignment, the measured phase jitter is 116 µs.
3. The method: how we measure

The measurement uses a short click written to the output. The rig measures the time until the click comes back through the input. There are two reading points:

  • Direct: from the written click to the first return.
  • Chain: from the first to the second return, through capture, an empty chain (pass-through, no DSP) and the rig output.
  • Added: chain minus direct, click by click.

p50 and p99. p50 is the middle value: half the clicks were below it. p99 is the value below which 99% of the clicks fell; with few clicks per step, p99 is practically the maximum.

Block. Audio moves in blocks of one USB microframe, 125 µs, at all three rates: 6, 12 and 24 frames at 48, 96 and 192 kHz.

Guard. It is the slack time the audio waits before entering the output queue. The sweep starts at 1000 µs and goes down in 125 µs steps to 0, with 4 s and 17 clicks per step, at each rate: 27 valid steps in total.

Valid, confirmed, indication. A step only counts if it was stable and had 0 errors, 0 underruns and 0 drops; a missing measurement shows as N/A, never as 0. A point is confirmed when it was already measured stable in more than one package; it is an indication when it was measured once, with few clicks, and the long run is still missing.

4. The path so far

The rows use different instruments, measurement points and loads: the first three are from the user-space loop on the regular kernel, the fourth is inside the audio thread and the last is from the user-space rig, direct p50, empty chain (AUDIO.md, TAXAS_CONSOLIDADO.md).

In order, only with what was measured and documented:

  • Start. With a 2.5 ms lead, the round trip was 3.98 ms, measured by the audio lat command.
  • Late mode. The output queue started to hold 32 silence packets at all times, and only the guard is delay. The median went to 2.08 ms.
  • Scheduler fixed. Without load, 1.71 ms, with late mode stable down to the 125 µs guard and 0 drops.
  • Inside the audio thread. Under load, 1.56 ms. That measurement leaves out the syscall entry and exit cost and the delay of the user-space loop scheduler; the difference from 1.71 ms is 0.15 ms, about one packet.
  • Stability. Two 30-minute tests with no drop, error or underrun. Restarting the stream under load took 217 s, because the audio thread and the restart competed for the same lock; with the lock released during the restart, it dropped to 125 ms.
  • The screen inside the audio loop. In the user-space rig, the screen was redrawn inside the loop: each draw costs about 1.67 ms on the Pi and leaves a step of 1.1 to 1.2 ms every 500 ms. Without the screen, direct was 1.73 to 1.83 ms (package #0169).
  • The sweep accumulated input. Between steps the rig sat idle, and the next adjustment read the accumulated capture all at once, up to the 384-frame ceiling (8 ms with blocks of 6). Hence the 9.6 to 10.4 ms of packages #0166 and #0167, which are not valid. Fixed in #0169: the capture is discarded at the start of each step, outside the measurement.
  • Higher rates. At 96 kHz in the rig kernel, direct transport gave 2.8 to 3.1 ms, with spikes of 200 to 300 ms and errors. By the user's decision, the 192 kHz test moved to user space, on the regular kernel: the rate switches at run time, the interface clock confirms the requested rate and all three rate steps closed with 0 errors and 0 underruns (#0175).
  • The floor drops with the rate. At guard 0, direct goes from 1564 µs (48 kHz), 1388 µs (96 kHz) and 1241 µs (192 kHz).

Between one start and another, the plateau shifts in 125 µs steps: from 1513 to 1763 µs, 1888 µs in one case, and 1638 and 1639 µs on restarts; within a start, jitter is 3 to 6 µs per minute. The cause of those plateaus remains unexplained: two experiments to reproduce the 1514 µs plateau of the first start (restarting the endpoints and zeroing the event ring) had no effect.

5. What the result means

At guard 0, the breakdown of package #0175 (p50) shows where the time goes:

  • The rig software costs close to zero: the chain and the write call add up to 1 µs and the loop software is between 0 to 7 µs. The block wait is between 57 to 72 µs, at most one microframe.
  • The rest is USB and hardware: the part from the write to the second return (queue, USB, interface hardware and back) measures 1627, 1499 and 1253 µs at 48, 96 and 192 kHz, out of a total of 1749, 1500 and 1375 µs.
  • The guard is pure time in the output queue: at all three rates, the chain p50 drops 125 µs at each guard step.

For a player, what the result shows is that software is no longer the big part of the delay on this path. For a builder, the ways the documentation points to from here down are fewer microframes between the write and the output (the guard is already at 0), a higher rate and another device.

6. Limits and next steps

What this result does not cover:

  • It is the case of one interface, one port, one loopback cable and an empty chain.
  • The highlighted value is at guard 0, measured with 17 clicks per step and no failures: an indication, not proof.
  • Latency with NAM, IR or gain on this path has not been measured yet (DSP comes in stages), nor external analog latency, nor other interfaces.

Next steps, which are not results yet:

  • Long runs at guard 0, about 60 s per rate, first without and then with CPU load, recording whether the late-mode cursor had to jump.
  • Variable block size (documented in DSP_BLOCO_VARIAVEL.md).
  • Fractional rates: the interface clock accepts 44.1, 88.2 and 176.4 kHz, which are not in this package's table.
  • DSP on the path (gain, NAM, IR), measured at each stage.
Context: published values for the same interface

Third-party numbers for the same interface at 48 kHz, as context only. Each source uses its own tool, computer and setup, and a DAW driver has a configurable buffer; LeanOS does not.

Table by buffer size

Buffer of the other systems (samples)Windows, ASIO
RMmedia, Dec 2024
Windows, Universal Control 4.3.2.1
DAWbench, Jan 2025
Linux (Raspberry Pi 5, ALSA)
PiPedal, Nov 2025
macOS, generic driver
Gearspace
164.00xrun
324.204.4446.006.583
485.60
644.875.1475.807.917
1287.207.5747.10
25611.8712.494
51222.313
LeanOS (no configurable buffer): 1.564 ms at 48 kHz, best measured case (guard 0 (indication)); overall best 1.241 ms (192 kHz).

Same interface; different computers, settings and methodologies; not a controlled comparison. LeanOS has no configurable buffer the way a DAW driver does. Round trip at 48 kHz in ms; "xrun" where the source records a failure. The RMmedia post does not name the tool; the PiPedal one uses pipedal_latency_test. The DAWbench values (RTL calculated by the utility, Windows 10 x64) are on page 15 of the Jan 2025 PDF, which does not state the sample rate. For macOS (Gearspace) only the two sizes whose source was checked are shown.

Latency by buffer size

0481216202416324864128256512buffer →ms ↑xrun: Pi 5, 16LeanOS 1.6 ms
  • Windows, ASIO (RMmedia)
  • Windows, Universal Control (DAWbench)
  • Linux (Raspberry Pi 5, ALSA; PiPedal)
  • macOS, generic driver (Gearspace)
  • LeanOS (direct transport, no DSP chain)

Horizontal axis: buffer size in samples, evenly spaced between the published points. LeanOS has no configurable buffer and appears as a horizontal line, measured as direct transport with no DSP chain; it does not yet have a curve by buffer size with the chain on. Each curve has its own methodology.

When the smaller buffer still gives xruns

The 16 to 512 sample buffers are those of the other systems, configurable in the driver; they are not the LeanOS configuration. On the Raspberry Pi 5 with ALSA (PiPedal, third-party data, not LeanOS), the source records an xrun at the 16-sample buffer; the table shows the lowest stable value per buffer. In LeanOS the block is one USB microframe, 125 µs (6, 12 and 24 samples at 48, 96 and 192 kHz), and there were two 30-minute runs with no drops, errors or underruns (AUDIO.md).

7. How to reproduce, and sources

Hardware: Raspberry Pi 500, PreSonus Quantum ES 2 over USB, cable from main output 1 to input 1. The results hold for that set. Sources, in Portuguese, in the repository:

  • resultados_quantum.json: one record per step, where the numbers of this page come from (package of the best value: #0175).
  • TAXAS_CONSOLIDADO.md: the method, the tables by rate and the breakdown.
  • RIG.md: the user-space rig, the screen and sweep fixes (§13.10) and the high rates (§13.11).
  • AUDIO.md: the kernel history, late mode and stability.