Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: perex@perex.cz, tiwai@suse.com, kai.vehmanen@linux.intel.com,
	alsa-devel@alsa-project.org
Subject: azx_get_pos_skl() induced system slowness
Date: Tue, 24 Aug 2021 11:38:08 -0600	[thread overview]
Message-ID: <402d5952-3bf6-5c0d-5276-8367bfe1542a@kernel.dk> (raw)

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


             reply	other threads:[~2021-08-25  6:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24 17:38 Jens Axboe [this message]
2021-08-25  6:14 ` azx_get_pos_skl() induced system slowness Takashi Iwai
2021-08-25 12:33   ` Jens Axboe
2021-08-26  6:08     ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=402d5952-3bf6-5c0d-5276-8367bfe1542a@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=alsa-devel@alsa-project.org \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox