azx_get_pos_skl() induced system slowness

Jens Axboe axboe at kernel.dk
Tue Aug 24 19:38:08 CEST 2021


Hi,

Got a new notebook recently, it's a Lenovo X1 Carbon 9th gen. Sound
works fine, but sometimes I get really stuttering playback from nestopia
and I finally decided to look into it. When this happens,
azx_get_pos_skl() is seemingly called a lot, at least it uses a ton of
CPU cycles. This comes and goes, sometimes 1 minute in between,
sometimes 2, and sometimes 30 seconds.

If I comment out the udelay() in that function it does seems to be
noticeably better, though it's not a complete fix. I guess it just
reduces the pain of calling it so many times?

This is running 5.14-rc7, but it's not a recent regression.

Any clues as to what this might be?

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 470753b36c8a..3c1f233e463f 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -878,7 +878,9 @@ static unsigned int azx_get_pos_skl(struct azx *chip, struct azx_dev *azx_dev)
 	 * for the possible boundary overlap; the read of DPIB fetches the
 	 * actual posbuf
 	 */
+#if 0
 	udelay(20);
+#endif
 	azx_skl_get_dpib_pos(chip, azx_dev);
 	return azx_get_pos_posbuf(chip, azx_dev);
 }

-- 
Jens Axboe



More information about the Alsa-devel mailing list