This is the nth day I'm stuck reading the ALSA-documentation over and over again, and I'm at a loss figuring out whats wrong.
Basically, I have a running thread capturing data from an ALSA-device, and within useconds I get: "samptest: pcm.c:5889: snd_pcm_mmap_commit: Assertion `frames <= snd_pcm_mmap_avail(pcm)' failed." (samptest is the name of my executable)
The reason for me being so confused is that this occures at the call "snd_pcm_readi(snd_pcm_t *, void *, snd_pcm_uframes_t )", which for starters ain't mmap :) I use "snd_pcm_delay(snd_pcm_t *, snd_pcm_sframes_t *)" to verify that there is sufficient data in the queue, before calling readi(), since I halfway expected that the above error in some obscure way was from me trying to read too much from the queue, but this one just informs me that there are the 385 samples (24ms), which happens to be the buffer-size (periods set to 4, buffersize_near set to 48). I have tried to pass "385","48" and the result of delay() as the amount, just to make sure.
I have found that if I increase my buffer-size to 3 times its current level, I can avoid the above error (at least for the some seconds I leave it running), but this incurs an unacceptably high latency. I currently require that latency be kept quite low, and with OSS I have no problem having a buffer-size ~= 6 usec. Unfortunately, I tend to get overruns when I increase my buffer-size to a level where I do not get the above error.
I hope someone can help me, or point me in the direction of a documentation I can understand and use (honestly, too often I've found that the documentation is "insufficient" - at least for me)
Cheers,
/Niels Chr.
-- My sense of self is fragile as it is without someone stealing me from me. |
signature.asc
Description: This is a digitally signed message part