Commit 947ca210 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: pcm - Fix hwptr buffer-size overlap bug

The fix 79452f0a introduced another
bug due to the missing offset for the overlapped hwptr.
When the hwptr goes back to zero, the delta value has to be corrected
with the buffer size.  Otherwise this causes looping sounds.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 89350640
...@@ -256,7 +256,7 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream) ...@@ -256,7 +256,7 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
delta = new_hw_ptr - hw_ptr_interrupt; delta = new_hw_ptr - hw_ptr_interrupt;
} }
if (delta < 0) { if (delta < 0) {
if (runtime->periods == 1) if (runtime->periods == 1 || new_hw_ptr < old_hw_ptr)
delta += runtime->buffer_size; delta += runtime->buffer_size;
if (delta < 0) { if (delta < 0) {
hw_ptr_error(substream, hw_ptr_error(substream,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment