2008/11/21 Chris Robinson chris.kcat@gmail.com:
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 snd_pcm_delay.
Thanks for the info.
I will have a stab at implementing this and then submit a patch.
Thanks, - Reece