From: Takashi Iwai Date: Tue, 16 Oct 2012 14:52:26 +0000 (+0200) Subject: ALSA: hda - Stop LPIB delay counting on broken hardware X-Git-Tag: v3.7-rc2~30^2~3 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=1f04661fde9deda4a2cd5845258715a22d8af197;p=~emulex%2Finfiniband.git ALSA: hda - Stop LPIB delay counting on broken hardware If LPIB reports a pretty bad value, we can't trust such hardware for calculating the PCM delay. Automatically turn off the delay counting when such a problem is encountered. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=48911 Cc: [v3.6] Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index ecf277506ad..72b085ae7d4 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -2158,9 +2158,12 @@ static unsigned int azx_get_position(struct azx *chip, if (delay < 0) delay += azx_dev->bufsize; if (delay >= azx_dev->period_bytes) { - snd_printdd("delay %d > period_bytes %d\n", - delay, azx_dev->period_bytes); - delay = 0; /* something is wrong */ + snd_printk(KERN_WARNING SFX + "Unstable LPIB (%d >= %d); " + "disabling LPIB delay counting\n", + delay, azx_dev->period_bytes); + delay = 0; + chip->driver_caps &= ~AZX_DCAPS_COUNT_LPIB_DELAY; } azx_dev->substream->runtime->delay = bytes_to_frames(azx_dev->substream->runtime, delay);