aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/core/pcm_lib.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 0f299a5ad6da..dd9126b92c19 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -263,6 +263,9 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
263 if (runtime->hw.info & SNDRV_PCM_INFO_BATCH) 263 if (runtime->hw.info & SNDRV_PCM_INFO_BATCH)
264 goto no_jiffies_check; 264 goto no_jiffies_check;
265 hdelta = new_hw_ptr - old_hw_ptr; 265 hdelta = new_hw_ptr - old_hw_ptr;
266 if (hdelta < runtime->delay)
267 goto no_jiffies_check;
268 hdelta -= runtime->delay;
266 jdelta = jiffies - runtime->hw_ptr_jiffies; 269 jdelta = jiffies - runtime->hw_ptr_jiffies;
267 if (((hdelta * HZ) / runtime->rate) > jdelta + HZ/100) { 270 if (((hdelta * HZ) / runtime->rate) > jdelta + HZ/100) {
268 delta = jdelta / 271 delta = jdelta /
@@ -349,8 +352,12 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
349 new_hw_ptr = hw_base + pos; 352 new_hw_ptr = hw_base + pos;
350 } 353 }
351 /* Do jiffies check only in xrun_debug mode */ 354 /* Do jiffies check only in xrun_debug mode */
352 if (xrun_debug(substream, 4) && 355 if (!xrun_debug(substream, 4))
353 ((delta * HZ) / runtime->rate) > jdelta + HZ/100) { 356 goto no_jiffies_check;
357 if (delta < runtime->delay)
358 goto no_jiffies_check;
359 delta -= runtime->delay;
360 if (((delta * HZ) / runtime->rate) > jdelta + HZ/100) {
354 hw_ptr_error(substream, 361 hw_ptr_error(substream,
355 "hw_ptr skipping! " 362 "hw_ptr skipping! "
356 "(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n", 363 "(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n",
@@ -359,6 +366,7 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
359 ((delta * HZ) / runtime->rate)); 366 ((delta * HZ) / runtime->rate));
360 return 0; 367 return 0;
361 } 368 }
369 no_jiffies_check:
362 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && 370 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
363 runtime->silence_size > 0) 371 runtime->silence_size > 0)
364 snd_pcm_playback_silence(substream, new_hw_ptr); 372 snd_pcm_playback_silence(substream, new_hw_ptr);