diff options
author | Timo Wischer <twischer@de.adit-jv.com> | 2018-02-23 10:28:51 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-02-24 11:41:22 +0100 |
commit | 543a9eac5d857c5a629e81c37d97102de537516a (patch) | |
tree | d518c919164a83f9b22476ee9cb2e653d7be9376 /include | |
parent | af531606b73634b56ec0ec73fbea8297a7752172 (diff) | |
download | alsa-lib-543a9eac5d857c5a629e81c37d97102de537516a.tar.gz |
pcm: ioplug: Use boundary for wrap around
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@de.adit-jv.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/pcm_ioplug.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/pcm_ioplug.h b/include/pcm_ioplug.h index 1c845940..e75f973e 100644 --- a/include/pcm_ioplug.h +++ b/include/pcm_ioplug.h @@ -65,6 +65,8 @@ typedef snd_pcm_ioplug_callback snd_pcm_ioplug_callback_t; */ #define SND_PCM_IOPLUG_FLAG_LISTED (1<<0) /**< list up this PCM */ #define SND_PCM_IOPLUG_FLAG_MONOTONIC (1<<1) /**< monotonic timestamps */ +/** hw pointer wrap around at boundary instead of buffer_size */ +#define SND_PCM_IOPLUG_FLAG_BOUNDARY_WA (1<<2) /* * Protocol version @@ -133,6 +135,9 @@ struct snd_pcm_ioplug_callback { int (*stop)(snd_pcm_ioplug_t *io); /** * get the current DMA position; required, called inside mutex lock + * \return buffer position up to buffer_size or + * when #SND_PCM_IOPLUG_FLAG_BOUNDARY_WA flag is set up to boundary or + * a negative error code for Xrun */ snd_pcm_sframes_t (*pointer)(snd_pcm_ioplug_t *io); /** |