Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-04-01 21:56:34

JordanBrown
Member
Registered: 2021-04-01
Posts: 8

Headphone sound is muted after suspending and locking session

Xfce version: 4.12
Distribution: Debian buster 10.8

The headphone volume (and only the headphone volume) master volume gets set to 0 and muted every time I wake the system up from suspend and unlock the session. (The locker is light-locker and the display manager is lightdm.) It does not happen when I log out directly or when I disable locking after suspend. It works fine when I power on or reboot: pulseaudio remembers the last volume configuration. Strangely, it also doesn't happen if I play something before suspending: the music will stop as soon as the session is suspended, but it'll resume as soon as the system is woken up.

When I power on and start up the desktop session I can see the volume being unmuted and set to the last volume configuration, but this somehow doesn't happen when I suspend AND lock the session. I have spent some hours researching this, but haven't managed to find out what commands/scripts are executed when I unlock the session after "suspend and lock", and my lack of expertise makes this very hard to debug. Can you help me figure out how Xfce behaves in this case?

Last edited by JordanBrown (2021-04-04 11:30:57)

Offline

#2 2021-04-01 22:59:22

MrEen
Member
Registered: 2019-04-19
Posts: 295

Re: Headphone sound is muted after suspending and locking session

Hi JordanBrown, and welcome to the forum.

