http://bugs.winehq.org/show_bug.cgi?id=15559
--- Comment #37 from Reece Dunn msclrhd@gmail.com 2008-11-25 11:29:03 --- There are two changes. The first [1] introduced by Maarten:
+ if (state == SND_PCM_STATE_XRUN) + snd_pcm_start(wwo->pcm);
that caused the initial issues. The second [2], introduced by me:
+ int err; - snd_pcm_delay(wwo->pcm, &delay); + avail = snd_pcm_avail_update(wwo->pcm); + err = snd_pcm_hw_params_get_buffer_size(wwo->hw_params, &buf_size); + delay = buf_size - avail;
To understand the issue, this is noticeable on machines running Ubuntu 8.10 that have Intel HDA audio cards going through the PulseAudio ALSA layer that came with Ubuntu. This is without doing anything to the setup apart from updating Ubuntu to get bug fixes from there. The issue is noticeable on various games such as Peggle Deluxe.
The observed behaviour is: (a) without [1] or [2] -- sound is good (no stuttering); (b) with [1] only -- stuttering, Cepstral SwiftTalker hangs second time you listen to some text; (c) with [2] only -- stuttering is even worse, SwiftTalker does not hang.
On IRC it was deemed that [2] is the correct way to calculate the delay value.
Can the people experiencing the issues try Wine with the 3 configurations in (a) - (c) and report that the stuttering behaviour is as stated above. This is even if you have tried it with configuration (a) before so that there is a control test environment.