Explicit clocked duplex conversion¶
PreparedClockedDuplex and open_clocked_duplex add opt-in input-clock conversion.
Capture and output use their own explicit f32 configurations; nominal rates may
differ within 8000..192000 Hz and the complete corrected rate ratio must remain
within the sinc converter bounds. The processor prepares
at the output rate, with 1..64 inputs/outputs and no auxiliary buses/events.
Nothing changes device settings or chooses fallback devices/formats.
ClockedDuplexOptions sets 1..65536 scratch output frames, even 16..256 taps per
input channel and an explicit FifoClockConfig. Its capacity must match the
power-of-two capture ring (2..65536 frames); target occupancy is strictly inside.
Conversion storage is allocated before processor preparation; all rendering
storage is allocated before native output stream construction.
The existing live callback contains panics and disables DSP until reopening.
Prepared ordinary conversion/rendering allocates nothing. Native operations and
processor code retain their own timing obligations.
Initially, input remains zero until capture reaches target occupancy. Thereafter, queued capture plus prefetched input feeds the bounded smoothed proportional clock controller, capped at ring capacity for feedback. Positive correction consumes input faster. All input channels share the same correction and conversion phase. The conservative fixed filter cutoff covers the complete allowed ppm range; no live table replacement occurs. Output chunks are converted and immediately processed; callback counts refer to native buffers, not scratch partitions.
If capture runs out, remaining input is zero, counted as underflow. Converter and controller histories reset and input reprimes; processor history and logical output position continue. Priming zeros are counted separately. The gauge includes prefetched input and may exceed raw ring capacity by up to one scratch block. Clock and ordinary stream statistics use independent relaxed atomic loads, without one coherent complete-block snapshot. Nonfinite audio propagates and converted f32 overflow/headroom is not guaranteed.
Start, pause and destruction use the existing paired-stream ownership. Pause preserves FIFO/converter/DSP histories; start remains sequential, without physical sample synchronization. Explicit reopen creates fresh histories. Automatic recovery/hotplug, MIDI, recording, latency estimation and native plug-in lifecycle scheduling are separate work. The proportional controller has a steady occupancy offset and cannot guarantee arbitrary configuration stability or long-session physical drift handling from synthetic tests.
CARGO_BUILD_JOBS=2 cargo run --release -p ravet-device-probe --locked -- \
--validate-clocked-duplex-silence input-id output-id [seconds]
This probe requires explicit enumerated IDs, uses each device's default f32 configuration, emits only silence and retains only counters. It checks three fresh pairs (default one second each; optional 1..60 seconds), pause/resume, callback/error/correction bounds and control-thread processor preparation/deactivation. Underflow, overflow and priming remain visible. Native evidence and its limits belong in work status; the probe alone does not establish physical alignment, long-session stability or deadlines. See decision 0104.