Skip to content

[test] Existing AudioWorklet futex test moved to browser tests (now audio works) #23719

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

Merged
merged 2 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5512,6 +5512,13 @@ def test_audio_worklet_stereo_io(self, args):
shutil.copy(test_file('webaudio/audio_files/emscripten-bass.mp3'), 'audio_files/')
self.btest_exit('webaudio/audioworklet_in_out_stereo.c', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-DBROWSER_TEST'] + args)

# Tests AudioWorklet with emscripten_futex_wake().
@requires_sound_hardware
@also_with_minimal_runtime
@disabled('https://github.com/emscripten-core/emscripten/issues/22962')
def test_audio_worklet_emscripten_futex_wake(self):
self.btest('webaudio/audioworklet_emscripten_futex_wake.cpp', expected='0', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-pthread', '-sPTHREAD_POOL_SIZE=2'])

def test_error_reporting(self):
# Test catching/reporting Error objects
create_file('post.js', 'throw new Error("oops");')
Expand Down
5 changes: 0 additions & 5 deletions test/test_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,6 @@ def test_audio_worklet(self):
self.btest('webaudio/audioworklet.c', expected='0', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '--preload-file', test_file('hello_world.c') + '@/'])
self.btest('webaudio/audioworklet.c', expected='0', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-pthread'])

# Tests AudioWorklet with emscripten_futex_wake().
@also_with_minimal_runtime
def test_audio_worklet_emscripten_futex_wake(self):
self.btest('webaudio/audioworklet_emscripten_futex_wake.cpp', expected='0', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS', '-pthread', '-sPTHREAD_POOL_SIZE=2'])

# Tests a second AudioWorklet example: sine wave tone generator.
def test_audio_worklet_tone_generator(self):
self.btest('webaudio/audio_worklet_tone_generator.c', expected='0', args=['-sAUDIO_WORKLET', '-sWASM_WORKERS'])
Expand Down
3 changes: 3 additions & 0 deletions test/webaudio/audioworklet_emscripten_futex_wake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
int futexLocation = 0;
int testSuccess = 0;

// Internal, found in 'system/lib/pthread/threading_internal.h'
extern "C" int _emscripten_thread_supports_atomics_wait();

bool ProcessAudio(int numInputs, const AudioSampleFrame *inputs, int numOutputs, AudioSampleFrame *outputs, int numParams, const AudioParamFrame *params, void *userData) {
int supportsAtomicWait = _emscripten_thread_supports_atomics_wait();
printf("supportsAtomicWait: %d\n", supportsAtomicWait);
Expand Down