Comment 57 for bug 1551041

Revision history for this message
sudodus (nio-wiklund) wrote :

Raymond,

The committer, Takashi Iwai, decided to help us. Can you use this patch (and help me test it) :-)

Nio
-----

OK, I see why this bogus report reappears again. The message tag was
reverted back after some commit for correctness.

Now I rephrased the text again so that it won't hit some stupid daemon
any longer. It'll be included in 4.6 kernel, and then backported to
stable kernels later.

But, note that this doesn't fix the issue. For a proper fix, a patch
like below would be needed. Let me know if this works for you. (But
I have no idea about Ubuntu, so I cannot tell you how to apply the
patch, ask other Ubuntu people about it

Takashi

-- 8< --
From: Takashi Iwai at SUSE
Subject: [PATCH] ALSA: au88x0: Fix overlapped PCM pointer

au88x0 hardware seems returning the current pointer at the buffer
boundary instead of going back to zero. This results in spewing
warnings from PCM core.

This patch corrects the return value from the pointer callback within
the proper value range, just returning zero if the position is equal
or above the buffer size.

Signed-off-by: Takashi Iwai at SUSE
---
 sound/pci/au88x0/au88x0_pcm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c
index a6d6d8d0867a..df5741a78fd2 100644
--- a/sound/pci/au88x0/au88x0_pcm.c
+++ b/sound/pci/au88x0/au88x0_pcm.c
@@ -432,7 +432,10 @@ static snd_pcm_uframes_t snd_vortex_pcm_pointer(struct snd_pcm_substream *substr
 #endif
  //printk(KERN_INFO "vortex: pointer = 0x%x\n", current_ptr);
  spin_unlock(&chip->lock);
- return (bytes_to_frames(substream->runtime, current_ptr));
+ current_ptr = bytes_to_frames(substream->runtime, current_ptr);
+ if (current_ptr >= substream->runtime->buffer_size)
+ current_ptr = 0;
+ return current_ptr;
 }

 /* operators */
--
2.7.2