Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f04661f authored by Takashi Iwai's avatar Takashi Iwai
Browse files

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: <stable@vger.kernel.org> [v3.6]
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 128960a9
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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",
			snd_printk(KERN_WARNING SFX
				   "Unstable LPIB (%d >= %d); "
				   "disabling LPIB delay counting\n",
				   delay, azx_dev->period_bytes);
			delay = 0; /* something is wrong */
			delay = 0;
			chip->driver_caps &= ~AZX_DCAPS_COUNT_LPIB_DELAY;
		}
		azx_dev->substream->runtime->delay =
			bytes_to_frames(azx_dev->substream->runtime, delay);