Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old June 4, 2012, 10:56   #1
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,957
PowerWyrm is on a distinguished road
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 http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old June 4, 2012, 16:07   #2
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,957
PowerWyrm is on a distinguished road
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 http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Display glitch with GCU client? PowerWyrm Development 13 October 15, 2012 20:58
A little bugfix for Windows users not using Win client... PowerWyrm Development 0 May 25, 2012 15:33
[3.3.x] SDL client: unable to perform some commands PowerWyrm Vanilla 2 November 1, 2011 15:58
Windows PNG support in staging d_m Development 9 June 1, 2011 04:51
2 options for Windows PNG support Blue Baron Development 36 June 1, 2011 00:14


All times are GMT +1. The time now is 17:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.