libsdl-org / SDL_mixer

An audio mixer that supports various file formats for Simple Directmedia Layer.
zlib License
433 stars 146 forks source link

MOD, native MIDI, and Opus support removed from macOS binaries? #419

Closed a-hurst closed 2 years ago

a-hurst commented 2 years ago

Hi all,

This is essentially the same as my issue for SDL_image (https://github.com/libsdl-org/SDL_image/issues/288). Basically, native MIDI as well as decoders for Modplug and Opus have been removed from the official macOS binaries, while they are all still enabled/included (albeit in an "optional" folder) for the Windows binaries.

I understand making various dependency libraries optional, but is there a way to have pre-built optional dependencies included for the macOS release, the same way they are for Windows? A folder of pre-built frameworks that can be dragged inside the mixer framework or into the same folder as the framework?

Thanks in advance!

Austin

a-hurst commented 2 years ago

@slouken Apologies for pinging you so soon after opening the issue, just trying to get a sense of whether this is a "won't fix" or not before I release the next version of pysdl2-dll (which bundles the official codesigned SDL2/mixer/ttf/image binaries in a Python package for easy use with PySDL2).

I've already confirmed that at least one larger dependent project is temporarily broken by the regression (the PursuedPyBear educational game library, which assumes MOD support when calling Mix_Init and fails as a result) and I'm sure they're not alone, so if this is a deliberate and permanent change I need to make it clear to users that support for the affected mixer/image formats can't be guaranteed across platforms. Thanks again!

slouken commented 2 years ago

I'm still mulling over the best way to handle this. One of the goals was to avoid including large framework archives in the repo, but I think I can do a special build for releases that has dynamic loading support and has the optional frameworks in a separate folder. I'll let you know as I get something together.

a-hurst commented 2 years ago

Fantastic, thanks so much! I fully understand wanting to avoid large frequently-changing binaries in the git. Even if those frameworks are released separately on their respective libsdl-org forks' releases pages, as long as they can be bundled into the binary in an automated fashion it solves my use case.

slouken commented 2 years ago

Can you try this? https://www.libsdl.org/tmp/SDL2_mixer.dmg

a-hurst commented 2 years ago

@slouken Native MIDI and Opus work great, but modplug is still failing for some reason: When I call Mix_Init(MIX_INIT_MOD) and check Mix_GetError afterwards, I get "MOD support not available". The libmodplug.framework is in the same folder as the opus and ogg ones, which are working fine, so I'm not sure what's up.

sezero commented 2 years ago

Possibly the modplug binary name is wrong? I see libmodplug in there instead of modplug.

slouken commented 2 years ago

No, the framework is libmodplug. SDL_mixer is weak linked against @rpath/libmodplug.framework/Versions/A/libmodplug

slouken commented 2 years ago

I know what's going on here, I'll have a fix shortly. Thanks!

slouken commented 2 years ago

I've updated the mixer package with libxmp-lite MOD playback support: https://www.libsdl.org/tmp/SDL2_mixer.dmg

sezero commented 2 years ago

What was the problem with libmodplug build? Missing linkage to c++ library or something?

slouken commented 2 years ago

It was an infinite loop when playing MOD files. Rather than dig into it, I decided to switch to the more modern and better supported libxmp.

sezero commented 2 years ago

It was an infinite loop when playing MOD files.

Within libmodplug or SDL_mixer?

slouken commented 2 years ago

libmodplug

slouken commented 2 years ago

Sorry, not infinite loop code-wise, infinitely looping play

sezero commented 2 years ago

Oh.. Maybe it needs some settings change? Whatever.

a-hurst commented 2 years ago

@slouken MOD support loads properly with the new binary, but MIDI and Opus are now broken! I get MIDI support not available and OPUS support not available from Mix_Error after calling Mix_Init on those formats. They were working fine before so hopefully it's something trivial. I also tried copying the known-working ogg/opus frameworks from the .dmg you uploaded yesterday but no dice, so it must be a difference in the mixer framework itself.

EDIT: Just for figuring out my own release plans, does the change of the MOD backend to XMP-lite mean there won't be official code-signed macOS binaries with MOD support until 2.8.0? With the test binaries you uploaded yesterday I got excited thinking the optional frameworks might get added in a patch release or just quietly added to the current release's DMG. Does changing out the default MOD backend rule that out?

slouken commented 2 years ago

@slouken MOD support loads properly with the new binary, but MIDI and Opus are now broken!

Yes, I was just iterating on MOD support. I've re-uploaded with support for all formats.

EDIT: Just for figuring out my own release plans, does the change of the MOD backend to XMP-lite mean there won't be official code-signed macOS binaries with MOD support until 2.8.0? With the test binaries you uploaded yesterday I got excited thinking the optional frameworks might get added in a patch release or just quietly added to the current release's DMG. Does changing out the default MOD backend rule that out?

Yes, I still have to figure out how to get these changes into the official release archives, so it's likely that this will all go into 2.8.0. Since the 2.6 archive doesn't have MOD support at all, I might backport this once I figure that out, but we'll see.

slouken commented 2 years ago

I have uploaded a shippable archive of SDL_mixer 2.6.0 with signed optional frameworks here: https://www.libsdl.org/tmp/SDL2_mixer-2.7.0.dmg

I'm not currently planning an interim release with these changes, but you can use this until the official 2.8.0 release.

a-hurst commented 2 years ago

Fantastic, thank you so much!

slouken commented 2 years ago

You're welcome! :)