Skip to content

IR cabinet: make convolver type and IR trim length user-configurable #250

@OpenSauce

Description

@OpenSauce

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:59ConvolverType::default() (= Fir)
    • plugin rustortion-plugin/src/lib.rs:330ConvolverType::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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions