ALSA: intel8x0 - Fix PCM position craziness
authorTakashi Iwai <tiwai@suse.de>
Mon, 15 Jun 2009 10:31:38 +0000 (12:31 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 15 Jun 2009 10:36:06 +0000 (12:36 +0200)
The PCM pointer callback sometimes returns invalid positions and this
screws up the hw_ptr updater in PCM core.  Especially since now the
jiffies check is optional with xrun_debug, the invalid position is
handled as is, and causes serious sound skips, etc.

This patch simplifies the position-fix strategy in intel8x0 to be more
robust:
- just falls back to the last position if bogus position is detected
- another sanity check for the backward move of the position due to
  a race of register update and the base-index update

This patch is applicable also for 2.6.30.

Tested-by: David Miller <davem@davemloft.net>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

No differences found