FS#71768 - X220 Mic Mute Button LED won't turn off since kernel 5.13

Attached to Project: Arch Linux
Opened by Angelo Geulin (arvl) - Sunday, 08 August 2021, 10:18 GMT
Last edited by Jonas Witschel (diabonas) - Sunday, 08 August 2021, 14:43 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Starting Linux 5.13, the mic mute button LED on the ThinkPad X220 stays lit after boot, and even when the mic is unmuted. The culprit seems to be this commit:

https://github.com/torvalds/linux/commit/e2da5ff435d64b59880648269c136484bea5c312

Muting and unmuting works fine, it's just that the Mute LED button stays on even when unmuted.
This task depends upon

Closed by  Jonas Witschel (diabonas)
Sunday, 08 August 2021, 14:43 GMT
Reason for closing:  Upstream
Comment by Jonathon (jonathon) - Sunday, 08 August 2021, 12:09 GMT
Just adding a data point that I'm also seeing this on my X230.
Comment by Jonas Witschel (diabonas) - Sunday, 08 August 2021, 12:27 GMT
Does the LED turn off when you change its trigger by issuing the following command?

sudo sh -c 'echo off > /sys/class/sound/ctl-led/mic/mode'

If yes, the LED is controlled correctly by the kernel and the microphone does not get muted correctly (or at least it's not recognised as being muted by the kernel). Otherwise something is wrong with the kernel code to control the LED itself.

Also, please provide the output of

cat /sys/class/leds/hda::micmute/trigger
Comment by Angelo Geulin (arvl) - Sunday, 08 August 2021, 12:42 GMT
~~That command does not change anything for me. It looks like this is a kernel bug.~~

Edit: I tried rebooting and it seems that command turns on and off the LED just fine.

I don't have a `/sys/class/leds/hda::micmute/trigger`, but there is a `/sys/class/leds/platform::micmute/trigger` after the reboot.

Here is the output of that file:

none usb-gadget usb-host kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock AC-online BAT0-charging-or-full BAT0-charging BAT0-full BAT0-charging-blink-full-solid disk-activity disk-read disk-write ide-disk mtd nand-disk cpu cpu0 cpu1 cpu2 cpu3 cpu4 cpu5 cpu6 cpu7 panic mmc0 rfkill-any rfkill-none audio-mute [audio-micmute] rfkill0 rfkill1 rc-feedback rfkill2 bluetooth-power
Comment by Jonas Witschel (diabonas) - Sunday, 08 August 2021, 12:54 GMT
Interesting, it seems as if the microphone mute LED is not recognised and setup to display the status of the microphone at all. In this case, please try if you can switch the LED on and off with the following commands:

sudo sh -c 'echo 0 > /sys/class/leds/platform::micmute/brightness'
sudo sh -c 'echo 1 > /sys/class/leds/platform::micmute/brightness'

"0" should turn it off, "1" should turn it on, but this might be switched if the LED is not recognised correctly by the kernel.

If that works, you can try

sudo sh -c 'echo audio-micmute > /sys/class/leds/platform::micmute/trigger; echo follow-mute > /sys/class/sound/ctl-led/mic/mode'

to setup the LED to light up only when the microphone is muted.

Did the LED use to follow the status of the microphone mute before kernel 5.13, or was it just permanently turned off then?
Comment by Angelo Geulin (arvl) - Sunday, 08 August 2021, 13:19 GMT
These two commands work fine.

sudo sh -c 'echo 0 > /sys/class/leds/platform::micmute/brightness'
sudo sh -c 'echo 1 > /sys/class/leds/platform::micmute/brightness'

They turn off and on the mic button LED.

This command works fine, I suppose?

sudo sh -c 'echo audio-micmute > /sys/class/leds/platform::micmute/trigger; echo follow-mute > /sys/class/sound/ctl-led/mic/mode'

If the if the mic is muted in Pavucontrol, it sets the light ON. If the mic is unmuted in Pavucontrol, it sets the light OFF.

>Did the LED use to follow the status of the microphone mute before kernel 5.13, or was it just permanently turned off then?

Before kernel 5.13, the LED switches just fine when I toggle the mic on and off in Pavucontrol.
Comment by Jonas Witschel (diabonas) - Sunday, 08 August 2021, 13:36 GMT
OK, then the problem is that the microphone mute LED is for some reason not recognised as a micmute LED and therefore doesn't get its trigger ("audio-micmute") assigned correctly. I suggest opening a bug report for this at https://bugzilla.kernel.org/ (Product: "Drivers", Component: "Sound(ALSA)") and providing the output of alsa-info.sh (https://www.alsa-project.org/wiki/AlsaInfo) to show your hardware configuration.

As a workaround, you can apply the correct trigger on every boot by creating a file /etc/tmpfiles.d/micmute-led.conf with the following contents:

w /sys/class/leds/platform::micmute/trigger - - - - audio-micmute

(As a bonus, if you want to invert the logic, i.e. light the LED if the microphone is unmuted, you can achieve this by adding the following line:)

w /sys/class/sound/ctl-led/mic/mode - - - - follow-route
Comment by Angelo Geulin (arvl) - Sunday, 08 August 2021, 13:53 GMT
Thanks for the tip. I'll try reporting there if it hasn't been yet.
Comment by Jonas Witschel (diabonas) - Sunday, 08 August 2021, 14:43 GMT
Thank you! Since this is a kernel regression that needs to be fixed upstream, I am going to close this bug report for now.

Loading...