Skip to main content

measure_all_dsp_cpu_timings

Function measure_all_dsp_cpu_timings 

Source
pub fn measure_all_dsp_cpu_timings(
    audio_service: State<'_, Mutex<AudioService>>,
) -> Result<Vec<ExecutionTimingDto>, String>
Expand description

Measures the CPU execution cost of every processor in the active DSP chain.

Benchmarks the Gain, Tone Stack, and Master Volume processors in signal-chain order using a block size of 2 048 samples. Each result is the net added cost relative to a zero-work passthrough, clamped to ≥ 0 µs/sample.

Results are both logged at info level and returned to the frontend as a Vec<ExecutionTimingDto>.

§Returns

Ok(timings) — a vector of exactly three ExecutionTimingDto entries in signal-chain order: Gain → Tone Stack → Master Volume.

§Errors

Returns Err if the AudioService mutex cannot be locked.