Difference between revisions of "Lenovo Fn+F4 MicMute binding fix"
(Add Fn + F4 article) |
(Update - get card ID) |
||
| Line 1: | Line 1: | ||
| − | Start ACPI service if not running: | + | Start ACPI service if not running:<syntaxhighlight lang="sh"> |
| − | + | $ /etc/init.d/acpid start | |
| + | </syntaxhighlight> | ||
Run <code>acpi_listen</code> and hit the key kombination. Something like this should emit:<syntaxhighlight lang="sh"> | Run <code>acpi_listen</code> and hit the key kombination. Something like this should emit:<syntaxhighlight lang="sh"> | ||
$ acpi_listen | $ acpi_listen | ||
| Line 9: | Line 10: | ||
</syntaxhighlight>Create a file <code>/etc/acpi/thinkpad-micmute.sh</code> and make it executable<syntaxhighlight lang="sh"> | </syntaxhighlight>Create a file <code>/etc/acpi/thinkpad-micmute.sh</code> and make it executable<syntaxhighlight lang="sh"> | ||
$ touch /etc/acpi/thinkpad-micmute.sh && chmod a+x /etc/acpi/thinkpad-micmute.sh | $ touch /etc/acpi/thinkpad-micmute.sh && chmod a+x /etc/acpi/thinkpad-micmute.sh | ||
| − | </syntaxhighlight>Open it and put the following snippet into it:<syntaxhighlight lang="sh"> | + | </syntaxhighlight>Find out the card and control to switch upon:<syntaxhighlight lang="sh"> |
| − | /usr/bin/amixer sset Capture toggle | + | $ 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, | ||
| + | </syntaxhighlight>From the example above, the card to use is card <code>#1</code> (using <code>1</code> 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 <code>-c1</code> switch can be omitted. | ||
| + | |||
| + | Open it and put the following snippet into it:<syntaxhighlight lang="sh"> | ||
| + | /usr/bin/amixer -c1 sset Capture toggle | ||
</syntaxhighlight>Restart acpid service<syntaxhighlight lang="sh"> | </syntaxhighlight>Restart acpid service<syntaxhighlight lang="sh"> | ||
| − | $ /etc/init.d/acpid | + | $ /etc/init.d/acpid restart |
</syntaxhighlight>also make sure it is being started after boot<syntaxhighlight lang="sh"> | </syntaxhighlight>also make sure it is being started after boot<syntaxhighlight lang="sh"> | ||
| − | systemctl enable acpid | + | $ systemctl enable acpid |
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 18:35, 9 May 2025
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 it 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