Motivation
IR cabinet performance on low-power hardware (Raspberry Pi) varies a lot between IRs, and the right trade-offs are hardware-dependent. Two values are currently hardcoded and should be user-tunable so people can dial in performance vs. tone for their machine.
Current state
- Convolver type is effectively fixed to direct FIR:
- standalone
rustortion-standalone/src/audio/manager.rs:59 → ConvolverType::default() (= Fir)
- plugin
rustortion-plugin/src/lib.rs:330 → ConvolverType::Fir hardcoded
- A
ConvolverType::TwoStage (partitioned FFT, ir/convolver/fft.rs) already exists but is unused.
- Trim length is the constant
DEFAULT_MAX_IR_MS = 50 (ir/cabinet.rs:15), passed into load_service::spawn and used as max_ir_samples = sample_rate * max_ir_ms / 1000.
Direct FIR cost is O(IR length) per sample (ir/convolver/fir.rs inner loop), so shorter IRs are cheaper. On the Pi, FIR has measured faster than TwoStage for these short (<=50 ms) IRs (per-block FFT overhead + small caches), so the answer is to let users choose rather than switch the default.
Proposed
- Expose convolver type (FIR / TwoStage) as a setting; changing it rebuilds the convolver and reloads the current IR.
- Expose IR trim length (ms) as a setting; changing it recomputes
max_ir_samples and reloads the current IR.
- Defaults unchanged (FIR, 50 ms).
Open questions
- Standalone settings only, or plugin too? (Plugin currently hides the settings UI via
Capabilities; may need a param or editor control.)
- Whether to add per-platform (ARM vs desktop) defaults — probably out of scope for v1.
Notes
- Related: the FTZ/DAZ denormal fix (separate issue) makes FIR cost consistent, which is the bigger lever for the Pi gradient. These two efforts are complementary.
- While in
load_and_cache, consider fixing the trim/truncate ordering (currently truncate runs before trim_silence, so IRs with leading pre-delay silence lose real tail content). Correctness cleanup, can ride along.
Motivation
IR cabinet performance on low-power hardware (Raspberry Pi) varies a lot between IRs, and the right trade-offs are hardware-dependent. Two values are currently hardcoded and should be user-tunable so people can dial in performance vs. tone for their machine.
Current state
rustortion-standalone/src/audio/manager.rs:59→ConvolverType::default()(=Fir)rustortion-plugin/src/lib.rs:330→ConvolverType::FirhardcodedConvolverType::TwoStage(partitioned FFT,ir/convolver/fft.rs) already exists but is unused.DEFAULT_MAX_IR_MS = 50(ir/cabinet.rs:15), passed intoload_service::spawnand used asmax_ir_samples = sample_rate * max_ir_ms / 1000.Direct FIR cost is
O(IR length)per sample (ir/convolver/fir.rsinner loop), so shorter IRs are cheaper. On the Pi, FIR has measured faster than TwoStage for these short (<=50 ms) IRs (per-block FFT overhead + small caches), so the answer is to let users choose rather than switch the default.Proposed
max_ir_samplesand reloads the current IR.Open questions
Capabilities; may need a param or editor control.)Notes
load_and_cache, consider fixing the trim/truncate ordering (currentlytruncateruns beforetrim_silence, so IRs with leading pre-delay silence lose real tail content). Correctness cleanup, can ride along.