The forum is being replaced with new software. Please use the replacement hosted at https://forum.angband.live/ in the meantime. These forums will stay open until migrating old topics can be achieved, though posting will eventually be locked. Thankyou for your patience.

Help! New MP3 support not working with SDL client under Windows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PowerWyrm
    Prophet
    • Apr 2008
    • 2942

    Help! New MP3 support not working with SDL client under Windows

    For my variant, I added mp3 support following this github commit: 2a6cd14f8cab95017071a8e607f5c5089838dd5b. When this perfectly works with the Win client, I have really big problems making it work with the SDL client under Windows.

    Currently for my variant, I compile the SDL client using SDL 1.2.14 and SDL Mixer 1.2.11 with dynamically linked sound support.

    First problem: "Failed to load smpeg.dll" when trying to play a sound
    This is the dll that is dynamically linked in SDL mixer for mp3 support. I go to \SDL_mixer-1.2.11\VisualC.zip\VisualC\smpeg\lib, find the dll and put it next to SDL_mixer.dll

    Second problem: "DLL entry point for SDL_CloseAudio cannot be found in SDL.dll"
    The compiled dll is not compatible with the version of SDL mixer I have compiled... and I need to compile it myself. So I open google, search for smpeg project and find links to smpeg 0.4.4... all leading to 404 errors (dead links). I go to the SDL Mixer project... and find that the new version (SDL Mixer 1.2.12) comes with a packaged version of the current source code of smpeg (0.4.5). So I download both smpeg 0.4.5 and SDL Mixer 1.2.12 source code and compile them.

    Third problem: "Failed loading SMPEG_actualSpec: the specified procedure cannot be found"
    To fix this, I have to link smpeg statically instead of dynamically in SDL Mixer.

    Fourth problem: SDL client doesn't start anymore
    I have a weird bug when initializing SDL sound in sound_sdl_init() after calling Mix_LoadMUS() to load the mp3 files in memory. This problem doesn't happen with SDL Mixer 1.2.11, so I roll back to that version.

    Fifth and final problem: mp3 files are not played by play_sound()
    Calling Mix_PlayMusic() the first time to play a mp3 sound does nothing, calling it a second time to play another sound simply results in an endless loop in the SDL Mixer code (precisely when calling SDL_LockAudio in Mix_FadeInMusicPos).

    I am now out of ideas on how to fix that... Is it a bug in smpeg? in SDL Mixer? a problem with Windows compatibility (smpeg is originally designed for linux)?
    PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
  • PowerWyrm
    Prophet
    • Apr 2008
    • 2942

    #2
    Whatever I change when compiling with SMPEG, the game crashes as soon as a sound is played. I give up...

    The only other alternative is using the MAD library for SDL Mixer. At least this works, though I cannot seem to make a sound start from the beginning once it has been played and halted before the end (playing sound A partially then sound B then sound A plays sound A partially, sound B, the rest of sound A then sound A again). Maybe reloading the Mix_Music structure from the mp3 file works...
    PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

    Comment

    Working...
    😀
    😂
    🥰
    😘
    🤢
    😎
    😞
    😡
    👍
    👎
    MMOMBuy POE 2 Currency