Maarten didn't reply, widening to wine-devel@
summary: looks like a bug was introduced into WaveOut queue management back in october that causes sound to skip and stutter.
-------- Original Message -------- Subject: WINE: suspected bug in change to winealsa.drv/waveout.c Date: Sun, 25 Jan 2009 03:46:09 +0000 From: Deomid Ryabkov myself@rojer.pp.ru To: m.b.lankhorst@gmail.com
hi, Maarten.
i'm a complete noob in WINE, this is the first time i delved in the source, so please bear with me if i'm wrong, but i believe i traced a specific problem i've been having with sound in Heroes of Might and Magic III to a change you made couple months ago to the ALSA waveout driver.
the regression manifests itself as rather annoying audio skipping and stuttering. having spent some time tracing and looking at the code, i believe that the problem was introduced by this change to dlls/winealsa.drv/waveout.c made on Oct 4:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=717df5b2972b3cb998ca5a...
specifically, this line
+ wwo->dwPlayedTotal += lpWaveHdr->reserved - wwo->dwPlayedTotal;
advances the dwPlayedTotal watermark when i believe it shouldn't. fundamentally, only DSP can report how much has been played, updating this pointer after reporting that a sample has been played makes no sense. DSP has reported that it has played up to a certain point that covers the sample in question, we are reporting this back and removing the sample. we should *not* be changing the value DSP sent us.
i don't know what was the specific issue you were addressing with the patch in question, but i'd like you to take one more look at it, because removing this one line fixes skipping and stuttering for me. if you need any more information, please feel free to ask.