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

Audio latency

The values below apply to the PreSonus Quantum ES 2 (USB), on a Pi 500, in loopback (Main 1 out → input 1): not external analog latency, and not valid for other interfaces.

1.241 msdirect round trip (p50), 192 kHz, guard 0, user-space rig, empty chain with no DSP; hypothesis of a reproducible plateau (supported by being stable in 3 packages (#0175, #0176, #0179); 17 clicks in this run)
2 × 30 minno drops, errors or underruns
~68 µsNAM A2 Full per 64-sample block, on the Pi 500

From the start to today

MilestoneRound trip (median)How
Original (2.5 ms lead)3.98 msuser program, 48 kHz
Late mode2.08 msuser program, 48 kHz
No load, scheduler fixed1.71 msuser program, 48 kHz
Under load1.56 msinside the audio thread, 48 kHz
User-space rig, best current value1.241 ms192 kHz, guard 0, empty chain; hypothesis of a reproducible plateau (supported by being stable in 3 packages (#0175, #0176, #0179); 17 clicks in this run)

The rows use different measurement points and loads: "No load" is from the user program and "Under load" is inside the audio thread (the 0.15 ms difference between them cannot be attributed to the instrument alone) and the last is from the user-space rig, direct p50, empty chain. Details in AUDIO.md (docs are in Portuguese).

30-minute test

CriterionResult
Lead125 µs (1 packet)
Median round trip1.69 to 1.81 ms
Jitter per minute within a run (aligned click)3 to 6 µs; unaligned, 116 µs
Plateau between runs1510 to 1763 µs, in 125 µs steps
Drops, errors and underruns0, in two runs
P99.92000 µs: at the 2.0 ms limit, not below

Test configuration: Quantum ES 2, 48 kHz, 1-microframe block (125 µs), loopback, controller usb0, 9002 clicks per run (packages #0082 and #0085).

What is not measured yet

ItemStatus
Latency with NAM and IR in the chainnot measured
External analog latencynot measured
Video and roboticsnot measured

Bring your own NAM model and IR: InscenityOS ships none, and each one's license belongs to whoever made it.

Terms and acronyms

TermWhat it is
Round triptime (in ms or µs) between the sample written to the interface output and its return through the input, with the output cabled to the input (loopback)
p50, p99, p99.9p50 is the median (half of the measurements fell below it); p99 and p99.9 are the values below which 99% and 99.9% of the measurements fell
µs, msmicrosecond (one millionth of a second) and millisecond (one thousandth); 1 ms = 1000 µs
Microframea 125 µs slice of high-speed USB 2.0; audio moves one at a time
Lead, guardslack time the audio waits before entering the output queue; in the current campaign the guard goes from 1000 µs to 0
Underrun, dropunderrun: the output ran out of data in time; drop: a sample that did not arrive
Empty chain, DSPDSP is signal processing; empty chain is pass-through, with no plugin at all
xHCIthe Pi 500 USB controller; usb0 and usb1 are the two controllers used in the tests
NAM, IRNAM is a neural amplifier model; IR is the impulse response of a cabinet

Under investigation

Open fronts of the measurement campaign. No number below is a final result: each row says only what is already fact, and the numbers that appear are measured data, recorded in the repository; any reading of them is a hypothesis.

FrontWhat it isWhat is already factStatus
Variable block (S0, S1, S2)S0 is direct transport; S1 processes in fixed blocks of one microframe; S2 processes what arrived in each USB packet, without waiting to fill a block. Empty chain onlyin the long run of #0176, the input packets carried only N and N+1 frames, never N−1. In #0181 (Pi, empty chain, guard 0, 1 boot, 47 clicks per step, 10 s steps with the sequence and output checked bit by bit), the rig internal trace recorded, from the capture arriving to the output packet completing, a p50 of 252 µs in S1 and 127 µs in S2 (32 of 32 steps, 96 and 48 kHz). In the loopback round trip, the chain p50 with S2 was 125 µs lower in 23 of 36 pairs, 250 µs lower in 2 and equal in 11; no pair got worse. Hypothesis: S2 saves 1 microframe (125 µs) on the hosthypothesis (guard 0 only, empty chain, 1 boot); not the highlighted value
DSP time budget per microframehow long the chain can spend in each call before the audio drops frames; measured with a synthetic delay (busy wait) fixed per callin #0182 (Pi, empty chain, guard 0, 1 stream opening per rate, one 6.4 s step per delay, delays from 0 to 250 µs), S1 dropped no input frames with a 120 µs delay per block and dropped them at 125 µs, at all 3 rates (4706, 15557 and 1634 frames at 96, 192 and 48 kHz). S2 dropped no frames up to 250 µs, at all 3 rates, and the chain p50 rose in steps of 125 µs. Hypothesis: the DSP budget per microframe is close to 120 µs in S1hypothesis (1 boot); S2 with the real chain cost, proportional to the frames, was not measured
S1 × S2 under the same latency limit (LCPC, phase 1)compare S1 (fixed block) and S2 (variable block) while each 125 µs microframe receives a synthetic processing load from 0 to 126 µs; 192 kHz only, empty chainin #0189 (Pi, guard 0, 3 stream openings × 3 repetitions per load, 8.4 s and 37 clicks per step, 282 steps), the block start wait was 125 µs in S1 and 0 µs in S2 in every valid step. In 108 S1 × S2 pairs (same opening, load and repetition) there are two criteria, which do not replace each other. In the chain (measured click), latency was lower in S2 in 57, equal in 38 and higher in 13; median −125 µs, mean −69 µs. On the host (inferred trace), S1 was higher in 48, equal in 59 and S2 higher in 1. The load ceiling was 123 µs of processing per microframe in both modes; at 124 µs both drop frames. Valid steps (0 lost frames, 0 errors, 0 underruns, sequence and output checked bit by bit): 216 of 216, from 0 to 123 µs. Hypothesis: the variable block reduces or matches the latency below about 120 µs per microframe, with no frame loss observed, and does not raise the processing ceilinghypothesis (282 steps in 3 openings, 1 boot); the long validation was not done; the chain p99 is exploratory (with 37 clicks per step the p99 is the maximum itself; it is only valid with 100 clicks or more, and p99.9 with 1000 or more); per-packet integrity is not instrumented yet, so “no lost clicks” does not prove full integrity
Stability per 30 s step (LCPC, phase 2, stage 1)repeat the S1 × S2 comparison with 30 s steps instead of 8.4 s, at loads of 0, 100, 120 and 123 µs per microframe, with 124 µs as the negative control; 192 kHz only, empty chainin #0192 (Pi, guard 0, 3 stream openings, 147 clicks per step, 60 data steps), the 2 steps of 30 s of each variant (with a pause and the capture discarded between them; they are not equal to a continuous 60 s) were valid in all 24 variants from 0 to 123 µs (3 openings × 2 modes × 4 loads): 0 lost frames, 0 errors, 0 underruns, sequence and output checked bit by bit. The observed ceiling is still 123 µs; at 124 µs the 6 control steps were invalid (3 openings × 2 modes). After 124, the load-0 step returned to the initial plateau (±5 µs) in 5 of 6 cases; opening a1 failed in S2, 125 µs higher. In 27 valid S1 × S2 pairs, in the chain S2 was lower in 13, equal in 12 and higher in 2; on the host (inferred trace), S2 was higher in 0. Comparing with #0189 (52.8%, 35.2% and 12.0% of 108 pairs) holds only with the caveat that the matrices differ (8.4 s steps and 37 clicks versus 30 s and 147). Hypothesis: the S2 advantage and the 123 µs ceiling hold in 30 s stepshypothesis (1 boot, 3 openings); the chain p99 is exploratory (about 147 clicks per step and about 882 across the 3 openings, below 1000); per-packet integrity is not instrumented; 5 minutes per variant has not been measured yet
Determinism of opening the streamwhy the latency plateau shifts in 125 µs steps from one stream opening to anotherthe shift happens (see the case study). Data from #0179 (empty chain, guard 0, 22 clicks per opening): across 90 reopenings (30 per rate, same boot) and 10 boots, the chain p50 fell on 4 or 5 plateaus 125 µs apart; a fresh boot does not differ from a reopening; the recorded microframe phase does not separate the plateaus. The cause is still unexplained, and two experiments to reproduce a plateau had no effecthypothesis; cause under investigation
Long-run stabilityrepeat the long runs at guard 0, including under CPU loadtwo 30 min runs (48 kHz, rig kernel) and 60 s runs per rate (6 in #0179, 297 clicks each), without load, closed with 0 errors, 0 underruns and 0 dropswithout load: done; with load: to be measured
USB topology and xHCI envelopethe effect of the port and the controller, and how far the controller can go, on latency and stabilityevery measurement cited here uses the Quantum on controller usb0, port 2, and the keyboard on usb1, port 2; no other topology was comparednot measured

Experimental history

PackageWhat it wasStatusSource
#0184 (LCPC, phase 1)first run of the S1 × S2 comparison under the same latency limit, at 192 kHzpartial data: 83 of the 251 planned steps ran, because the shell truncated the list of loads. It is not used to decide S1 × S2 and is not the current result; the most recent reference for the comparison is #0189 (row above)LCPC_ANALISE_EXISTENTES.md, TAXAS_CONSOLIDADO.md

Build your rig