Skip to content

Commit

Permalink
ALSA: hda - Stop LPIB delay counting on broken hardware
Browse files Browse the repository at this point in the history
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: <[email protected]> [v3.6]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Oct 16, 2012
1 parent 128960a commit 1f04661
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1f04661

Please sign in to comment.