All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Cc: alsa-devel@alsa-project.org, Harald Arnesen <harald@skogtun.org>,
	Alex Xu <alex_y_xu@yahoo.ca>
Subject: Re: Intel HD Audio: sound stops working in Xen PV dom0 in >=5.17
Date: Fri, 09 Dec 2022 09:10:19 +0100	[thread overview]
Message-ID: <87tu256lqs.wl-tiwai@suse.de> (raw)
In-Reply-To: <Y5KPAs6f7S2dEoxR@mail-itl>

On Fri, 09 Dec 2022 02:27:30 +0100,
Marek Marczykowski-Górecki wrote:
> 
> Hi,
> 
> Under Xen PV dom0, with Linux >= 5.17, sound stops working after few
> hours. pavucontrol still shows meter bars moving, but the speakers
> remain silent. At least on some occasions I see the following message in
> dmesg:
> 
>   [ 2142.484553] snd_hda_intel 0000:00:1f.3: Unstable LPIB (18144 >= 6396); disabling LPIB delay counting
> 
> I'm not sure if that happens before sound stops working, after, of if
> it's related at all, but that's pretty much the only sound-related error
> I found in logs.
> When the issue happens, on rare occasions it starts working again later
> for a short time, but generally the fix is to reboot. Reloading all
> snd_* modules (surprisingly) do not help. I don't know what exactly
> triggers the issue, sometimes is happen after short time like 15 minutes
> uptime, but usually after several hours. I guess it depends on usage
> pattern, but I haven't spotted any specific relation.
> 
> I managed to bisect it to this commit:
> 
>     2c95b92ecd92e784785b1db8cccc4f0f2bfa850c is the first bad commit
>     commit 2c95b92ecd92e784785b1db8cccc4f0f2bfa850c
>     Author: Takashi Iwai <tiwai@suse.de>
>     Date:   Tue Nov 16 08:33:58 2021 +0100
> 
>         ALSA: memalloc: Unify x86 SG-buffer handling (take#3)
>         
>         This is a second attempt to unify the x86-specific SG-buffer handling
>         code with the new standard non-contiguous page handler.
>         
>         The first try (in commit 2d9ea39917a4) failed due to the wrong page
>         and address calculations, hence reverted.  (And the second try failed
>         due to a copy&paste error.)  Now it's corrected with the previous fix
>         for noncontig pages, and the proper sg page iteration by this patch.
>         
>         After the migration, SNDRV_DMA_TYPE_DMA_SG becomes identical with
>         SNDRV_DMA_TYPE_NONCONTIG on x86, while others still fall back to
>         SNDRV_DMA_TYPE_DEV.
>         
>         Tested-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
>         Tested-by: Harald Arnesen <harald@skogtun.org>
>         Link: https://lore.kernel.org/r/20211017074859.24112-4-tiwai@suse.de
>         Link: https://lore.kernel.org/r/20211109062235.22310-1-tiwai@suse.de
>         Link: https://lore.kernel.org/r/20211116073358.19741-1-tiwai@suse.de
>         Signed-off-by: Takashi Iwai <tiwai@suse.de>
> 
>      include/sound/memalloc.h |  14 ++--
>      sound/core/Makefile      |   1 -
>      sound/core/memalloc.c    |  53 ++++++++++++-
>      sound/core/sgbuf.c       | 201 -----------------------------------------------
>      4 files changed, 56 insertions(+), 213 deletions(-)
>      delete mode 100644 sound/core/sgbuf.c
> 
> I've seen further follow ups to this commit, but I still observe this
> issue on Linux 6.0.8.
> 
> I have observed this issue on KBL-based system, but I've got reports
> also from users of other platforms (including as old as Sandy Bridge).
> 
> I tried to include all relevant information above, but some more details
> can be found at original report at
> https://github.com/QubesOS/qubes-issues/issues/7465
> 
> Any ideas?

Hm, is it specific to Xen, i.e. if you run the normal kernel on the
same machine, does it still work?

In anyway, please check the behavior with 6.1-rc8 + the commit
cc26516374065a34e10c9a8bf3e940e42cd96e2a
    ALSA: memalloc: Allocate more contiguous pages for fallback case
from for-next of my sound git tree (which will be in 6.2-rc1).

If the problem persists, another thing to check is the hack below
works.


thanks,

Takashi

-- 8< --
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1808,9 +1808,16 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
 	if (err < 0)
 		return err;
 
+#if 0
 	/* use the non-cached pages in non-snoop mode */
 	if (!azx_snoop(chip))
 		azx_bus(chip)->dma_type = SNDRV_DMA_TYPE_DEV_WC_SG;
+#else
+	if (!azx_snoop(chip))
+		azx_bus(chip)->dma_type = SNDRV_DMA_TYPE_DEV_SG;
+	else
+		azx_bus(chip)->dma_type = SNDRV_DMA_TYPE_DEV;
+#endif
 
 	if (chip->driver_type == AZX_DRIVER_NVIDIA) {
 		dev_dbg(chip->card->dev, "Enable delay in RIRB handling\n");

       reply	other threads:[~2022-12-09  8:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Y5KPAs6f7S2dEoxR@mail-itl>
2022-12-09  8:10 ` Takashi Iwai [this message]
2022-12-09 12:40   ` Intel HD Audio: sound stops working in Xen PV dom0 in >=5.17 Marek Marczykowski-Górecki
2022-12-10  1:00     ` Marek Marczykowski-Górecki
2022-12-10 16:17       ` Marek Marczykowski-Górecki
2022-12-20  4:43         ` Marek Marczykowski-Górecki
2022-12-22  8:09         ` Takashi Iwai
2022-12-27 15:26           ` Marek Marczykowski-Górecki
2023-01-16 15:55             ` Takashi Iwai
2023-01-17  7:58               ` Takashi Iwai
2023-01-17 11:36                 ` Marek Marczykowski-Górecki
2023-01-17 14:21                   ` Marek Marczykowski-Górecki
2023-01-17 14:33                     ` Takashi Iwai
2023-01-17 16:49                       ` Marek Marczykowski-Górecki
2023-01-17 16:52                         ` Takashi Iwai
2023-01-17 20:34                           ` Marek Marczykowski-Górecki
2023-01-18  8:59                             ` Takashi Iwai
2023-01-18 10:39                               ` Marek Marczykowski-Górecki
2023-01-18 12:39                                 ` Takashi Iwai
2023-01-20  1:10                                   ` Marek Marczykowski-Górecki
2023-01-20  2:24                                     ` Marek Marczykowski-Górecki
2023-01-20  7:26                                       ` Takashi Iwai
2023-01-20 12:11                                         ` Marek Marczykowski-Górecki
2023-01-20 13:19                                           ` Takashi Iwai
2023-01-23 21:31                                             ` Marek Marczykowski-Górecki
2023-01-24  9:24                                               ` 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=87tu256lqs.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alex_y_xu@yahoo.ca \
    --cc=alsa-devel@alsa-project.org \
    --cc=harald@skogtun.org \
    --cc=marmarek@invisiblethingslab.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.