Jump to content

ThinkPad special keys Fn+Fxy


coverup
 Share

Recommended Posts

Does anybody have ThinkPad T61 special keys working under Mandriva 2008.0 Free? I have just tried Ubuntu Gutsy 7.10 Live CD, and to my surprise all special keys Fn+F2 to Fn+F12 work as they should. Only key that does not work is Fn+F7 (display switch). With Mandriva, only Fn+F4 (suspend to RAM) and Fn+F12 (suspend to Disk) work. I found that /proc/acpi/ibm/hotkey is sat to "disabled" on boot in Mandriva 2008.0. But even after I enabled the special keys, none of them work except for Fn+F4 and Fn+F12. A brief comparison between /etc/acpi/ibm/ in Ubuntu and Mandriva shows that in Ububntu, the directory is populated with scripts and events, while in Mandriva only the power management events are present by the thinkpad_icpi modules. Why is this difference? How to get the keys work under Mandriva?

Link to comment
Share on other sites

Does anybody have ThinkPad T61 special keys working under Mandriva 2008.0 Free? How to get the keys work under Mandriva?

 

I have X30. The hotkeys work for me after I installed a package called ibm-acpi through the MCC. Actually I just looked for "IBM" in the search box and found that package, didn't even look on the web.

Link to comment
Share on other sites

Thanks for the replies. I have the thinkpad-acpi package (which replaced ibm-acpi) but it still does not allow me to switch between the LCD and an external display, neither can I switch on/off bluetooth. I looked at the ibm-acpi scripts but was concerned they might interfere with 2008 scripts such as hibernation one, so I removed them...

Link to comment
Share on other sites

With the thinkpad-acpi package notice the following:

ibm-acpi/thinkpad-acpi events

 

Some of the following events require a # echo enable,0xffff >/proc/acpi/ibm/hotkey (when using ibm-acpi) in order to make acpi able to get information on them. Since the newer thinkpad-acpi has a larger number of bits that can be set in the mask, you might try # echo enable,0xffffffff >/proc/acpi/ibm/hotkey if you are using this driver. These events can be used to configure acpid.

 

So in other words, instead of issueing the command: echo 0xffff > /proc/acpi/ibm/hotkey

Issue this instead: echo 0xffffffff > /proc/acpi/ibm/hotkey

 

Try the echo commands to see what works. When you get it working, you can add lines to the /etc/modprobe.conf file to make the changes stick after a reboot.

 

See also the following from the IBM ThinkPad ACPI Extras Driver README file.

Hot keys -- /proc/acpi/ibm/hotkey

---------------------------------

 

Without this driver, only the Fn-F4 key (sleep button) generates an

ACPI event. With the driver loaded, the hotkey feature enabled and the

mask set (see below), the various hot keys generate ACPI events in the

following format:

 

ibm/hotkey HKEY 00000080 0000xxxx

 

The last four digits vary depending on the key combination pressed.

All labeled Fn-Fx key combinations generate distinct events. In

addition, the lid microswitch and some docking station buttons may

also generate such events.

 

The following commands can be written to this file:

 

echo enable > /proc/acpi/ibm/hotkey -- enable the hot keys feature

echo disable > /proc/acpi/ibm/hotkey -- disable the hot keys feature

echo 0xffff > /proc/acpi/ibm/hotkey -- enable all possible hot keys

echo 0x0000 > /proc/acpi/ibm/hotkey -- disable all possible hot keys

... any other 4-hex-digit mask ...

echo reset > /proc/acpi/ibm/hotkey -- restore the original mask

 

The bit mask allows some control over which hot keys generate ACPI

events. Not all bits in the mask can be modified. Not all bits that

can be modified do anything. Not all hot keys can be individually

controlled by the mask. Most recent ThinkPad models honor the

following bits (assuming the hot keys feature has been enabled):

 

key bit behavior when set behavior when unset

 

Fn-F3 always generates ACPI event

Fn-F4 always generates ACPI event

Fn-F5 0010 generate ACPI event enable/disable Bluetooth

Fn-F7 0040 generate ACPI event switch LCD and external display

Fn-F8 0080 generate ACPI event expand screen or none

Fn-F9 0100 generate ACPI event none

Fn-F12 always generates ACPI event

 

Some models do not support all of the above. For example, the T30 does

not support Fn-F5 and Fn-F9. Other models do not support the mask at

all. On those models, hot keys cannot be controlled individually.

 

Note that enabling ACPI events for some keys prevents their default

behavior. For example, if events for Fn-F5 are enabled, that key will

no longer enable/disable Bluetooth by itself. This can still be done

from an acpid handler for the ibm/hotkey event.

 

Note also that not all Fn key combinations are supported through

ACPI. For example, on the X40, the brightness, volume and "Access IBM"

buttons do not generate ACPI events even with this driver. They *can*

be used through the "ThinkPad Buttons" utility, see

http://www.nongnu.org/tpb/

 

Additionally, there is a lot of good information at http://www.thinkwiki.org. There you can search on "hotkeys" and "acpi" to find more on this subject.

