[alsa-devel] Event flood on USB disconnect

Clemens Ladisch clemens at ladisch.de
Mon Oct 3 23:50:41 CEST 2011


Colin Guthrie wrote:
> Would a POLLERR|POLLNVAL be received any time
> when normal operations will continue afterwards? e.g. should we use this
> error as an indicator to ignore it forever or, e.g., just for a finite
> period of time like 1s.

POLLERR means that the PCM device is in a state where it cannot transfer
data.  This typically happens on an xrun or when the device is unplugged,
if the first system call after that event is poll() and not write().
The error handling should be the same (snd_pcm_prepare(), which might
fail).

A disconnected device returns POLLERR|POLLNVAL, while any other error
state returns POLLOUT|POLLERR.


Regards,
Clemens


More information about the Alsa-devel mailing list