-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AudioWorklet
improvements
#127
Comments
I added some more todos following the discussion over at https://app.slack.com/client/T04PVA27V/CGS5YDU0J |
I would rather not add something to the base lib to facilitate this. Instead, we could just add an unconnect custom AudioWorkletNode of our own in de the node lib to each AudioContext. It won't affect audio processing, and will tick exactly once per render quantum. This we can use to yield to V8. |
I understand your point, but can we be sure it will be called last? I'm a bit unsure of the graph sorting rules but I think in particular if we have a second user defined unconnected worklet, we might end up in a situation where the graph needs to wait for the JS tick to end, no? (that may be no huge deal and certainly better than the current situation in any case) |
Yes indeed, we cannot guarantee it is called before or after the audio destination node. (unless we connect the destination node to the canary node - perhaps not a bad idea although the end user could theoretically disconnect them) I agree that ideally these two operations run concurrently in their respective threads
But I think that is something to look into later. In any case we go from many event loop spins to 1 per render quantum, which is beneficial always. Let me whip up some code and we can discuss further :) |
Hehe, yup let's go :) |
Remaining todos and ideas following #124
Float32Array
channels to avoid allocation and GC (as much as possible)run_audio_worklet_global_scope
andsetImmediate
only once per render quantumNapiAudioWorlketProcessor::param_values
could just beVec<&'static [f32]>
parking_lot
crate ?)Dry runcould create issues If the worklet buffer some valuesprocess
functions to force the JIT compiler to optimize them ? (might break some wpt checks)The text was updated successfully, but these errors were encountered: