From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: When to start the capture device? Date: Fri, 21 Sep 2007 16:16:31 +0200 Message-ID: References: <005101c7fb13$511e5040$aea4c380@dream.eng.uci.edu> <20070920101427.2499dd58.alsauser@pragmasoft.com> <20070920114612.27b70757.alsauser@pragmasoft.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id B354124617 for ; Fri, 21 Sep 2007 16:16:31 +0200 (CEST) In-Reply-To: <20070920114612.27b70757.alsauser@pragmasoft.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: "J. Scott Merritt" Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 20 Sep 2007 11:46:12 -0400, J. Scott Merritt wrote: > > On Thu, 20 Sep 2007 16:23:30 +0200 > Takashi Iwai wrote: > > > snd_pcm_prepare() is required to recover the stream from XRUN or any > > other errors. But, for the recovery purpose, we have now > > snd_pcm_recover() as a generic solution, too. > > It appears that (currently) the additional benefit of snd_pcm_recover > is simply that of resuming the stream. However, I haven't seen any > details on when/why a stream would become suspened and require this > type of recovery. The audio apps (or system) usually want to know when the stream is stopped unexpectedly. The suspend/resume is exactly as same as XRUN from this perspective. That's why it's handled by the application. snd_pcm_recover() is provided to handle it more easily. > Also, in SALSA, it appears that snd_pcm_recover can -block- even if > the stream has been configured for non-blocking behavior. It's with ALSA-lib, too. The snd_pcm_recover() code is identical in both libraries. This is the function that may block regardless what mode you use. The non-blocking mode isn't specified for ioctls but for read/write in general. In theory, the normal snd_pcm_prepare() could block (take some time) if the driver is implemented in such a way. Takashi