-
Notifications
You must be signed in to change notification settings - Fork 16
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
Free audio processor resources when the node has stopped/ended and cannot be started again #397
Comments
Cool to re-open this discussion, I really think we have a lot of room for perf improvements in handling the audio graph more smartly (...but that's quite/really tricky for sure...)
I don't really get that, if the
This is true for all Related note regarding #396 and
Do the renderer continue to hardly compute things that cannot be heard anymore? (I'm actually afraid this is the case, and maybe that could explain the issue) ...And we could just imagine the exact same setup with an If I'm not mistaking in the first place, maybe a new rule for And then (needs review) maybe this could be generalized to:
|
Yes, all valid points.
Reading the spec literally, yes it should continue processing regardless if the output are used. Now common sense would make you think we don't need to render pieces of the audio graph that are not connected to the destination node, but this is only true when none of these nodes have observable side effects Nodes with observable side effects include
As you can see this becomes quite hairy easily. But maybe the browser implementation don't care and only traverse backwards from the destination node? That said we could easily drop orphaned source nodes, it would be a nice start. |
Hehe, ok, but can you actually observe any side effect if you don't have any handle to the node, and then no way to observe any side effect? |
Ah true, disregard delay node and analyser node |
[edited to remove noise :)]
Yes, I agree this is kind of nightmare to think about
Yup sure! I can already think of another problematic case I think, but probably best to clearly define what observable side effects means beforehand |
Currently, we drop the AudioProcessor when both:
But we can release the resources earlier, e.g. when
Take care, since the control thread still has the AudioNode they could call connect/disconnect/etc on it.
This means we should not recycle the AudioNodeId immediately
The text was updated successfully, but these errors were encountered: