-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
emscripten with AudioWorklets: performance.now and crypto #13224
Comments
I'm the maintainer of libopenmpt (https://github.com/OpenMPT/openmpt/). We worked around the The issue with crypto remains. The only thing libopenmpt really wants/needs here is libopenmpt itself would even gracefully handle a C++ exception in I'm not sure what a good solution would be here, in particular because in libopenmpt, I cannot detect at compile-time if we are targeting to run inside an AudioWorkletProcesssor (where crypto and thus std::random_device is unavailable) or not (where everything works normally). |
Reading further, it could actually also use the
or
I'm not sure which implementation is used in emscripten, however both of them will work fine if |
Seems reasonable to return error rather than abort in getentropy(). Would you like to upload a patch to that effect? What do you mean "both of them will work fine" if we return an error? It looks like they would both |
I would rather prefer if someone with actual experience in Javascript would write such a patch.
Yes. C++
Yes, libopenmpt relies on C++ exceptions to work correctly (we basically require a complete C++ implementation), and emscripten builds of libopenmpt thus have exceptions enabled ( |
So why was this closed? There is NOTHING solved here yet. Emscripten still does not implement a fully working C++ standard library usable in AudioWorklets. The fact that libopenmpt works around emscripten bugs now is not a reason to close the emscripten issue. |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
Well, it looks like Line 2190 in a23058a
|
Hi, after building an audio library (libopenmpt) to WASM, using the es6 module approach,
I find that it generates js code that relies on performance.now and crypto, so it does not work on an Audio Worklet context.
The workaround I used to make it work was using Date.now, and using a polyfill for crypto (for random number generation).
What would be the best way of sorting that out? Could emscripten generate the code for that to work?
Thanks
The text was updated successfully, but these errors were encountered: