Stoatworks Labs

SoundBench

Put an audio interface on the bench

In developmentApplicationRust / Tauri
SoundBench — Put an audio interface on the bench
SoundBench

What it does

Every audio interface comes with a driver that makes claims: a latency figure, a list of buffer sizes, a set of sample rates. SoundBench holds the interface to them. One of its outputs goes back into one of its inputs through a cable, and every test plays something out of that output and records what comes back on the same frame clock. In a duplex PortAudio callback the input and output buffers cover the same frames, so a delay found by correlation is the round trip, with nothing to calibrate.

Latency is a chirp played five times and found again by cross-correlation, refined to a fraction of a sample. Beside it you get the latency the driver reports, and the difference, which is how far out a DAW compensating from the driver's number would be. Frequency response, phase and harmonic distortion come from one exponential sine sweep by Farina's deconvolution, where each order of distortion turns up as its own impulse response a fixed time before the linear one. THD+N, THD, SNR and SINAD come from a tone, measured the way AES17 does it, and the received frequency in ppm reads off the clock difference between the converters. The noise floor is reported unweighted, A-weighted and as the narrow peaks sticking up out of it. Pink noise gives a second transfer-function estimate with coherence, so the response plot tells you which parts of itself to believe.

The buffer stability sweep is the bit a browser can't do. The interface is opened at each buffer size in turn (the driver's own list on ASIO, the HAL's published range on CoreAudio), a chirp and a tone go round the loop, and each size is judged on three things: whether the host flagged an underrun or overrun, whether the recorded tone has a discontinuity or a dropout in it, and whether the measured round trip grew with the buffer, which is how you catch a host that ignored the request and said nothing. The lowest clean size, with its round trip, is the number to set the DAW to.

That's why it's a desktop app and not a browser tool. A web page only sees the browser's audio stack (CoreAudio on a Mac, shared-mode WASAPI on Windows, never ASIO) and can't set a device's buffer size at all. SoundBench is Tauri around a Rust core, with PortAudio vendored and built from source so the binary carries every host API it can reach.

  • Everything the driver says: channels and their names, accepted sample rates, the allowed buffer sizes, the declared latency, and on macOS the HAL property list — transport, device UID, safety offsets, the physical stream format, whether another process holds the device
  • Round-trip latency to a fraction of a sample, the driver's own figure beside it, and the unreported difference; polarity of the loop; spread across five bursts
  • Frequency response, phase and THD against frequency from one log sweep, with the second and third harmonics drawn separately and the impulse response shown
  • THD+N, THD, SNR, SINAD and level from a 997 Hz tone at −1 dBFS, in the AES17 band under a seven-term window; the received frequency in ppm
  • Noise floor unweighted and A-weighted, with the hum, packet-whine and supply peaks above it listed by frequency
  • Transfer function and coherence from pink or white noise, as the cross-check on the sweep
  • Buffer stability: every size in turn, judged on host xruns, glitches found in the recorded tone, and whether the latency grew
  • Several input channels recorded at once, each with its own results; the setup remembered between runs
  • Markdown and JSON reports carrying every reading and every curve
  • CoreAudio, WASAPI shared and exclusive, WDM-KS, DirectSound, MME and ALSA, with ASIO as a build feature

Where it stands

In development, not tagged yet. Every analysis is pinned down by tests that run it through a simulated loopback of known delay, gain, filtering and distortion (36 of them), and the whole bench has run end to end on macOS through a CoreAudio loopback device: latency reads exactly three buffers at every size from 16 to 4096, the response is flat to 0.01 dB, and the stability sweep is clean all the way. No physical loopback cable has been through it yet, so the analogue path hasn't been tried on real converters. Windows and Linux compile in CI but haven't been run against hardware, and the ASIO path in particular is PortAudio's and untested here.