The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: IgorEliezer on December 01, 2008, 11:32:13 pm

Title: r2150 WinXP - I can't hear any music
Post by: IgorEliezer on December 01, 2008, 11:32:13 pm
r2150 WinXP

In r2113, I could hear mids, but now I can't, just sound effects.

Also, "Disable midi" button is stuck.
Title: Re: r2150 WinXP - I can't hear any music
Post by: prissi on December 02, 2008, 10:40:34 pm
Well I can. This is only disabled, if initialising the midi subsystem fails.
Title: Re: r2150 WinXP - I can't hear any music
Post by: whoami on December 04, 2008, 07:32:47 pm
This seems to be a problem with the nightly builds (same problem here with r2153/gdi and r2151/win-sdl), because music works with my own build.

By the way: I would appreciate if the music didn't always start with #1, instead, the last played song should be saved to know where to continue, no matter whether shuffle is switched on.

EDIT/correction: nightly GDI build doesn't have the problem, you just get a lengthy delay, probably due to the initialization of the sound system.
Title: Re: r2150 WinXP - I can't hear any music
Post by: wernieman on December 04, 2008, 09:35:46 pm
Do you use "my" sdl-Mixer-dll??
Title: Re: r2150 WinXP - I can't hear any music
Post by: Lmallet on December 07, 2008, 12:01:13 am
Might not be dll related...  I have the same problem on Linux.

Simutrans r2156 pak128-264 - Midi disabled, sound effect ok.

Simutrans r2082 pak128-264 - Midi and sounds ok.

I am including the results of log -1.


Title: Re: r2150 WinXP - I can't hear any music
Post by: Frank on December 07, 2008, 12:07:56 am
the midi-files renamed 'with spaces' to '-'

example

old = '01 Simutrans Main Theme.mid'
new = '01-Simutrans-Main-Theme.mid'
Title: Re: r2150 WinXP - I can't hear any music
Post by: Lmallet on December 07, 2008, 12:56:13 am
music.tab was also updated with the dashes, so that is not the problem.
Title: Re: r2150 WinXP - I can't hear any music
Post by: whoami on December 07, 2008, 04:06:22 am
Yes, I tried again after extracting the complete archive for r2156/win-sdl. My self-built SDL executable (which can play music when started in the same environment) doesn't depend on SDL_mixer.dll (huh?), so comparing that doesn't tell much.

Simu.log doesn't give a clue in my case, but look at Lmallets log: "could not load wav (MPEG Layer 3 data not supported)".
Title: Re: r2150 WinXP - I can't hear any music
Post by: wernieman on December 07, 2008, 01:46:15 pm
How do you compiled, that you not need the sdl-mixer .....
Title: Re: r2150 WinXP - I can't hear any music
Post by: prissi on December 07, 2008, 08:14:15 pm
On windoes using mingw, win32 sound will be used, since it is built in from win 3.11 and work well for ages.
Title: Re: r2150 WinXP - I can't hear any music
Post by: Lmallet on December 08, 2008, 06:44:00 pm
Still does not work on r2159, WinXP and Linux.

I took a look at the source code.  It seems dr_init_midi() in simmain.cc never gets called.  I commented out all the IF statements to force Simutrans to run Mix_OpenAudio() from music/sdl_midi.cc, but it segfaults every time when Mix_OpenAudio() is called.

Just to make sure the problem was not with my computer, I compiled the SDL_Mixer tutorial here: http://www.kekkai.org/roger/sdl/mixer/ and replaced the ogg file with a mid file, and that works fine.

I will look at it more tonight.  If Prissi doesn't beat me to it :)  [It is taking a long time to learn what is where in the code, and I haven't done any serious programming since high school, but it is coming back slowly  ;)].
Title: Re: r2150 WinXP - I can't hear any music
Post by: Lmallet on December 09, 2008, 07:16:11 am
My first Simutrans patch: for music/sdl_midi.cc.   Rewrote dr_init_midi().  Seems as if it never returned true (therefore music never gets initialized).  Note that you might have to re-enable sounds by un-checking the Disable Midi box in the Sound options, as starting a "broken" version will have written in simuworld.cfg to start disabled.  I feel like I am missing something, but the patch works for me.
Title: Re: r2150 WinXP - I can't hear any music
Post by: prissi on December 09, 2008, 09:28:50 pm
Does this change all sounds to double frequency? Last time we checked, this was the cases.
Title: Re: r2150 WinXP - I can't hear any music
Post by: Lmallet on December 09, 2008, 11:18:54 pm
Whoops!  My mistake, should have been 22050.   ;D
Title: Re: r2150 WinXP - I can't hear any music
Post by: prissi on December 12, 2008, 11:00:49 pm
In trunk now.

You have a very strange patch program if you succeed with this patch ... please use "svn diff" to generate the diffs.
Title: Re: r2150 WinXP - I can't hear any music
Post by: prissi on December 30, 2008, 11:10:32 pm
aparently solved ...