Difference between revisions of "Lenovo Fn+F4 MicMute binding fix"

From ZhoubaWiki
Jump to navigation Jump to search
(Add Fn + F4 article)
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Start ACPI service if not running:
+
Start ACPI service if not running:<syntaxhighlight lang="sh">
/etc/init.d/acpid start
+
$ /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 file <code>/etc/acpi/thinkpad-micmute.sh</code> 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 start
+
$ /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.socket
+
$ systemctl enable acpid
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 18:37, 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 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