Skip to content

Conversation

@cwoffenden
Copy link
Collaborator

@cwoffenden cwoffenden commented Jan 14, 2025

Fix for #22962. In brief:

  • spinlocks fixed so they work in audio worklets
  • adds tests for various spinlock cases
  • test renamed to match its new use
  • test converted to C-only (like the other tests, plus it wasn't using C++ features)

This is an update to #22995 which had become hard to track. The spinlocks are moved to using emscripten_get_now() so they can be used in Audio Worklets, and a set of interactive tests added for the spinlock use cases.

The test can be run with:

test/runner interactive.test_audio_worklet_emscripten_locks

Or standalone with:

emcc -sAUDIO_WORKLET -sWASM_WORKERS -pthread audioworklet_emscripten_locks.c

I can change the other emscripten_performance_now() calls to emscripten_get_now() (as suggested in #22995) in a separate PR.

@cwoffenden cwoffenden marked this pull request as ready for review January 14, 2025 11:51
@cwoffenden cwoffenden closed this Jan 21, 2025
@cwoffenden cwoffenden deleted the cw-audio-tweaks-4 branch January 21, 2025 10:22
@cwoffenden
Copy link
Collaborator Author

Odd, GH closed this when I renamed the branch to merge into a fork (it's residing in cw-audio-spinlock-fix).

If there's any interest in this I can re-open another PR.

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

Successfully merging this pull request may close these issues.

1 participant