All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Takashi Iwai <tiwai@suse.de>
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: Sat, 10 Dec 2022 17:17:42 +0100	[thread overview]
Message-ID: <Y5SxJ3IkhHSC/Psu@mail-itl> (raw)
In-Reply-To: <Y5PaF4LhQGIrKthy@mail-itl>


[-- Attachment #1.1: Type: text/plain, Size: 3235 bytes --]

On Sat, Dec 10, 2022 at 02:00:06AM +0100, Marek Marczykowski-Górecki wrote:
> On Fri, Dec 09, 2022 at 01:40:15PM +0100, Marek Marczykowski-Górecki wrote:
> > On Fri, Dec 09, 2022 at 09:10:19AM +0100, Takashi Iwai wrote:
> > > 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
> 
> Hit the issue again, this message did not appear in the log (or at least
> not yet).
> 
> (...)
> 
> > > 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).
> 
> This did not helped.
> 
> > Looking at the mentioned commits, there is one specific aspect of Xen PV
> > that may be relevant. It configures PAT differently than native Linux.
> > Theoretically Linux adapts automatically and using proper API (like
> > set_memory_wc()) should just work, but at least for i915 driver it
> > causes issues (not fully tracked down yet). Details about that bug
> > report include some more background:
> > https://lore.kernel.org/intel-gfx/Y5Hst0bCxQDTN7lK@mail-itl/
> > 
> > Anyway, I have tested it on a Xen modified to setup PAT the same way as
> > native Linux and the audio issue is still there.
> > 
> > > If the problem persists, another thing to check is the hack below
> > > works.
> 
> Trying this one now.

And this one didn't either :/

When it stopped working, I did two things:
1. switched audio profiles ("configuration" tab in pavucontrol) several
times; this on its own did not helped
2. reloaded sound related modules, but did not loaded them all back (see
attached list before and after).

After this, it worked again for a few minutes. Not sure if/which the above
actions were relevant, tho...

Another observation: when it stops working, it's never during a
playback. It's always that at some point starting an audio stream
results in a silence.

> > > -- 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");

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

