DirectSound, new patch available for testing

Randall Walls rwalls at gwi.net
Mon Nov 7 12:25:49 CST 2005


Ok.... after a full recompile, rm-fr ~/.wine, and reinstall of the 
application all seems to be working fine now, with the exception that I 
still have the 'crackling' sound during gameplay (but that existed prior 
to your patch as well). Underruns are gone.

As for the crackling, Alex Villacis Lasso wrote a patch in August for 
the audio.c that was supposed to fix the crackling noise that was heard 
with some directsound games. The patch was apparently applied to CVS 
prior to 0.9 (from looking at the original audio.c source), but it 
didn't fix the crackling noise, at least not with Battlezone 2. The 
issue appears to be with the hardware pointer and playposition being 
'out of sync' so to speak. The patch added this line:

if (hw_ptr >= period_size) hw_ptr -= period_size; else hw_ptr = 0;

Which seems to adjust the harware pointer to more closely match the play 
position by subtracting the period size from it (if hw_ptr is greater 
than period_size). This has since been changed with your patch to:

hw_ptr = This->mmap_ppos;

Just curious if you could shed a bit of light on this. As I said, the 
original patch did not fix my specific problem, but I would curious if 
you reimplemented the same logic elsewhere, as it did seem to fix the 
issue for Alex.

Randall Walls


Davin McCall wrote:

>Dang. Forgot to attach.
>
>---
>Here's another patch to fix the clicking noise. Once again apply over the top.
>
>With this one, I think everything should be at least as good as it was with my very first patch. (Plus the full device buffer will be used if UseDirectHW="y", which should reduce underrun problems).
>
>Davin
>
>
>On Thu, 3 Nov 2005 18:42:50 +1100
>Davin McCall <davmac at davmac.org> wrote:
>
>  
>
>>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 <rwalls at gwi.net> 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
>>>
>>>
>>>      
>>>
>>------------------------------------------------------------------------
>>
>>
>>    
>>



More information about the wine-devel mailing list