[ltp] How to get volume hotkeys working again on W500?

Marc MERLIN linux-thinkpad@linux-thinkpad.org
Sun, 28 Feb 2010 09:39:49 -0800


[pleaes Cc me on replies so that I can see them faster]

I've read the list archives, I know ubuntu did something not much loved
where they generate X events on the hardware volume keys.
As a matter of fact, I get those:
KeyRelease event, serial 35, synthetic NO, window 0x6200001,
    root 0x126, subw 0x6200002, time 1337700564, (42,27), root:(550,1045),
    state 0x0, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

So, with an ugly hack, installing xbindkeys, and:
gandalfthegrey:~$ cat .xbindkeysrc 
"aumix -v -10"
XF86AudioLowerVolume

"aumix -v +10"
XF86AudioRaiseVolume


I was able to make things work again.

But this made me curious: why can't I get the hardware keys to work at the
OS level anymore like they used to?

My W500's hotkey mask comes with:
gandalf:~# cat /sys/devices/platform/thinkpad_acpi/hotkey_recommended_mask
0x038c7fff

linux/Documentation/laptops/thinkpad-acpi.txt gives the hotkey mask
and 
0x1015  0x14    VOLUME UP       Internal mixer volume up. This
                                key is always handled by the
                                firmware, even when unmasked.
                                NOTE: Lenovo seems to be changing
                                this.
0x1016  0x15    VOLUME DOWN     Internal mixer volume up. This
                                key is always handled by the
                                firmware, even when unmasked.
                                NOTE: Lenovo seems to be changing
                                this.
0x1017  0x16    MUTE            Mute internal mixer. This
                                key is always handled by the
                                firmware, even when unmasked.   

As a result, I tried to add the 0x14 and 0x15 bits to the hotkey mask and fed
gandalfthegrey [mc]# cat /proc/acpi/ibm/hotkey
status:         enabled
mask:           0x03bc7fff
commands:       enable, disable, reset, <mask>

(0x03bc7fff instead of 0x038c7fff)

Yet, using the mute key still works.
When I mute, the vol up and vol down keys do unmute, but this happens in the bios. 

tpb doesn't see the keys anymore (while tpb does see mute), and acpi_listen
does not see the keys either (strace of tpb or acpid doesn't show anything
registering in tpb or acpid when I push vol up and vol down).

I used to have tpb control master mixer volume, which I can't do anymore now.

I guess I can live with making this work through X, but any idea what
changed or what I'm missing?

Thanks,
Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/