Power Management

Silent drive with APM

This chapter contains information about

Using APM with the aero
Reduce harddisk-spin-ups

The Compaq Contura Aero comes with Advanced Power Management (APM) in version 1.1. That means that the aero's BIOS has still control over the suspend-function. This should be easier to handle than the more autonomous "Advanced Configuration & Power Interface" ACPI in recent laptops.

But it's still tricky.

If you want to run the aero as server, you may wonder if APM is still a good idea. I think it is. Of course it is not useful to power down an aero-server after a certain idle-time.

But APM could be really helpful if there is a power-failure: The aero will then fall back to battery-power and finally go into hibernation. An abrupt power-off instead could cause severe damages - I once have ruined a hdd with simply plugging a PC from power.

Using APM with the aero

APM has to be configured into the kernel. UPDATE: As I found out with kernels 2.4.25 and 2.4.26 these settings work fine:

[*] Power Management support
  [ ]   ACPI support
  <*>   Advanced Power Management BIOS support
     [ ]     Ignore USER SUSPEND
     [*]     Enable PM at boot time
     [ ]     Make CPU Idle calls when idle
     [ ]     Enable console blanking using  APM
     [*]     RTC stores time in GMT
     [*]     Allow interrupts during APM BIOS calls
     [ ]     Use real mode APM BIOS call to power off

Without the "Enable PM at boot time" and "Allow interrupts during APM BIOS calls" settings I sometimes got the message "hda: lost interrupt" after resuming from hibernated state. This doesn't seem to happen any more since I enabled these kernels settings.

"Use real mode APM BIOS call" did not work for me. If compiled into the kernel, the command "power off" only shut down the aero but didn't power it off. And in reaction to the command "shutdown -h now" the aero sometimes rebooted.

The setting "Enable console blanking" caused problems with gpm (mouse on the console). You also don't need it, because the BIOS turns off the backlight all alone, if it is in power-saving-mode.

ACPI is of course not supported.


