w3ctag / design-reviews

W3C specs and API reviews
Creative Commons Zero v1.0 Universal
318 stars 55 forks source link

Web Audio API: User-Selectable Render Quantum Size #895

Closed hoch closed 5 months ago

hoch commented 9 months ago

こんにちは TAG-さん!

I'm requesting a TAG review of User-Selectable Render Quantum Size.

Historically, WebAudio has always rendered the graph in chunks of 128 frames, called a render quantum in the specification. This was a trade-off between function-call overhead and latency. A smaller number would reduce latency, but the function call overhead would increase. With a larger value, the overhead is reduced, but the latency increases because any change takes more audio frames to reach the output.

Further details:

We'd prefer the TAG provide feedback as (please delete all but the desired option): 💬 leave review feedback as a comment in this issue and @hoch @padenot

maxpassion commented 8 months ago

Hi @hoch, we had a discussion in our breakout C meeting today. We have one question: Will this API also affect other web applications that running on the same device?

padenot commented 8 months ago

No more than implementations have decided to make running an AudioContext affect other web applications (or any application) running on the same device today.

Creating and starting an AudioContext, in the overwhelming majority of cases (the exception being if the AudioContextLatencyCategory is "playback"), will start a low-latency real-time audio stream on the device. This in turns can, depending on the OS and various other factors, lower the global latency and/or buffer size of all apps on the machine, or at least the programs that are using the same audio device.

This is the case for any program that make use of low-latency audio. Allowing authors to pick a buffer size, or asking the OS for the best buffer size to use, isn't going to negatively change the impact of a web application on the rest of the system, because the default always has been something quite impactful already.

hoch commented 8 months ago

Re: @maxpassion

Will this API also affect other web applications that running on the same device?

@padenot wrote a detailed explanation above! Additionally to answer your question more directly, "No".

I also have a question. What's "break C meeting"?

maxpassion commented 8 months ago

Re: @maxpassion

Will this API also affect other web applications that running on the same device?

@padenot wrote a detailed explanation above! Additionally to answer your question more directly, "No".

I also have a question. What's "break C meeting"?

Sorry for the typo, it should be "breakout C meeting".

cynthia commented 5 months ago

Discussed (between @torgo, @ylafon and myself) during London F2F. The problem statement is clear, we like the fact that there is a path for graceful degradation, and it is a well thought-through solution to the given problem. LGTM from us.