[-- Attachment #1.2: snd-mods-list-after.txt --]
[-- Type: text/plain, Size: 1077 bytes --]

snd_hda_codec_hdmi     86016  1
snd_ctl_led            24576  0
snd_hda_codec_conexant    32768  1
snd_hda_codec_generic    98304  1 snd_hda_codec_conexant
ledtrig_audio          16384  2 snd_ctl_led,snd_hda_codec_generic
snd_hda_intel          61440  5
snd_intel_dspcfg       36864  1 snd_hda_intel
snd_intel_sdw_acpi     20480  1 snd_intel_dspcfg
snd_hda_codec         184320  4 snd_hda_codec_generic,snd_hda_codec_conexant,snd_hda_codec_hdmi,snd_hda_intel
snd_hda_core          118784  5 snd_hda_codec_generic,snd_hda_codec_conexant,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd_hwdep              16384  1 snd_hda_codec
snd_seq                94208  0
snd_seq_device         16384  1 snd_seq
snd_pcm               151552  5 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_core
snd_timer              49152  3 snd_seq,snd_pcm
snd                   126976  19 snd_ctl_led,snd_hda_codec_generic,snd_seq,snd_hda_codec_conexant,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_timer,snd_pcm
soundcore              16384  2 snd_ctl_led,snd

[-- Attachment #1.3: snd-mods-list-before.txt --]
[-- Type: text/plain, Size: 2848 bytes --]

snd_sof_pci_intel_skl    16384  0
snd_sof_intel_hda_common   217088  1 snd_sof_pci_intel_skl
soundwire_intel        53248  1 snd_sof_intel_hda_common
snd_sof_intel_hda      20480  1 snd_sof_intel_hda_common
snd_sof_pci            24576  2 snd_sof_intel_hda_common,snd_sof_pci_intel_skl
snd_sof_xtensa_dsp     20480  1 snd_sof_intel_hda_common
snd_sof               339968  2 snd_sof_pci,snd_sof_intel_hda_common
snd_sof_utils          20480  1 snd_sof
snd_soc_avs           172032  0
snd_soc_hda_codec      28672  1 snd_soc_avs
snd_soc_skl           217088  0
snd_soc_hdac_hda       28672  2 snd_sof_intel_hda_common,snd_soc_skl
snd_hda_ext_core       36864  5 snd_soc_avs,snd_soc_hda_codec,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_soc_skl
snd_soc_sst_ipc        20480  1 snd_soc_skl
snd_soc_sst_dsp        36864  1 snd_soc_skl
snd_soc_acpi_intel_match    73728  3 snd_sof_intel_hda_common,snd_soc_skl,snd_sof_pci_intel_skl
snd_soc_acpi           16384  3 snd_soc_acpi_intel_match,snd_sof_intel_hda_common,snd_soc_skl
snd_hda_codec_hdmi     86016  1
snd_soc_core          393216  7 snd_soc_avs,snd_soc_hda_codec,soundwire_intel,snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_soc_skl
snd_ctl_led            24576  0
snd_compress           28672  1 snd_soc_core
ac97_bus               16384  1 snd_soc_core
snd_hda_codec_conexant    32768  1
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_hda_codec_generic    98304  1 snd_hda_codec_conexant
snd_hda_intel          61440  2
snd_intel_dspcfg       36864  5 snd_soc_avs,snd_hda_intel,snd_sof,snd_sof_intel_hda_common,snd_soc_skl
snd_intel_sdw_acpi     20480  2 snd_sof_intel_hda_common,snd_intel_dspcfg
snd_hda_codec         184320  9 snd_hda_codec_generic,snd_hda_codec_conexant,snd_soc_avs,snd_hda_codec_hdmi,snd_soc_hda_codec,snd_hda_intel,snd_soc_hdac_hda,snd_soc_skl,snd_sof_intel_hda
snd_hda_core          118784  12 snd_hda_codec_generic,snd_hda_codec_conexant,snd_soc_avs,snd_hda_codec_hdmi,snd_soc_hda_codec,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_soc_skl,snd_sof_intel_hda
snd_hwdep              16384  1 snd_hda_codec
snd_seq                94208  0
snd_seq_device         16384  1 snd_seq
snd_pcm               151552  13 snd_soc_avs,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,soundwire_intel,snd_sof,snd_sof_intel_hda_common,snd_compress,snd_soc_core,snd_sof_utils,snd_soc_skl,snd_hda_core,snd_pcm_dmaengine
snd_timer              49152  2 snd_seq,snd_pcm
ledtrig_audio          16384  3 snd_ctl_led,snd_hda_codec_generic,thinkpad_acpi
snd                   126976  19 snd_ctl_led,snd_hda_codec_generic,snd_seq,snd_hda_codec_conexant,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_sof,snd_timer,snd_compress,thinkpad_acpi,snd_soc_core,snd_pcm
soundcore              16384  2 snd_ctl_led,snd

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-12-10 16:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Y5KPAs6f7S2dEoxR@mail-itl>
2022-12-09  8:10 ` Intel HD Audio: sound stops working in Xen PV dom0 in >=5.17 Takashi Iwai
2022-12-09 12:40   ` Marek Marczykowski-Górecki
2022-12-10  1:00     ` Marek Marczykowski-Górecki
2022-12-10 16:17       ` Marek Marczykowski-Górecki [this message]
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=Y5SxJ3IkhHSC/Psu@mail-itl \
    --to=marmarek@invisiblethingslab.com \
    --cc=alex_y_xu@yahoo.ca \
    --cc=alsa-devel@alsa-project.org \
    --cc=harald@skogtun.org \
    --cc=tiwai@suse.de \
    /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.