After compiling the new kernel I installed apmd and related packages. I used those from my current distribution on the aero (Debian 3.0) as there were:

  • apmd (3.0.2-1.19)
  • libapm1 (3.0.2-1.19)
  • powermgmt-base (1.6)
  • You need these packages for sending the aero into suspend mode (what compaq called "hibernation" and "standby").

    The APMD Conflict

    What you actually don't need to use is the daemon "apmd". Kernel-apm seems to be able to answer all apm-requests alone. In fact kernel-apm and apmd conflict with each other and cause some interesting behaviours:

    For instance when shutting down the aero, apmd is (like all other daemons) stopped. But one of the apm-programs understand this stop-command as order to suspend - and suspends. When you reboot the aero it goes back to the hibernated state, which was in the middle of the shutdown-process, and continues shutting down.

    Also if the aero is in power-saving mode and I run apmd with an apm-enabled kernel, from time to time the hdd spins up for 20 seconds. In /var/log/daemon.log I find the entries:

      Mar 28 18:14:53 dog2 apmd[216]: apmd_call_proxy: 
      Executing proxy: '/etc/apm/apmd_proxy' 'standby' 'system'
    
      Mar 28 18:14:55 dog2 apmd[216]: System Standby
    
      [repeated 18 times till:]
    
      Mar 28 18:15:18 dog2 apmd[216]: apmd_call_proxy: 
      Executing proxy: '/etc/apm/apmd_proxy' 'standby' 'system'
      Mar 28 18:15:19 dog2 apmd[216]: System Standby
    

    This is annoying. So don't start apmd and delete the symlink in your bootscripts.


    And: action...

    With the standard settings, the aero suspends to disk (hibernates) perfectly if

  • I type "apm --suspend"

  • I push the On/Off button

  • the battery is empty

  • The aero wakes up from suspend like it did in win 3.1/win95 with the usual info

    "Restoring hibernated state..."
    

    I must confess, I still didn't find out if there is a "hibrn8.dat"-file or where apm stores the information from RAM. I don't know if it matters, but I still have a first partition (hda1) with fat16, so maybe this is the reason why it works.


    Suspend to disk? Or Suspend to RAM?

    As you saw, my aeros default suspend-mode is hibernation. But this can be changed easily. Compaq offers for this purpose SP0801 with the software "STBY_HIB.COM" for free.

    Unfortunately it doesn't work under linux but only under DOS. As I have FreeDOS running in hda1 this is no problem.

    If you prefer 'Suspend to RAM' (standby), command in DOS:

    STBY_HIB.COM s
    

    If you want 'Suspend to disk' (hibernation):

    STBY_HIB.COM h
    

    You may perhaps use the linux-package "dosemu" (in most distributions included) for this dos-utility, then you don't need to reboot after this step.

  • After a resume from hibernation PCMCIA-cards will be automatically reconfigured (two beeps).

  • After a resume from standby PCMCIA prints the message
    "autonegotiation restarted, found link beat, autonegotiation complete.."
    
    no beep and everything's up again.



  • No standby if idle

    I didn't find out yet how to enable the aero to automatically enter standby if idle for a certain time. Normally this is defined in the power-saving-modes in BIOS or by Fn+F7.



    For instance for the highest power-saving-mode the aero should go through the following steps

  • Step 1: After 1 minute of inactivity the aero powers off the screen backlight.

  • Step 2: In the same minute it should send the hdd into standby.

  • Step 3: After 3 minutes idle, it should go into standby.

  • Instead only Step 1 (screenblanking) works correctly for me.

    Step 2 (silencing the hdd) results in the following output to the console screen (tty) and to "/var/log/messages":

    ide0: unexpected interrupt, status=0x80
    

    Because that information is written into syslog, the hdd can't spin down. If the syslog-daemon is disabled, the hdd indeed spins down. But I still receive that error-message on the screen.

    If I enable additional tools for silencing the hdd (hdparm. laptop-mode, noflushd), I don't have to stop the syslog-daemon to have the hdd spinning down. Those tools take care for it. All the logging of syslog is buffered to RAM. But I still receive that error-message.

    Step 3 (enter standby after 3 minutes idle) doesn't work at all.

    So, we still have to find out, how to avoid these error-messages and/or how the BIOS could successfully order the aero to enter standby automatically after a special idle time.

    The hdparm-parameters -m0 (multimode off) and -n1 (ignore write errors) didn't help. Suggestions are welcome.

    At least the message-output doesn't hurt anything, everything is still fuctional.


    Bogomips and how to slow down the aero

    At the beginning of the boot-process Linux will take the power-saving mode of the aero as measure of the aeros speed (bogomips-count). So if you boot up the aero in highest power-saving mode, Linux will give it only a bogomips-count of 8,4.

    Powering it up in full speed will result in 16,53 bogomips. This procedure is quite important: a low bogomips-count will slow down linux.

    So avoid booting with full power-saving enabled in the BIOS or by a previous setting with Fn+F7. Choose full "speed" instead. ;-)


    BTW: As Ali Albayrak and Harald.T.Alvestrand found out, the CPU of a Contura Aero 4/33 starts always in "slowed" mode to conserve power. So it will get less bogomips and run slower than a 4/25. This can be avoided by:

  • starting linux from a dos-partition by loadlin (guess why I have a freedos-partition of 30 MB on my 10 GB hdd).

  • or by downgrading the BIOS to SP0723. (which is unfortunately not able to use the 16MB RAM-Modules or bigger hdd.)
  • So if you run a 4/33, start linux with loadlin.



    Reduce harddisk-spin-ups

    I want to run the aero-server as silent as possible. It has no fan, so it is a nice companion in my apartment. But of course there is still the hdd. Avoiding disk-accesses and silencing linux is a very special piece of art.

    Currently I use these two tools:

    hdparm
    A program for tweaking the hdd (is in most distributions included).

    laptop-mode
    A kernel-function that is in the 2.4-kernels from > 2.4.23 upwards included per default. It is supposed to be in 2.6-kernels from 2.6.6 upwards.
    It groups write activity on your disks, so that only reads of uncached data causes disk spin-ups.
    See http://lwn.net/Articles/64883/.
    See http://www.samwel.tk/laptop_mode/

    There is also an alternative to laptop-mode called noflushd. From its description: "A daemon that caches disk writes and flushes them to disk when the next read request triggers a spin-up."
    See http://noflushd.sourceforge.net/

    Although with 2.4-kernels noflushd and laptop-mode can be used at the same time without interfering, it doesn't make much sense as they both serve the same purpose. So just decide which tool you like better.


    Thanks, Bart Samwel, for the correction!


    Configuration of noflushd

    In the configuration file /etc/default/noflushd I use:

    TIMEOUT=1
    

    for spinning down after one minute.


    Configuration of laptop-mode

    Laptop-mode is configured by the script "laptop-mode.sh" that can be copied to /etc/init.d. It can be found here, if it is not included in the kernel-source.

    In this script, I use:

    MAX_AGE=3600
    

    for maximal silence... ;-)


    Check who's spinning up!

    Laptop-mode also offers a possibility to see which programs are causing spin-ups:

    You enable this feature with:

    echo="1">/proc/sys/vm/block_dump
    

    You disable this feature with:

    echo="0">/proc/sys/vm/block_dump
    

    The output can be viewed by commanding "dmesg" on the console.

    You should disable syslog for the time you use this tool or you end up in a loop.


    Other tricks

    There are of course many more tweaks for all the different linux-software. For instance: Samba likes to access it's cache and it's lock-file every few minutes.

    So I mounted with

    mount tmpfs /var/run/samba -t tmpfs
    mount tmpfs /var/log/samba -t tmpfs
    mount tmpfs /var/cache/samba -t tmpfs
    

    the appropriate samba-folders to a temporary filesystem in RAM. Of course I had to change the samba logrotate-scripts for not filling up the 20 MB RAM with log-files...

    Further tips and ideas for silencing linux can be found here:

    http://www-2.cs.cmu.edu/~mukesh/hacks/spindown/t1.html
    http://www.agol.dk/quietlinux/

    and in various newsgroup-threads.

    Hope this helps.
    Ulrich Hansen, 29.03.2004




    Comments

    Suggestions for this page? Ideas? Please drop a note!
    Don't forget to add your email, if you appreciate a personal reply.
    The comments are sorted from date.

    previous previous index index next next


    Home   ·   manual & docs   ·   drivers & updates   ·   original software
    linux   ·   internal speaker   ·   ads   ·   the aero's wildest dream...   ·   links