# Thinkpad buttons on T440s won't work

## MarcusXP

Hi,

I just installed Gentoo on my new T440s.

Most of the stuff works, except the special Thinkpad buttons (mute, volume up/down, etc)

Some buttons work kinda flaky, some don't work at all.

Volume up/down is what I am interested in mostly. When I press any volume button it pops-up the OSD showing 0% volume and doesn't do anything (but the volume is at max already).

Anyone has a T440s with Gentoo installed, to confirm these buttons won't work?

I have this enabled in the kernel:

   Device Drivers  ---> 

     [*] X86 Platform Specific Device Drivers  --->  

       <M>   ThinkPad ACPI Laptop Extras 

According to this link: http://www.thinkwiki.org/wiki/Thinkpad-acpi#Supported_ThinkPads

it seems T440s is supported (or not??). I see T440p and T440s are colored in RED, as opposed to some older models, colored in BLUE.

Does that mean this kernel option doesn't work for T440s/T440p?

thanks,

Marcus

----------

## xaviermiller

Hello,

On my S540, I also enabled Lenovo/Thinkpad stuff in the HID section. And everything is working.

----------

## MarcusXP

In the HID section is only the Lenovo keyboard, which has nothing to do with the Thinkpad special buttons.

I don't have that enabled, but I doubt it would make any difference in my case.

Anyone with T440s or T440p that can confirm/infirm the special buttons work for him?

----------

## xaviermiller

Why don't you try it ?

----------

## albright

 *Quote:*   

> Anyone with T440s or T440p that can confirm/infirm the special buttons work for him?

 

I have a t440s and the buttons work

the volume up/down/mute buttons work in kde and they worked without any setup

once sound was working

the micmute button I had to setup manually (using xbindkeys)

the brightness keys work once I set

echo N >  /sys/module/video/parameters/brightness_switch_enabled

in /etc/local.d/baselayoutstart

rfkill works out of the box

the special windows keys at F9 ... don't do anything and the

last three seem to give identical keycodes

----------

## MarcusXP

 *XavierMiller wrote:*   

> Why don't you try it ?

 

I did, it made no difference  :Sad: 

----------

## MarcusXP

 *albright wrote:*   

>  *Quote:*   Anyone with T440s or T440p that can confirm/infirm the special buttons work for him? 
> 
> I have a t440s and the buttons work
> 
> the volume up/down/mute buttons work in kde and they worked without any setup
> ...

 

For some reason I can't hear the welcome sound when I login in kde, so I am not sure if the sound works properly.

However, if I go to:

 System Settings / Multimedia / Audio and Video Settings

I can see "HDA Intel PCH, ALC292 Analog" device first in the list and if I press the "Test" button, I can see the sound playing. 

If I keep the mouse over the little speaker icon in the taskbar it shows a popup message "Volume at 0%" and I am not able to increase the volume.

If I click on the little speaker icon, it shows the "Master" volume all the way to the top (contradicting the message with "Volume at 0%")

Does it mean the sound works properly or not?

I didn't get the other part regarding the brightness keys, how do I make them work as well?

----------

## albright

I doubt your sound is setup correctly

what happens if you run

```
speaker-test -c2 -tpink
```

(this program from alsa-utils)

----------

## MarcusXP

 *albright wrote:*   

> I doubt your sound is setup correctly
> 
> what happens if you run
> 
> ```
> ...

 

Looks like you are right:

```
T440s ~ # speaker-test -c2 -tpink

speaker-test 1.0.27.2

Playback device is default

Stream parameters are 48000Hz, S16_LE, 2 channels

Using 16 octaves of pink noise

ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.0.27.2/work/alsa-lib-1.0.27.2/src/pcm/pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave

Playback open error: -2,No such file or directory

