diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-03-19 05:01:47 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-03-19 05:01:47 -0400 |
commit | 5f513e1197f27e9a0bcfec0feaac59f976f4a37e (patch) | |
tree | b82a37f36b4153abc666ad67839d8ef694111bc9 /sound | |
parent | 98204646f2b15d368701265e4194b773a6f94600 (diff) |
ALSA: pcm - Reset invalid position even without debug option
Always reset the invalind hw_ptr position returned by the pointer
callback. The behavior should be consitent independently from the
debug option.
Also, add the printk_ratelimit() check to avoid flooding debug
prints.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/pcm_lib.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 302654769faf..92ed6d819225 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -159,11 +159,15 @@ snd_pcm_update_hw_ptr_pos(struct snd_pcm_substream *substream, | |||
159 | pos = substream->ops->pointer(substream); | 159 | pos = substream->ops->pointer(substream); |
160 | if (pos == SNDRV_PCM_POS_XRUN) | 160 | if (pos == SNDRV_PCM_POS_XRUN) |
161 | return pos; /* XRUN */ | 161 | return pos; /* XRUN */ |
162 | #ifdef CONFIG_SND_DEBUG | ||
163 | if (pos >= runtime->buffer_size) { | 162 | if (pos >= runtime->buffer_size) { |
164 | snd_printk(KERN_ERR "BUG: stream = %i, pos = 0x%lx, buffer size = 0x%lx, period size = 0x%lx\n", substream->stream, pos, runtime->buffer_size, runtime->period_size); | 163 | if (printk_ratelimit()) { |
164 | snd_printd(KERN_ERR "BUG: stream = %i, pos = 0x%lx, " | ||
165 | "buffer size = 0x%lx, period size = 0x%lx\n", | ||
166 | substream->stream, pos, runtime->buffer_size, | ||
167 | runtime->period_size); | ||
168 | } | ||
169 | pos = 0; | ||
165 | } | 170 | } |
166 | #endif | ||
167 | pos -= pos % runtime->min_align; | 171 | pos -= pos % runtime->min_align; |
168 | return pos; | 172 | return pos; |
169 | } | 173 | } |