From: Takashi Iwai Subject: Re: More snd_pcm_ioplug_avail_update() questions Date: Thu, 26 Jul 2018 16:37:03 +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 263B126739D for ; Thu, 26 Jul 2018 16:37:04 +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 Thu, 26 Jul 2018 16:19:19 +0200, Rob Duncan wrote: > > > At 00:04 on Thu, Jul 26 2018, Takashi 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. > > But what I see is that snd_pcm_rate_avail_update() commits data in the > slave PCM in units of slave->period_size (via > snd_pcm_rate_grab_next_period()), which means that if there is a partial > period in the slave PCM mmap it will not be committed. > > In other words, not all the available data will be commmitted before the > next call to snd_pcm_ioplug_avail_update(). This means that the data > will be discarded the next time that snd_pcm_ioplug_avail_update() is > called. OK, I seem to have misunderstood about what you meant as committed in the context. Yes, if the available is partial, it might be not committed. But I don't understand the next part. How will it be discarded at the next snd_pcm_ioplug_avail_update()? The data remains on the buffer, and applptr isn't changed. Takashi