```

----------

## MarcusXP

what could be the problem?

I already have "Intel HD audio" enabled in the kernel under "Sound Card support\Advanced Linux sound architecture\PCI sound devices"

----------

## albright

I think the problem is that the t440s has multiple sound cards (at least

three) and the system has to be directed to use the proper one.

on my t400s, alsamixer shows the following three cards:

HDA Intel PCH

Thinkpad Console Audio Control

HDA Intel HDMI

I had some trouble getting the correct setting, but in the end the

solution for me was to load the snd_hda_intel kernel module

with this parameter:

index=2

The way I did this was to first blacklist snd_hda_intel (adding

"blacklist snd_hda_intel" to /etc/modprobe.d/blacklist.conf) and

then add these lines to /etc/conf.d/modules

modules="thinkpad_acpi snd_hda_intel snd_hda_codec_realtek"

module_thinkpad_acpi_args="fan_control=1"

module_snd_hda_intel_args="index=2"

(of course, the thinkpad_acpi stuff is unrelated to sound issues)

----------

## MarcusXP

I made the changes you suggested but no help.

I think none of the thinkpad keys work properly actually, not even the ones that increase/decrease screen brightness.

I had Thinkpad T430s before and W530 working just fine with Gentoo, and Thinkpad keys used to work out of the box, with no special configuration.

But they don't seem to work with T440s for some reason  :Sad: 

If there's any owner of T440s using Gentoo out there, I'd really appreciate his experience.

----------

## albright

so, still no sound?

anyway, about the keys, you could use xbindkeys to

set the function and find the keycodes for the thinkpad

keys

----------

## chithanh

I recently received a T440s too, and the volume, brightness and wifi function keys work fine without any extra configuration needed in KDE. The brightness key I need to hold down longer, because /sys/class/backlight/acpi_video0/brightness goes from 0 to 100 and is only in/decremented by 1 at a time. The controls in /sys/class/backlight/intel_backlight/ seem to have no effect.

What does not work here is the external monitor hotkey, but that is expected I guess.

I summarized what I got to work so far in the wiki: http://wiki.gentoo.org/wiki/Lenovo_ThinkPad_T440s

----------

## albright

@chithanh

a little off topic, but have had this problem

using min_power setting in ASPM causes ext4 disk errors and

remount as ro after plugging back into ac?

I have to use medium_power setting ... (but it low power setting

appears to work fine in windows)

----------

## chithanh

If there is a problem with SATA ALPM, it is best to report it at kernel bugzilla.

Also try updating your BIOS to 2.21 if you have not already done so.

----------

## jmp_

It may work, but does not change bright on KDE.

Does it work for you ?

 *albright wrote:*   

>  *Quote:*   Anyone with T440s or T440p that can confirm/infirm the special buttons work for him? 
> 
> I have a t440s and the buttons work
> 
> the volume up/down/mute buttons work in kde and they worked without any setup
> ...

 

----------

## GOS

I have a Thinkpad R400 in use. 

Here it is necessary to boot with "acpi_osi=Linux" and "acpi_backlight=vendor". Additionally one has to activate "Support for NVRAM Polling" in the "Thinkpad ACPI Laptop Extras" section. (Sometimes it is necessary to build the whole kernel new for working hotkeys - secure ".config" and then "make mrproper" before you build the kernel new. Don't forget to rebuild dbus, X11-drivers, eudev and other kernel-related packages in the "mrproper" case.) 

Otherwise the mute button doesn't work properly and if one uses this button ones he destroys the proper function of the volume-keys. On the other hand on newer thinkpads (e.g. X230) only "acpi_backlight=vendor" is necessary (not for the hotkeys bur rather for a proper working backlight).

Best regards 

GOS

----------

## jcjc

Hi everybody,

I posted a bug on the ALPM problem, as I believe this leads to hibernate crashes.

Maybe you can add additional info if you have any:

https://bugzilla.kernel.org/show_bug.cgi?id=72191

Bye

----------

## albright

thanks for that; I sent a followup

the most important piece of information is that this

same problem infects windows systems too; see

http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/T440s-is-killing-Samsung-840-pro-SSD-s/td-p/1366903

My SSD is Samsung MZ7TD512HAGM-0001L  (512gb) which is an oem version of

840 series I believe.

Do you also have Samsung SSD?

----------

## dziadu

For me most of the buttons were working: Mute, VolUP, VolDown, BacklightUp, BacklightDown on kernel up to 3.12.21-r1.

After upgrade to 3.14.x series BacklightDown stopped working.

With 3.15.4/5 none of Backlight buttons is working anymore. Three volume buttons are OK.

I compared source code of thinkpad_acpi kernel module for 3.12.21 nad 3.15.5 but did not found anything suggesting changes in this part. But I am not expert in kernel modules.

Any ideas?

----------

## chithanh

Did you try the acpi_backlight=vendor workaround which is suggested in the wiki?

----------

## albright

 *Quote:*   

> After upgrade to 3.14.x series BacklightDown stopped working.
> 
> With 3.15.4/5 none of Backlight buttons is working anymore. Three volume buttons are OK.  

 

FWIW, I'm running 3.15.6 and the backlight keys work, given (as mentioned above)

that I run

echo N > /sys/module/video/parameters/brightness_switch_enabled 

at bootup

Without the echo the brightness keys still work but you have to hit them about

5 or six times to get one change in brightness

----------

## dziadu

The 

```
acpi_backlight=vendor
```

 does not change anything for me.

 *Quote:*   

> echo N > /sys/module/video/parameters/brightness_switch_enabled 
> 
> at bootup

 

Does it must be run at some certain stage of boot or can be done in already running system? Becasue for me now it also does not work.

The BrightnessUp button works, but no BrightnessDown. Crrently I use kernel 3.15.7

----------

## dziadu

Kernel 3.16 and still the same problem.

I additionally tested with xev, here is the message when I press Fn+BrightnesUp

```
KeyRelease event, serial 55, synthetic NO, window 0x5400001,

    root 0x2ba, subw 0x0, time 2052863, (-481,-292), root:(0,294),

    state 0x10, keycode 233 (keysym 0x1008ff02, XF86MonBrightnessUp), same_screen YES,

    XLookupString gives 0 bytes: 

    XFilterEvent returns: False
```

There is no input for BrightnessDown.

Also showkey does not show anything for BrightnesDown keys. Looks like this key is not recognized at all (I have similarly no input for MicMute button but is nod crucial fro me).

----------

## albright

for me, xev gives this output for brightness-down:

 *Quote:*   

> RRNotify event, serial 48, synthetic NO, window 0x6200001,
> 
>     subtype XRROutputPropertyChangeNotifyEvent
> 
>     output eDP1, property Backlight, timestamp 76651476, state NewValue

 

xbindkeys -k gives this output for brightness-down

 *Quote:*   

> "(Scheme function)"
> 
>     m:0x0 + c:232
> 
>     XF86MonBrightnessDown
> ...

 

It's very strange you get nothing from that button   :Confused: 

----------

## dziadu

I found the solution in Thinkwiki, in section Hotkeys:

 *Quote:*   

> # cat /proc/acpi/ibm/hotkey 
> 
> status:         enabled
> 
> mask:           0x0000ffbb
> ...

 

With mask 0xffbb did not work, after enabling all (whatever it is) brightness down key works again.

On this page is section Speichern is given how to pass this to kernel module at boot:

 *Quote:*   

> # cat /etc/modprobe.d/thinkpad_acpi.conf
> 
> options thinkpad_acpi experimental=1 fan_control=1 hotkey=enable,0xffff8f bluetooth=enable

 

----------

