Skip to content

wip: wasm: use miniaudio instead of sdl in emscripten#877

Open
jcelerier wants to merge 5 commits into
masterfrom
wip/miniaudio-wasm
Open

wip: wasm: use miniaudio instead of sdl in emscripten#877
jcelerier wants to merge 5 commits into
masterfrom
wip/miniaudio-wasm

Conversation

@jcelerier

Copy link
Copy Markdown
Member

No description provided.

@jcelerier jcelerier temporarily deployed to Apple Certificate April 21, 2026 08:16 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate April 21, 2026 08:16 — with GitHub Actions Inactive
@jcelerier jcelerier force-pushed the wip/miniaudio-wasm branch from dd24e18 to e9016f5 Compare May 29, 2026 19:50
@jcelerier jcelerier temporarily deployed to Apple Certificate May 29, 2026 19:51 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate May 29, 2026 19:51 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate May 29, 2026 19:51 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate May 29, 2026 19:51 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate May 29, 2026 19:51 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate May 29, 2026 19:51 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate May 29, 2026 19:51 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate May 29, 2026 19:51 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate May 29, 2026 19:51 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate May 29, 2026 19:51 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate May 29, 2026 19:51 — with GitHub Actions Inactive
Jean-Michaël Celerier and others added 2 commits July 11, 2026 18:06
Pulls the emscripten MIDI backend fix (observer update() notify arg) needed for
the wasm build. See celtera/libremidi#228.
@jcelerier jcelerier force-pushed the wip/miniaudio-wasm branch from e9016f5 to 96141ee Compare July 11, 2026 22:10
@jcelerier jcelerier temporarily deployed to Apple Certificate July 11, 2026 22:10 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 11, 2026 22:10 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 11, 2026 22:10 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 11, 2026 22:10 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 12, 2026 02:54 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 12, 2026 02:54 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 12, 2026 02:54 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 12, 2026 02:54 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 12, 2026 02:54 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 12, 2026 02:54 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 12, 2026 15:08 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 12, 2026 15:08 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 12, 2026 15:08 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 12, 2026 15:08 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 12, 2026 15:08 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 12, 2026 15:08 — with GitHub Actions Inactive
@jcelerier jcelerier deployed to Apple Certificate July 12, 2026 15:08 — with GitHub Actions Active
@jcelerier jcelerier temporarily deployed to Apple Certificate July 12, 2026 15:08 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 12, 2026 15:08 — with GitHub Actions Inactive
@jcelerier jcelerier temporarily deployed to Apple Certificate July 12, 2026 15:08 — with GitHub Actions Inactive
miniaudio_protocol.hpp used to #define MINIAUDIO_IMPLEMENTATION itself, so
every TU that included it compiled a full copy of the ma_* implementation.
That was harmless only because the miniaudio include dir was private to
score-plugin-audio. Enabling the miniaudio path in libossia's make_audio_engine
gave a second copy and produced duplicate-symbol link errors once both objects
end up in one binary (wasm, and any static build).

Make libossia the single owner:
- miniaudio_protocol.hpp is now declarations-only (no MINIAUDIO_IMPLEMENTATION)
  and marks the API with MA_API = OSSIA_EXPORT.
- miniaudio.cpp is the one TU that defines MINIAUDIO_IMPLEMENTATION; kept out of
  unity builds so it can't be reordered past a declarations-only include.
- ossia links it wherever miniaudio is used (macOS/Linux/BSD/wasm, not Windows)
  and pulls in the CoreAudio frameworks on Apple.

OSSIA_EXPORT is empty in static builds (one definition, referenced across
libraries), and export/import when ossia is a shared lib, so score-plugin-audio
links this single copy in every configuration instead of recompiling it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019oPj1zRcxSQX7FNni7EHM6
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