Add SDL_mixer support
Summary
Adds SDL_mixer support to nxdk as an SDL2 companion library.
This first pass enables the core SDL_mixer library with WAV/chunk playback support only. Compressed/music codec support such as OGG, MP3, MOD, MIDI, and FLAC is intentionally deferred to follow-up work so the initial integration stays small and reviewable.
Changes
- Add
lib/sdl/SDL_mixersubmodule - Build
libSDL2_mixer.libwhenNXDK_SDL = y - Enable SDL_mixer core +
MUSIC_WAV - Add
lib/pkgconfig/SDL2_mixer.pc - Add
samples/sdl_mixer - Update README SDL library summary
SDL_mixer submodule
The SDL_mixer submodule points at PaulMDemers/SDL_mixer, branch nxdk-sdl-mixer.
That branch is based on SDL_mixer release-2.0.4 and contains one small nxdk compatibility change: use the existing strtok() path for XBOX builds instead of the Windows strtok_s() path.
Verification
Built successfully on Windows/MSYS2 with:
make -C samples/sdl_mixer
This produced:
- lib/libSDL2_mixer.lib
- samples/sdl_mixer/bin/default.xbe
- samples/sdl_mixer/nxdk sample - SDL2_mixer.iso
The sample generates a small in-memory WAV tone, loads it through Mix_LoadWAV_RW, and plays it through SDL_mixer.
I don't think this should be merged. See reasons in https://github.com/XboxDev/nxdk/pull/601
use the existing
strtok()path for XBOX builds instead of the Windowsstrtok_s()path.
Sounds like upstream should check for __STDC_LIB_EXT1__ instead, then nxdk would work without changes.
nxdk could also add a dummy wrapper for strtok_s (upstream in pdclib?) or to the WIN32 code (as part of the win32 libc).
Is there any recent developments to adding SDL2_mixer to the nxdk? My project requires SDL2_mixer, and I might possibly assist getting the full SDL2_mixer to the SDK.
@tifasoftware the work hasn't been forgotten, I am distracted with another project at the moment.
This port currently is just the initial base WAV support, additional help is more than welcome. :)
It'll be probably a week or two before I'm back working on libraries.
That's absolutely okay, take your time. I too can get distracted with other parts of my game engine too. I'll probably be working on my other ports to the PS2, GameCube, and the Dreamcast in the meantime.
My project also will need ogg support, but I'll try to help in any way i can in the future
Your demo compiled successfully on Ubuntu 26.04, however I don't think I can hear your audio clips in XEMU.