http://bugs.winehq.org/show_bug.cgi?id=15866
Summary: MechCommander 2: DSERR_CONTROLUNAVAIL errors Product: Wine Version: 1.0.1 Platform: PC URL: http://www.mechcommander.org OS/Version: Linux Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: directx-dsound AssignedTo: wine-bugs@winehq.org ReportedBy: georg298@gmx.de
Starting the game with
WINEDLLOVERRIDES="dpnet=n" wine MC2Rel.exe -window /gosnoblade /gosusehw
it will display many
FAILED (0x8878001e - DSERR_CONTROLUNAVAIL) - SetPan(0x8fa89a0: 0)
errors. These errors occur each time a sound notification or similar (e.g. hovering the mouse over a button in the menu or firing a weapon inside the game) is played. The reason is the function IDirectSoundBufferImpl_SetPan inside buffer.c from dsound dll. The following code is the reason:
/* You cannot use both pan and 3D controls */ if (!(This->dsbd.dwFlags & DSBCAPS_CTRLPAN) || (This->dsbd.dwFlags & DSBCAPS_CTRL3D)) { WARN("control unavailable\n"); return DSERR_CONTROLUNAVAIL; }
Is the logic here correct? Shouldn't "if(!A || B)" really be if(!(A || B)) ? However the comment "You cannot use both pan and 3D controls" doesn't make any sense in both cases, I think. If I change it accordingly, it will work (not display these errors any more):
/* You cannot use both pan and 3D controls */ if (!((This->dsbd.dwFlags & DSBCAPS_CTRLPAN) || (This->dsbd.dwFlags & DSBCAPS_CTRL3D))) { WARN("control unavailable\n"); return DSERR_CONTROLUNAVAIL; }
Changing it according to the comment to if(A && B) doesn't work.
I hope I provided enough information. I don't really know what I did there.
http://bugs.winehq.org/show_bug.cgi?id=15866
Georg Hennig georg298@gmx.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal Version|1.0.1 |1.1.9
--- Comment #1 from Georg Hennig georg298@gmx.de 2008-11-21 19:07:59 --- Still not fixed in 1.1.19.
http://bugs.winehq.org/show_bug.cgi?id=15866
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.9 |1.0.1
--- Comment #2 from Dmitry Timoshkov dmitry@codeweavers.com 2008-11-22 06:23:18 --- Please don't change an originally reported version.
http://bugs.winehq.org/show_bug.cgi?id=15866
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |trivial
http://bugs.winehq.org/show_bug.cgi?id=15866
--- Comment #3 from Austin English austinenglish@gmail.com 2009-05-29 12:19:09 --- Is this still an issue in current (1.1.22 or newer) wine?
http://bugs.winehq.org/show_bug.cgi?id=15866
--- Comment #4 from Georg Hennig georg298@gmx.de 2009-06-06 09:23:28 --- MC2 does not run on wine 1.1.22 so I cannot check. But as the typo isn't fixed in 1.1.23 sources, it's very likely that the bug still exists. If I find the time, I might run a regression test.
http://bugs.winehq.org/show_bug.cgi?id=15866
--- Comment #5 from Georg Hennig georg298@gmx.de 2010-02-02 17:19:59 --- Typo still not fixed in 1.1.37. At the moment a native dbghelp.dll is needed to bypass bug.
http://bugs.winehq.org/show_bug.cgi?id=15866
--- Comment #6 from Georg Hennig georg298@gmx.de 2010-05-09 05:34:40 --- Bug still exists in wine 1.1.43
http://bugs.winehq.org/show_bug.cgi?id=15866
--- Comment #7 from Georg Hennig georg298@gmx.de 2010-08-03 13:46:23 --- This bug still exists in wine 1.3.0
http://bugs.winehq.org/show_bug.cgi?id=15866
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mstefani@redhat.com
http://bugs.winehq.org/show_bug.cgi?id=15866
nozomi kodama nozomi.kodama@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nozomi.kodama@yahoo.com
--- Comment #8 from nozomi kodama nozomi.kodama@yahoo.com 2012-09-14 19:46:55 CDT --- Following to MSDN, SetPan needs a control at least. So the correct change is !A && !B = !(A || B).
That proved by tests in http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/dsound/tests/ds3d8.c
Unfortunately, they are never reached.
http://bugs.winehq.org/show_bug.cgi?id=15866
Jarkko K jarkko_korpi@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jarkko_korpi@hotmail.com
--- Comment #9 from Jarkko K jarkko_korpi@hotmail.com --- It seems microsoft is giving the game source for free now http://www.microsoft.com/en-us/download/details.aspx?id=11457
Here is the source code of wine related to this issue.
http://source.winehq.org/git/wine.git/blob/e3997294621471a077480787e8961a453...
https://bugs.winehq.org/show_bug.cgi?id=15866
Pedro F neuralshock@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |neuralshock@hotmail.com
--- Comment #10 from Pedro F neuralshock@hotmail.com --- Created attachment 51111 --> https://bugs.winehq.org/attachment.cgi?id=51111 Wine error log.
Used the build available at Microsoft's website for this test, since it's freely available.
https://bugs.winehq.org/show_bug.cgi?id=15866
--- Comment #11 from Pedro F neuralshock@hotmail.com --- Don't know if it's possible to edit comments, but it appears not: I tested this with wine 1.7.39 (installed via Homebrew).
https://bugs.winehq.org/show_bug.cgi?id=15866
--- Comment #12 from Pedro F neuralshock@hotmail.com --- Created attachment 51153 --> https://bugs.winehq.org/attachment.cgi?id=51153 Patch as suggested by Georg Hennig
Patch file with correction as suggested by Georg Hennig. Applies to 1.7.39, no other changes required.
https://bugs.winehq.org/show_bug.cgi?id=15866
--- Comment #13 from Pedro Fernandes neuralshock@hotmail.com --- The problem still happens with 1.7.51.
The patch continues to apply cleanly on top of 1.7.51 and working (tested with OSX 10.11 + Wine 1.7.51 installed via homebrew w/ patch applied).
Tested with both MC2 Shared Source and Retail releases.
https://bugs.winehq.org/show_bug.cgi?id=15866
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #14 from Michael Stefaniuc mstefani@redhat.com --- The proposed patch is incorrect. DSBCAPS_CTRL3D does not imply DSBCAPS_CTRLPAN. Quite the opposite, the two flags are mutually exclusive. The code and comment are actually correct but just for secondary IDirectSoundBuffer8.
On the other hand error checking in version 1 is incomplete. Native allows both to create a 3D secondary buffer with both DSBCAPS_CTRL3D and DSBCAPS_CTRLPAN set as well as calling SetPan() for such a buffer. The associated GetPan() on the other hand fails with DSERR_CONTROLUNAVAIL.
I have submitted a fix for this with tests: https://source.winehq.org/patches/data/117067
https://bugs.winehq.org/show_bug.cgi?id=15866
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |e69d9ec3c4e8829c5c18cea7d83 | |48171d51dcd76 Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #15 from Michael Stefaniuc mstefani@redhat.com --- The patch got committed and with that I don't get those annoying error pop up windows anymore.
https://bugs.winehq.org/show_bug.cgi?id=15866
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #16 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.8-rc3.