This isn't an Xfce issue but rather a PulseAudio or ALSA issue I'm pretty sure. There could be a few different reasons this is happening but my primary suspect would be the wrong sink is becoming the active sink after unlocking. As an example, maybe the HDMI output is becoming active (even if it's not used) and the method you're using to unmute the headphones is also changing the active sink back to where you're wanting it.

The following command will show which sink is default so you can compare:

pacmd list-sinks | grep -A 1 "*"

If that doesn't help sort this out, run this command with properly working audio and again after unlocking so we can compare the outputs:

curl https://gitlab.freedesktop.org/pulseaudio/pulseaudio/raw/master/src/utils/pa-info?inline=false | bash | nc termbin.com 9999

The last line of output should have a URL pointing to your sound setup.

Offline

#3 2021-04-01 23:19:12

JordanBrown
Member
Registered: 2021-04-01
Posts: 8

Re: Headphone sound is muted after suspending and locking session

Hi, thanks for answering!

The first command gives the same output in both cases:

  * index: 0
	name: <alsa_output.pci-0000_00_1f.3.analog-stereo>

As for your second command, this link https://termbin.com/jvpe is the output when sound is on, and this https://termbin.com/wu0x is the output after unlocking.

Offline

#4 2021-04-02 00:58:19

MrEen
Member
Registered: 2019-04-19
Posts: 295

Re: Headphone sound is muted after suspending and locking session

Okay, let's check to see if ALSA is playing a part in this:

wget http://www.alsa-project.org/alsa-info.sh -O alsa-info.sh && bash alsa-info.sh

Run that one in both cases again please. This one asks if you want to save locally or upload. Please choose upload and share the URL's it'll spit out when done.

I did notice the extremely low volume and mute state in your outputs, but PulseAudio's settings can be influenced by what ALSA is reporting.

I noticed one other oddity, where there "appears" to be no Headphone jack:

> jacks_do
card=0
numid=47,iface=CARD,name='HDMI/DP,pcm=10 Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off
numid=23,iface=CARD,name='HDMI/DP,pcm=3 Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off
numid=29,iface=CARD,name='HDMI/DP,pcm=7 Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off
numid=35,iface=CARD,name='HDMI/DP,pcm=8 Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off
numid=41,iface=CARD,name='HDMI/DP,pcm=9 Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off
numid=18,iface=CARD,name='Headphone Mic Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on
numid=17,iface=CARD,name='Headset Mic Phantom Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on
numid=19,iface=CARD,name='Speaker Phantom Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on

But that's the same in both cases, so I doubt it has any bearing here.

Offline

#5 2021-04-02 11:36:36

JordanBrown
Member
Registered: 2021-04-01
Posts: 8

Re: Headphone sound is muted after suspending and locking session

I don't know if it's important, but the command showed some errors before asking me to upload the results:

alsa-info.sh: line 661: tree: command not found
dmesg: read kernel buffer failed: Operation not permitted

Here is the output when sound is on: http://alsa-project.org/db/?f=955c8dd07 … c999c5ab18.
And here is the output after unlocking (it was way quicker the second time): http://alsa-project.org/db/?f=e9f06f764 … 0893eea330.

Offline

#6 2021-04-03 17:58:08

MrEen
Member
Registered: 2019-04-19
Posts: 295

Re: Headphone sound is muted after suspending and locking session

Don't worry about the errors. They happen in certain scenarios depending on the distro and kernel in use. And we now see ALSA is muting the headphones in your case. In fact, it's the Master volume that is also muted:

Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 58 [67%] [-21.75dB] [off]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 0 [0%] [-65.25dB] [off]
  Front Right: Playback 0 [0%] [-65.25dB] [off]

The last chance I know of to possibly find out why this is happening is one more command in both cases:

sudo dmesg | grep -C1 -E 'ALSA|HDA|sof|HDMI|snd[_-]|sound|hda.codec|hda.intel'

I should mention, you added "options snd-hda-intel dmic_detect=0" to a file in /etc/modprobe.d that you should remove. That option was deprecated back in the 5.3 kernel series. It is possible that could fix your issue, as it might put you on the new sof audio driver instead of snd-hda-intel. That could also makes things worse if the setup isn't configured properly, but that's usually fixable.

Offline

#7 2021-04-03 21:01:10

JordanBrown
Member
Registered: 2021-04-01
Posts: 8

Re: Headphone sound is muted after suspending and locking session

Yes you're right, actually the speakers volume gets muted as well. The reason I hadn't noticed is because when I unplug the headphone jack I see that the speakers' volume is fine (but if I unplug it before suspending the speakers volume gets muted as well). (On the other hand, if I plug the headphone jack again the headphone volume remains off, I have to manually unmute it.)

And yes, I actually added the line `snd_hda_intel.dmic_detect=0` to /etc/default/grub. That was the only way I had found to fix a worse problem: no audio at all (maybe the "sof" drivers are incompatible with my hardware?). It happened after I updated the kernel (backported to Debian buster from bullseye), but I had done that in order to fix a still worse problem...

Anyway, here's the outputs of your command:

https://pastebin.com/j5dWJzkX when the audio is working

https://pastebin.com/zRQtU3r1 after unlocking

Offline

#8 2021-04-04 00:55:17

MrEen
Member
Registered: 2019-04-19
Posts: 295

Re: Headphone sound is muted after suspending and locking session

Okay, like I said I'm not sure I'll be able to help with it but if you could remove the grub change, and do that last command again, it might be possible to fix the sound while the sof driver is in use.

We didn't get any useful info as to why it was muted after suspending I'm afraid, and Debian-based distros are just foreign enough to me that some of the things I can help with don't work there.

Either way, if you end up needing to stay with the legacy driver, the correct parameter to use now is this:

snd-intel-dspcfg.dsp_driver=1

While your dmic_detect parameter is working now, there's no telling when it will suddenly stop working.

Offline

#9 2021-04-04 11:26:55

JordanBrown
Member
Registered: 2021-04-01
Posts: 8

Re: Headphone sound is muted after suspending and locking session

Okay, thanks for the heads-up!

Now I deleted that grub parameter and, as expected, the audio stopped working altogether. It seems that ALSA can't find any sound card. Here is the output of your command 'sudo dmesg...' :

[    0.183884] ACPI: Added _OSI(Linux-Dell-Video)
[    0.183884] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
[    0.183884] ACPI: Added _OSI(Linux-HPI-Hybrid-Graphics)
--
[    1.068423] DMAR: Intel(R) Virtualization Technology for Directed I/O
[    1.068424] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    1.068425] software IO TLB: mapped [mem 0x000000006ca86000-0x0000000070a86000] (64MB)
[    1.068726] Initialise system trusted keyrings
--
[    1.111345] integrity: Loading X.509 certificate: UEFI:db
[    1.111362] integrity: Loaded X.509 cert 'Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed522988a1bd4'
[    1.111363] integrity: Loading X.509 certificate: UEFI:db
[    1.111377] integrity: Loaded X.509 cert 'Microsoft Windows Production PCA 2011: a92902398e16c49778cd90f99e4f9ae17c55af53'
[    1.114007] Freeing unused kernel image (initmem) memory: 2400K
--
[    4.055845] iwlwifi 0000:00:14.3 wlo1: renamed from wlan0
[    4.056814] snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    4.056831] snd_hda_intel 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    4.141366] snd_soc_skl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    4.141382] snd_soc_skl 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    4.147062] Bluetooth: Core ver 2.22
--
[    4.160899] Bluetooth: hci0: Firmware revision 0.1 build 241 week 36 2020
[    4.200037] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    4.200170] sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    4.200182] sof-audio-pci 0000:00:1f.3: enabling device (0000 -> 0002)
[    4.200350] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[    4.200467] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    4.208128] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[    4.219932] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
--
[    4.226511] NET: Registered protocol family 38
[    4.336192] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[    4.336195] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[    4.336198] sof-audio-pci 0000:00:1f.3: DMICs detected in NHLT tables: 2
[    4.336351] sof-audio-pci 0000:00:1f.3: firmware: failed to load intel/sof/sof-cfl.ri (-2)
[    4.337490] sof-audio-pci 0000:00:1f.3: Direct firmware load for intel/sof/sof-cfl.ri failed with error -2
[    4.337494] sof-audio-pci 0000:00:1f.3: error: request firmware intel/sof/sof-cfl.ri failed err: -2
[    4.338624] sof-audio-pci 0000:00:1f.3: error: failed to load DSP firmware -2
[    4.340153] sof-audio-pci 0000:00:1f.3: error: sof_probe_work failed err: -2
[    5.639722] Bluetooth: RFCOMM TTY layer initialized

