Repository navigation
Description
hello! recently I had set up my old dell laptop as a stand in for my main laptop (which is down for repair work), and while I was gaming (proton experimental latest, wine staging 7), audio would stop working altogether. I originally did not know the cause, but compiling my favorite performance kernel (xanmod-rog) improved it a little. I have provided a log up to the moment after audio loss. I think the most relevant (and where I think you guys step in) block is this:
[ +0.001478] audit: type=1105 audit(1640474989.148:115): pid=4606 uid=1000 auid=1000 ses=4 subj==unconfined msg='op=PAM:session_open grantors=pam_systemd_home,pam_limits,pam_unix,pam_permit acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success
[ +5.926301] audit: type=1334 audit(1640474995.076:116): prog-id=21 op=LOAD
[ +0.000076] audit: type=1334 audit(1640474995.076:117): prog-id=22 op=LOAD
[ +0.000043] audit: type=1334 audit(1640474995.076:118): prog-id=23 op=LOAD
[ +0.042852] audit: type=1130 audit(1640474995.118:119): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success
[Dec25 18:30] audit: type=1131 audit(1640475025.166:120): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success
[ +0.047013] audit: type=1334 audit(1640475025.216:121): prog-id=0 op=UNLOAD
[ +0.000004] audit: type=1334 audit(1640475025.216:122): prog-id=0 op=UNLOAD
[ +0.000001] audit: type=1334 audit(1640475025.216:123): prog-id=0 op=UNLOAD
[Dec25 18:58] sof-audio-pci-intel-cnl 0000:00:1f.3: error: reply expected 12 got 0 bytes
[ +0.000013] sof-audio-pci-intel-cnl 0000:00:1f.3: error: ipc error for 0x80010000 size 12
[ +0.000002] sof-audio-pci-intel-cnl 0000:00:1f.3: error: failed to set dai config for Analog Playback and Capture
[ +0.000001] sof-audio-pci-intel-cnl 0000:00:1f.3: ASoC: error at soc_dai_trigger on Analog CPU DAI: -22
[ +0.000002] HDA Analog: ASoC: dpcm_be_dai_trigger() failed at Analog Playback and Capture (-22)
[ +0.000003] HDA Analog: ASoC: trigger FE cmd: 0 failed: -22
[ +0.000612] sof-audio-pci-intel-cnl 0000:00:1f.3: error: reply expected 20 got 0 bytes
[ +0.000028] sof-audio-pci-intel-cnl 0000:00:1f.3: error: ipc error for 0x60010000 size 20
[ +0.000002] sof-audio-pci-intel-cnl 0000:00:1f.3: error: hw params ipc failed for stream 1
[ +0.000001] sof-audio-pci-intel-cnl 0000:00:1f.3: error: set pcm hw_params after resume
[ +0.000001] sof-audio-pci-intel-cnl 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_prepare on 0000:00:1f.3: -22
[ +0.000001] HDA Analog: ASoC: soc_pcm_prepare() failed (-22)
[ +0.000002] HDA Analog: ASoC: dpcm_fe_dai_prepare() failed (-22)
this bit occurs every time audio dies, and it never recovers. sometimes I get a full system lockup shortly afterward (which I deliberately avoided this time by a reboot)
full dmesg log (just in case):
debug.log
EDIT:
I should probably clarify that this happens on both native titles and non-native, as well as other applications (discord, firefox, VLC, etc..)
EDIT 2:
forgot a very important bit of info:
Distro: EndeavourOS (Arch Rolling Release)
dGPU driver: nvidia 495 (latest as of this time)
Integrated driver: intel open source latest
Desktop: Gnome 41 latest
Activity
[-]Laptop audio dies while under load (Dell G3 3590)[/-][+]Laptop audio dies after a while (Dell G3 3590)[/+]lgirdwood commentedon Dec 26, 2021
@Ninjastorm380 thanks, are you saying this error happens every time the system load is high or does it happen when you are playing audio for a long time ? Trying to figure out what the use case is that causes the issue.
Ninjastorm380 commentedon Dec 26, 2021
@lgirdwood on stock arch kernel, it can happen pretty much out of the blue (IE: just running discord), but with a clanged xanmod-rog kernel, it only readily occurs while running a intensive game (warframe is a good free working choice for that part) while playing music from another source (I was running newgrounds audio from firefox when this happened) while running OBS studio (I was prepping for stream, so I was running some test recordings to make sure NVENC was ready to do work).
Ninjastorm380 commentedon Dec 26, 2021
thus, I suspect something is not keeping up while under load (buffer overrun/underrun?), as the crash frequency goes down with a newer optimized kernel.
stock arch kernel is currently linux 5.15.11
xanmod rog kernel is currently linux-xanmod-rog 5.15.10, compiled with clang march native + lto + O3, for an intel core i5 9th gen mobile cpu
Ninjastorm380 commentedon Dec 26, 2021
my use case is streaming to twitch (average of ~3 hours), but it's failing quite frequently, thus preventing me from doing my job.
it tends to happen on both of your examples, honestly.
Ninjastorm380 commentedon Dec 27, 2021
just saw that there was an update to sof-firmware (is now sof-firmware-2.0-1). will test stability in the morning.
Ninjastorm380 commentedon Dec 27, 2021
@lgirdwood finished testing. same issue on newest release. did a whole recording of it happening + another dmesg log. strangely enough, nothing talking about asoc this time?
dmesg.log
Audio Crash Recording (google drive link)
Issue can bee seen at timestamp ~16:30
lgirdwood commentedon Dec 27, 2021
@Ninjastorm380 can you confirm all the audio endpoints you have been using before the crash. I can see analog HDA realtek PCMs and also DP/HDMI PCMs. I am suspicious we have a DSP DP/HDMI interaction with the Intel GPU (when it's disabled as Nvidia is used ?) or incorrectly with the Nvidia driver via HDMI audio APIs ? (possibly by pulseaudio or pipewire probing all PCMs). @plbossart @kv2019i any comments here ?
Ninjastorm380 commentedon Dec 27, 2021
last test was just laptop display only, one before was with my external display connected. both had the same audio failure. I know laptop display is LVDS/DP and that there is another DP on the usb-c port, and that there is a HDMI port on the left hand side.
Ninjastorm380 commentedon Dec 27, 2021
as noted in my video, the integrated mic volume can't be adjusted without a lockup. could it be something interacting with the DMIC array?
Ninjastorm380 commentedon Dec 27, 2021
@lgirdwood
Ninjastorm380 commentedon Dec 28, 2021
audio endpoints: 3.5mm audio jack (trrs) headset is all that I was using for audio, although the hdmi port was connected to my second monitor on the older log.
Ninjastorm380 commentedon Dec 28, 2021
dmesg.log
another failure, and it's got entries pointing to asoc again.
was using my headset, had firefox playing music, discord was doing voice calls, and was playing warframe
lgirdwood commentedon Dec 28, 2021
This is really a FW error as the IPC request fails for hw_params.
Can you confirm you are using a sound server like pipewire or pulseaudio as I would expect the sound server to mix the streams and keep the PCM open but the log above shows what looks like a new PCM being opened (do you know which of the applications is opening the last PCM). Need to figure out the usage so we can duplicate.
Ninjastorm380 commentedon Dec 29, 2021
@lgirdwood pipewire is the backend, with pipewire-alsa, pipewire-jack, and pipewire-pulse for compat with WINE
57 remaining items
Ninjastorm380 commentedon Jan 28, 2022
@ujfalusi you got easyeffects installed + a few virtual pipewire streams? I found those to be instrumental to enabling the audio crashing/system hanging.
ujfalusi commentedon Jan 28, 2022
I did not had easyeffects but had few playback streams running.
I can overload the system with few easyeffects plugins to have close to constant underruns and glitches, kept only the compressor for now.
Let's see.
Ninjastorm380 commentedon Jan 28, 2022
@ujfalusi here's my pipewire config. just remove the .txt and drop it into ~/.config/pipewire
pipewire.conf.txt
lgirdwood commentedon Jan 31, 2022
@Ninjastorm380 any reason why you have the default latency commented out ?
Do you have any hints what this would be when commented out ?
I've also noticed your config has 3 default sinks ?
Ninjastorm380 commentedon Feb 1, 2022
I just copy-pasta'd from here , but with the names and descriptions changed for the virtual streams. the rest is default.
ujfalusi commentedon Feb 2, 2022
@Ninjastorm380, I have been running the laptop I have for few days but I'm close to conclude that I'm not going to be able to reproduce the issue.
What bugs me is that touching DMIC gain is alone makes your laptop freeze, which one of these are doing that?
1.
Are you able to ssh in to the laptop?
If so, can you connect it via ethernet, ssh in to the laptop.
log out from your desktop env, stop PW (
killall wireplumber; killall pipewire-pulse; killall pipewire)Switch to a character console (CTRL+ALT+F1)
From the ssh session:
sudo echo 8 > /proc/sys/kernel/printkyou might try to ssh in to another session to run
sudo dmesg -wNow, run the amixer command which locks up the machine and let's hope something is printed to the laptop's screen or to the dmesg.
Does the laptop freeze like this as well? If not, then log in back to your user to have PW running and switch to console again and run the amixer command.
If it is really something to do with the DMIC, which is really strange, then we might need to block PW to touch the DMIC gains via the
/usr/share/alsa/ucm2/Intel/sof-hda-dsp/HiFi.conf. But when the UCM is loaded the gain is set to a default via the profile, so PW should be touching it.Bdw: when the laptop is frozen, you can not log in via ssh or ping it, right? It is hard frozen.
Ninjastorm380 commentedon Feb 2, 2022
Currently, I no longer have access to that laptop (I got the missing components ordered for my tower, so I loaned it out again), but I know it was dmic0 that caused the immediate lockups. Nothing is working at all, not even pings (lockup at kernel level?) when the laptop freezes. The eventual lockups don't seem to be caused by dmic0, however. those only occurred under high CPU + GPU load using something vulkan based (Warframe (or whatever other free windows steam game you got on hand) via DXVK, with it's audio captured using one of those 3 virtual streams, and streaming or recording via OBS Studio, which is also receiving those virtual streams)
Ninjastorm380 commentedon Feb 2, 2022
@ujfalusi
ujfalusi commentedon Feb 2, 2022
@Ninjastorm380, components are hard to find these days ;)
Any chance you will get it back sometime? We were unable to reproduce this so far and by the look of it it could be not even audio related. Some Optimus setups tend to be more fragile than others and afaik they do cause problems here and there.
It would be great to be able to debug it further to find the rootcause for the benefit of you and other users. If it is in audio we will for sure going to fix it, if it's something else then we can try to reach the correct audience.
But you have confirmed that it is locking up when you change the volume of the dmic:
This Dmic0 makes me nervous as this is something which we have not seen. Fyi: changing a Dmic volume is a simple process:
send an ipc to the dsp, dsp changes the gain and returns with success or error (unlikely) and that's it. Simple ipc tx/reply round.
Running multiple virtual streams will not affect the DSP as the real PCM stream count remains the same, user space is doing the mixing.
The only thing I can think of is that a thread is holding a lock and an interrupt is handled on the same core and it wants to take the same lock. The task can not proceed as it is preempted, the interrupt handler can not proceed as it is waiting for the lock to be released.
So, this is really interesting.
Ninjastorm380 commentedon Feb 2, 2022
I am talking about two separate lockup conditions. lockup by dmic0 is instantaneous, and halts everything. the eventual lockup (at least when pipewire node power suspend is disabled) seems to leave some things functional (sound continues playing, even newgrounds playlists from the web!).
Ninjastorm380 commentedon Feb 2, 2022
as for when i'll get it back? earliest is in 4 weeks.
saligrama commentedon Feb 2, 2022
My issue seems to now be fixed after updating to kernel 5.16.4. 36 hours of uptime so far with multiple suspend/resume cycles and sound is still going strong.
plbossart commentedon Jan 5, 2023
no update in 10 months, closing.
Bot-wxt1221 commentedon Jun 21, 2024
On my G3 3590, kernel 6.9.5, NixOS. The same problems appears.
I'm currently testing if the problem is because of the wrong settings of clock rate.
Call me if more information is needed.