[alsa-devel] underruns and POLLERR when copying audio frames

Stefan Schoenleitner dev.c0debabe at gmail.com
Wed Jul 21 12:20:10 CEST 2010


Clemens Ladisch wrote:
> Stefan Schoenleitner wrote:
>> Clemens Ladisch wrote:
>>> How do you synchronize the clocks of both devices?
>> I don't.  [...]
>> I guess if clock drift gets too high, I will get xruns as well ?
> 
> Yes.

Hmm, ok.
For now I will just add buffering and hope that the buffer is big enough
 so that there will be no xruns for reasonable long amounts of time.
In case I get troubles anyway, is there some kind of way to synchronize
clocks between the ALSA stack running on one system with the stack on
another system ?


>> But as mmapping just seems to work for files, I no longer think it is
>> possible.
> 
> Some optimization is possible even when only one device supports mmap:
> When you want to copy from the hardware device to the plugin, you could
> call the plugin's snd_pcm_writei with an address in the sound card's
> buffer as the source.

right.

Thanks four your input,

cheers,
stefan



More information about the Alsa-devel mailing list