http://bugs.winehq.org/show_bug.cgi?id=23756
Summary: In-game MIDI music does not play in Melker - The Elk Hunt (a.k.a. Moose on the Loose) Product: Wine Version: 1.2 Platform: x86 URL: http://www.wihlborg.se/melker_the_elk_hunt.html OS/Version: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: winmm&mci AssignedTo: wine-bugs@winehq.org ReportedBy: markk@clara.co.uk
Created an attachment (id=29775) --> (http://bugs.winehq.org/attachment.cgi?id=29775) +winmm log, compressed with bzip2
This bug applies to the game "Melker - The Elk Hunt" by Wihlborg Entertainment. The game was also marketed as "Moose on the Loose" by eGames/Greenstreet games. A demo can be downloaded from http://www.wihlborg.se/melker_the_elk_hunt.html
The in-game (MIDI) background music does not play in Wine. However the title sequence music does play.
Install the demo and run melker.exe. Click Start Game! Watch the title sequence and note that the music plays. Press Enter several times to begin play. A dialog box appears: : The MCI device you are using does not support the specified command.
After dismissing that, press Enter at the map screen and the same dialog appears again, then a second dialog: MidiPlyrPlayPart() failed! MidiPlayPart() failed MidiProcessTune() failed MidiPlayTune() failed
The attached log is with WINEDEBUG=+winmm, running melker.exe, waiting at the title sequence, then starting play, dismissing the error dialogs, quitting the game, returning to title sequence and exiting.
http://bugs.winehq.org/show_bug.cgi?id=23756
markk@clara.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download CC| |markk@clara.co.uk
http://bugs.winehq.org/show_bug.cgi?id=23756
Raymond superquad.vortex2@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |superquad.vortex2@gmail.com
--- Comment #1 from Raymond superquad.vortex2@gmail.com 2010-07-23 17:57:05 --- Did you have any softsynth , wavetable sound card or mpu401-uart ?
aplaymidi -l
http://bugs.winehq.org/show_bug.cgi?id=23756
--- Comment #2 from markk@clara.co.uk 2010-07-24 02:47:44 --- Yes, I have timidity installed. As I mentioned, the title sequence music (which is also MIDI) does play; it's just the in-game music which doesn't.
http://bugs.winehq.org/show_bug.cgi?id=23756
--- Comment #3 from Raymond superquad.vortex2@gmail.com 2010-07-24 08:07:28 --- The application also use waveout and dsound according to your log
Did timidity use "dmix", "pulseaudio" or your sound card support hardware mixing ?
http://bugs.winehq.org/show_bug.cgi?id=23756
--- Comment #4 from markk@clara.co.uk 2010-07-24 13:02:12 --- The sound hardware is Intel HDA audio. In winecfg I have the ALSA Driver checkbox selected for audio. That lists dmix:0, dsnoop:0, TiMidity ports 0-3 for MIDI out devices, HDA Intel for mixer devices.
The dsound calls are probably for sound effects. In the title sequence the sound effects and music are both audible.
I ran the game again, this time disabling sound effects in the initial settings (to rule out the sound effects channel overriding/muting the music), but got the same result. Does the in-game music work for you?
I will attach the end of a +winmm,+mci log taken when running the game without sound effects. The log ends at the point when the "The MCI device..." dialog appears.
http://bugs.winehq.org/show_bug.cgi?id=23756
--- Comment #5 from markk@clara.co.uk 2010-07-24 13:02:50 --- Created an attachment (id=29813) --> (http://bugs.winehq.org/attachment.cgi?id=29813) End of +winmm,+mci log running without sound effects
http://bugs.winehq.org/show_bug.cgi?id=23756
--- Comment #6 from Raymond superquad.vortex2@gmail.com 2010-07-24 18:52:47 --- (In reply to comment #4)
The sound hardware is Intel HDA audio. In winecfg I have the ALSA Driver checkbox selected for audio. That lists dmix:0, dsnoop:0, TiMidity ports 0-3 for MIDI out devices, HDA Intel for mixer devices.
The point is how you start timidity ?
are timidity using "default" device ? ( hw:0,0 , dmix or pulseaudio )
since wine open "default" device again when the application use "dsound"
WINEDEBUG=+winmm,+dsound
http://bugs.winehq.org/show_bug.cgi?id=23756
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |hoehle@users.sourceforge.ne | |t
--- Comment #7 from Jörg Höhle hoehle@users.sourceforge.net 2010-11-15 03:26:06 CST --- It's unclear why this apps print the MCI error text corresponding to MCIERR_UNSUPPORTED_FUNCTION. It does not use the MCI at all!
It uses winmm:midiStreamOut() to play the music instead. A hint to the possible fault appears only when waiting for music to start in demo mode, instead of going to the high scores: fixme:winmm:MMSYSTEM_MidiStream_MessageHandler Dropping bad stream lpMidiHdr (streamID=30315f79) [that's "01_y"]
There may also be some buffer overflow involved. A log with warn+heap gave: warn:heap:HEAP_ValidateInUseArena Heap 0x110000: invalid in-use arena magic 00555555 for 0x135f700 This address is near one used for MIDI: trace:winmm:midiOutPrepareHeader (0x8000, 0x135f708, 64) fixme:winmm:MMSYSTEM_MidiStream_MessageHandler Dropping bad stream lpMidiHdr (streamID=55555555) 55555555 looks like the bad "arena magic" above.
http://bugs.winehq.org/show_bug.cgi?id=23756
--- Comment #8 from Jörg Höhle hoehle@users.sourceforge.net 2010-12-16 16:46:35 CST --- The main process (tid 0009) issues midiStreamStop which sends MSM_STOP to the player thread via MMSYSTEM_MidiStream_PostMessage. The player thread (typical tid 0019) then executes midiOutReset() and DriverCallback(MOM_DONE) for all 5 headers. This is a function callback and that's why things get interesting. The app callback, called on the players thread, calls midiOutUnprepareHeader() every time and additionally midiStreamClose() after the last one...
midiStreamClose() calls (midiStreamStop() and) sends the WM_QUIT message to the player thread via the known MMSYSTEM_MidiStream_PostMessage -- but the callback is still executing within the player thread! So the player thread 0019 hangs, waiting for lpMidiStrm->hEvent to be acknowledged by the player thread -- itself.
More precisely, hEvent was somehow signaled, but that's an auto-reset event and the "system automatically resets the event state to nonsignaled after a *single* waiting thread has been released" [MSDN]. The awakened thread is 0009, which has been waiting for this same hEvent as the answer to MSM_STOP above.
So perhaps unlike bug #3930, the main application thread continues to run. Only the player is hung, and the callback never completed. What follows (MCI error, MIDI only played once) is likely a consequence of that bad state.
Note that the app is broken because MSDN disallows using the multimedia API from within callbacks, but nobody cares when it works often enough.
So this is another case where the code is not re-entrant, although it's unclear to me whether it should be. Callbacks could as well be issued from a distinct thread (but see bug #3930, comment #37 about MOM_DONE).
http://bugs.winehq.org/show_bug.cgi?id=23756
--- Comment #9 from Jörg Höhle hoehle@users.sourceforge.net 2012-02-13 08:08:49 CST --- Please retest using the patches mentioned in bug #26697, comment #10.
http://bugs.winehq.org/show_bug.cgi?id=23756
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|In-game MIDI music does not |In-game MIDI music does not |play in Melker - The Elk |play in Melker - The Elk |Hunt (a.k.a. Moose on the |Hunt (midiStream function |Loose) |callback)
http://bugs.winehq.org/show_bug.cgi?id=23756
--- Comment #10 from Jörg Höhle hoehle@users.sourceforge.net 2012-02-13 15:10:38 CST --- My 2 patches allow this app to play incl. MIDI music. The invalid midiStream* usage is now detected: fixme:winmm:midiStreamClose leak from call within function callback
The app has more issues, as mentioned in comment #7. fixme:winmm:MMSYSTEM_MidiStream_MessageHandler Dropping bad stream lpMidiHdr (streamID=006e0069) appears sometimes, avoided using WINEDEBUG=warn+heap except when the app exits: warn:heap:HEAP_ValidateInUseArena Heap 0x110000: invalid in-use arena magic 00555555 for 0x21bc80
http://bugs.winehq.org/show_bug.cgi?id=23756
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|In-game MIDI music does not |Melker - The Elk Hunt: |play in Melker - The Elk |random invalid MIDIHDR |Hunt (midiStream function | |callback) |
--- Comment #11 from Jörg Höhle hoehle@users.sourceforge.net 2012-02-23 13:54:42 CST --- MIDI plays now. I've updated the title without closing this bug because of the invalid MIDIHDR mentioned in comment #7 of which we don't know whether it's caused by an app bug or one in Wine.
https://bugs.winehq.org/show_bug.cgi?id=23756
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Abandoned?
--- Comment #12 from Ken Sharp imwellcushtymelike@gmail.com --- Is this still an issue in Wine 1.7.45 or later?
https://bugs.winehq.org/show_bug.cgi?id=23756
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|Abandoned? | Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #13 from Bruno Jesus 00cpxxx@gmail.com --- Confirming in wine 1.7.53.