http://bugs.winehq.org/show_bug.cgi?id=27184
Summary: Unhandled Exception in CoreAudio (AudioRenderClient_ReleaseBuffer) Product: Wine Version: 1.3.20 Platform: x86 OS/Version: Mac OS X 10.6 Status: UNCONFIRMED Severity: normal Priority: P2 Component: mmdevapi AssignedTo: wine-bugs@winehq.org ReportedBy: thanoulas@gmail.com
Created an attachment (id=34730) --> (http://bugs.winehq.org/attachment.cgi?id=34730) Unhandled Exception in Coreaudio (AudioRenderClient_ReleaseBuffer)
Running the game "Hector" from Telltale Games generates the attached unhandled exception in MacOS 10.6 (CoreAudio)
http://bugs.winehq.org/show_bug.cgi?id=27184
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |hoehle@users.sourceforge.ne | |t
--- Comment #1 from Jörg Höhle hoehle@users.sourceforge.net 2011-06-06 01:24:58 CDT --- Source code attachment #35024 to bug #27393 produces an exception in AudioRenderClient_ReleaseBuffer too, on Mac OSX 10.5.8. It may be the same issue (even though I observe an illegal read access to 0x00000004, not a write access as originally reported).
Please attach a WINEDEBUG=+wave,+coreaudio log.
http://bugs.winehq.org/show_bug.cgi?id=27184
--- Comment #2 from Jörg Höhle hoehle@users.sourceforge.net 2011-06-06 01:46:14 CDT --- Created an attachment (id=35042) --> (http://bugs.winehq.org/attachment.cgi?id=35042) render.c test output to compare with testbot job #11482
The crash with my render test occurs after GetData yields a NULL data pointer. This happens when GetCurrentPadding equals GetBufferSize, and the renderer invokes GetData(numFramesRequested=0). We need a testcase to cover this "buffer full" situation.
MSDN says: "If the caller sets NumFramesRequested = 0, the method returns status code S_OK but does not write to the variable that the ppData parameter points to." I.e. the data pointer is not initialized! ReleaseBuffer must not crash in such a case, because "The client has the option of calling or not calling ReleaseBuffer to release a packet of size 0."
Note that in native, my player does not trigger such a "buffer full" situation, because after sleeping for 100ms, 9-10 10ms chunks will be found free. That could be another bug. If you look at the attached output from render.c:723 GetCurrentPadding on MacOS, you'll note "available space" behaviour vastly different from native.
http://bugs.winehq.org/show_bug.cgi?id=27184
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |aeikum@codeweavers.com
http://bugs.winehq.org/show_bug.cgi?id=27184
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #35042|0 |1 is obsolete| |
--- Comment #3 from Jörg Höhle hoehle@users.sourceforge.net 2011-08-07 07:51:40 CDT --- Created an attachment (id=35860) --> (http://bugs.winehq.org/attachment.cgi?id=35860) Patch to CoreAudio Get & ReleaseBuffer on top of wine-1.3.26
Please test this patch that helps MacOS not to crash in ReleaseBuffer during my mmdevapi/tests/render.c tests. My prior render.c attachment is made obsolete by attachment #35818 in bug #27937.
http://bugs.winehq.org/show_bug.cgi?id=27184
--- Comment #4 from Andrew Eikum aeikum@codeweavers.com 2011-08-08 08:13:41 CDT --- (In reply to comment #3)
The patch looks good to me except this hunk:
@@ -1781,7 +1792,7 @@ static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface, *flags = 0; This->written_frames += *frames; This->inbuf_frames -= *frames; - This->getbuf_last = TRUE; + This->getbuf_last = 0;
if(devpos || qpcpos) AudioClock_GetPosition_nolock(This, devpos, qpcpos, FALSE);
Should that not be "getbuf_last = *frames"? With your patch applied, I believe the subsequent ReleaseBuffer() will always fail with E_OUT_OF_ORDER.
http://bugs.winehq.org/show_bug.cgi?id=27184
--- Comment #5 from Jörg Höhle hoehle@users.sourceforge.net 2011-08-08 08:46:10 CDT --- Indeed, I'm guilty of "copy&paste error" too. I noticed that too when looking at "git log -p" and decided to run capture.ok You'll see that "getbuf_last = *frames" fails the test too because frames may be 0. *frames=1 passes the tests, but should not be needed. What's needed is to fix capture's allowed ordering of GetBuffer/ReleaseBuffer, but I have no access to a capture enabled mmdevapi. E.g. I believe that ReleaseBuffer(0) always returns S_OK, like in the render case.
http://bugs.winehq.org/show_bug.cgi?id=27184
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- OS/Version|Mac OS X 10.6 |Mac OS X
http://bugs.winehq.org/show_bug.cgi?id=27184
--- Comment #6 from Jörg Höhle hoehle@users.sourceforge.net 2011-09-12 07:06:13 CDT --- The patch to ReleaseBuffer is in wine-1.3.28. Please retest and mark this issue as fixed if it's enough make the app's audio work.
http://bugs.winehq.org/show_bug.cgi?id=27184
thanoulas thanoulas@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #7 from thanoulas thanoulas@gmail.com 2011-12-30 15:52:47 CST --- I tried the app again and the audio now indeed works in the game.
Marking as resolved & fixed
http://bugs.winehq.org/show_bug.cgi?id=27184
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |adam.j.cooper+wine@gmail.co | |m
--- Comment #8 from Jörg Höhle hoehle@users.sourceforge.net 2012-01-05 10:02:48 CST --- *** Bug 27805 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=27184
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #9 from Alexandre Julliard julliard@winehq.org 2012-01-13 13:49:55 CST --- Closing bugs fixed in 1.3.37.