Re: Question about device recovery when under/over run error case

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

 



On Mon, 18 Jan 2016 07:04:03 +0100,
Kuninori Morimoto wrote:
> 
> Hi Sakamoto-san
> 
> Thank you for your feedback
> 
> > > 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.
> 
> I think we can use snd_pcm_stop_xrun() for this purpose.

Right.  But beware of locking by this function.  Unlike snd_pcm_stop()
this function takes the stream lock by itself.


Takashi
_______________________________________________
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