-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[AUDIO_WORKLETS] Move code off the main thread in locks test #25276
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
|
122be37
to
8dcef4c
Compare
1b37d5a
to
de0aebb
Compare
|
d8bd45d
to
f81f4e3
Compare
That could be from some other audio worklet bug, I've seen |
I've also seen plain old |
This flake seems to be Chrome-specific btw - the flake does not occur on Firefox. I wonder if there could be a Chrome bug or improvement possible? |
I saw a few failures with the earlier code after the We're not running anything from Emscripten 4 in production yet (only in development), but what we've seen for years in the logs are errors when unloading the page. Usually some timeout call or worker is still running after the page is partially unloaded. |
If it is down to the worker's interaction with main, it might be why I see I had this about every other run whilst trying to get all ticks for this PR. |
But this isn't even doing any audio code, it's essentially a message passing worker. |
#25312 seems to fix |
5695571
to
e8ee1b3
Compare
I added the same explicit shutdown here too to see how that goes. So far the unrelated |
If you want to run more iterations faster I have a helper option |
This should be good to land, since it moves code off the main thread and add the exit hang fix from #25312. |
ProcessAudio()
behaves like it's running on the main thread, so spin locks are also blockingMainLoop()
from running*. I removed the previous workaround of a counter in the AW process callback, used to only have interaction between the audio and main thread after a delay.The previous main thread's code is now run in a worker, which still tests the spinlocks from the AW's side.
*it may also just be that the main thread is used to schedule the callbacks.