AUDIO
Source snapshot · 11 November 2026

Standalone audio devices

Input capture and duplex effects

input_devices enumerates IDs/configuration ranges, and input_device selects an exact ID or the default without fallback. open_input opens an explicit f32 stream and returns its unique audio ring consumer. PreparedCapture supplies the same capture path for offline tests. Ring capacity is a power of two 1..65536 frames, with 1..64 channels. Capture publishes a whole-frame prefix, drops the newest suffix on overflow and counts it. A partial frame rejects the whole input buffer without touching queued data. No input samples are written to files or transmitted by these APIs.

PreparedDuplex dequeues bounded interleaved input, zero-fills underflow and feeds prepared planar effects; output callbacks partition at 1..65536 scratch frames. Input/output counts are independently 1..64. Stats expose underflow frames; faults and silence are enforced as in the output adapter. The live wrapper uses the shared panic containment path and disables DSP until reopening after panic. Events, auxiliary buses and output event capacity are zero.

open_duplex builds explicit input and output streams with matching nominal rates, a ring capacity and scratch maximum. Input starts before output; failed output start attempts to pause input. Pause attempts both streams, retaining FIFO and DSP history. Restart is sequential, not sample-synchronized. Independent clocks can drift, producing counted underflow/overflow; there is no automatic resampling or compensation. Even on one interface, this FIFO path does not claim sample-exact capture/output alignment or round-trip latency. Reopen to clear FIFO or recover errors. Use the separate prepared worker/ring recording controllers for WAV, AIFF, FLAC, Vorbis or MP3 described in audio files. Physical recording and shutdown timing still require device validation; device-clocked transport and record scheduling remain separate work.

CARGO_BUILD_JOBS=2 cargo run -p ravet-device-probe --locked -- --list-input
CARGO_BUILD_JOBS=2 cargo run -p ravet-device-probe --locked -- \
  --validate-duplex-silence input-id output-id

The duplex probe receives one second of input into the bounded FIFO and emits silence on every output. It retains only counters, with no recorded sample file. Both default configurations must be f32 at the same rate. The probe requires input/output callbacks and no backend/DSP errors; underflow/overflow counters are reported, not hidden. Offline tests cover capture backpressure, invalid-frame rejection, queued ordering, variable duplex partitioning, underflow silence, processor fault silence and 1000 heap-free capture/render workloads. See decision 0028.