Offline

#10 2021-04-04 13:12:51

MrEen
Member
Registered: 2019-04-19
Posts: 295

Re: Headphone sound is muted after suspending and locking session

Okay, we're getting close. Those errors at the bottom are the source of the trouble. Do you have the following folder on your system:
/lib/firmware/intel/sof

If so, try this as this fixes the same first error on Ubuntu:

sudo ln -s /lib/firmware/intel/sof/sof-cnl.ri /lib/firmware/intel/sof/sof-cfl.ri

Reboot after creating the symlink and test your sound. If still not working run that last dmesg command again

Offline

#11 2021-04-04 16:00:04

JordanBrown
Member
Registered: 2021-04-01
Posts: 8

Re: Headphone sound is muted after suspending and locking session

I couldn't find any sof folder, so I had to install the sof firmware from source (after finding this thread). I rebooted and it worked... for a while. The audio stopped working again after suspending, then I tried restarting again but it only got worse. Now the system is very unstable, it freezes randomly during boot or shutdown, and when it manages to start up correctly I get no audio anyway. This is what I am getting right now for example:

[    0.184047] ACPI: Added _OSI(Linux-Dell-Video)
[    0.184047] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
[    0.184047] ACPI: Added _OSI(Linux-HPI-Hybrid-Graphics)
--
[    1.052662] DMAR: Intel(R) Virtualization Technology for Directed I/O
[    1.052663] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    1.052664] software IO TLB: mapped [mem 0x000000006ca86000-0x0000000070a86000] (64MB)
[    1.052977] Initialise system trusted keyrings
--
[    1.096200] integrity: Loading X.509 certificate: UEFI:db
[    1.096215] integrity: Loaded X.509 cert 'Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed522988a1bd4'
[    1.096216] integrity: Loading X.509 certificate: UEFI:db
[    1.096228] integrity: Loaded X.509 cert 'Microsoft Windows Production PCA 2011: a92902398e16c49778cd90f99e4f9ae17c55af53'
[    1.098934] Freeing unused kernel image (initmem) memory: 2400K
--
[    4.274942] iwlwifi 0000:00:14.3: Detected Intel(R) Wireless-AC 9560 160MHz, REV=0x318
[    4.279568] snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    4.279584] snd_hda_intel 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    4.326836] intel_rapl_common: Found RAPL domain package
--
[    4.334440] iwlwifi 0000:00:14.3: base HW address: 08:d2:3e:8a:73:52
[    4.335847] snd_soc_skl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    4.335860] snd_soc_skl 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    4.403061] ieee80211 phy0: Selected rate control algorithm 'iwl-mvm-rs'
--
[    4.405116] iwlwifi 0000:00:14.3 wlo1: renamed from wlan0
[    4.405781] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    4.406194] sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    4.406208] sof-audio-pci 0000:00:1f.3: enabling device (0000 -> 0002)
[    4.406804] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[    4.406968] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    4.411875] Bluetooth: Core ver 2.22
--
[    4.411901] Bluetooth: SCO socket layer initialized
[    4.416488] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[    4.421101] usbcore: registered new interface driver btusb
--
[    4.435525] Bluetooth: hci0: Found device firmware: intel/ibt-17-16-1.sfi
[    4.482319] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[    4.482321] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[    4.482327] sof-audio-pci 0000:00:1f.3: DMICs detected in NHLT tables: 2
[    4.483379] sof-audio-pci 0000:00:1f.3: firmware: direct-loading firmware intel/sof/sof-cfl.ri
[    4.564046] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
--
[    4.564050] Bluetooth: BNEP socket layer initialized
[    4.603809] sof-audio-pci 0000:00:1f.3: Firmware info: version 1:6:1-53680
[    4.603812] sof-audio-pci 0000:00:1f.3: Firmware: ABI 3:17:0 Kernel ABI 3:17:0
[    4.650336] sof-audio-pci 0000:00:1f.3: firmware: direct-loading firmware intel/sof-tplg/sof-hda-generic-2ch.tplg
[    4.650345] sof-audio-pci 0000:00:1f.3: Topology: ABI 3:17:0 Kernel ABI 3:17:0
[    4.661999] sof-audio-pci 0000:00:1f.3: error: reply expected 12 got 20 bytes
[    4.662590] sof-audio-pci 0000:00:1f.3: error: ipc error for 0x30030000 size 12
[    4.663163] sof-audio-pci 0000:00:1f.3: error: failed to add route sink BUF1.0 control none source PCM0P
[    4.663754] sof-audio-pci 0000:00:1f.3: ASoC: topology: add_route failed: -22
[    4.664330] sof-audio-pci 0000:00:1f.3: ASoC: topology: could not load header: -22
[    4.665365] sof-audio-pci 0000:00:1f.3: error: tplg component load failed -22
[    4.665962] sof-audio-pci 0000:00:1f.3: error: failed to load DSP topology -22
[    4.666552] sof-audio-pci 0000:00:1f.3: ASoC: error at snd_soc_component_probe on 0000:00:1f.3: -22
[    4.667150] sof-audio-pci 0000:00:1f.3: ASoC: failed to probe component -22
[    4.667765] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: failed to instantiate card -22