Link to comment
Share on other sites

I have tried both echo 0xffff > /proc/acpi/ibm/hotkey and echo 0xffffffff > /proc/acpi/ibm/hotkey. These commands enable the acpi daemon to listen when a Fn+Fx key is pressed (As a matter of fact, running one of those commands was necessary to activate hibernation via Fn+F12).

 

What Mandriva missing is a set of scripts in /etc/acpi/events and /etc/acpi/actions that make the system respond to the special buttons. Ubuntu comes with a wealth of such scripts, while mandriva includes virtually none. For instance, neither tpb nor kmilo have any effect on the screen brightness, they only display the current level setting in /proc/acpi/ibm/brightness on the screen. Contrast to this, in Ubuntu Fn+Home, Fn+End does actually reduce/increase the brightness. same goes to the bluetooth and other Fn keys, they just work out of the box.

 

So, my question, is it possible to download those scripts for Mandriva?

Link to comment
Share on other sites

The screen brightness keys worked for me from the beginning, even before I started messing with anything. Take a look at the readme for ibm-acpi. It has a wealth of information. http://ibm-acpi.sourceforge.net/README

 

I found the scripts in /etc/acpi/events and /etc/acpi/actions were already there when I went to look for them. I am not sure if they were there all the time or some program I installed put them there. I have installed: acpi, acpid, ibm-acpi, radeontool, tpb, and kima. I installed in the past configure-thinkpad, but I could not get it to work because I did not have the thinkpad module installed. I ended up uninstalling configure thinkpad. See if the following are any help. If you want any specific scripts, I can put them here, although I do not see any specific script files on my system to control display brightness.

 

CMOS control -- /proc/acpi/ibm/cmos

-----------------------------------

 

This feature is used internally by the ACPI firmware to control the

ThinkLight on most newer ThinkPad models. It may also control LCD

brightness, sounds volume and more, but only on some models.

 

The commands are non-negative integer numbers:

 

echo 0 >/proc/acpi/ibm/cmos

echo 1 >/proc/acpi/ibm/cmos

echo 2 >/proc/acpi/ibm/cmos

...

 

The range of valid numbers is 0 to 21, but not all have an effect and

the behavior varies from model to model. Here is the behavior on the

X40 (tpb is the ThinkPad Buttons utility):

 

0 - no effect but tpb reports "Volume down"

1 - no effect but tpb reports "Volume up"

2 - no effect but tpb reports "Mute on"

3 - simulate pressing the "Access IBM" button

4 - LCD brightness up

5 - LCD brightness down

11 - toggle screen expansion

12 - ThinkLight on

13 - ThinkLight off

14 - no effect but tpb reports ThinkLight status change

 

LCD brightness control -- /proc/acpi/ibm/brightness

---------------------------------------------------

 

This feature allows software control of the LCD brightness on ThinkPad

models which don't have a hardware brightness slider. The available

commands are:

 

echo up >/proc/acpi/ibm/brightness

echo down >/proc/acpi/ibm/brightness

echo 'level <level>' >/proc/acpi/ibm/brightness

 

The <level> number range is 0 to 7, although not all of them may be

distinct. The current brightness level is shown in the file.

Edited by David Batson
Link to comment
Share on other sites

Thank you all for you comments and suggestions.

 

First, let me note that T4x ThinkPads are different from T61 and are much better IMHO (I still have T41). In T4x, the screen brightness and volume are not software controlled, hence these buttons don't rely on acpi events. Unfortunately, this is not the case with T61.

 

Eventually, with the help from ThinkWiki, I managed to get the bluetooth switch, screen blanking and video toggle working by manually adding events descriptions and acpi actions scripts. BUT, they only work after I manually restart acpid and acpi daemons. The system boots Ok, but scripts do not work until I manually restart acpid and acpi. After acpi restart, .the bluetooth and monitor switches and screen blanking work. I cannot see why it is necessary to do manual restart....

 

As for the LCD brightness, things are messed up in Mandriva quite badly. Most likely the bug is in the kpowersave applet which controls the brightness. At this moment, pressing Fn+Home and Fn+End (brightenss up/down) results in the screen brightness jumping to 100%. This silly bug takes over any other scripts you would provide for this. As I mentioned, Ubuntu handles ThinkPad controls a lot more gracefully, and I am considering switching to Ubuntu. The LCD is one of the main power drains, lack of proper control to adjust it properly is not just a nuisance.

Link to comment
Share on other sites

The system boots Ok, but scripts do not work until I manually restart acpid and acpi. After acpi restart, .the bluetooth and monitor switches and screen blanking work. I cannot see why it is necessary to do manual restart....

 

As for the LCD brightness, things are messed up in Mandriva quite badly. Most likely the bug is in the kpowersave applet which controls the brightness.

I am guessing that if you enter the commands to start acpi and acpid in modprobe.conf, that should start the daemons on boot up. /etc/modprobe.conf is where I start ibm-acpi.

 

