I'm not having much luck with sound this week-end :-( First there was the crash in ALSA_WaveInit() (an old bug apparently), but now the winmm test either gets stuck or crashes.
When it gets stuck it's because I get:
trace:wave:wodUpdatePlayedTotal dwPlayedTotal=21987 dwWrittenTotal=22050 delay=63 trace:wave:wodPlayer_NotifyCompletions still playing 0x4069fd1c (22050/21987) trace:wave:wodPlayer waiting 2ms (7,2) trace:wave:wodUpdatePlayedTotal dwPlayedTotal=21987 dwWrittenTotal=22050 delay=63 ...
So the problem is that everything has been played but because snd_pcm_delay() keeps returning 63, dwPlayedTotal never reaches the 22050 that would signal the completion of the first tone.
Now it seems like snd_pcm_delay() should return 0 after a while so this looks like an Alsa bug (0.9.6). Is this a known bug? Is there a way to work around it? (besides commenting out the call to snd_pcm_delay())
And when I don't get into the above infinite loop it's because I've crashed before with an Alsa assertion:
trace:wave:wodPlayer waiting 7ms (7,4294967295) trace:wave:wodUpdatePlayedTotal dwPlayedTotal=11781 dwWrittenTotal=17184 delay=5403 trace:wave:wodPlayer_WriteMaxFrags Writing wavehdr 0x4069fd1c.17184[22050] trace:wave:wodPlayer_WriteMaxFrags 1065 dwLength=2433 toWrite=110 0010:Call ntdll.RtlAcquireResourceShared(4037c168,00000001) ret=404e0751 0010:Ret ntdll.RtlAcquireResourceShared() retval=00000001 ret=404e0751 0010:Call ntdll.RtlReleaseResource(4037c168) ret=404e08ae 0010:Ret ntdll.RtlReleaseResource() retval=00000000 ret=404e08ae 0010:Call ntdll.RtlTryEnterCriticalSection(40340098) ret=404e0519 0010:Ret ntdll.RtlTryEnterCriticalSection() retval=00000001 ret=404e0519 0010:Call ntdll.RtlTryEnterCriticalSection(40340098) ret=404e0519 0010:Ret ntdll.RtlTryEnterCriticalSection() retval=00000001 ret=404e0519 0010:Call ntdll.RtlTryEnterCriticalSection(40340098) ret=404e0519 0010:Ret ntdll.RtlTryEnterCriticalSection() retval=00000001 ret=404e0519 wine-kthread: pcm.c:5899: snd_pcm_mmap_commit: Assertion `frames <= snd_pcm_mmap_avail(pcm)' failed.
The interesting things are that wwo->write points to snd_pcm_mmap_writei(). This assertion would seem to imply that we are writing too much stuff at once?
On Mon, 26 Apr 2004 01:03:41 +0200, Francois Gouget wrote:
Now it seems like snd_pcm_delay() should return 0 after a while so this looks like an Alsa bug (0.9.6). Is this a known bug? Is there a way to work around it?
I'd really think about upgrading ALSA - the volume of bugfixes that have been put in lately is just unbelievable. In fact virtually all the releases in the last 6 months have been bugfixes, so it pays to be on the very latest code I think.