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 measures the interface against 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, because 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, the latency the driver reports, and the difference — the amount a DAW compensating from the driver's number would be wrong by. Frequency response, phase and harmonic distortion come from one exponential sine sweep by Farina's deconvolution, in which each order of distortion arrives as its own impulse response a fixed time before the linear one. THD+N, THD, SNR and SINAD come from a tone the way AES17 measures them, with the received frequency in ppm reading the clock difference between converters. The noise floor is reported unweighted, A-weighted and as the narrow peaks standing above it. Pink noise gives a second transfer-function estimate with coherence, so the response plot says which part of itself to believe.

The buffer stability sweep is the part a browser cannot 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 are run through 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 a host that quietly ignored the request is caught. The lowest clean size, and its round trip, is the number to set the DAW to.

It is a desktop app rather than a browser tool for exactly that reason. A web page sees the browser's audio stack — CoreAudio on a Mac, shared-mode WASAPI on Windows, never ASIO — and cannot 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 yet tagged. Every analysis is pinned 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 throughout. No physical loopback cable has been through it yet, so the analogue path has not been exercised on real converters. Windows and Linux compile in CI and have not been run against hardware; the ASIO path in particular is PortAudio's and untested here.