http://bugs.winehq.org/show_bug.cgi?id=19901
Summary: Burg Schreckenstein: OSS HW emulation plays too slow and crashes Product: Wine Version: 1.1.28 Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-dsound AssignedTo: wine-bugs@winehq.org ReportedBy: hoehle@users.sourceforge.net
Often enough, an app works better in HW emulation mode than with acceleration. With Burg Schreckenstein, the opposite is true: emulation crashes.
OSS HW: intro music and game play are fine! OSS emul: music too slow (125 seconds instead of 63); assertion failure during game play: err:dsound:DSOUND_MixInBuffer length not a multiple of block size, len = 2 or 130, block size = 4 mixer.c:502: DSOUND_MixInBuffer: Assertion `dsb->buf_mixpos + len <= dsb->tmp_buffer_len' failed.
ALSA emul: like OSS emul ALSA HW: no sound at all, subtitles display too short to be readable, log: fixme:dsound:DSOUND_PerformMix Buffering too much! (20480, 0, 0, 4096) [N times]
Incidentally, the MacOS with its CoreAudio driver behaves like OSS HW emulation (same 2 symptoms). So fixing this bug might make that app playable on MacOS (as would implementing HW acceleration for Mac OSX, which is probably harder).
Using Ubuntu Intrepid without PulseAudio, with Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 03).
+wave,+dsound,+winmm,+mmaux,+driver,+mixer,+tid logs of both OSS cases are attached. Hopefully the comparison side by side will reveal the fault in the logic that leads to the block size error and subsequent assertion violation. Indeed, nAvgBytesPerSec and nBlockAlign are different, but why?
http://bugs.winehq.org/show_bug.cgi?id=19901
--- Comment #1 from Jörg Höhle hoehle@users.sourceforge.net 2009-09-01 03:45:36 --- Created an attachment (id=23360) --> (http://bugs.winehq.org/attachment.cgi?id=23360) OSS with hardware driver: perfect sound
+wave,+dsound,+winmm,+mmaux,+driver,+mixer,+tid log
+snoop would reveal how the function smackw32._SmackWait@4 is continuously called from the main thread.
http://bugs.winehq.org/show_bug.cgi?id=19901
--- Comment #2 from Jörg Höhle hoehle@users.sourceforge.net 2009-09-01 03:54:24 --- Created an attachment (id=23361) --> (http://bugs.winehq.org/attachment.cgi?id=23361) OSS driver emulation: music plays at half speed
Both logs are from the first seconds of the intro music. The music plays at half speed (frequency shift leads to bass voices) and takes twice as long as normal.
The assertion failure that occurs later during game play is not shown. Curiously, voices are played correctly during game play (the crash randomly occurs sooner or later).
My hope is that a fix of the wrong sampling of the intro music will fix the later crash during game play as well.
http://bugs.winehq.org/show_bug.cgi?id=19901
--- Comment #3 from Jörg Höhle hoehle@users.sourceforge.net 2009-09-02 06:01:59 --- Bug #12349 is about the assertion failure (similar symptoms with OSS and ALSA, HW and emulation), but in another application. The present bug is about the slow playback speed in sound hardware emulation mode. I cannot exclude that both have a common cause. It may be easier to spot it in "der Dieb von Burg Schreckenstein" than in "der Löwe ist los" because the slow playback happens right at the start of the former app. Alas, there's no downloadable demo of neither of those apps.
http://bugs.winehq.org/show_bug.cgi?id=19901
--- Comment #4 from Jörg Höhle hoehle@users.sourceforge.net 2009-09-11 08:08:27 --- My hopes came true: Bug #12349 and this one are the same and "Burg Schreckenstein" was easier to analyse.
Wine gets confused by nBlockAlign or nAvgBytesPerSec being inconsistent with nSamplesPerSec/nBitsPerSample/nChannels.
That's why OSS with hardware acceleration works with these apps -- it is the only one to reset these values -- while emulation and ALSA crash.
Testing shows that MS-Windows (2k) ignores these 2 values.
My experimental patch in bug #12349, comment #21 restores correct values for OSS HW emulation (CoreAudio and ALSA are in the works).
With it, the state is as follows (with 1.1.29): - ALSA HW or emulation: wrong speed & crashes with assertion failure - OSS HW: perfect - OSS emulation: perfect with patch
http://bugs.winehq.org/show_bug.cgi?id=19901
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #5 from Jörg Höhle hoehle@users.sourceforge.net 2009-09-17 11:31:54 --- OSS commit 8870fe38b5d9a143c78c68a43c95c1be766739b3 CoreAudio commit e6770a40118349e8d33e52a54af3602e9af76ac3 Expect ALSA when I'll have more time.
Is it right to mark this as resolved even though not all audio drivers are fixed? (well, this bug has OSS in the subject, which is fixed in 1.1.30)
http://bugs.winehq.org/show_bug.cgi?id=19901
--- Comment #6 from Jörg Höhle hoehle@users.sourceforge.net 2009-09-18 06:13:31 --- Leaving open until all sound drivers are fixed. Who is going to fix wineJack/ESD/NAS/AudioIO etc? I feel a bit uncomfortable patching stuff I cannot even compile, least run (e.g. I made a copy&paste error when moving my code from OSS to CoreAudio; it was detected by running the test).
http://bugs.winehq.org/show_bug.cgi?id=19901
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|FIXED |
--- Comment #7 from Jörg Höhle hoehle@users.sourceforge.net 2009-09-18 06:20:37 --- Not marking resolved until all sound drivers are fixed.
http://bugs.winehq.org/show_bug.cgi?id=19901
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #8 from Jörg Höhle hoehle@users.sourceforge.net 2009-10-06 14:19:55 --- Fixed by my pre-1.1.31 commit dc3471ca0e7c2209ecf9758359cc62f9d958bf2c for all audio drivers (ALSA+OSS+CoreAudio+...)
Now that I can play with ALSA as well (my former driver-specific patches in comment #5 enabled playing with OSS and CoreAudio), I observe these warnings:
ALSA HW, while in menu (where no music plays) warn:dsound:DSOUND_PerformMix Probable buffer underrun (playing silence?)
ALSA emulation mode, while in menu warn:wave:wodUpdatePlayedTotal Unexpected state (4) while updating Total Played, resetting
ALSA or OSS, HW or emulation, in game, when one character says something: warn:dsound:IDirectSoundBufferImpl_Lock Overwriting mixing position, case 1 (no warning comes from sound effects, only voices (mixing?))
http://bugs.winehq.org/show_bug.cgi?id=19901
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #9 from Alexandre Julliard julliard@winehq.org 2009-10-09 11:14:22 --- Closing bugs fixed in 1.1.31.