Skip to content

Laptop audio dies after a while (Dell G3 3590) #5134

Closed

Description

@Ninjastorm380

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

  1. changed the title [-]Laptop audio dies while under load (Dell G3 3590)[/-] [+]Laptop audio dies after a while (Dell G3 3590)[/+] on Dec 26, 2021
  2. lgirdwood commented on Dec 26, 2021

    @lgirdwood
    Member

    @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.

  3. Ninjastorm380 commented on Dec 26, 2021

    @Ninjastorm380
    Author

    @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).

  4. Ninjastorm380 commented on Dec 26, 2021

    @Ninjastorm380
    Author

    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

  5. Ninjastorm380 commented on Dec 26, 2021

    @Ninjastorm380
    Author

    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.

  6. Ninjastorm380 commented on Dec 27, 2021

    @Ninjastorm380
    Author

    just saw that there was an update to sof-firmware (is now sof-firmware-2.0-1). will test stability in the morning.

  7. Ninjastorm380 commented on Dec 27, 2021

    @Ninjastorm380
    Author

    @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

  8. lgirdwood commented on Dec 27, 2021

    @lgirdwood
    Member

    @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 ?

  9. Ninjastorm380 commented on Dec 27, 2021

    @Ninjastorm380
    Author

    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.

  10. Ninjastorm380 commented on Dec 27, 2021

    @Ninjastorm380
    Author

    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?

  11. Ninjastorm380 commented on Dec 27, 2021

    @Ninjastorm380
    Author
  12. Ninjastorm380 commented on Dec 28, 2021

    @Ninjastorm380
    Author

    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.

  13. Ninjastorm380 commented on Dec 28, 2021

    @Ninjastorm380
    Author

    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

  14. lgirdwood commented on Dec 28, 2021

    @lgirdwood
    Member
    [42525.862435] audit: type=1334 audit(1640691247.139:117): prog-id=0 op=UNLOAD
    [78763.784733] sof-audio-pci-intel-cnl 0000:00:1f.3: error: reply expected 20 got 0 bytes
    [78763.784774] sof-audio-pci-intel-cnl 0000:00:1f.3: error: ipc error for 0x60010000 size 20
    [78763.784778] sof-audio-pci-intel-cnl 0000:00:1f.3: error: hw params ipc failed for stream 1
    [78763.784780] sof-audio-pci-intel-cnl 0000:00:1f.3: error: set pcm hw_params after resume
    [78763.784782] sof-audio-pci-intel-cnl 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_prepare on 0000:00:1f.3: -22
    [78763.784784]  HDA Analog: ASoC: soc_pcm_prepare() failed (-22)
    [78763.784787]  HDA Analog: ASoC: dpcm_fe_dai_prepare() failed (-22)
    

    This is really a FW error as the IPC request fails for hw_params.

    was using my headset, had firefox playing music, discord was doing voice calls, and was playing warframe

    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.

  15. Ninjastorm380 commented on Dec 29, 2021

    @Ninjastorm380
    Author

    @lgirdwood pipewire is the backend, with pipewire-alsa, pipewire-jack, and pipewire-pulse for compat with WINE

  16. 57 remaining items

  17. Ninjastorm380 commented on Jan 28, 2022

    @Ninjastorm380
    Author

    @ujfalusi you got easyeffects installed + a few virtual pipewire streams? I found those to be instrumental to enabling the audio crashing/system hanging.

  18. ujfalusi commented on Jan 28, 2022

    @ujfalusi
    Contributor

    @ujfalusi you got easyeffects installed + a few virtual pipewire streams? I found those to be instrumental to enabling the audio crashing/system hanging.

    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.

  19. Ninjastorm380 commented on Jan 28, 2022

    @Ninjastorm380
    Author

    @ujfalusi here's my pipewire config. just remove the .txt and drop it into ~/.config/pipewire

    pipewire.conf.txt

  20. lgirdwood commented on Jan 31, 2022

    @lgirdwood
    Member

    @Ninjastorm380 any reason why you have the default latency commented out ?

     #node.latency = 1024/48000
     audio.rate = 48000
    

    Do you have any hints what this would be when commented out ?
    I've also noticed your config has 3 default sinks ?

  21. Ninjastorm380 commented on Feb 1, 2022

    @Ninjastorm380
    Author

    I just copy-pasta'd from here , but with the names and descriptions changed for the virtual streams. the rest is default.

  22. ujfalusi commented on Feb 2, 2022

    @ujfalusi
    Contributor

    @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.

    amixer -c1 sset  "Dmic0" 30
    amixer -c1 sset  "Dmic0" 60
    
    amixer -c1 sset  "Dmic1 2nd" 30
    amixer -c1 sset  "Dmic1 2nd" 60
    

    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/printk
    you might try to ssh in to another session to run sudo dmesg -w
    Now, 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.

  23. Ninjastorm380 commented on Feb 2, 2022

    @Ninjastorm380
    Author

    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)

  24. Ninjastorm380 commented on Feb 2, 2022

    @Ninjastorm380
    Author
  25. ujfalusi commented on Feb 2, 2022

    @ujfalusi
    Contributor

    @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.

    The eventual lockups don't seem to be caused by dmic0, however.

    But you have confirmed that it is locking up when you change the volume of the dmic:

    specifically, touching the volume slider for the integrated dmic would result in an immediate lockup. no other source causes that.

    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.

  26. Ninjastorm380 commented on Feb 2, 2022

    @Ninjastorm380
    Author

    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!).

  27. Ninjastorm380 commented on Feb 2, 2022

    @Ninjastorm380
    Author

    as for when i'll get it back? earliest is in 4 weeks.

  28. saligrama commented on Feb 2, 2022

    @saligrama

    Having the same issues and it doesn't seem necessarily linked to suspend/resume. Have an X1 Carbon Gen 9 (i5-1145G7) running Arch Linux, kernel 5.16.2 and sof 2.0.

    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.

  29. plbossart commented on Jan 5, 2023

    @plbossart
    Member

    no update in 10 months, closing.

  30. Bot-wxt1221 commented on Jun 21, 2024

    @Bot-wxt1221

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions