Lenovo Fn+F4 MicMute binding fix

From ZhoubaWiki
Revision as of 18:36, 9 May 2025 by Garak (talk | contribs) (better instruction wording)
Jump to navigation Jump to search

Start ACPI service if not running:

$ /etc/init.d/acpid start

Run acpi_listen and hit the key kombination. Something like this should emit:

$ acpi_listen 
button/micmute MICMUTE 00000080 00000000 K

Create a file /etc/acpi/events/thinkpad-micmute and put this snippet into it (update event based on previous command output):

event=button/micmute MICMUTE 00000080 00000000 K                                
action=/etc/acpi/thinkpad-micmute.sh

Create a file /etc/acpi/thinkpad-micmute.sh and make it executable

$ touch /etc/acpi/thinkpad-micmute.sh && chmod a+x /etc/acpi/thinkpad-micmute.sh

Find out the card and control to switch upon:

$ cat /proc/asound/cards
 0 [HDMI           ]: HDA-Intel - HDA Intel HDMI
                      HDA Intel HDMI at 0xf2530000 irq 42
 1 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xf2534000 irq 43
29 [ThinkPadEC     ]: ThinkPad EC - ThinkPad Console Audio Control
                      ThinkPad Console Audio Control at EC reg 0x30,

From the example above, the card to use is card #1 (using 1 in the examples in the text later - update based on your setup). In case the card is not the default one (= the first one when sorted by ID ascendingly) card ID needs to be specified explicitly. If it's the default one, the -c1 switch can be omitted. Open file /etc/acpi/thinkpad-micmute.sh and put the following snippet into it:

/usr/bin/amixer -c1 sset Capture toggle

Restart acpid service

$ /etc/init.d/acpid restart

also make sure it is being started after boot

$ systemctl enable acpid