[RFC/RFH] winmm:wave hang fix question (commit 717df5b2972b3cb998ca5a43279ae2283b117eaa) [bug 15559]

Chris Robinson chris.kcat at gmail.com
Fri Nov 21 12:56:41 CST 2008

On Friday 21 November 2008 10:26:19 am Reece Dunn wrote:
> I want to submit the following patch to revert the part of the patch
> that caused the regression and fix some of the tracing. I have been
> using this patch on Cepstral SwiftTalker without issue and have tested
> it also with the game Azguard Defense.
> I am submitting this here and not to wine-patches initially, as I
> would like to understand what the fix was actually fixing and (based
> on the test history still showing timeouts) whether it actually fixes
> the issue it was trying to.

Hi Reese,

As far as I understand, the issue is that winealsa uses the delay value to 
determine how much data is unplayed in the pcm buffer, and it expects the 
delay to be 0 when it's empty. The problem is, snd_pcm_delay measures the 
time it would take for the next sample written to get through the DAC, which 
is only marginally related, and may not get down to 0 (depending on the 
backend, there may always be some delay even if the next samples written get 
played right away).

The proper way to fix this, AFAIK from the conclusion on IRC, would be to 
subtract the snd_pcm_avail_update() value from the total pcm buffer size, as 
a way to determine how much is unplayed in the buffer instead of abusing 

More information about the wine-devel mailing list