-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Open
Description
Version of emscripten/emsdk:
4.0.13 (but verified in code this should still exist on HEAD)
Description:
Using the web audio API with one AudioContext but with two or more modules does not work, as the second one will try silently the memory of the first one, causing memory failures.
Example:
const audioContext = new AudioContext();
const mainModule = await createModule();
const audioContextId = mainModule.emscriptenRegisterAudioObject(audioContext);
mainModule.functionThatStartsAWorklet(audioContextId);
const mainModule2 = await createModule();
const audioContextId2 =
mainModule2.emscriptenRegisterAudioObject(audioContext);
mainModule2.functionThatStartsAnotherWorklet(audioContextId2);Where functionThatStartsAWorklet and functionThatStartsAnotherWorklet starts AudioWorklets.
addModule will succeed, at least if the same URL is used.
But since it is set up with the wasmModule and memory only once for the AudioContext. When starting another worklet, from another module, both will use the same memory even though they should be using separate ones. This causes memory corruptions, and usually crashes for one or both of the worklets.
Metadata
Metadata
Assignees
Labels
No labels