Thinkpad HDAPS in Ubuntu 9.04 Jaunty

One of the cool features in a Thinkpad is IBM Active Protection System.
The system consist of two parts. The driver that enables reading the acceleration data and some sort of userspace software that does the actual parking of the harddrive heads, usually hdapsd.
The hdaps driver is part of the kernel but the driver maintainers actually recommend using the tp-smapi driver instead. So that’s what we’ll do.
Make sure you have the necessary tools installed:

sudo aptitude install build-essential module-assistant

The tp-smapi is in the package repository (universe):

sudo m-a a-i tp-smapi

This will fetch and install the tp-smapi-source package, unpack the source and then compile and install the kernel module.

Try loading it:

sudo modprobe tp_smapi
sudo modprobe hdaps

The kernel log should show something like this:

[ 4504.896887] tp_smapi 0.40 loading...
[ 4504.897178] tp_smapi successfully loaded (smapi_port=0xb2).
[ 4532.702289] hdaps: initial mode latch is 0x05
[ 4532.702442] hdaps: setting ec_rate=250, filter_order=2
[ 4532.702674] hdaps: device successfully initialized.
[ 4532.702788] input: ThinkPad HDAPS joystick emulation as /devices/virtual/input/input22
[ 4532.728212] input: ThinkPad HDAPS accelerometer data as /devices/virtual/input/input23
[ 4532.756552] hdaps: driver successfully loaded.

For some reason some configuration for udev is missing. Fix this by running:

echo 'KERNEL=="event[0-9]*", ATTRS{phys}=="hdaps/input1",ATTRS{modalias}=="input:b0019v1014p5054e4801-*",SYMLINK+="input/hdaps/accelerometer-event"' | sudo tee /etc/udev/rules.d/51-hdaps.rules

Now for the userspace stuff. First let us test if APS is actually working.

sudo aptitude install hdaps-utils

This will install hdaps-pivot or hdaps-gl which you can use to verify that the sensors are working.
You can also test this by running this in your terminal (stop it with pressing CTRL + C):

sudo hdapsd -d sda -s 15 -a -v -y

Next we need to update the hdapsd. The one provided in Jaunty is old. There is a PPA with newer versions.

cat | sudo tee /etc/apt/sources.list.d/hdapsd.list << EOF
deb http://ppa.launchpad.net/jonasped/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/jonasped/ppa/ubuntu jaunty main
EOF

Add the PPA key:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 45EA2DEACE74152B61554DE4036A90F2BEFC6EB4

Update the package list and install the package:

sudo aptitude update
sudo aptitude install hdapsd

Install gnome-hdaps-applet (optional).
There is a PPA for this. You can add it like this:

cat | sudo tee /etc/apt/sources.list.d/gnome-hdaps-applet.list << EOF
deb http://ppa.launchpad.net/whoopie79/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/whoopie79/ppa/ubuntu jaunty main
EOF

Add the key:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com e1c344a23bb057ff1d4d80cf8c236986e1ecdbb2

Update the package list again and install the packages:

sudo aptitude update
sudo aptitude install gnome-hdaps-applet

Enjoy!

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close