I think the sof firmware is too buggy for my system and I am considering upgrading to the next Debian version (currently in testing but about to become stable). Do you think it's a good idea or could I solve this more easily?

Offline

#12 2021-04-04 19:56:50

MrEen
Member
Registered: 2019-04-19
Posts: 295

Re: Headphone sound is muted after suspending and locking session

I'm afraid we've hit my limit on Debian-based systems for this. It appears it's now the topology files that are the issue. I just don't know anything about Debian's implementation of the sof driver, so not sure where to head next, and it seems like it's still not going to solve your issue.

You might just want to re-add the grub parameter for now. And you can see if running this after suspending gets the audio working again:

pulseaudio -k

If PulseAudio doesn't restart on it's own, you may need to force it with this:

pulseaudio --start

Offline

#13 2021-04-04 20:14:59

JordanBrown
Member
Registered: 2021-04-01
Posts: 8

Re: Headphone sound is muted after suspending and locking session

Don't worry, and I thank you very much for taking your time to help me. I think I will upgrade Debian soon, hopefully it will be enough to fix this.

I did add the (updated) parameter and got the audio back. Of course it still gets muted after suspending. `pulseaudio -k` does not work, unfortunately. What does work is `sudo alsactl init` or `sudo alsactl restore`. Do you know of a way to run this automatically after I unlock the session?

Offline

#14 2021-04-04 20:42:14

MrEen
Member
Registered: 2019-04-19
Posts: 295

Re: Headphone sound is muted after suspending and locking session

Okay, your fix indicates this is ALSA that is at fault.

When unlocking, is this after a suspend? If so, a systemd service is probably what you want. I'm not sure if Debian handles this differently, but there's some info here: https://unix.stackexchange.com/question … eup/492497
You might just need to change one line to the answer by davidovitch to this:

ExecStart=alsactl restore

You might need the path to alsactl though which for me is /usr/sbin/alsactl

Offline

#15 2021-04-04 20:56:20

JordanBrown
Member
Registered: 2021-04-01
Posts: 8

Re: Headphone sound is muted after suspending and locking session

I will try that, thanks again for your help.

Offline

#16 2021-04-04 21:31:51

MrEen
Member
Registered: 2019-04-19
Posts: 295

Re: Headphone sound is muted after suspending and locking session

You're quite welcome. And good luck!

Offline

#17 2021-05-01 03:37:38

dlu2020
Member
Registered: 2021-01-07
Posts: 4

Re: Headphone sound is muted after suspending and locking session

I too have the exact same symptoms as JordanBrown. I am currently running Debian testing.  I don't have a solution, just the work around that I currently use.  I narrowed it down to something to do with the lightdm greeter (at least on my machine), but only in some cases.  Logging in or out doesn't mute the volume, only when I either lock the screen with light locker, or click switch user. 

So my workaround was to uninstall light locker, install xscreensaver instead, and disable the switch user commands, since my computer only has one account on it anyways.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 636.16 KiB (Peak: 669 KiB) ]