libsdl-org / SDL_mixer

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

`xm` file regression from 2.6.2 -> 2.6.3 #518

Closed Starbuck5 closed 9 months ago

Starbuck5 commented 1 year ago

I'm one of the developers of pygame-ce, and one of our users reported xm files not being playable in our latest version, which uses 2.6.3. I swapped out for 2.6.2 in a build and it worked there.

Additional context: Windows, 64 bit, using the -devel-vc packages from the Github releases.

I made a minimum reproducible example in C, below. Using 2.6.2, this plays successfully. Using 2.6.3, I get the error "Unrecognized audio format."

#include <stdio.h>
#include <assert.h>

#define SDL_MAIN_HANDLED

#include "SDL.h"
#include "SDL_mixer.h"

//gcc test.c -Iinclude -L. -lsdl2 -lsdl2_mixer

int main() {
    assert(SDL_Init(SDL_INIT_AUDIO) == 0);
    Mix_Init(0);

    Mix_OpenAudio(48000, AUDIO_S32SYS, 2, 30000);

    const SDL_version * ver = Mix_Linked_Version();
    printf("Mixer %i.%i.%i\n", ver->major, ver->minor, ver->patch);

    Mix_Music* music = Mix_LoadMUS("surfonasinewave.xm");

    if (music == NULL) {
        printf("SDL_GetError=%s\n", SDL_GetError());
        exit(0);
    }

    Mix_PlayMusic(music, 0);

    SDL_Delay(5000);

    Mix_FreeMusic(music);
    SDL_Quit();
}

Example XM file: surfonasinewave.zip

sezero commented 1 year ago

There has been no changes at all in tracker code, neither in SDL_mixer itself nor in its backends, between 2.6.2 and 2.6.3

sezero commented 1 year ago

Maybe something to do with the way binaries are built and / or packaged?

CC: @slouken

sezero commented 1 year ago

Assuming that you are a windows user, it looks like that the official 2.6.3 windows builds were not configured for tracker music. So it really is an issue with the way the binaries are built.

Starbuck5 commented 1 year ago

Yep that makes sense.

For the meantime I've gone down to 2.6.2, but it would be nice to have it resolved in the next release of course.

Thanks for looking into it!

slouken commented 9 months ago

This is fixed for the 2.8 release!

Starbuck5 commented 9 months ago

Thanks!