summaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-03-10 21:03:09 +0100
committerTakashi Iwai <tiwai@suse.de>2016-04-26 09:55:42 +0200
commit58a8738cfcdec389b3764a636303f97b57f85193 (patch)
tree9161a56c1a4e2f588aa4117575d6cd4d544b5153 /sound/pci
parentd2c5cf88d5282de258f4eb6ab40040b80a075cd8 (diff)
downloadop-kernel-dev-58a8738cfcdec389b3764a636303f97b57f85193.zip
op-kernel-dev-58a8738cfcdec389b3764a636303f97b57f85193.tar.gz
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 <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/au88x0/au88x0_pcm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c
index a6d6d8d..df5741a 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 */
OpenPOWER on IntegriCloud