http://bugs.winehq.org/show_bug.cgi?id=28207
Summary: Caesar III crashes in dsound Product: Wine Version: 1.3.27 Platform: x86 URL: http://www.fileplanet.com/11410/10000/fileinfo/Caesar- III-Demo OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-dsound AssignedTo: wine-bugs@winehq.org ReportedBy: gyebro69@gmail.com CC: mstefani@redhat.de Regression SHA1: 6d7c38256f258dcb71d73e573954c00b77b40202
Created an attachment (id=36124) --> (http://bugs.winehq.org/attachment.cgi?id=36124) terminal output
Steps to reproduce the problem in the demo: Install the demo as usual then launch the game by c3.exe (located under drive_c:/SIERRA/CAESAR3DEMO) Audio just begins to play when it is suddenly interrupted and Wine crashes.
This didn't occur in Wine-1.3.26 and the result of the regression test:
6d7c38256f258dcb71d73e573954c00b77b40202 is the first bad commit commit 6d7c38256f258dcb71d73e573954c00b77b40202 Author: Michael Stefaniuc mstefani@redhat.de Date: Thu Aug 25 23:42:44 2011 +0200
dsound: Fix refcounting for the secondary buffer object.
This fixes a regression introduced in 6b64e0090cb7.
:040000 040000 c9a6568b6e75de0fb421db9a6445d6b0fdfda983 05273f110f5a025be1df6f47f116283fc164c5a3 M dlls
With the reverted patch the game starts normally. Disabling audio in winecfg's Audio tab works around the problem.
Fedora 15 x86 Alsa 1.0.24 Pulseaudio is not running
http://bugs.winehq.org/show_bug.cgi?id=28207
GyB gyebro69@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, regression
--- Comment #1 from GyB gyebro69@gmail.com 2011-08-27 12:39:56 CDT --- Added some keywords.
http://bugs.winehq.org/show_bug.cgi?id=28207
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mstefani@redhat.com
--- Comment #2 from Michael Stefaniuc mstefani@redhat.com 2011-08-27 15:16:15 CDT --- Looking at the crash it happens in the primary buffer implementation which I didn't touch yet. Can you please attach the +dsound debug output? I'm travelling at the moment and my 3G connection isn't that great else I would get it myself.
http://bugs.winehq.org/show_bug.cgi?id=28207
--- Comment #3 from GyB gyebro69@gmail.com 2011-08-27 21:33:56 CDT --- Created an attachment (id=36126) --> (http://bugs.winehq.org/attachment.cgi?id=36126) +dsound log
http://bugs.winehq.org/show_bug.cgi?id=28207
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED AssignedTo|wine-bugs@winehq.org |mstefani@redhat.com Ever Confirmed|0 |1
--- Comment #4 from Michael Stefaniuc mstefani@redhat.com 2011-08-28 15:23:25 CDT --- *SIGH* - confirming.
http://bugs.winehq.org/show_bug.cgi?id=28207
--- Comment #5 from Michael Stefaniuc mstefani@redhat.com 2011-08-28 15:39:23 CDT --- Created an attachment (id=36145) --> (http://bugs.winehq.org/attachment.cgi?id=36145) Hack to restore the layout of the secondary buffer object
http://bugs.winehq.org/show_bug.cgi?id=28207
--- Comment #6 from Michael Stefaniuc mstefani@redhat.com 2011-08-28 15:42:39 CDT --- Can you please try out the attached hack? This "fixes" it for me.
It looks like dsound is so broken that a secondary buffer is passed as a primary buffer and the struct layout isn't compatible anymore.
http://bugs.winehq.org/show_bug.cgi?id=28207
--- Comment #7 from GyB gyebro69@gmail.com 2011-08-28 21:43:52 CDT --- The hack works here as well.
http://bugs.winehq.org/show_bug.cgi?id=28207
--- Comment #8 from Michael Stefaniuc mstefani@redhat.com 2011-08-29 03:15:45 CDT --- Yeah, with the help of Maarten I figure out what went wrong. The game is buggy and does something like this: primary->lpVtbl.GetStatus(secondary, &status) aka calling the GetStatus method of the primary IDirectSoundBuffer object on the secondary IDirectSoundBuffer object. This works on Windows because there is only one IDirectSoundBuffer implementation there and thus the vtbls are the same.
I have submitted a test case for this http://source.winehq.org/patches/data/78080 but a proper fix will take some time.
http://bugs.winehq.org/show_bug.cgi?id=28207
--- Comment #9 from Michael Stefaniuc mstefani@redhat.com 2011-08-29 17:14:08 CDT --- Created an attachment (id=36154) --> (http://bugs.winehq.org/attachment.cgi?id=36154) Proper regression fix
This is the "proper" fix for now that makes the primary buffer use the same struct as the secondary buffer. This restores the behavior to match the one before the regression. Though this isn't a full fix as the app gets the state of the primary buffer instead of the secondary buffer.
http://bugs.winehq.org/show_bug.cgi?id=28207
--- Comment #10 from GyB gyebro69@gmail.com 2011-08-30 12:33:12 CDT --- (In reply to comment #9)
Created an attachment (id=36154)
--> (http://bugs.winehq.org/attachment.cgi?id=36154) [details]
Proper regression fix
This is the "proper" fix for now that makes the primary buffer use the same struct as the secondary buffer. This restores the behavior to match the one before the regression. Though this isn't a full fix as the app gets the state of the primary buffer instead of the secondary buffer.
Caesar 3 works without problems here using that patch.
http://bugs.winehq.org/show_bug.cgi?id=28207
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED
--- Comment #11 from Michael Stefaniuc mstefani@redhat.com 2011-08-31 14:51:58 CDT --- Patch commited http://source.winehq.org/git/wine.git/?a=commit;h=ffb51208e92041f905447407ac...
I'm resolving the ticket as the regression is fixed. The merging of the primary and secondary buffer vtbls is work in progress but doesn't needs to be tracked in bugzilla; that work is part of my COM cleanup work.
http://bugs.winehq.org/show_bug.cgi?id=28207
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #12 from Alexandre Julliard julliard@winehq.org 2011-09-09 12:55:00 CDT --- Closing bugs fixed in 1.3.28.
http://bugs.winehq.org/show_bug.cgi?id=28207
GyB gyebro69@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |ffb51208e92041f905447407ac5 | |2f1ec2bbabf68