]> git.alsa-project.org Git - alsa-plugins.git/commit
jack: Use boundary as hw_ptr wrap around
authorTimo Wischer <twischer@de.adit-jv.com>
Fri, 23 Feb 2018 14:18:08 +0000 (15:18 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sat, 24 Feb 2018 10:42:44 +0000 (11:42 +0100)
commit3e6ace6fe045c580dc5490d87eff6b616f7769ef
treee90e6e97b90e74cb2af8f2cd4cea6592077992e7
parent21839e981a4b7c7178c1a473f20460c003e13db4
jack: Use boundary as hw_ptr wrap around

instead of using buffer_size as wrap around.

This is required to detect Xruns.

It is also required to allow the JACK thread
to processes the whole ALSA audio buffer at once
without calling snd_pcm_avail_update() in between.

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.

Due to that the user application would not recognize
that the complete audio buffer was copied.

Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
jack/pcm_jack.c