[alsa-devel] Question about device recovery when under/over run error case
Takashi Sakamoto
o-takashi at sakamocchi.jp
Mon Jan 18 06:03:17 CET 2016
Hi,
I'm not Mark but might answer it.
On 2016年01月18日 13:45, Kuninori Morimoto wrote:
> Our sound device needs recovery if under/over run error happen.
> Basically, this "recovery" means "restart hardware".
> But, in such case, who should recovers sound device, Kernel or Userland ?
>
> Current our sound driver recovers it by kernel automatically.
> (But I need do work more for it)
I think you should not recover it in kernel space, because 'hw_ptr' in
mapped page includes values unexpected by userspace application. (The
value may suddenly jump up to unexpected value after recovered.)
What driver in kernel land is to notify XRUN to the applications in your
case. If recovering processing includes event waiting, it should not be
executed in interrupt context.
> We considered that userland should know it, or, run it by himself (?)
> If userland should do it, which function should be called to announce
> error to userland from kernel ?
Userspace can get to know the XRUN state by calling some APIs. Then, it
can recover PCM substream by executing SNDRV_PCM_IOCTL_PREPARE ioctl.
Regards
Takashi Sakamoto
More information about the Alsa-devel
mailing list