Skip to content
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

Have a single AudioWorkletGlobalScope per BaseAudioContext #1753

Closed
padenot opened this issue Sep 14, 2018 · 3 comments · Fixed by #1760
Closed

Have a single AudioWorkletGlobalScope per BaseAudioContext #1753

padenot opened this issue Sep 14, 2018 · 3 comments · Fixed by #1760
Assignees

Comments

@padenot
Copy link
Member

padenot commented Sep 14, 2018

I think this was forgotten when writing a PR for #1511 (no wonder, it was so big).

The resolution seem to be #1511 (comment). It's also a resolution in #966 (comment).

It's rather critical for interop and is what Chrome implements (and we'll implement). Authors need to reliably be able to share data between instances (wave tables, audio buffers, other precomputed data, etc.).

@hoch
Copy link
Member

hoch commented Sep 14, 2018

Yes, this is an oversight and the fix should be trivial. So you think the following text in the spec is problematic? (From here)

At least one AudioWorkletGlobalScope exists for each AudioContext that contains one or more AudioWorkletNodes.

@padenot
Copy link
Member Author

padenot commented Sep 17, 2018

Yes, it means you can't really count on the fact that you can read the expandos you set in one process in another process.

@hoch
Copy link
Member

hoch commented Sep 17, 2018

Also Worklet's addModule method and the construction process of WorkletGlobalScope do not seem to be compatible with the notion of parallelism. In fact, there is a bit of history on this sentence - @joeberkovitz wanted to have some room for the future so we can support multi-threading support by having multiple AudioWorkletGlobalScopes.

Here's the relevant discussion: https://github.com/WebAudio/web-audio-api/pull/1020/files#r88695255

But I think it might need a completely different approach to support the multi-threading without violating many assumptions that are already in place. Hence, SGTM.

@padenot padenot self-assigned this Sep 18, 2018
padenot added a commit to padenot/web-audio-api that referenced this issue Sep 19, 2018
… could exist for a single AudioContext. This fixes WebAudio#1753.
padenot added a commit that referenced this issue Sep 20, 2018
… could exist for a single AudioContext. This fixes #1753. (#1760)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants