-
Notifications
You must be signed in to change notification settings - Fork 172
Add AudioPlayoutStats interface #2645
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
base: main
Are you sure you want to change the base?
Conversation
hoch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good with some nits.
Also could you wrap the text at the column 80?
From @hoch Co-authored-by: Hongchan Choi <hongchan.choi@gmail.com>
|
Implemented your comments and wrapped the lines at 80 (except where it would have cut through a link, which seems to be the standard for the rest of the document), thanks! |
hoch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
|
@padenot Could you take a look? |
index.bs
Outdated
| 1. Set {{[[underrun duration]]}} to the total duration of all | ||
| [=underrun frames=] (in seconds) that | ||
| {{[[audio context]]}} has played since its construction. | ||
| 1. Set {{[[underrun events]]}} to the number of times that {{[[audio context]]}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious if this design holds up to distinguish these three cases
- occasional spike
- consistent overload -> consistent underruns (every quantum processed)
- periodic overload. as an example, a misaligned block based computation that ends up processing every N frames
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
- An occasional spike will manifest as a single increase in
underrunDuration, and an increase inunderrunEventsby 1. - Consistent underruns will manifest as many small increases in
underrunDuration, and many increases inunderrunEvents. - Similar to 1, but periodic. Since the API updates at most once per second (for privacy reasons), this might not be possible to immediately detect if N is small enough that we get several underruns per second. If N is large, it should be possible to see that the underruns occur at regular intervals. Also (if my math is correct)
underrunEvents / currentTimeshould converge steadily towardssampleRate / N, so you could also look for that.
Co-authored-by: Christoph Guttandin <chrisguttandin@media-codings.com>
padenot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments.
index.bs
Outdated
| Audio underruns (also commonly called glitches) are gaps in the audio | ||
| playout which occur when the audio pipeline cannot deliver audio on time. | ||
| Underruns (often manifesting as audible "clicks" in the playout) are bad | ||
| for the user experience, so if any of these occur it | ||
| can be useful for the application to be able to detect them and possibly | ||
| take some action to improve the playout. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Audio underruns (also commonly called glitches) are gaps in the audio | |
| playout which occur when the audio pipeline cannot deliver audio on time. | |
| Underruns (often manifesting as audible "clicks" in the playout) are bad | |
| for the user experience, so if any of these occur it | |
| can be useful for the application to be able to detect them and possibly | |
| take some action to improve the playout. | |
| Audio underruns (also commonly called glitches) are gaps in the audio | |
| playback that occur when an audio pipeline cannot deliver audio on time. | |
| Underruns (often manifesting as audible "clicks" in the playout) are bad | |
| for the user experience, so if any of these occur it | |
| can be useful for the application to be able to detect them and possibly | |
| take some action to improve the playout. |
we probably need to rephrase this. When the audio isn't delievered on time, it causes an audio underrun, that causes a discontinuity, that causes and audible click, that can be called a glitch. This is because of the synchronous nature of the AudioContext, unlike for example a PeerConnection, that will do something when audio input is missing to cover it up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rephrased, how about now?
| covert channel between two cooperating sites. | ||
| One site could transmit information by intentionally causing audio glitches | ||
| (by causing very high CPU usage, for example) while the other site | ||
| could detect these glitches. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but only if:
- There is a linearization point somewhere on the system (typically the audio mixer, be it in the OS or in the browser)
- The callbacks are effectively synchronous all the way from this linearization point, without a buffer in between that could flatten load spikes (that could be because of a different
AudioContextLatencyCategory).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, the side channel is likely only possible/efficient on a subset of systems, but should we mention this in the spec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to have a sentence or two about this yes, to convey a nuanced level of importance.
Co-authored-by: Paul Adenot <paul@paul.cx>
Co-authored-by: Paul Adenot <paul@paul.cx>
f36f524 to
92be88e
Compare
92be88e to
3d037e7
Compare
3d037e7 to
427a7d5
Compare
Hernqvist
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review!
index.bs
Outdated
| Audio underruns (also commonly called glitches) are gaps in the audio | ||
| playout which occur when the audio pipeline cannot deliver audio on time. | ||
| Underruns (often manifesting as audible "clicks" in the playout) are bad | ||
| for the user experience, so if any of these occur it | ||
| can be useful for the application to be able to detect them and possibly | ||
| take some action to improve the playout. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rephrased, how about now?
Integrates the Playout Statistics API for WebAudio spec into the WebAudio spec.
The following changes are made between the version incubated in WICG and this PR:
Related issue: #2642
Preview | Diff