Thanks for that -
There was at least one problem with the patch. I've attached a fix for that
(apply over the top of the previous one).
I don't get buffer underruns in my own testing, but I do get an annoying
clicking noise every so often (seems to be when streaming buffers wrap from the
end back to the start). I think that's a mixer issue rather than an ALSA driver
issue however as it occurs with OSS as well as ALSA. At the moment, I'm
focusing primarily on the ALSA driver issues.
I'd be grateful if you could try this modification (best results should be with
full acceleration, and UseDirectHW set to "y").
Davin
On Thu, 03 Nov 2005 02:18:48 +0000
Randall Walls <[EMAIL PROTECTED]> wrote:
> Tested again with BattleZone2 and I'm still getting what sounds like
> serious buffer underruns with this new patch. This one seemed to 'skip'
> a bit more too, depending on action taking place on screen, but that
> could be due to other issues (system load etc...). Running with Alsa as
> the audio driver and full hardware acceleration, no emulation. Tested
> both with and without the registry key set, and stuttering and the
> looping sounds actually seemed to get worse WITH the key. Switched to
> OSS driver to test (this would be Alsa's OSS emulation) and I still get
> the repeating sounds but some of the other issues are better.
> BattleZone2 does have a demo that can still be found online, and there
> was a patch on the list not too long ago to get the demo up and running.
>
> Again, let me know if any traces would be benneficial.
>
> Randall Walls
>
>
--- wine-0.9-progressive/dlls/winmm/winealsa/audio.c Thu Nov 3 09:53:15 2005
+++ wine-0.9/dlls/winmm/winealsa/audio.c Thu Nov 3 16:52:52 2005
@@ -3064,8 +3064,7 @@
TRACE("avail=%d, mul=%d\n", (int)avail, mul);
-
- frames = pdbi->mmap_buflen_bytes;
+ frames = pdbi->mmap_buflen_frames;
EnterCriticalSection(&pdbi->mmap_crst);
@@ -3088,8 +3087,8 @@
* only gives a contiguous linear region, so we need to check this
* in case we've reached the end of the buffer, in which case we
* can wrap around back to the beginning. */
- frames -= wanted;
- if (frames > 0) {
+ if (frames < wanted) {
+ frames = wanted -= frames;
snd_pcm_mmap_begin(wwo->pcm, &areas, &ofs, &frames);
snd_pcm_mmap_commit(wwo->pcm, ofs, frames);
}