[Bug 37983] New: Jedi Knight: Dark Forces II (GOG.com version) - music doesn't work
https://bugs.winehq.org/show_bug.cgi?id=37983 Bug ID: 37983 Summary: Jedi Knight: Dark Forces II (GOG.com version) - music doesn't work Product: Wine Version: 1.7.35 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs(a)winehq.org Reporter: rixa(a)cs.tut.fi Distribution: --- The game originally used to have background music on CD audio tracks. The recent GOG.com release includes those tracks in .ogg format, along with what seems to be some sort of a hack to play them through a custom winmm.dll in the game directory. The music does not play. For the included winmm.dll to do anything, an override of "winmm (native,builtin)" seems like a logical step. Indeed, it was reported on the GOG.com forums that this gets the music working on Crossover, and I used the trial version to verify that this is indeed the case. But if I do the same on Wine, the game doesn't start anymore. It just dies with: err:seh:raise_exception Exception frame is not in stack limits => unable to dispatch exception. I tried to trace it down to other overrides that crossover sets by default, but it would still work even if I removed them all. It would even keep working if I replaced the entire drive_c there with the one from my wineprefix where it doesn't work, so it probably does not have to do with any of the pre-installed software, nor an installation broken for whatever reason. Using wine on the prefix installed in crossover didn't work any better either. In addition to a clean unpatched wine 1.7.35 that I compiled myself, I tried multiple versions of wine from PlayOnLinux but none of them started the game with the override in place; each died with the same message. Without the override the game is still very playable, just has no background music. Xubuntu 14.10, nvidia 331.113. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 Sebastian Lackner <sebastian(a)fds-team.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sebastian(a)fds-team.de --- Comment #1 from Sebastian Lackner <sebastian(a)fds-team.de> --- Created attachment 50611 --> https://bugs.winehq.org/attachment.cgi?id=50611 winmm: Delay import ole32 msacm32 to workaround bug when loading multiple winmm versions. Confirming. Michael Müller has tracked it down to the attached change which is included in Crossover. With that applied (and setting 'winmm' to native) the music plays fine. Please note that the wine Makefile system is buggy here, you'll have to do some other changes in dlls/winmm (touch dlls/winmm/*.c), otherwise it will not recompile the library. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 Sebastian Lackner <sebastian(a)fds-team.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michael(a)fds-team.de -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |leslie_alistair(a)hotmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 --- Comment #2 from Rixa <rixa(a)cs.tut.fi> --- Confirming that the patch works. Great work! -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 --- Comment #3 from Sebastian Lackner <sebastian(a)fds-team.de> --- Created attachment 50634 --> https://bugs.winehq.org/attachment.cgi?id=50634 Log with WINEDEBUG=+module and winedbg stack trace The attached log shows that this is indeed a ntdll/loader problem. * The game loads the native winmm library. * While resolving the forwarded export "system32\\winmm.waveOutClose" the builtin dll is loaded. * While fixing up the imports for the native library (load_builtin_callback -> fixup_imports -> import_dll), additional libraries (ole32, msacm32) are loaded as dependencies. * Those dependencies also try to import winmm. Unfortunately they are also affected by the hook, so they don't get the builtin library, but instead the native lib. This recursive loading situation is not handled properly by the Wine loader. This has the effect that wm->deps[i] is referenced before it was initialized (in the attached log it contained the garbage value 0x640000). To demonstrate this a bit better you can also apply the following patch: --- snip --- diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index e1444d2..0405cf5 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -884,4 +884,7 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path ) wm->deps = RtlAllocateHeap( GetProcessHeap(), 0, nb_imports*sizeof(WINE_MODREF *) ); + for (i = 0; i < nb_imports; i++) + wm->deps[i] = (void *)0xdeadbeef; + /* load the imported modules. They are automatically * added to the modref list of the process. --- snip --- I am not sure how exactly this issue can be fixed (besides the workaround above), but probably some other people more experienced with the wine loader area can take a look. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 Shmerl <shtetldik(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |shtetldik(a)gmail.com --- Comment #4 from Shmerl <shtetldik(a)gmail.com> --- Looks like Outlaws (GOG release) uses the same winmm hook technique. I'll test the patch a bit later and will report the result. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 Bruno Jesus <00cpxxx(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #5 from Bruno Jesus <00cpxxx(a)gmail.com> --- Confirming as per previous comments. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 Sean DuBois <sean(a)siobud.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sean(a)siobud.com --- Comment #6 from Sean DuBois <sean(a)siobud.com> --- Bruno Jesus you were able to build with the patch and play outlaws with the current HEAD? I built f34ec94308514d4379d7af2e73e78c3b99a94c75 + the attached the patch and got the following backtrace on OSX -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 --- Comment #7 from Sean DuBois <sean(a)siobud.com> --- Created attachment 51076 --> https://bugs.winehq.org/attachment.cgi?id=51076 Outlaws Backtrace with patch applied against f34ec94308514d4379d7af2e73e78c3b99a94c75 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 --- Comment #8 from Sean DuBois <sean(a)siobud.com> --- Created attachment 51077 --> https://bugs.winehq.org/attachment.cgi?id=51077 Outlaws Wine Debug with patch applied against f34ec94308514d4379d7af2e73e78c3b99a94c75 With WINEDEBUG=+module this is the output when using (native, builtin) for winmm.dll -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 Rixa <rixa(a)cs.tut.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Jedi Knight: Dark Forces II |Jedi Knight: Dark Forces |(GOG.com version) - music |II, Outlaws (GOG.com |doesn't work |versions) - music doesn't | |work -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 --- Comment #9 from Shmerl <shtetldik(a)gmail.com> --- I also opened a bug in ogg-winmm just for tracking this: https://github.com/hifi/ogg-winmm/issues/2 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 Sean DuBois <sean(a)siobud.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #51076|0 |1 is obsolete| | --- Comment #10 from Sean DuBois <sean(a)siobud.com> --- Created attachment 51093 --> https://bugs.winehq.org/attachment.cgi?id=51093 Outlaws Backtrace with patch applied against f34ec94308514d4379d7af2e73e78c3b99a94c75 with symbols -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 --- Comment #11 from Sebastian Lackner <sebastian(a)fds-team.de> --- Hello guys. Could someone explain me please (via email) why the Outlaws issue has anything to do with the original bug report? This is a bug tracker and not a forum, it is meant to provide Wine developers with the necessary information to fix _one_ specific issue. This only works when wild speculations are avoided. This issue was opened for Jedi Knight: Dark Forces II and was already half-analyzed and tracked down to a wine loader issue (see comment #3). I have confirmed myself that the patch from comment #1 is fully sufficient to fix/workaround _this_ bug, with that applied Jedi Knight: Dark Forces II works perfectly fine. The backtraces / logs from Outlaws have nothing in common (and show a crash related to dialog procs), so unless you already debugged the application, there is no way to conclude that is has anything to do with this bug. It could be basically anything. Asking the ogg-winmm people will also not help, because this is not a bug in their wrapper, its in the wine loader. Please try to avoid all the confusion, it will make it much harder for someone else to investigate this issue. If you need help with testing the patch, please discuss that in the forums. Otherwise, if you are sure that the patch doesn't help, please open a new bug report instead of mixing up different issues in this one. Thanks. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 --- Comment #12 from Shmerl <shtetldik(a)gmail.com> --- Not sure about the traces, but Outlaws uses exactly the same library which is internal GOG's fork of ogg-winmm, and also doesn't play music. So I'd say it should be a common bug for both. There is actually an easy workaround for this, and I'll post it shortly (writing a small script now). -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 --- Comment #13 from Shmerl <shtetldik(a)gmail.com> --- The workaround is to rename hook winmm.dll to something else (with same length of the name), and to patch binaries which use it with that change. See example for Outlaws here: https://gist.github.com/shmerl/baa5367fce111e6999a4 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 --- Comment #14 from Rixa <rixa(a)cs.tut.fi> --- I noticed that the 1998 remakes of X-Wing and TIE Fighter as sold by GOG.com also have this same setup. They too require an override for winmm.dll, but this again crashes wine. The patch in Comment1 helps, and the music then works. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 Anastasius Focht <focht(a)gmx.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch CC| |focht(a)gmx.net Component|-unknown |winmm&mci --- Comment #15 from Anastasius Focht <focht(a)gmx.net> --- Hello folks, obviously still present. $ wine --version wine-1.7.43-123-g90ed96a The patch from Michael is also available/included in Wine-Staging by default: https://github.com/wine-compholio/wine-staging/blob/master/patches/winmm-Del... Regards -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 WineBuG <winebugs140(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |winebugs140(a)gmail.com --- Comment #16 from WineBuG <winebugs140(a)gmail.com> --- *** Bug 35992 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 --- Comment #17 from WineBuG <winebugs140(a)gmail.com> --- Not fixed in Wine 1.7.51, GOG.com HoMM 2 Gold Windows version seems to be affected by this bug as well. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 Michael Müller <michael(a)fds-team.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |STAGED Staged patchset| |https://github.com/wine-com | |pholio/wine-staging/tree/ma | |ster/patches/winmm-Delay_Im | |port_Depends -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 fjfrackiewicz(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fjfrackiewicz(a)gmail.com --- Comment #18 from fjfrackiewicz(a)gmail.com --- Music during the actual levels in Outlaws (GOG version) does not play. The music does play i the intro movies, though. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 Paul The Tall <paulthetall(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paulthetall(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 --- Comment #19 from Rixa <rixasha(a)yahoo.com> --- I decided to get Outlaws from the current GOG.com sale to finally check it out for the purposes of this bug. * First I tried it with wine 2.2, and the music during missions didn't play. * I then added an override to winmm.dll, and wine crashed. * I then added the patch from Comment 1, and the music started to play. As far as I can tell, there is nothing special about Outlaws. It is the same setup as with Dark Forces II, the 1998 remakes of X-Wing and Tie Fighter and probably others as this seems to be the way that GOG.com likes to handle used-to-be-CD-audio. It has the same problem as the others, and the same patch fixes it. (A wine-staging build together with the override also plays the music, which is not surprising if wine-staging already includes the patch) -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 André H. <nerv(a)dawncrow.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Staged patchset|https://github.com/wine-com |https://github.com/wine-sta |pholio/wine-staging/tree/ma |ging/wine-staging/tree/mast |ster/patches/winmm-Delay_Im |er/patches/winmm-Delay_Impo |port_Depends |rt_Depends CC| |nerv(a)dawncrow.de -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 --- Comment #20 from Shmerl <shtetldik(a)gmail.com> --- I just tested Outlaws with winmm native override. In regular Wine, the music works, but it's too fast. With Wine staging, the music is normal. What patch in Staging exactly is fixing this? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 Le Gluon du Net <legluondunet(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |legluondunet(a)gmail.com --- Comment #21 from Le Gluon du Net <legluondunet(a)gmail.com> --- winmm works for me with this games: motoracer 1 and 2 dark forces II heretic II just override dll in "native, builtin" this bug could be close -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 Zebediah Figura <z.figura12(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|winmm&mci |ntdll CC| |z.figura12(a)gmail.com Resolution|--- |FIXED Status|STAGED |RESOLVED --- Comment #22 from Zebediah Figura <z.figura12(a)gmail.com> --- I can confirm that the music in Jedi Knight: Dark Forces II (from GOG) works, with winmm set to "native,builtin". I started a new game, skipped the cutscene, and there was music playing that matched "MUSIC/Track12.ogg". When I removed the override, no music played. I haven't bisected when it was fixed. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37983 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #23 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 6.5. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (2)
-
wine-bugs@winehq.org -
WineHQ Bugzilla