From ThinkWiki
Jump to: navigation, search

Smackpad and Compiz

There are a few references to scripts that will switch the workspace when you tap the laptop on the side. I googled for a while and all I could find was pretty old stuff.

A few of the links I found are:

Compiz Smackpad Plugin This one looks very interesting but how do you install it?

Compiz Smackpad I could not clone the software.

Here comes the smackpad No luck here either.


So, has anyone got this working recently? How?

Thanks! --Lunatico 18:15, 21 April 2010 (UTC)

Careful with Gnome HDAPS applet

This applet polls /sys/block/sda/device/unload_heads and loads the corresponding icon from disk every 10th of a second. I'd like to talk to the upstream developer and fix that, but I wouldn't recommend its usage meanwhile. I guess we should warn users in the wiki page? --Berto 14:40, 3 April 2010 (UTC)

--Lunatico 17:45, 21 April 2010 (UTC) Can you elaborate more on this? I'm using the gnome applet and haven't had any perceivable issues.

You can take a look at the source code (gnome-hdaps-applet.c, v20081204), it's very small and easy to see. g_timeout_add() installs the timer that wakes the process every 100 milliseconds, even if nothing happens (which will be the case 99.9% of the time). Even if the impact is not dramatic, this is not what I would recommend for a laptop considering that this program is going to be always running in background. --Berto 01:33, 28 June 2011 (CEST)

--peepingtom Try running powertop to observe this. I just turned off the GUI monitoring stuff, you can hear the head park anyway

Question regarding the example udev rule ?

The example udev rule is as follows.

  • KERNEL=="event[0-9]*", ATTRS{phys}=="hdaps/input1", ATTRS{modalias}=="input:b0019v1014p5054e4801-*", SYMLINK+="input/hdaps/accelerometer-event"

Where is the b0019v1014p5054e4801 being taken from?

It is from "udevinfo --attribute-walk --name /dev/input/event9" (only with the tp_smapi module)

Lucid does not have udevinfo. Instead, use:
udevadm info

Where can one find the recent hdapsd version mentioned in the article ?

The article mentions "New interface (requires hdapsd dated 2008-10-04 or newer)" without giving any clue about where one can find such a version, I looked in repositories, google and elsewhere in this very site and found an outdated , as a newcomer here, it eludes me completely. Bugmenot1 21:38, 28 November 2008 (CET)

I had the same problem, I think I found it via How_to_protect_the_harddisk_through_APS#Manual_compilation_from_source, it links to a mailing list post at [1] which has an attached source file at [2], this can be compiled easily with gcc -o hdapsd hdapsd.c. Why this is not released cleanly on the original homepage eludes me as well... --Centic 12:34, 30 November 2008 (CET)

"Reduced Power" hdapsd Consuming More Power

There is a link to a "reduced power" version of hdapsd, which is supposed to lower the number of timer interrupts (thereby reducing the power consumed by the daemon). From my experiments (using powertop), however, this program requires about twice as many interrupts to operate in "low power" mode as it does using the (older) sysfs interface. It also consumes enough CPU cycles to force my CPU back on periodically, consuming more power. Has anybody else had this experience?

--Mbsullivan 05:41, 24 August 2007 (UTC)

Well, not really. With tp_smapi 0.31 and older hdapsd I had wakeups from hdapsd and from the hdaps module, now powertop only shows about 50wakeups from hdapsd (which are really from the module, but this is a bug in powertop, it tells who first called a function, not whose function it is [it's a function in the module code]). So I get a lower power consumption with the newer pair of tpsmapi and hdapsd
--Zhenech 07:26, 24 August 2007 (UTC)

I hawe a problem

I tray to start working my IBM x40 with hdaps function but I can't make it right.

The main problem is in a not hanging variables when I read /sys/devices/platform/hdaps/position

I also have this problem!

Hi, I also have this problem that on my X40 the device/platform/hdaps/position does not give the right response. It is simply constant (128,1). Does anyone have a clue? I use the suse kernel from suse10.1. the hdaps sources in that kernel are the same as in the original kernel. thanks in advance,

Does the HDAPS sensor work under Windows (as observed from actual disk parking, or the graphical animation)? Also, try loading tp_smapi, it includes some patches for the hdaps driver. Does it help?

--Thinker 16:45, 8 June 2006 (CEST)

HI Again, HDAPS does work under windows. When I had windows running and then reboot the machine, hdaps is running under suse10.1 also. If I, however, turn off the machine and restart it, then, hdaps does *not* work anymore. I remember that with suse 10.0 and the separate module, hdaps did work. HDAPS now works with tp_smapi as suggested above. Still, where does the problem derive from?

The hdaps in the vanilla kernel has some bugs (i.e., in doesn't talk to the hardware correctly) which tp_smapi fixes. Looks like you've hit one of these.

--Thinker 18:05, 12 June 2006 (CEST)

laptop acpi problem with hdaps

UPDATE: the problem seems fixed in the version 0.21

My my both IBM T42/T43 laptops freezes time to times with the follow:

kernel 2.6.16/sata patch
hdaps build as a module from the kernel. tp_smapi 0.20/hdapsd

The freez is quite common then I access CD-ROM,but it also might freez without touching anything.
After the freez keyboard doesn't work or priting some character,power button doesn't work, however mouse might continue to work.
KDE battery systray shows discarchged batteries.
Still under investigation that cases the problem.
The related software: khdapsmon 0.1.2
ibm-acpi build-in as a module from the kernel(for ksensors) modified ksensors without lm_sensors with a patch

--noname 00:25, 13 June 2006 (CEST)Anton

You're the 2nd one reporting this. The fact you can reproduce it on two machines may be very helpful! Are these machines configured identically? Do they run the same software? Can you send your kernel .config, and precise kernel version + patches, to the e-mail address in the tp_smapi README? Please specify which hdaps or tp_smapi -related applications you're typically running.

BTW, if you have swsusp or Software Suspend 2 installed, you can do a suspend-to-disk cycle to recover from the hang.

--Thinker 11:53, 13 June 2006 (CEST)

I also have the follow Problems_with_SATA_and_Linux#No_DMA_on_DVD_drive. So I switched cdrom driver from IDE to ATA and it fixed the problem. However HDAPS has stared to freez a machine if I shake it then HDD is active. The issue might be not related to ACPI but I'll log it here for now.

I'll send configs. Thank you. ps. 0.21 is out so let me try the new version. --noname 08:34, 22 June 2006 (CEST)Anton

hdaps and /sys

Hey Fellas,

I've just upgraded from, where the patches all dropped in ok and all was well, to, where hdaps is built into the kernel.
the hdapsd daemon referenced on thinkwiki looks in /sys/block/<drive>/queue/protect to get started.
The default drivers that come with for hdaps apparently dont put anything in /queue there, so there is no 'protect' directory.
Has anyone else experienced this? I'd love to get my drive protection back :)
ON THE UPSIDE! - the Ricoh card reader in my z60m came to life, and I can read sd cards (but not sony memory sticks, oddly enough)
Any input would be awesome!

You need an extra kernel patch for "protect". Please read the page more carefully.

--Thinker 00:24, 22 July 2006 (CEST)

Gnome HDAPS-Applet and the new interface

I just installed my first linux kernel with the new hdaps disk protection interface. Since the file that controls the (un)parking of the disk heads has changed with this interface, you have to edit the GNOME HDAPS applet source before compiling to make it work. Simply replace the lines

#define SYSFS_PROTECT_FILE_HDA "/sys/block/hda/queue/protect"
#define SYSFS_PROTECT_FILE_SDA "/sys/block/sda/queue/protect"

with these:

#define SYSFS_PROTECT_FILE_HDA "/sys/block/hda/device/unload_heads"
#define SYSFS_PROTECT_FILE_SDA "/sys/block/sda/device/unload_heads"

Then proceed with the instructions in the included INSTALL file.

Another hint: On Ubuntu 8.10, install the hdapsd package, then compile the new version of hdapsd and replace the binary in /usr/sbin. Afterwards edit the /etc/init.d/hdapsd file so it looks for the new interface. Otherwise it will never start hdapsd bcause it's looking for the /sys/block/<device>/queue/protect file which simply doesn't exist. You may want to use the init script I posted at
And don't forget that udev-rule to create the symlink hdapsd needs to work!

Kind regards,
--Gollo 20:15, 18 December 2008 (CET)

Older discussion

So, this is in the stable kernel now, but what userspace program do we need to actually park the heads? --MrStaticVoid 01:26, 30 Oct 2005 (CEST)

Yes the hdaps driver is in the 2.6.14 kernel, but support to park the heads quickly and freeze the disk queue (to prevent the heads from getting un-parked) is not. There is some disagreement into how that should be implemented.

In other words, the hdaps driver for the moment is rather useless, unless you want to use it to play games.

--Tonko 02:10, 30 Oct 2005 (CEST)

I head rumours that you can make SDL handle this like a joystick, e.g. for playing Neverball. Can anyone confirm or deny that? Thanx --Nomeata 01:16, 16 Nov 2005 (CET)

Yes it is possible to use it as a joystick, as Tonko allready mentioned. /dev/input/jsX modprobe joydev


Thanks, I didn't have the joydev module. Rebuilding... -- 15:30, 16 Nov 2005 (CET)

Yeah, it's a pretty good party trick - set up the HDAPS joystick as xmame input. You can play Ms. Pac-man by tilting your laptop to make pac-man navigate the maze. You can imagine that the pac-man "rolls" downhill, just like those old wooden marble-puzzles that you see around. Heh, can actually clear a level or two.

Marble madness was strangely unsatisfying though, and just didn't work well (probably due to the diagonal nature of the screen in that game).

--gsmenden 20:10, 13 Jan 2006 (CEST)

Anyone got the queue freezing patch running on 2.6.16? I'm going to try to manually merge it but didn't want to duplicate someone else's work.

--Ajbarr 19:12, 22 March 2006 (CET)