Skip to content

Are the input and output arguments of AudioWorkletProcessor.process reused and mutated? #1127

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

Closed
lukewagner opened this issue Dec 20, 2016 · 4 comments
Labels
Needs Discussion The issue needs more discussion before it can be fixed.
Milestone

Comments

@lukewagner
Copy link

Reading the description of the call to the AudioWorkletProcessor process method, I was trying to determine whether it created garbage from the input/output parameters. I expect the intention is 'no', because the point is to alias and reuse the buffers between nodes of the graph. But this reuse would technically be visible to JS so it seemed like the spec would need to explicitly say that the input/output objects are allowed to be arbitrarily mutated/reused after process returns. (cc @bakulf)

@padenot padenot added the Needs Discussion The issue needs more discussion before it can be fixed. label Dec 20, 2016
@padenot padenot added this to the Web Audio V1 milestone Dec 20, 2016
@joeberkovitz
Copy link

We're going to discuss this in the WG shortly, but I don't presently see why the spec needs to speak to this question. It should be up to the UA to implement any sort of sensible buffer management policy it likes, without creating dependencies on that policy (even if it's possible for JS to discover certain aspects of the policy by stashing buffer references and seeing if they're reused elsewhere).

@lukewagner
Copy link
Author

lukewagner commented Jan 4, 2017

Thanks! At least from my experience in other parts of the web platform, it's not about JS discovering, but rather JS implicitly depending which can later come back to bite. E.g., let's say some browser creates a fresh buffer on each process call and then some popular library or app is created which only tests on that one browser and it ends up holding onto and rereading buffers for a few frames and now this breaks on some browser that attempts to reuse buffers. We can say "it's the app's fault" but it's still the latter browser's problem.

@joeberkovitz
Copy link

Thanks for the clarification. We'll be sure to consider this angle.

@joeberkovitz
Copy link

This question will be resolved by #1079.

As a preview of the answer, buffer reuse across calls is likely to be permitted since otherwise there will be performance issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Discussion The issue needs more discussion before it can be fixed.
Projects
None yet
Development

No branches or pull requests

3 participants