[alsa-devel] Handle large period size end-of-stream situation

Clemens Ladisch clemens at ladisch.de
Thu Apr 4 19:08:45 CEST 2013


Gabriel M. Beddingfield wrote:
> So, if the hardware can detect it then the hardware needs to signal an interrupt for the XRUN.

The hardware typically doesn't know the application pointer.

> Another option... from userspace you can call SYNC_PTR (e.g.
> pcm_get_htimestamp() in tinyalsa) to update the hw and application
> pointers, then inspect them to detect when all the data is transferred.
> When you see all is played, immediately stop the stream.

ALSA checks for xruns before returning the pointer.  It's enough to just
ask for the pointer (or the state).


Regards,
Clemens


More information about the Alsa-devel mailing list