News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

r2150 WinXP - I can't hear any music

Started by IgorEliezer, December 01, 2008, 11:32:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IgorEliezer

r2150 WinXP

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

Also, "Disable midi" button is stuck.

prissi

Well I can. This is only disabled, if initialising the midi subsystem fails.

whoami

#2
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.

wernieman

I hope you understand my English

Lmallet

#4
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.



Frank

the midi-files renamed 'with spaces' to '-'

example

old = '01 Simutrans Main Theme.mid'
new = '01-Simutrans-Main-Theme.mid'

Lmallet

music.tab was also updated with the dashes, so that is not the problem.

whoami

#7
Quote from: wernieman on December 04, 2008, 09:35:46 PM
Do you use "my" sdl-Mixer-dll??
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)".

wernieman

How do you compiled, that you not need the sdl-mixer .....
I hope you understand my English

prissi

On windoes using mingw, win32 sound will be used, since it is built in from win 3.11 and work well for ages.

Lmallet

#10
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  ;)].

Lmallet

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.

prissi

Does this change all sounds to double frequency? Last time we checked, this was the cases.

Lmallet

Whoops!  My mistake, should have been 22050.   ;D

prissi

In trunk now.

You have a very strange patch program if you succeed with this patch ... please use "svn diff" to generate the diffs.

prissi