Comment 45 for bug 408903

Revision history for this message
Chris Van Hoof (vanhoof) wrote :

Couple bits to note:

1: As for the mic-mute LED. There was a thread a few months back (would have to dig it up) where the LED functioning was brought up and the proposed patch was never ack'd in favor of a more scale-able approach, however I'm not sure if that is still an active effort. Here is the patch in question for reference which I've tested on Precise and my x220's LED light does function with the patch:

http://kernel.ubuntu.com/git?p=vanhoof/ubuntu-precise.git;a=commitdiff;h=94758d8ce7068c5c3b7eb91fceb3c7acca9b0bd5

2: There is no userspace plumbing for this key (as pitti mentioned). I have been using a workaround on my x220 to get the mic mute button to function. With Oneiric and Precise, with these acpi script workarounds the mute function _should_ function (no LED) when depressed (verify in sound settings).

Here are the two scripts I'm using:

==> /etc/acpi/micmute.sh <==
#!/bin/bash

test -x /usr/bin/amixer || exit 0

mic_status () {
 STATUS=$(amixer sget Capture | grep ': Capture' | grep -v Limits | head -n 1 | awk '{print $7}' | sed 's/\[//;s/\]//')
}

mic_status

if [[ $STATUS == "on" ]]; then
 /bin/echo "1" > '/sys/devices/platform/thinkpad_acpi/leds/tpacpi::micmute/brightness'
elif [[ $STATUS == "off" ]]; then
 /bin/echo "0" > '/sys/devices/platform/thinkpad_acpi/leds/tpacpi::micmute/brightness'
fi

/usr/bin/amixer -q sset Capture toggle

==> /etc/acpi/events/lenovo-micmute <==
#
# listens for an acpi event when micmute hotkey is pressed
# ... and executes /etc/acpi/micmute.sh
#
event=ibm/hotkey HKEY 00000080 0000101b
action=/etc/acpi/micmute.sh

======================================================================================

Couple additional bits to note:

1: If using these scripts make sure you're seeing the acpi event when the mic mute key is pressed, and that value matches what is entered in /etc/acpi/events/lenovo-micmute:

$ acpi_listen
    ... press the mic-mute key

You should see something similar (if not identical) to this:

"ibm/hotkey HKEY 00000080 0000101b"

2: Set both /etc/acpi/events/lenovo-micmute and /etc/acpi/micmute.sh to be executable and restart the acpid service.

3: I've written micmute.sh in a way where the LED will be toggled, so it relies on LED support, however it should work even without the aforementioned patch.

Lastly, if you would like to test out a precise kernel with the LED patch you can download a build here:

http://kernel.ubuntu.com/~vanhoof/tp/precise/amd64/
http://kernel.ubuntu.com/git?p=vanhoof/ubuntu-precise.git;a=shortlog;h=refs/heads/tp

-chris