-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Interactive audio worklet futex test fails #22962
Comments
There's more to this. If I comment out
Because when the audio worklet code hits here:
As the comment says, an audio worklet will take the same path as the main thread:
Which then fails when it arrives here:
(And in testing, it's correct that |
And adding more: since
But are fine without assertions. So the questions comes to this:
Is still true and Audio Worklets will need this fixing or another implementation? Bit of a rabbit hole... |
It turns out @tklajnscek (writer of the other implementation mentioned in the issue and with whom I work) exposed a separate futex to the worklet. I'll create an additional PR later. |
Having discussed this over here, the consensus being the existing working API spinlocks should be used, so
But this could be changed to use Line 1378 in 119a427
And since these ms calls don't need to resolution the ns calls do, is probably a good compromise and will only affect the Audio Worklet for little overhead (either |
For what it's worth, I don't see any other way except if we only allow infinite timeout... |
Is this because |
Exactly that, The low precision of the |
The relevant WebAudio issue here: WebAudio/web-audio-api#2413 With comments from @juj :) |
Fix #23393 ready. |
…udio works) (#23719) Now that the audio tests are running in CI (see #23665) this existing AudioWorklet/futex test can be moved from `interactive` to `browser`: https://github.com/emscripten-core/emscripten/blob/32832575e0d200afcccd1d892ff3555baf54bc83/test/webaudio/audioworklet_emscripten_futex_wake.cpp It's had the bare minimum to enable it to compile but is otherwise broken and therefore disabled. The issue is here #22962. A fix is [already done](https://github.com/cwoffenden/emscripten/tree/cw-audio-spinlock-fix) with more advanced lock tests, but needs this to land first to get things in the right order. To confirm the test is broken, comment out the `@disabled` in line 5518 and run with: ``` test/runner browser.test_audio_worklet_emscripten_futex_wake ``` It will fail with: ``` test.js:1003 Uncaught RuntimeError: Aborted(Assertion failed: emscripten_is_main_browser_thread(), at: /emsdk/emscripten/system/lib/pthread/emscripten_futex_wait.c,26,futex_wait_main_browser_thread) at abort (test.js:1003:11) at ___assert_fail (test.js:1945:7) at test.wasm:0x10a8 at test.wasm:0xf34 at test.wasm:0xa78 at WasmAudioWorkletProcessor.process (test.aw.js:113:34) ```
…#23729) - spinlocks fixed so they work in audio worklets - adds tests for various spinlock cases - test converted to C-only (still in a C++ file for now, see below) This was unmerged last year (#22995), visited again now the browser tests are running with audio. It's been moved over to `btest_exit()` and verified that it runs (and will only exit after all tests have run or asserted). The only change I'd make is to rename the original test file, which has grown beyond its original use. A `git mv` command won't survive multiple commits, so I want to either leave it until last, live with the resulting deletion, or rename as a separate PR. Fixes: #22962
With the latest Emscripten:
This interactive audio worklet futex test fails:
emscripten/test/test_interactive.py
Line 298 in 299be0b
Running:
It fails to compile due to
_emscripten_thread_supports_atomics_wait()
being internal to the pthread implementation:Further, the comment here:
emscripten/system/lib/pthread/emscripten_thread_state.S
Line 56 in 299be0b
Is incorrect since
!ENVIRONMENT_IS_WEB
is true for Audio Worklets butAtomics.wait
is not supported.The text was updated successfully, but these errors were encountered: