ALSA: Enable PCM hw_ptr_jiffies check only in xrun_debug mode
[firefly-linux-kernel-4.4.55.git] / sound / core / pcm_lib.c
index 3eea98a4e65ac4e5816963e493945222e92ace4d..d659995ac3ac7be2f20e488c71b7b3fe405a879e 100644 (file)
@@ -249,6 +249,11 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
                        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.
         * Such hardware usually just increases the position at each IRQ,
         * thus it can't give any strange position.
@@ -336,7 +341,9 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
                        hw_base = 0;
                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 skipping! "
                             "(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n",