-
Notifications
You must be signed in to change notification settings - Fork 168
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
Globals specified with [Exposed=*]
not present in AudioWorkletGlobalScope
#2499
Comments
[Exposed=*]
not present in `AudioWorkletGlobalScope[Exposed=*]
not present in AudioWorkletGlobalScope
As you mentioned, the WG's intention is to limit the exposure of AudioWorkletGlobalScope only for the worklet-based audio processing. I am not sure if there's a way to notate the exception of specific Globals using WebIDL. It also seems like there's inconsistency between the spec and the actual implementation: We'll triage this issue in the next teleconference and think about solution. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@Liamolucko It looks like we need to open issues against TextEncoder and URL specs. Could you do that? |
FYI, TextEncoder/TextDecoder were made So... might require discussion w/ TC39 folks etc. if you want to revisit that. |
More specifically: if you have a reason to exclude these APIs, it would follow there are parts of ECMAScript that perhaps you'd also want to exclude (e.g. parts of ECMA-402 Internationalization?), now or in the future. |
That's a good point. Thanks @inexorabletash! |
2023 TPAC Audio WG Discussion: Pinging implementors to get more thoughts: @padenot @jyavenard |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This is not the case. It is a mistake to use those APIs in a real-time context such as the |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Real-time safety can be assessed theoretically in the cases we care about here, by simply thinking about the constructs in use in the It follows that anything but the simplest amount of necessary computations is to be done on a different thread than the thread the https://paul.cx/public/karplus-stress-tester/ is an empirical test you can run, source is available. https://blog.paul.cx/post/a-wait-free-spsc-ringbuffer-for-the-web/ is a discussion on this. You're welcome to write your own tests, you'll find the same result. This article shows how to precisely assess the performance you're getting. As said in the article above, communication to and from this scope is better done using wait or lock-free data structure, that are real-time-safe, as widely documented in the literature, but this classic article is a good introduction to the entire field. And we've tested asynchronous code extensively while implementing, it's a disaster for performance and causes glitches in the simplest case. It's always possible to write bad code on any platform, but if we can, it's better to not allow it. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Was there any further discussion or conclusion on which interfaces exactly should not be exposed? Coming from Wasm here it would be good to know if |
We do not have a comprehensive list of blocked APIs yet, but these are good questions to ask:
If the answer to them is yes, then it is likely to be excluded from the AudioWorkletGlobalScope. |
@padenot has pointed out in Mozilla's Bugzilla, that any allocation is bad and considering there is already a non-allocating API for So the proposal is to expose It was suggested to ask for clarification in WHATWG Encoding, which I would like to do after getting some official statement here. Does that sound like an appropriate plan? |
Describe the issue
There are several globals such as
TextEncoder
,TextDecoder
andURL
which seem to have been intentionally left out ofAudioWorkletGlobalScope
. However, these are specified with[Exposed=*]
in WebIDL, which is defined as:The definition of
AudioWorkletGlobalScope
uses[Global]
, so should technically contain these:To be clear, I'm not saying they should be added to
AudioWorkletGlobalScope
; I'm saying that it needs to be specified somewhere that they aren't there.It's possible I may have just missed a note about this somewhere in the spec, but I couldn't find anything.
Where Is It
I'm not entirely sure whether this should be fixed in the Web Audio spec itself or the specs which define these globals with
[Exposed=*]
.Some possibilities, though:
AudioWorkletGlobalScope
WorkletGlobalScope
TextEncoder
TextEncoder
URL
The text was updated successfully, but these errors were encountered: