SDL_mixer fork, any interest in changes from upstream?

Hi,

I work on a Wolfenstein 3D source port called ECWolf. Awhile back
sampled music playback was added to the engine, however it was found
that SDL_mixer didn’t provide facilities to both use the built in music
player and use a callback to run the AdLIb/PC Speaker emulator. So I
decided to fork SDL_mixer for my purposes, which allowed me to add
several other features. It includes the following.

  1. Music player is always active and is mixed in after the “music
    player” callback. This essentially just involved changing the internal
    music player to assume that the buffer is already initialized.

  2. The resampling function from SDL (SDL_ConvertAudio) is copy & pasted
    in with the slow resampler uncommented. The comment there suggests that
    some cards can’t handle buffers of arbitrary sizes, however, it’s
    completely irrelevant to SDL_mixer as SDL_mixer tries to fill in as much
    data as possible (reading more from the file if need be). So it seems
    to work just fine here.

  3. The above was prompted by the inclusion of Opus support as I needed
    to support both 44.1kHz and 48kHz sounds.

  4. Loop tag support for Vorbis, FLAC, and Opus so music can be
    seamlessly looped while having a fade out if played outside of the game.

  5. Fixed a race condition in the Windows MIDI code. (Although this is
    only one of the thousand issues with SDL_mixer’s MIDI code. So it still
    crashes constantly on Windows and on Linux with fluidsynth there seems
    to be a massive memory leak resulting in over 8GB of memory being used
    after just a few song changes. I haven’t even begun to look into that
    as I need much more powerful MIDI code than what SDL_mixer can offer.)

  6. SDL_mixer uses SDL’s WAV loader, but tries to use SDL_free on the
    buffer instead of SDL_FreeWAV. This results in a crash in some cases.

  7. It’s built using CMake, although this is the most basic CMake script
    possible as I just needed it to work and is thus geared more for my
    purposes of statically linking in my desired configuration.

The repository for my fork is here:
https://bitbucket.org/Blzut3/sdl_mixer-for-ecwolf/commits/all

Not sure if any of that is of interest for upstream?

  • Braden “Blzut3” Obrzut

I work on a Wolfenstein 3D source port called ECWolf. […] I decided to
fork SDL_mixer
for my purposes, which allowed me to add several other features.
[…]
3. The above was prompted by the inclusion of Opus support as I needed to
support
both 44.1kHz and 48kHz sounds.

Official Opus support for SDL_mixer would be something that would greatly
interest me. Apart from your own fork, I also came across
https://forums.libsdl.org/viewtopic.php?t=10169, but this looks like it
breaks API compatibility?

Is there any plan of including this, that, or another implementation? Do
other people use any of the forks above and can recommend one? (Though I am
kind of reluctant to include or require a patched version of SDL_mixer to
compile my game)

KaiOn Mon, Jun 8, 2015 at 1:11 PM, Braden Obrzut wrote: