Skip to content
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

Audio Worklets fail with STRICT #22971

Closed
cwoffenden opened this issue Nov 20, 2024 · 4 comments
Closed

Audio Worklets fail with STRICT #22971

cwoffenden opened this issue Nov 20, 2024 · 4 comments

Comments

@cwoffenden
Copy link
Contributor

This is in the latest Emscripten:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.73-git (299be0bbfbbadfa926cb69380f0fffa3703b26c7)

Building any of the Audio Worklet tests with -sSTRICT compiles but fails to run:

emcc -sAUDIO_WORKLET -sWASM_WORKERS -sSTRICT audio_worklet_tone_generator.c

The browser errors being variations of missing API calls, e.g.:

Aborted(`Module.wasmMemory` was supplied but `wasmMemory` not included in INCOMING_MODULE_JS_API)

The suggestion here being to add it:

#22753 (comment)

(This can be assigned to me and I'll look at it)

@sbc100
Copy link
Collaborator

sbc100 commented Nov 20, 2024

I think the fix here is to explicitly add the needed exports to INCOMING_MODULE_JS_API. Something like this:

emscripten/tools/link.py

Lines 1214 to 1216 in e1ce10d

if options.preload_files:
# File preloading uses `Module['preRun']`.
settings.INCOMING_MODULE_JS_API.append('preRun')

e.g:

if settings.AUDIO_WORKLET:
  # The following incomming API elements are using when starting a audio worklet.
  settings.INCOMING_MODULE_JS_API += [ .. .]

@cwoffenden
Copy link
Contributor Author

Thanks, I can take a look next week (and verify which should be added or not, in comparison with an Hello, World).

@cwoffenden
Copy link
Contributor Author

cwoffenden commented Dec 11, 2024

Small fix in #23130. As per the comment there, this error wasn't getting caught by the parameterised STRICT test (see #23131, none of the tests are running correctly).

sbc100 pushed a commit that referenced this issue Dec 12, 2024
Fix for #22971.

This highlights that the AW tests weren't catching this or other issues
in the parameterised tests. Running, for example:
```
test/runner browser.test_audio_worklet_strict
```
Passes, but if compiled with the same settings doesn't run.
@cwoffenden
Copy link
Contributor Author

cwoffenden commented Dec 13, 2024

I’ll close this now the fix has landed (#23131 covers the failing tests).

hedwigz pushed a commit to hedwigz/emscripten that referenced this issue Dec 18, 2024
Fix for emscripten-core#22971.

This highlights that the AW tests weren't catching this or other issues
in the parameterised tests. Running, for example:
```
test/runner browser.test_audio_worklet_strict
```
Passes, but if compiled with the same settings doesn't run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants