From: Takashi Iwai Subject: Re: More snd_pcm_ioplug_avail_update() questions Date: Thu, 26 Jul 2018 09:04:28 +0200 Message-ID: References: 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 (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id CD20826772E for ; Thu, 26 Jul 2018 09:04:29 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Rob Duncan Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On Wed, 25 Jul 2018 23:52:36 +0200, Rob Duncan wrote: > > Is it required that all available data has been committed between calls > to snd_pcm_ioplug_avail_update() on an IO plugin capture stream? Yes, the capture data is committed. The snd_pcm_ioplug_hw_ptr_update() should have reported the amount of data the slave PCM can actually transfer. Hence the transfer call thereafter must fulfill the whole requested data. The capture in ioplug is a sort of mmap emulation. On real hardware, the mmap data is already committed before update_avail is called, update_avail just follows the already committed amount. In the emulation mode, it's other way round; the data is committed at the point hwptr is update, i.e. avail_update is called. Takashi > If this is not a requirement then there can still be uncommitted data in > the mmap after the current appl_ptr. This data will get overwritten by > the transfer call. > > If it is a requirement then snd_pcm_rate_avail_update() seems to be > doing the wrong thing, because it only commits in units of the period > size, which means that there could be a partial period left in the mmap. > > Can someone clarify what the contract is for these calls? > > Thanks, > > Rob. > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >