Re: Handling non-buffer-sized MMAP requests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



louis@xxxxxxxxxxxxxxxx wrote:
> Hi everyone, I'm having some difficulty improving a full-duplex MMAP ALSA
> routine.  ALSA sometimes reports more samples available for input than my
> buffer can take, or asks for more samples than I have available.  Is this
> a buffer overrun/underrun? 

Yes.  (And this should happen only when you've disabled stopping on
an xrun, so you've asked for it.  :-)

> If I restart the streams in the case that too
> much input is available (on the assumption that it's an xrun) it seems to
> happen at the drop of a hat and makes things worse.  If I discard the
> excess input, that doesn't work well either.
> 
> What is the appropriate way to deal with this situation?

The best way would be to prevent this situation from happening, i.e.,
read the captured data from the buffer before it overflows.

(In the case of capturing, latency does _not_ depend on the buffer size,
so you should make the buffer as big as possible.)


Regards,
Clemens
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux