Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThinkPad T14 AMD microphone LED always ON #100

Closed
miquecg opened this issue Jun 16, 2021 · 105 comments
Closed

ThinkPad T14 AMD microphone LED always ON #100

miquecg opened this issue Jun 16, 2021 · 105 comments

Comments

@miquecg
Copy link

miquecg commented Jun 16, 2021

I'm running Arch Linux with alsa-ucm-conf 1.2.5.1. This problem was present in previous versions and it's being discussed on a forum thread among other things.

So the problem is that microphone LED is always ON but mute/unmute behaviour still works.

@perexg
Copy link
Member

perexg commented Jun 16, 2021

Yes, the problem with this hw is that it has only software mute control, so we need to handle it differently than for other devices. The UCM is ready to support this. I'll prepare some test configs when we have the testers, soon.

@miquecg
Copy link
Author

miquecg commented Jun 16, 2021

Great, good to know that you are aware of this. Thanks!

@miquecg
Copy link
Author

miquecg commented Jun 16, 2021

Btw, this hw needs sof-firmware or is it just for Intel platform?

@perexg
Copy link
Member

perexg commented Jun 16, 2021

Btw, this hw needs sof-firmware or is it just for Intel platform?

It's an AMD platform, but the microphone is connected to the AMD ACP sound bridge (it's not HDA sound bridge). The sof-firmware is required only for Intel hardware.

@miquecg
Copy link
Author

miquecg commented Aug 23, 2021

Hi, any news on this?

@tvlpirb
Copy link

tvlpirb commented Aug 26, 2021

This issue hasn't been resolved yet. Using latest version of Arch 5.13.12. I can manually change the microphone LED and the button works. However the LED does not reflect the current state of the microphone.

@perexg
Copy link
Member

perexg commented Nov 4, 2021

Could you test changes in #115 ?

@miquecg
Copy link
Author

miquecg commented Nov 4, 2021

Could you test changes in #115 ?

For me it doesn't work.

@perexg
Copy link
Member

perexg commented Nov 4, 2021

Could you elaborate more? A reboot is required to let the alsactl utility to create the new control at boot (check journal for alsa-state service for errors) and you should see 'Mic ACP LED' control in alsamixer for the HDA card.

@miquecg
Copy link
Author

miquecg commented Nov 4, 2021

Well, I did reboot after editing both files HDA-Intel.conf and HiFi-acp.conf. I tested mute/unmute with laptop MIC button, which works (as before), but LED always remains on.

What do you mean by 'new control'? Is this supposed to circumvent the keyboard Fn key to achieve a working LED?

@perexg
Copy link
Member

perexg commented Nov 4, 2021

You're using very high level. It's not about key mappings. I need to go down to the ALSA subsystem basics and test things one by one. So, could you show me the alsactl log after boot - journalctl /usr/sbin/alsactl - and amixer dump - amixer -c 0 controls - the zero number should be the HDA card number. If you are not sure about the card number, use aplay -l to list them.

@miquecg
Copy link
Author

miquecg commented Nov 4, 2021

'Mic ACP LED' control doesn't appear.

$ amixer -c 1 controls
numid=12,iface=CARD,name='Headphone Jack'
numid=11,iface=CARD,name='Mic Jack'
numid=13,iface=CARD,name='Speaker Phantom Jack'
numid=10,iface=MIXER,name='Master Playback Switch'
numid=9,iface=MIXER,name='Master Playback Volume'
numid=2,iface=MIXER,name='Headphone Playback Switch'
numid=1,iface=MIXER,name='Headphone Playback Volume'
numid=8,iface=MIXER,name='Mic Boost Volume'
numid=7,iface=MIXER,name='Capture Switch'
numid=6,iface=MIXER,name='Capture Volume'
numid=5,iface=MIXER,name='Auto-Mute Mode'
numid=4,iface=MIXER,name='Speaker Playback Switch'
numid=3,iface=MIXER,name='Speaker Playback Volume'
numid=15,iface=PCM,name='Capture Channel Map'
numid=14,iface=PCM,name='Playback Channel Map'

There is one UCM error in the logs.

$ journalctl /usr/sbin/alsactl
alsactl[783]: alsa-lib parser.c:242:(error_node) UCM is not supported for this HDA model (HD-Audio Generic at 0xfd3c8000 irq 108)
alsactl[783]: alsa-lib main.c:1405:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -6

Kernel 5.14.16

@perexg
Copy link
Member

perexg commented Nov 4, 2021

The FixedBootSequence should be executed with command alsactl init 1 (initialize card 1). I would suggest to use the whole tree from my PR #115 - https://github.com/perexg/alsa-ucm-conf/archive/refs/heads/acp-led.zip . Unpack this, and create a symlink from /usr/share/alsa/ucm2 to the upacked alsa-ucm-conf/ucm2 tree. Rename the original ucm2 tree as backup before.

Verification:

  • alsactl init 1
  • check if snd_ctl_led kernel module is loaded (lsmod)
  • check if the Mic ACP LED Switch control is present (amixer -c 1 controls)

@miquecg
Copy link
Author

miquecg commented Nov 5, 2021

Tested with whole tree from PR and 'Mic ACP LED Switch' appears when listing controls.

@perexg
Copy link
Member

perexg commented Nov 5, 2021

If snd_ctl_led kernel module is loaded, you can control the Mic ACP LED switch using a mixer and the LED should reflect the changes.

@miquecg
Copy link
Author

miquecg commented Nov 5, 2021

Yes, that's right. I can mute/unmute the new control on alsamixer and the LED switches states.

On the other hand, this has nothing to do with Mic status, which remains the same. I guess that now both things have to be connected somehow, right?

@perexg
Copy link
Member

perexg commented Nov 5, 2021

Pulseaudio or pipewire should change the state this control when the microphone is active / inactive. It's the change in ucm2/HDA-Intel/HiFi-acp.conf . This sound hardware cannot mute the stream in the driver, so the sound server must do the job.

Does it work in the sound server? Note that all microphone inputs must be off (including the headphone / headset mic).

@miquecg
Copy link
Author

miquecg commented Nov 5, 2021

I've checked with pavucontrol:

  • 'Digital Microphone' → mute/unmute doesn't change LED ❌
  • 'Headphones Stereo Microphone' → mute/unmute changes LED ✅

@perexg
Copy link
Member

perexg commented Nov 5, 2021

Thank you for the feedback. I updated the code in my pull request. The CaptureMasterElem should be CaptureMixerElem in ucm2/HDA-Intel/HiFi-acp.conf . Could you retest with the recent zip ?

@miquecg
Copy link
Author

miquecg commented Nov 6, 2021

Same behaviour.

Btw, PR is not updated. I just put the change myself.

@perexg
Copy link
Member

perexg commented Nov 6, 2021

Could you show the pulseaudio debug log ?

https://fedoraproject.org/wiki/How_to_debug_PulseAudio_problems

The PR is updated now (pushed changes to other repo originally).

@miquecg
Copy link
Author

miquecg commented Nov 8, 2021

No errors so far:

>>> Umute Digital Microphone
D: [pulseaudio] protocol-native.c: Client pavucontrol-qt changes mute of source alsa_input.pci-0000_07_00.6.HiFi__hw_acp__source.
D: [pulseaudio] source.c: The mute of source alsa_input.pci-0000_07_00.6.HiFi__hw_acp__source changed from yes to no.
I: [pulseaudio] module-device-restore.c: Storing volume/mute for device+port source:alsa_input.pci-0000_07_00.6.HiFi__hw_acp__source:[In] Mic1.
I: [pulseaudio] module-device-restore.c: Synced.
>>> Mute Digital Microphone
D: [pulseaudio] protocol-native.c: Client pavucontrol-qt changes mute of source alsa_input.pci-0000_07_00.6.HiFi__hw_acp__source.
D: [pulseaudio] source.c: The mute of source alsa_input.pci-0000_07_00.6.HiFi__hw_acp__source changed from no to yes.
I: [pulseaudio] module-device-restore.c: Storing volume/mute for device+port source:alsa_input.pci-0000_07_00.6.HiFi__hw_acp__source:[In] Mic1.
I: [pulseaudio] module-device-restore.c: Synced.
>>> Umute Headphones Stereo Microphone
D: [pulseaudio] protocol-native.c: Client pavucontrol-qt changes mute of source alsa_input.pci-0000_07_00.6.HiFi__hw_Generic_1__source.
D: [pulseaudio] source.c: The mute of source alsa_input.pci-0000_07_00.6.HiFi__hw_Generic_1__source changed from yes to no.
I: [pulseaudio] module-device-restore.c: Storing volume/mute for device+port source:alsa_input.pci-0000_07_00.6.HiFi__hw_Generic_1__source:[In] Mic2.
>>> Mute Headphones Stereo Microphone
D: [pulseaudio] protocol-native.c: Client pavucontrol-qt changes mute of source alsa_input.pci-0000_07_00.6.HiFi__hw_Generic_1__source.
D: [pulseaudio] source.c: The mute of source alsa_input.pci-0000_07_00.6.HiFi__hw_Generic_1__source changed from no to yes.
I: [pulseaudio] module-device-restore.c: Storing volume/mute for device+port source:alsa_input.pci-0000_07_00.6.HiFi__hw_Generic_1__source:[In] Mic2.

@perexg
Copy link
Member

perexg commented Nov 8, 2021

Please, show the full log (use https://gist.github.com/ or https://pastebin.com for example). I need to check, why the switch in mixer is not detected.

@miquecg
Copy link
Author

miquecg commented Nov 8, 2021

Here you have.

@perexg
Copy link
Member

perexg commented Nov 8, 2021

PA ignores this mixer control, checking why:

D: [pulseaudio] alsa-mixer.c: Probing path 'Mic ACP LED'
D: [pulseaudio] alsa-mixer.c: Probe of element 'Mic ACP LED' succeeded (volume=0, switch=0, enumeration=0, has_dB=0).
W: [pulseaudio] alsa-ucm.c: Path Mic ACP LED is not a volume control

@perexg
Copy link
Member

perexg commented Nov 8, 2021

Could you dump smixer contents, please? amixer -c 1 scontents

@perexg
Copy link
Member

perexg commented Nov 8, 2021

Perhaps, the capture direction is missing in the control name (PR is updated):

diff --git a/ucm2/HDA-Intel/HDA-Intel.conf b/ucm2/HDA-Intel/HDA-Intel.conf
index 7bc5f7f..78b46f0 100644
--- a/ucm2/HDA-Intel/HDA-Intel.conf
+++ b/ucm2/HDA-Intel/HDA-Intel.conf
@@ -30,9 +30,9 @@ If.use {
                Include.init.File "/HDA-Intel/init.conf"
 
                FixedBootSequence [
diff --git a/ucm2/HDA-Intel/HDA-Intel.conf b/ucm2/HDA-Intel/HDA-Intel.conf
index 7bc5f7f..78b46f0 100644
--- a/ucm2/HDA-Intel/HDA-Intel.conf
+++ b/ucm2/HDA-Intel/HDA-Intel.conf
@@ -30,9 +30,9 @@ If.use {
                Include.init.File "/HDA-Intel/init.conf"
 
                FixedBootSequence [
-                       cset-new "name='Mic ACP LED Switch' type=bool,count=1 off"
+                       cset-new "name='Mic ACP LED Capture Switch' type=bool,count=1 off"
                        exec "-/sbin/modprobe snd_ctl_led"
-                       sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:Mic ACP LED Switch"
+                       sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:Mic ACP LED Capture Switch"
                ]
        }
        True {
diff --git a/ucm2/HDA-Intel/HiFi-acp.conf b/ucm2/HDA-Intel/HiFi-acp.conf
index ead8646..a650f5c 100644
--- a/ucm2/HDA-Intel/HiFi-acp.conf
+++ b/ucm2/HDA-Intel/HiFi-acp.conf
@@ -5,6 +5,6 @@ SectionDevice."Mic1" {
                CapturePriority 100
                CapturePCM "hw:${var:AcpCardId}"
                CaptureMixerElem "Mic ACP LED"
-               CaptureSwitch "Mic ACP LED Switch"
+               CaptureSwitch "Mic ACP LED Capture Switch"
        }
 }

@miquecg
Copy link
Author

miquecg commented Nov 9, 2021

Could you dump smixer contents, please? amixer -c 1 scontents

Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 0 [0%] [-65.25dB] [off]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 52 [60%] [-26.25dB] [on]
  Front Right: Playback 52 [60%] [-26.25dB] [on]
Simple mixer control 'Speaker',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]
Simple mixer control 'Mic ACP LED',0
  Capabilities: cswitch cswitch-joined
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 63
  Front Left: Capture 0 [0%] [-17.25dB] [off]
  Front Right: Capture 0 [0%] [-17.25dB] [off]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'

Now 'Mic ACP LED' went to Capture view on alsamixer and it's a toggle, not a channel that can be muted/unmuted, but LED switches just fine.

With pavucontrol same as before.

Second Pulseaudio log

@perexg
Copy link
Member

perexg commented Nov 11, 2021

I found it. The mixer devices must be different in HiFi-acp.conf:

SectionDevice."Mic1" {
        Comment "Digital Microphone"

        Value {
                CapturePriority 100
                CapturePCM "hw:${var:AcpCardId}"
                CaptureMixer "hw:${var:AcpCardId}"
                CaptureMixerElem "Mic ACP LED"
                CaptureCTL "hw:${var:AcpCardId}"
                CaptureSwitch "Mic ACP LED Capture Switch"
        }
}

The PR was updated.

@miquecg
Copy link
Author

miquecg commented Nov 12, 2021

Same result, LED only reacts to mute/unmute of Headphones Stereo Mic when using pavucontrol.

3rd log

@miquecg
Copy link
Author

miquecg commented Feb 2, 2022

Thanks for finding out Jaroslav! Should we expect a new release or is it a matter of alsa packagers on every distro?

@perexg
Copy link
Member

perexg commented Feb 2, 2022

@miquecg
Copy link
Author

miquecg commented Feb 2, 2022

In my case LED works sometimes, for instance today. How the selinux issue explains this? Total honest question. No idea about it.

How can I check selinux policy on my Arch system?

Edit:
Looks like it's not activated on Arch by default: https://wiki.archlinux.org/title/SELinux

@miquecg
Copy link
Author

miquecg commented Feb 2, 2022

Confirmed. After reboot LED stopped working. What I notice is a different device order on KDE sound applet this time, so maybe card detection order could be causing the issue. I have to double check on this.

@perexg
Copy link
Member

perexg commented Feb 2, 2022

You may try add -d option to alsactl calls (/lib/systemd/system/alsa*.service) to get more info. I also added the serialization lock guard in the latest alsactl - alsa-project/alsa-utils@8403967 . It may also help in your case.

@miquecg
Copy link
Author

miquecg commented Feb 3, 2022

Here are the results with debug enabled.

When it worked:

feb 03 11:57:25 systemd[1]: Starting Save/Restore Sound Card State...
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1499: device='hw:0', doit=0
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1511: card-info-id: 'Generic'
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1546: list count: 22
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1574: maxnumid=22 maxnumid2=22
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1587: result code: 0
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1499: device='hw:0', doit=1
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1511: card-info-id: 'Generic'
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1587: result code: 0
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1499: device='hw:1', doit=0
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1511: card-info-id: 'Generic_1'
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1546: list count: 16
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1574: maxnumid=15 maxnumid2=16
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1579: more controls than maxnumid?
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1587: result code: -11
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: sysfs_init:45: sysfs_path='/sys'
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1499: device='hw:1', doit=1
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1511: card-info-id: 'Generic_1'
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1587: result code: 0
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1499: device='hw:2', doit=0
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1511: card-info-id: 'acp'
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1546: list count: 0
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1574: maxnumid=-1 maxnumid2=-1
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1587: result code: 0
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1499: device='hw:2', doit=1
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1511: card-info-id: 'acp'
feb 03 11:57:25 alsactl[849]: /usr/bin/alsactl: set_controls:1587: result code: 0
feb 03 11:57:25 systemd[1]: Finished Save/Restore Sound Card State.
feb 03 11:58:03 systemd[1]: Stopping Save/Restore Sound Card State...
feb 03 11:58:03 systemd[1]: alsa-restore.service: Deactivated successfully.
feb 03 11:58:03 systemd[1]: Stopped Save/Restore Sound Card State.

On subsequent boots it didn't work anymore:

feb 03 11:58:23 alsactl[826]: /usr/bin/alsactl: set_controls:1499: device='hw:0', doit=0
feb 03 11:58:23 alsactl[826]: /usr/bin/alsactl: set_controls:1511: card-info-id: 'Generic'
feb 03 11:58:23 alsactl[826]: /usr/bin/alsactl: set_controls:1546: list count: 22
feb 03 11:58:23 alsactl[826]: /usr/bin/alsactl: set_controls:1574: maxnumid=22 maxnumid2=22
feb 03 11:58:23 alsactl[826]: /usr/bin/alsactl: set_controls:1587: result code: 0
feb 03 11:58:23 alsactl[826]: /usr/bin/alsactl: set_controls:1499: device='hw:0', doit=1
feb 03 11:58:23 alsactl[826]: /usr/bin/alsactl: set_controls:1511: card-info-id: 'Generic'
feb 03 11:58:23 alsactl[826]: /usr/bin/alsactl: set_controls:1587: result code: 0
feb 03 11:58:22 systemd[1]: Starting Save/Restore Sound Card State...
feb 03 11:58:23 systemd[1]: Finished Save/Restore Sound Card State.
feb 03 12:02:59 systemd[1]: Stopping Save/Restore Sound Card State...
feb 03 12:02:59 systemd[1]: alsa-restore.service: Deactivated successfully.
feb 03 12:02:59 systemd[1]: Stopped Save/Restore Sound Card State.
-- Another boot --
feb 03 12:03:58 alsactl[797]: /usr/bin/alsactl: set_controls:1499: device='hw:0', doit=0
feb 03 12:03:58 alsactl[797]: /usr/bin/alsactl: set_controls:1511: card-info-id: 'Generic'
feb 03 12:03:58 alsactl[797]: /usr/bin/alsactl: set_controls:1546: list count: 22
feb 03 12:03:58 alsactl[797]: /usr/bin/alsactl: set_controls:1574: maxnumid=22 maxnumid2=22
feb 03 12:03:58 alsactl[797]: /usr/bin/alsactl: set_controls:1587: result code: 0
feb 03 12:03:58 alsactl[797]: /usr/bin/alsactl: set_controls:1499: device='hw:0', doit=1
feb 03 12:03:58 alsactl[797]: /usr/bin/alsactl: set_controls:1511: card-info-id: 'Generic'
feb 03 12:03:58 alsactl[797]: /usr/bin/alsactl: set_controls:1587: result code: 0
feb 03 12:03:57 systemd[1]: Starting Save/Restore Sound Card State...
feb 03 12:03:57 systemd[1]: Finished Save/Restore Sound Card State.

I've double checked device order on KDE sound applet and it was consistent for every boot.

@perexg
Copy link
Member

perexg commented Feb 3, 2022

It seems that Generic_1 card is not found (initialized). It looks like a timing issue. The udev rule /lib/udev/rules.d/90-alsa-restore.rules should handle this situation (card appears later after alsa-restore service).

@miquecg
Copy link
Author

miquecg commented Feb 3, 2022

This is the rule and for some reason it must not be working:

➜  ~ cat /lib/udev/rules.d/90-alsa-restore.rules
ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS!="card*", TEST=="/usr/bin", TEST=="/usr/share/alsa", GOTO="alsa_restore_go"
GOTO="alsa_restore_end"

LABEL="alsa_restore_go"
TEST!="/etc/alsa/state-daemon.conf", RUN+="/usr/bin/alsactl restore $attr{device/number}"
TEST=="/etc/alsa/state-daemon.conf", RUN+="/usr/bin/alsactl nrestore $attr{device/number}"

LABEL="alsa_restore_end"

@perexg
Copy link
Member

perexg commented Feb 3, 2022

Right, the RUN call should be also checked (-d argument and redirection of stderr).

@miquecg
Copy link
Author

miquecg commented Feb 4, 2022

For some reason this specific rule is not being triggered. This is what I did:

  • Change RUN commands: RUN+="/usr/bin/alsactl -d restore $attr{device/number} 2>&1 and same to the other
  • Activate debug in /etc/udev/udev.conf

With this in place nothing shows on boot logs not even on systemd-udev unit logs. So I went to manually trigger the rules with command: udevadm trigger -s sound. Same result, that specific rule didn't fire but 60-persistent-alsa.rules did it.

For some reason I don't remember now I had disabled 90-alsa-restore.rules with a symlink to /dev/null on /etc/udev/rules.d. When I realized that I just removed the link and tested again.

@miquecg
Copy link
Author

miquecg commented Feb 4, 2022

I've managed to trigger the problem consistently, at least a couple of times. It's really weird. Whenever I poweroff the laptop, LED works on next boot. If I just reboot it doesn't. That's it, quite strange and maybe indicative of a much deeper issue on this specific platform.

@hexchain
Copy link

hexchain commented Sep 24, 2022

I have a ThinkPad Z13 (AMD) and am seeing the same issue. On an Arch Linux with alsa-ucm-conf 1.2.7.2, the mic-mute LED doesn't work after a reboot. In alsamixer there is a "Mic ACP LED" control, but toggling that does nothing. However, when it happens, running alsactl restore fixes the issue until the next reboot.

Here is my /proc/asound/cards:

 0 [Generic        ]: HDA-Intel - HD-Audio Generic
                      HD-Audio Generic at 0xb0ac8000 irq 121
 1 [Generic_1      ]: HDA-Intel - HD-Audio Generic
                      HD-Audio Generic at 0xb0ac0000 irq 122
 2 [acp6x          ]: acp6x - acp6x
                      LENOVO-21D2CTO1WW-ThinkPadZ13Gen1

Here are some udev debug logs, with -d appended to the RUN line: udev-alsa.log
Here are some output from alsa-restore.service, also with -d added: alsa-restore.log

And this is what happens after running alsactl -d restore 1 manually:

% sudo alsactl -d restore 1
alsactl: init_ucm:48: ucm open '-hw:1': 0
alsactl: init_ucm:53: ucm _fboot: 0
alsactl: set_controls:1499: device='hw:1', doit=0
alsactl: set_controls:1511: card-info-id: 'Generic_1'
alsactl: set_controls:1546: list count: 17
alsactl: set_controls:1574: maxnumid=18 maxnumid2=17
alsactl: set_controls:1579: more controls than maxnumid?
alsactl: set_controls:1587: result code: -11
alsactl: sysfs_init:45: sysfs_path='/sys'
alsactl: init_ucm:48: ucm open '-hw:1': 0
alsactl: init_ucm:62: ucm _boot: 0
alsactl: set_controls:1499: device='hw:1', doit=1
alsactl: set_controls:1511: card-info-id: 'Generic_1'
alsactl: set_controls:1587: result code: 0

@perexg
Copy link
Member

perexg commented Sep 24, 2022

@hexchain : Which distro ?

'/usr/bin/alsactl: init_ucm:48: ucm open '-hw:0': -6'
'/usr/bin/alsactl: init_ucm:48: ucm open '-hw:1': -6'

It may be also a SELinux issue or so...

@hexchain
Copy link

@perexg Sorry, it's on Arch Linux, it doesn't have SELinux.

@Bodanor
Copy link

Bodanor commented Oct 28, 2022

I have a Thinkpad P14s AMD Gen 2 And i can confirm the same issue as @hexchain . Issuing the command alsa restore, makes the mic led work again until the next reboot. Seems like Mic ACP LED and Capture are in conflict

Edit : Running Arch 6.0.5 and tried older kernels with no luck.

Edit 2 : Tried Ubuntu and the OEM version and basically is works half as expected. Plug a headset Mic in, mute the headset mic via LED mic mute button, unplug it and click on the LED mic mute and the LED doesn't work anymore unless I manually open alsamixer and mute the Capture input

Basically on Ubuntu:
Computer boots : Microphone' → mute/unmute LED ✅
Plug Headset Mic: Microphone' → mute/unmute LED ✅
Mute Headset
Unplug Headset Mic: Microphone' → mute/unmute LED ❌

@hexchain
Copy link

For me, this issue seems to go away after upgrading to 6.0. The Mic Mute LED works every time for the internal microphone after boot. But I don't have a headset with a mic, so I cannot test the above scenario.

@nfp0
Copy link

nfp0 commented Sep 9, 2023

I think I've fixed it on my end. The problem is I don't know exactly what I did to fix it.

On my AMD ThinkPad P14s Gen 2 my mic mute LED was always on, independently if I muted or un-muted the mic.

I've opened alsamixer and I'm not sure what did it, but I think I just changed the sound card (F6) and disabled the Auto-Mute Mode. Then I rebooted and turned it back on.

Not sure if this is what fixed it, but seems like so.

This is on Arch Linux on kernel 6.4.12

@devhell
Copy link

devhell commented Sep 10, 2023

T14s Gen 1 here. No success with any of these suggestions, I'm afraid. The mic mutes and unmutes when pressed, just the LED will stay constantly on. I'm on 6.5.1. I'm on sway, so no DE.

@tvlpirb
Copy link

tvlpirb commented Sep 11, 2023

T14s Gen 1 here. No success with any of these suggestions, I'm afraid. The mic mutes and unmutes when pressed, just the LED will stay constantly on. I'm on 6.5.1. I'm on sway, so no DE.

I'm on a ThinkPad T14s Gen 1 AMD here, and this problem has been solved months ago. Like at least 5 months ago now. Using Arch Linux 6.5.2 with Hyprland and Sway.

Using pipewire rather than pulseaudio.

@devhell
Copy link

devhell commented Sep 12, 2023

T14s Gen 1 here. No success with any of these suggestions, I'm afraid. The mic mutes and unmutes when pressed, just the LED will stay constantly on. I'm on 6.5.1. I'm on sway, so no DE.

I'm on a ThinkPad T14s Gen 1 AMD here, and this problem has been solved months ago. Like at least 5 months ago now. Using Arch Linux 6.5.2 with Hyprland and Sway.

Using pipewire rather than pulseaudio.

Yeah, mine is AMD as well, and running pipewire rather than pulseaudio too. I'm glad it's working for you. Can you point to the fix or how you managed to make it behave accordingly?

@tvlpirb
Copy link

tvlpirb commented Sep 15, 2023

T14s Gen 1 here. No success with any of these suggestions, I'm afraid. The mic mutes and unmutes when pressed, just the LED will stay constantly on. I'm on 6.5.1. I'm on sway, so no DE.

I'm on a ThinkPad T14s Gen 1 AMD here, and this problem has been solved months ago. Like at least 5 months ago now. Using Arch Linux 6.5.2 with Hyprland and Sway.

Using pipewire rather than pulseaudio.

Yeah, mine is AMD as well, and running pipewire rather than pulseaudio too. I'm glad it's working for you. Can you point to the fix or how you managed to make it behave accordingly?

Honestly I didn't take any specific steps to fix it, I had just reinstalled arch and magically it was fixed. I would recommend you install arch or some other arch based distro onto a live USB to test if it works there. If it does then doing the same thing might fix it. Also I should mention my firmware is also updated to the latest version with fwupd incase that for some reason plays a role.

@devhell
Copy link

devhell commented Sep 16, 2023

T14s Gen 1 here. No success with any of these suggestions, I'm afraid. The mic mutes and unmutes when pressed, just the LED will stay constantly on. I'm on 6.5.1. I'm on sway, so no DE.

I'm on a ThinkPad T14s Gen 1 AMD here, and this problem has been solved months ago. Like at least 5 months ago now. Using Arch Linux 6.5.2 with Hyprland and Sway.
Using pipewire rather than pulseaudio.

Yeah, mine is AMD as well, and running pipewire rather than pulseaudio too. I'm glad it's working for you. Can you point to the fix or how you managed to make it behave accordingly?

Honestly I didn't take any specific steps to fix it, I had just reinstalled arch and magically it was fixed. I would recommend you install arch or some other arch based distro onto a live USB to test if it works there. If it does then doing the same thing might fix it. Also I should mention my firmware is also updated to the latest version with fwupd incase that for some reason plays a role.

Thanks! I'm already on a bleeding-edge distro, so that shouldn't be the issue, I hope. I've dug a bit around, and while using alsamixer, I've switched to the Realtek AC257 sound card, and then toggling Capture actually makes the LED correspond with the state. When pressing the hardware button, the Capture doesn't change its state, and neither does the LED. However, PipeWire will happily indicate that the microphone is muted and unmuted. So, not sure what's going on there. But alsamixer being able to toggle the LED is promising, so maybe this is a PEBCAK issue of some sort. I'll see what I can find. Thank you!

@nishanthkarthik
Copy link

nishanthkarthik commented Sep 22, 2023

@devhell I can reproduce the same exact pattern here. Pipewire does not control the led, alsamixer can toggle it manually when I use pipewire-alsa and pipewire. The hardware button does not toggle its state. I'm on the latest archlinux packages

@nishanthkarthik
Copy link

If it helps, randomly installing pipewire-alsa and alsautils, then running sudo alsactl restore, followed by playing with alsamixer followed by uninstalling alsamixer and pipewire-alsa fixes it (only until next reboot). I have not figured out the exact pattern required because it is not consistent.

@nfp0
Copy link

nfp0 commented Sep 22, 2023

@nishanthkarthik I honestly don't know how I did it, but mine is working correctly even after reboot.
I know it was something inside alsamixer because it got fixed after I've installed and fiddled around with it.
Have you tried enablind/disabling Auto-Mute mode as I described here?

@devhell
Copy link

devhell commented Sep 25, 2023

@nishanthkarthik I honestly don't know how I did it, but mine is working correctly even after reboot. I know it was something inside alsamixer because it got fixed after I've installed and fiddled around with it. Have you tried enablind/disabling Auto-Mute mode as I described here?

No worries. Yes, tried your solution, but after the reboot it was re-enabled again.

@himazawa
Copy link

himazawa commented Nov 4, 2023

I currently have the same issue, I have a T14 AMD with kernel 6.1.58.
Current driver version k6.1.58.

@Justinzobel
Copy link

Justinzobel commented Jan 11, 2024

I just bought a P14S Gen 1 and I have this issue as well.

amixer -c 1 controls
...
numid=16,iface=MIXER,name='Mic ACP LED Capture Switch
...
lsmod | g led
snd_ctl_led            24576  0
ledtrig_audio          12288  3 snd_ctl_led,snd_hda_codec_generic,thinkpad_acpi
snd                   159744  51 snd_ctl_led,snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_sof,snd_timer,snd_compress,thinkpad_acpi,snd_soc_core,snd_pcm
soundcore              16384  2 snd_ctl_led,snd

@pkapustin
Copy link

pkapustin commented Feb 4, 2024

@nfp0 Thanks a lot, your solution has fixed the issue (Mic Mute Led always on) for me as well on AMD ThinkPad P16s Gen 2.
Also mentioning for completeness that alsamixer is available as part of the alsa-utils package.

I think I've fixed it on my end. The problem is I don't know exactly what I did to fix it.

On my AMD ThinkPad P14s Gen 2 my mic mute LED was always on, independently if I muted or un-muted the mic.

I've opened alsamixer and I'm not sure what did it, but I think I just changed the sound card (F6) and disabled the Auto-Mute Mode. Then I rebooted and turned it back on.

Not sure if this is what fixed it, but seems like so.

This is on Arch Linux on kernel 6.4.12

Just as a note, the solutions from either of these pages didn't work for me.
https://wiki.archlinux.org/title/Lenovo_ThinkPad_P16s_(AMD)_Gen_2
https://wiki.archlinux.org/title/Lenovo_ThinkPad_T14_(AMD)_Gen_4#Mic_LED_always_on

I assume that the solution from the second page probably doesn't work now because Mic LED controls were removed from alsamixer as explained here.
https://bbs.archlinux.org/viewtopic.php?id=269526

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests