[alsa-devel] More snd_pcm_ioplug_avail_update() questions
Takashi Iwai
tiwai at suse.de
Thu Jul 26 09:04:28 CEST 2018
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 at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
More information about the Alsa-devel
mailing list