[alsa-devel] [PATCH IO plug API 1/1] ioplug: Use boundary for wrap around

Takashi Iwai tiwai at suse.de
Fri Feb 23 11:40:01 CET 2018


On Fri, 23 Feb 2018 10:28:51 +0100,
<twischer at de.adit-jv.com> wrote:
> 
> From: Timo Wischer <twischer at de.adit-jv.com>
> 
> if requested by the IO plugin
> 
> Without this changes an IO plugin is not able to report
> that buffer_size frames were read from the buffer.
> When the buffer was full this is a valid action and
> has not to be handled as an under run.
> 
> For example when the hw_ptr will be updated with
> hw_ptr += buffer_size
> and it is using the buffer_size as wrap around
> hw_ptr %= buffer_size
> would result in the same value as before the add operation.
> 
> Signed-off-by: Timo Wischer <twischer at de.adit-jv.com>
> ---
> Hello Takashi,
> 
> > If you need to improve such a situation, you'd have to fix in the
> > ioplug implementation itself, not the jack plugin.
> 
> A have attached a patch which improves the IO plug API.
> If you are happy with this solution I would also adapt the pending
> JACK plugin patch and set the SND_PCM_IOPLUG_FLAG_BOUNDARY_WA flag.

Yep, this looks better now.

A slightly complex procedure when extending an API is that you need
to check the existence of SND_PCM_IOPLUG_FLAG_BOUNDARY_WA in jack
plugin side at the compilation time.  Or make AM_PATH_ALSA() in
alsa-utils/configure.ac aligned with this change, but it won't work
until the release of alsa-lib itself.


thanks,

Takashi


More information about the Alsa-devel mailing list