I think you are right about KPowersave not behaving well. I had to turn off all the button events in KPowersave for things to work properly. I would think you could just uninstall KPowersave and use the utilities and scripts mentioned in ThinkWiki instead. I am not a Linux guru though, so these are just guesses on my part.

Link to comment
Share on other sites

Let me double check with you... Currently, I have the thinkpad_acpi module listed in /etc/modprobe.preload, and I added

options thinkpad_acpi hotkey=enable,0xffffffff experimental=1

to /etc/modprobe.conf as suggested in ThinkWiki. acpid and acpi services start on boot from /etc/rc5.d, where I have

S04acpi@
S14acpid@

My understanding is that the stuff in modprobe.preload and modprobe.conf loads before the stuff in /etc/rc5.d is that correct? In that is correct then it should not be necessary to restart the daemons. Maybe, you could post your modprobe.preload and modprobe.conf?

 

I would be happy to get rid of kpowersave, but it looks like Mandriva uses it to control the cpu speed and temperature instead of cpufreq. But I will try your suggestion and disable screen brightness control in kpowersave. Thanks for your help.

Link to comment
Share on other sites

My understanding is that the stuff in modprobe.preload and modprobe.conf loads before the stuff in /etc/rc5.d is that correct? In that is correct then it should not be necessary to restart the daemons. Maybe, you could post your modprobe.preload and modprobe.conf?

Dunno. :unsure:

 

Here you go:

 

/etc/modprobe.preload

# /etc/modprobe.preload: kernel modules to load at boot time.
#
# This file should contain the names of kernel modules that are
# to be loaded at boot time, one per line.  Comments begin with
# a `#', and everything on the line after them are ignored.
# this file is for module-init-tools (kernel 2.5 and above) ONLY
# for old kernel use /etc/modules

slamr
nvram
intel-agp
hw_random
evdev
ibm_acpi

 

/etc/modprobe.conf

alias eth0 e1000
alias sound-slot-0 snd-intel8x0
remove snd-intel8x0 /sbin/modprobe -r snd-pcm-oss; /sbin/modprobe --first-time -r --ignore-remove snd-intel8x0
install snd-intel8x0 /sbin/modprobe --first-time --ignore-install snd-intel8x0 && { /sbin/modprobe snd-pcm-oss; /bin/true; }
install usb-interface /sbin/modprobe uhci-hcd; /sbin/modprobe ehci-hcd; /bin/true
alias eth1 ipw2200
######
options ibm_acpi hotkey=enable,0x0100
######

Edited by David Batson
Link to comment
Share on other sites

I just noticed that Thinkwiki says different things on different pages. The following page says to add the Options line to /etc/modprobe.d/thinkpad_acpi. Maybe thinkpad_acpi works slightly different than ibm_acpi? I do not have anything relevant in my /etc/modprobe.d/ directory.

 

Hotkeys

 

One important difference from ibm-acpi for those who wish to enable all possible hotkeys is that there are more possible bits to be set in the mask. Thus, to enable all possible hotkeys, do a

echo enable,0xffffffff >/proc/acpi/ibm/hotkey

 

To make this permanent, add the following line to /etc/modprobe.d/thinkpad_acpi:

options thinkpad_acpi hotkey=enable,0xffffffff experimental=1

 

http://www.thinkwiki.org/wiki/Thinkpad-acpi

Edited by David Batson
Link to comment
Share on other sites

I just noticed that Thinkwiki says different things on different pages. The following page says to add the Options line to /etc/modprobe.d/thinkpad_acpi. Maybe thinkpad_acpi works slightly different than ibm_acpi? I do not have anything relevant in my /etc/modprobe.d/ directory.

Indeed, these inconsistencies in Thinkwiki drive me crazy - often they don't mention the hardware, versions of the tools/kernel, etc. Very frustrating!

 

I doubt thinkpad_acpi and ibm_acpi are too different; it's just that T43 and T61 have very different BIOS plus video drivers for intel and ATI cards again are very different.

 

Here is my progress so far:

* I can turn on and off bluetooth (Fn+F5) using a script from ThinkWiki;

* Screen blanking works (Fn+F2) using the slightly modified script from the old ibm-acpi package (as suggested by David Batson);

* Suspend to RAM (Fn+F4) and Suspend to disk (Fn+F12) work including resume. This did not require any special effort, though the hotkey Fn+F12 had to be enabled by passing the option to the module (echo enable,0xffffff blah blah).

 

All this works without restarting acpid.

Link to comment
Share on other sites

On my r60 Fn+F4 works (either suspend-to-RAM or suspend-to-Disk, depending on the settings in gnome-power-manager/kpowersave), Fn+F5 can be used to switch bluetooth on and off, screen brightness and thinklight work, I have no problems with kpowersave so far, after installing the tpb (thinkpad buttons) rpm the volume and mute buttons worked too. So far I have not tried to get the other buttons to work (I just don't need them at the moment).

 

Yes think-wiki is somewhat inconsistent at times.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...