node-web-audio-api icon indicating copy to clipboard operation
node-web-audio-api copied to clipboard

`AudioWorklet` improvements

Open b-ma opened this issue 9 months ago • 5 comments

Remaining todos and ideas following #124

  • [x] Review rules and fix number of channels outputs when input change
  • [x] Use a pool of Float32Array channels to avoid allocation and GC (as much as possible)
  • [ ] Ensure we run run_audio_worklet_global_scope and setImmediate only once per render quantum
  • [ ] Use the fact that parameterDescriptors are ordered to avoid transferring parameter keys, i.e. NapiAudioWorlketProcessor::param_values could just be Vec<&'static [f32]>
  • [ ] Review how message passing is done between audio and worklet threads (possibly use parking_lot crate ?)
  • [ ] ~Dry run process functions to force the JIT compiler to optimize them ? (might break some wpt checks)~ could create issues If the worklet buffer some values
  • [ ] Review and annotate unsafe sections
  • [ ] Change the thread_priority crate to https://github.com/mozilla/audio_thread_priority
  • [ ] Use a CondVar instead of crossbeam channel for Worker/Rust message passing
  • [ ] Propagate back error to rust thread in case of WorkletAbruptCompletionResult to remove the Worklet from graph
  • [ ] ...

b-ma avatar May 15 '24 11:05 b-ma