http://bugs.winehq.org/show_bug.cgi?id=15559
--- Comment #25 from Reece Dunn msclrhd@gmail.com 2008-11-20 02:02:39 --- Alright, I have tracked down the Cepstral SwiftTalker hang and the fix is to revert the patch :)! Only the lines: - if (state == SND_PCM_STATE_XRUN) - snd_pcm_start(wwo->pcm); seem to affect the fix; I can keep the others and this will work.
Tracking invalid states as well, I get the following with WINEDEBUG=+wave
trace:wave:wodPlayer_NotifyCompletions still playing 0x6fadf0 (28672/27146) trace:wave:wodPlayer waiting 21ms (21,34) warn:wave:wodUpdatePlayedTotal Unexpected state (4) while updating Total Played, resetting trace:wave:wodNotifyClient wMsg = 0x03bd dwParm1 = 6FADF0 dwParam2 = 0000 trace:wave:wodPlayer_NotifyCompletions Empty queue trace:wave:wodPlayer waiting 21ms (21,4294967295) warn:wave:wodUpdatePlayedTotal Unexpected state (4) while updating Total Played, resetting ... trace:wave:ALSA_wodMessage (0, WODM_UNPREPARE, 7EC34B1B, 006F8D90, 00000020); trace:wave:ALSA_wodMessage (0, WODM_CLOSE, 7EC34B1B, 00000000, 00000000);
The interesting thing here is that I get about 3-4 NotifyCompletion Empty queue, waiting 21ms, unexpected state (4) cycles before getting the first WODM_UNPREPARE (I get 4 of these) and the WODM_CLOSE.
Also of interest here is the wodNotifyClient sending a WOM_DONE (0x03bd) message before that sequence.
The final key thing of interest is that if I use WINEDEBUG=alsa or WINEDEBUG=wave (even redirecting stderr to a file), the application does not hang.
Putting all of this together, I believe that this fix for the winmm:wave tests is invalid. The test - in response to a wodNotifyClient(wMsg = WODM_CLOSE) should send the WODM_CLOSE and possibly the WODM_UNPREPARE messages (before the WODM_CLOSE) to tell the wave audio handler "I'm done!".
So here, state 4 *is* a valid state for wodUpdatePlayedTotal, but only between sending a WODM_CLOSE notification and receiving a WODM_CLOSE message.
I don't know if this solves the stuttering sound issue or how to go about correcting the winmm:wave tests, though.