diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-05-27 04:53:33 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-05-27 05:04:30 -0400 |
commit | c87d9732004b3f8fd82d729f12ccfb96c0df279e (patch) | |
tree | f265b35a8c34fa7d0bc41c46b519b330a4d68e8e /sound | |
parent | 6af3fb72d2437239e5eb13a59e95dc43ccab3e8f (diff) |
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: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/pcm_lib.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 3eea98a4e65a..d659995ac3ac 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -249,6 +249,11 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream) | |||
249 | new_hw_ptr = hw_base + pos; | 249 | new_hw_ptr = hw_base + pos; |
250 | } | 250 | } |
251 | } | 251 | } |
252 | |||
253 | /* Do jiffies check only in xrun_debug mode */ | ||
254 | if (!xrun_debug(substream)) | ||
255 | goto no_jiffies_check; | ||
256 | |||
252 | /* Skip the jiffies check for hardwares with BATCH flag. | 257 | /* Skip the jiffies check for hardwares with BATCH flag. |
253 | * Such hardware usually just increases the position at each IRQ, | 258 | * Such hardware usually just increases the position at each IRQ, |
254 | * thus it can't give any strange position. | 259 | * thus it can't give any strange position. |
@@ -336,7 +341,9 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream) | |||
336 | hw_base = 0; | 341 | hw_base = 0; |
337 | new_hw_ptr = hw_base + pos; | 342 | new_hw_ptr = hw_base + pos; |
338 | } | 343 | } |
339 | if (((delta * HZ) / runtime->rate) > jdelta + HZ/100) { | 344 | /* Do jiffies check only in xrun_debug mode */ |
345 | if (xrun_debug(substream) && | ||
346 | ((delta * HZ) / runtime->rate) > jdelta + HZ/100) { | ||
340 | hw_ptr_error(substream, | 347 | hw_ptr_error(substream, |
341 | "hw_ptr skipping! " | 348 | "hw_ptr skipping! " |
342 | "(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n", | 349 | "(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n", |