Commit c87d9732 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: Enable PCM hw_ptr_jiffies check only in xrun_debug mode

The PCM hw_ptr jiffies check results sometimes in problems when a
hardware doesn't give smooth hw_ptr updates.  So far, au88x0 and some
other drivers appear not working due to this strict check.
However, this check is a nice debug tool, and the capability should be
still kept.

Hence, we disable this check now as default unless the user enables it
by setting the xrun_debug mode to the specific stream via a proc file.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 6af3fb72
...@@ -104,6 +104,11 @@ card*/pcm*/xrun_debug ...@@ -104,6 +104,11 @@ card*/pcm*/xrun_debug
When this value is greater than 1, the driver will show the When this value is greater than 1, the driver will show the
stack trace additionally. This may help the debugging. stack trace additionally. This may help the debugging.
Since 2.6.30, this option also enables the hwptr check using
jiffies. This detects spontaneous invalid pointer callback
values, but can be lead to too much corrections for a (mostly
buggy) hardware that doesn't give smooth pointer updates.
card*/pcm*/sub*/info card*/pcm*/sub*/info
The general information of this PCM sub-stream. The general information of this PCM sub-stream.
......
...@@ -249,6 +249,11 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream) ...@@ -249,6 +249,11 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
new_hw_ptr = hw_base + pos; new_hw_ptr = hw_base + pos;
} }
} }
/* Do jiffies check only in xrun_debug mode */
if (!xrun_debug(substream))
goto no_jiffies_check;
/* Skip the jiffies check for hardwares with BATCH flag. /* Skip the jiffies check for hardwares with BATCH flag.
* Such hardware usually just increases the position at each IRQ, * Such hardware usually just increases the position at each IRQ,
* thus it can't give any strange position. * thus it can't give any strange position.
...@@ -336,7 +341,9 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream) ...@@ -336,7 +341,9 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
hw_base = 0; hw_base = 0;
new_hw_ptr = hw_base + pos; new_hw_ptr = hw_base + pos;
} }
if (((delta * HZ) / runtime->rate) > jdelta + HZ/100) { /* Do jiffies check only in xrun_debug mode */
if (xrun_debug(substream) &&
((delta * HZ) / runtime->rate) > jdelta + HZ/100) {
hw_ptr_error(substream, hw_ptr_error(substream,
"hw_ptr skipping! " "hw_ptr skipping! "
"(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n", "(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment