Re: underruns and POLLERR when copying audio frames

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

 



Stefan Schoenleitner wrote:
> I have some code that basically captures audio frames from one device
> and then writes it for playback to another device.

How do you synchronize the clocks of both devices?

> Ideally mmapped IO could be used for such a task,

Why would mmap be more ideal?

> My idea would be to just increment avail_min to something bigger, so
> that more frames are being buffered before playback starts.
> Would this work ?

Yes; to avoid underruns, try to have buffer as full as possible, and try
to use a bigger buffer.  However, this will increase latency.

To avoid overruns in the capture device, use a bigger buffer, which will
_not_ increase latency.

> 2. Another idea would be to do some buffering on my own in the application.

This is bascially the same as the first idea, except that you have to
manage this buffer yourself.  This might be worthwile if the devices do
not have big enough buffers.


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