aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2010-01-13 02:12:31 -0500
committerJaroslav Kysela <perex@perex.cz>2010-01-13 02:12:31 -0500
commited69c6a8eef679f2783848ed624897a937a434ac (patch)
tree5eb125ef32231da8f17cfe49b77d7db8fc20cf02 /sound/core
parentc4cfe66c4c2d5a91b3734ffb4e2bad0badd5c874 (diff)
ALSA: pcm_lib - fix wrong delta print for jiffies check
The previous jiffies delta was 0 in all cases. Use hw_ptr variable to store and print original value. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/pcm_lib.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 0ee7e807c964..5417f7dce834 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -394,6 +394,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
394 + HZ/100); 394 + HZ/100);
395 /* move new_hw_ptr according jiffies not pos variable */ 395 /* move new_hw_ptr according jiffies not pos variable */
396 new_hw_ptr = old_hw_ptr; 396 new_hw_ptr = old_hw_ptr;
397 hw_base = delta;
397 /* use loop to avoid checks for delta overflows */ 398 /* use loop to avoid checks for delta overflows */
398 /* the delta value is small or zero in most cases */ 399 /* the delta value is small or zero in most cases */
399 while (delta > 0) { 400 while (delta > 0) {
@@ -403,8 +404,6 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
403 delta--; 404 delta--;
404 } 405 }
405 /* align hw_base to buffer_size */ 406 /* align hw_base to buffer_size */
406 hw_base = new_hw_ptr - (new_hw_ptr % runtime->buffer_size);
407 delta = 0;
408 hw_ptr_error(substream, 407 hw_ptr_error(substream,
409 "hw_ptr skipping! %s" 408 "hw_ptr skipping! %s"
410 "(pos=%ld, delta=%ld, period=%ld, " 409 "(pos=%ld, delta=%ld, period=%ld, "
@@ -412,9 +411,12 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
412 in_interrupt ? "[Q] " : "", 411 in_interrupt ? "[Q] " : "",
413 (long)pos, (long)hdelta, 412 (long)pos, (long)hdelta,
414 (long)runtime->period_size, jdelta, 413 (long)runtime->period_size, jdelta,
415 ((hdelta * HZ) / runtime->rate), delta, 414 ((hdelta * HZ) / runtime->rate), hw_base,
416 (unsigned long)old_hw_ptr, 415 (unsigned long)old_hw_ptr,
417 (unsigned long)new_hw_ptr); 416 (unsigned long)new_hw_ptr);
417 /* reset values to proper state */
418 delta = 0;
419 hw_base = new_hw_ptr - (new_hw_ptr % runtime->buffer_size);
418 } 420 }
419 no_jiffies_check: 421 no_jiffies_check:
420 if (delta > runtime->period_size + runtime->period_size / 2) { 422 if (delta > runtime->period_size + runtime->period_size / 2) {