Laptop-mode-tools fixes and improvements

I have been in contact with the autor of laptop-mode-tools and new version is coming some time next month or maybe even in March. So I decided to share my tweaks because some things are broken right now and some need improvements.
There are some modules I don't use and so didn't notice any problems with them, if there are any (lcd-brightness, video-out and those for which I don't have suitable hardware like cpufreq, iwl/ipw and sched-mc).
Alright then, first is the problem with systems where the battery doesn't report events and has no alarm support on which the auto-hibernate module depends. There is a script from gentoo-wiki which is quite popular among people with lousy batteries. It would be great if the package manager would take care of it for us. Author of laptop-mode-tools also said (on debian lists) that such script could be included in future versions, for now the common "solution" is to create a cronjob that calls /usr/sbin/laptop_mode every few minutes. I don't quite like it compared to the gentoo script. For now I include the script in the package as /usr/sbin/battery_mode and call it from rc.local on boot.
Currently there is a module called ac97-powersave that controls power management on those sound cards. Intel HDA sound cards also support this and in the future versions a module them will probably be included. For now I patch the ac97-powersave module to include the support for Intel HDA.
Bluetooth module removes bluetooth and hci_usb modules when disabling the device. However on my system it's not enough to completly turn it off. For now I patch the bluetooth module to include rfkill support. Only then the system reports a USB disconnect and the LED goes off. The default path in the patch is for my acer system with acer-wmi rfkill support.
Due to w differences the dpms-standby module is broken on many systems. The module uses xset and arguments are piped from the command w -hs where the third field is supposed to be DPMS_SCREEN but it's actually IDLE time, so xset command fails because the argument passed to xset -d is something like 4:54. On Debian/Ubuntu they went around this by including this in their acpi-support package. I didn't bother to see what they actually did, to backport it. It should be done in future laptop-mode-tools anyway. For now I just hardcode the display value for my single-user/one-X-screen system in the dpms-standby module.
Due to a simple mistake LM_VERBOSE was broken. Meaning that none of those informative status messages from laptop-mode-tools were logged when VERBOSE LOGGING was enabled. Only the output of called commands was logged. For now I fix this in the build process.
Speaking of logging, default output for verbose is /dev/stdout, and I would like to log everything to a file. So I modify it in the build process to log everything to /var/log/laptop-mode.log, and also include a logrotate script in the package. With the above fix I have a complete and informative log file.
It's not a bad idea to stop/restart laptop-mode-tools when suspending, so a pm-utils hook is helpful. Arch PKGBUILD already includes installing pm-utils support but it's actually pbbuttonsd/pmud support and not pm-utils. Such a script/hook could one day be included in laptop-mode-tools however there is/was a debate going if it's their job to provide it. I read somewhere that Ubuntu already provides such script/hook but I'm not sure if it's provided by acpi-support or laptop-mode-tools package. For now I wrote my own pm-utils hook and I include it in the build process.
Powertop suggests usbcore.autosuspend=1 sysctl, but it would be nice if we have all this power management control in one place. Usb-autosuspend module will be included in future versions of laptop-mode-tools, but for now someone wrote a module and posted it to the Debian bug tracker. I keep the module and configuration in my build dir but don't include it in the final package for now. I'll wait a bit and see how things will develop.
To help you start hacking on laptop-mode-tools you can take a look at all the above patches and my PKGBUILD. Every step is documented in PKGBUILD comments, and please do check them because some things I patch but some I modify inline with sed. I also don't install acpid handlers and before mentioned false pm-utils support... everything is commented: http://sysphere.org/~anrxc/local/softwa … ode-tools/

Hello,
this was one year ago, and I helped the author improve these things. Today I don't have to patch my laptop-mode-tools... (I still do with some minor things, but that's just to satisfy some personal preferences . Use the arch package, even the battery polling helper is included.

Similar Messages

  • Xfce4-power-manager and laptop-mode-tools + backlight problems.

    Cross posted from here: https://bbs.archlinux.org/viewtopic.php?id=127992
    I don't know which forum it belongs to, so maybe a mod can close the one in the wrong forum.
    Out of curiosity, do these two tools conflict with each other? There seems to be some features that do the same thing, ie harddrive spin down time, but I'm not sure if these two will try to kill each other trying to configure the same power settings. If they do conflict, how could I go about disabling the conflicting parts (on either)? laptop-mode-tools claims it needs acpid "for ACPI support", however, acpid seems to be grabbing the standby event and throwing the laptop in standby despite the standby button bound to do nothing in xfce-power-manager. If I take out acpid, does that mean laptop-mode will no longer detect acpi events such as connecting/disconnecting AC power and thus not change modes when its plugged in?
    Another problem I've had after installing xfce4-power-manager is that when I use the brightness hotkeys the backlight gets stuck and starts flashing, locking up the system until I force shutdown. However, I can use the brightness plugin without trouble at all. What's causing the power manager to screw up setting the brightness since it clearly seems to work otherwise.

    It is easier to close this one and move the other thread over here. Just continue there.
    BTW better use the Report button when you want to have a thread of yours moved to another forum. That way it is guaranteed a mod will see this in time. And you never need to cross post.

  • Laptop-mode-tools and hdparm -B settings

    Since the change to systemd (I think so), I have a problem with laptop-mode-tools and hdparm. The hdparm -B settings (settings to park the hard drive) are most of the times not applied on startup of my laptop. But: sometimes the setting in the config file of laptop-mode-tools is applied.
    These configs I have in /etc/laptop-mode/laptop-mode.conf:
    # Power management for HD (hdparm -B values)
    BATT_HD_POWERMGMT=254
    LM_AC_HD_POWERMGMT=254
    NOLM_AC_HD_POWERMGMT=254
    If I check the settings of hdparm after starting my laptop (sudo hdparm -B /dev/sda), most of the times the setting is 128. Because I am afraid that my hard drive will damage with this setting, every time I have to do 'sudo systemctl restart laptop-mode.service'. After that, the setting of hdparm -B is 254.
    Does anybody know something to solve this annoying problem? Thanks in advance!

    You could write an udev rule. That's what I did, although laptop-mode-tools was giving me the same result - I just wanted to reduce the list of services for the sake of boot speed.
    Mine looks like this:
    /etc/udev/rules.d/75-hdparm.rules
    ACTION=="add", KERNEL=="sda", ATTR{queue/rotational}=="1", RUN+="/sbin/hdparm -B 254 /dev/$kernel"
    You might have to change "sda" according to your system.
    Disclaimer (and friendly hint): I didn't come up with this by myself, I had to borrow it from somewhere on this forum.
    Edit: from here, but you can also find it there.
    Last edited by sano (2013-04-04 23:53:09)

  • [SOLVED] Systemd and laptop-mode-tools frequency scaling

    Hi all.
    After a long time with no arch updates (november 2011) for various reasons, I decided to reinstall Arch from point 0 on my Clevo laptop.
    I was pleased to see nothing went bad, all is now set like I want. I installed systemd yesterday. All very straightforward for me, I only have a problem with CPU frequency scaling plus some minor glitches.
    Before systemd, everything went fine. Ondemand governor, set up like I wanted.
    Now when on AC the system uses ondemand, but when on battery it uses the conservative governor. What's more, it does not go over 1.6GHz (2.54GHz max).
    Here are some infos about it:
    [adriano@M735T ~] cpupower frequency-info
    analyzing CPU 0:
    driver: acpi-cpufreq
    CPUs which run at the same hardware frequency: 0 1
    CPUs which need to have their frequency coordinated by software: 0
    maximum transition latency: 10.0 us.
    hardware limits: 800 MHz - 2.53 GHz
    available frequency steps: 2.53 GHz, 2.53 GHz, 1.60 GHz, 800 MHz
    available cpufreq governors: ondemand, performance
    current policy: frequency should be within 800 MHz and 1.60 GHz.
    The governor "ondemand" may decide which speed to use
    within this range.
    current CPU frequency is 1.60 GHz.
    boost state support:
    Supported: yes
    Active: yes
    [yes this is all come out of the cpupower command, no mention of CPU 1. Is this normal?]
    Of course LMT is set up correctly
    CONTROL_CPU_FREQUENCY="1"
    BATT_CPU_MAXFREQ=fastest
    BATT_CPU_MINFREQ=slowest
    BATT_CPU_GOVERNOR=ondemand
    BATT_CPU_IGNORE_NICE_LOAD=1
    LM_AC_CPU_MAXFREQ=fastest
    LM_AC_CPU_MINFREQ=slowest
    LM_AC_CPU_GOVERNOR=ondemand
    LM_AC_CPU_IGNORE_NICE_LOAD=1
    NOLM_AC_CPU_MAXFREQ=fastest
    NOLM_AC_CPU_MINFREQ=slowest
    NOLM_AC_CPU_GOVERNOR=ondemand
    NOLM_AC_CPU_IGNORE_NICE_LOAD=0
    [adriano@M735T ~] sudo systemctl status laptop-mode-tools.service
    laptop-mode-tools.service - Laptop Power Saving Tools
    Loaded: loaded (/usr/lib/systemd/system/laptop-mode-tools.service; enabled)
    Active: active (exited) since Sun, 02 Sep 2012 17:03:45 +0200; 4h 34min ago
    Main PID: 367 (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/laptop-mode-tools.service
    Sep 02 17:03:43 M735T laptop_mode[367]: /usr/sbin/laptop_mode: line 198: /dev/fd/1: No such device or address
    Sep 02 17:03:44 M735T laptop_mode[367]: /usr/sbin/laptop_mode: line 198: /dev/fd/1: No such device or address
    Sep 02 17:03:44 M735T laptop_mode[367]: /usr/sbin/laptop_mode: line 198: /dev/fd/1: No such device or address
    I wonder why LMT status is "exited"
    OK bin that, I just now see something is wrong. I said it used conservative, but I'm on battery and it now says ondemand (still 1.6GHz max). However it seems it does so casually.
    ACPI:
    [adriano@M735T ~] acpi
    Battery 0: Discharging, 53%, rate information unavailable
    This may be (?) or may not be linked with nother problem I have: when unplugging the AC the KDE battery monitor does not update. It says AC is plugged and it will not activate power saving features (screen dimming, suspend...)
    Note that this battery monitor problem occurred even before systemd, so it should not be linked to the above problem. However I'm not 100% sure the above problems did not occur before installing systemd since I only had the system up and running for a comple of days. I seem to recall I checked and it worked fine.
    Any idea why all this happens?
    Last edited by OdinEidolon (2012-11-20 08:56:31)

    Ok rebooted and this is the output of the pm-powersave log file:
    (AC IN, no battery)
    (pastebin)
    http://pastebin.com/Kf2Lx7UQ
    If I grep cpupower:
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    right now:
    1) cpupower reports ondemand and 2.54GHz (right)
    2) acpi -bi reports nothing as it should (battery is disconnected)
    3) acpi -a reports AC in as it should
    4) all KDE stuff works OK
    Now I plug the battery in:
    1) cpupower reports ondemand and 2.54GHz (right)
    2) acpi -bi reports nothing, which is wrong
    3) acpi -a reports AC in as it should
    4) KDE battery monitor reports no battery in, as signaled by acpi
    5) if performing acpi_listen ,it reports nothing interesting
    Now I unplug AC:
    Absolutely nothing changes (not even in the log file) but:
    1) cpupower reports ondemand and 1.6GHz (wrong)
    2) acpi -bi reports nothing, which is wrong
    3) acpi -a reports no AC as it should
    4) KDE battery monitor reports no battery in, as signaled by acpi,  but it also reports AC is inserted

  • Power management: laptop-mode-tools and pm-utils confusion

    There have been a few threads recently that touch on this topic, but I'm still somewhat confused as to how best to use these two tools for power management.
    As I understand it, laptop-mode-tools is a set of scripts and config files for controlling various aspects of power saving, while pm-utils started as a tool for managing suspend/hibernate.  However, newer versions of pm-utils have begun to include general power management features that conflict with those of laptop-mode-tools, and respond to the pm-powersave command.
    Ideally, I would like to control power management in the following way: Have acpid as the only running daemon (rather than acpid and laptop-mode-tools as I have now), which then calls pm-suspend, pm-hibernate and pm-powersave in the appropriate circumstances. 
    The wiki has a brief guide on how to insert pm-powersave as an acpi event; however, it seems to me that pm-utils is not able to replicate all the functions of laptop-mode-tools yet, for example in controlling the eeepc's SHE.
    In this thread: https://bbs.archlinux.org/viewtopic.php?pid=784969, einhard seems to suggest that its quite a simple process to modify some hooks from laptop-mode-tools to make them work with pm-utils.  I would be eternally grateful if somebody could post an example of how to carry out this modification.  I have very minimal knowledge of bash, which means that I can't get going on my own but I think I could modify the rest of the hooks on my own if I had an example, a template, to guide me. 
    Of course if anyone has any other suggestions regarding how best to mix these tools for power management it would be very good to hear them.  I am aware of this thread: https://bbs.archlinux.org/viewtopic.php?id=88011&p=2, in which takedown suggests writing some dummy hooks to pm-utils to prevent any conflict, but I'm not entirely clear about which hooks I should apply this to, i. e. just the hooks in power.d or those in sleep.d, too?

    mordoc, what exactly is the problem your having?
    Since I made the original post I have actually succeeded in creating the setup I described, i.e. I have removed laptop-mode-tools and have pm-utils do all suspend, hibernate and power management functions using acpid.  This required adding a very simple custom hook to pm-powersave to deal with all the power-saving functions of laptop-mode-tools that pm-powersave does not (yet) replace OOTB.

  • Slow boot with systemd due to NetworkManager and laptop-mode-tools

    ernestas ~ $ systemd-analyze blame
    25787ms NetworkManager.service
      3440ms laptop-mode-tools.service
      1792ms systemd-logind.service
      1573ms systemd-modules-load.service
      1519ms home.mount
      1305ms polkit.service
       977ms systemd-udevd.service
       903ms systemd-sysctl.servic
    What could be the underlying problem? How do I solve it?

    Okay. I no longer use laptop-mode-tools, but NetworkManager still seems to be slow:
    ernestas ~ $ systemd-analyze blame
      3592ms NetworkManager.service
      3013ms systemd-logind.service
       869ms dev-sda7.swap
       762ms home.mount
       666ms systemd-modules-load.service
       546ms systemd-udev-trigger.service
       523ms systemd-udevd.service
       500ms dev-hugepages.mount
       479ms sys-kernel-debug.mount
    Last edited by ernetas (2012-11-03 16:01:44)

  • [SOLVED]Laptop-mode-tools no cpu scaling

    Hi!
    After I installed laptop-mode-tools, I can't have my cpu freq scaling as I always did.
    Well, I'll explain better: without laptop-mode-tools I used to set my cpu freq via /etc/rc.local, and everything was fine.
    But now I need laptop-mode-tools and I have to say, everything works very well...But here comes the sun, uhm no, here comes the problem: when i plug in and out my ac cable, my frequency will stay at its lowest. The same thing happens after suspend... I can't understand...
    I tried with acpid, obviously, and for example, when i plug in ac power, lcd brightness changes as expected from my config files, but cpufreq will stay just as I said.
    So, here is my cpufreq-info now:
    limiti hardware: 1000 MHz - 1.67 GHz
    frequenze disponibili: 1.67 GHz, 1.33 GHz, 1000 MHz
    gestori disponibili: conservative, ondemand, userspace, powersave, performance
    gestore attuale: la frequenza deve mantenersi tra 1000 MHz e 1000 MHz.
    Il gestore "performance" può decidere quale velocità usare
    in questo intervallo.
    (it's italian sorry)
    this is /etc/laptop-mode/conf.d/cpufreq.conf
    # Configuration file for Laptop Mode Tools module cpufreq.
    # For more information, consult the laptop-mode.conf(8) manual page.
    # CPU frequency scaling and throttling
    # Laptop mode tools can automatically adjust your kernel CPU frequency
    # settings. This includes upper and lower limits and scaling governors.
    # There is also support for CPU throttling, on systems that don't support
    # frequency scaling.
    # This feature only works on 2.6 kernels.
    # IMPORTANT: In versions 1.36 and earlier, these settings were included in the
    # main laptop-mode.conf configuration file. If they are still present, they
    # overrule the settings in this file. To fix this, simply delete the settings
    # from the main config file.
    # Enable debug mode for this module
    # Set to 1 if you want to debug this module
    DEBUG=0
    # Should laptop mode tools control the CPU frequency settings?
    # Set to 0 to disable
    CONTROL_CPU_FREQUENCY=1
    # Legal values are "slowest" for the slowest speed that your
    # CPU is able to operate at, "fastest" for the fastest speed,
    # "medium" for some value in the middle, or any value listed in
    # /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies.
    # The "governor" can be any governor installed on your system, this usually
    # includes "ondemand", "conservative", and "performance". The
    # "IGNORE_NICE_LOAD" setting specifies that background programs that have
    # a low priority ("nice level") should not cause the CPU frequency to
    # be increased. (You generally want this to be enabled in battery mode.)
    BATT_CPU_MAXFREQ=fastest
    BATT_CPU_MINFREQ=slowest
    BATT_CPU_GOVERNOR=ondemand
    BATT_CPU_IGNORE_NICE_LOAD=1
    LM_AC_CPU_MAXFREQ=fastest
    LM_AC_CPU_MINFREQ=slowest
    LM_AC_CPU_GOVERNOR=performance
    LM_AC_CPU_IGNORE_NICE_LOAD=1
    NOLM_AC_CPU_MAXFREQ=fastest
    NOLM_AC_CPU_MINFREQ=slowest
    NOLM_AC_CPU_GOVERNOR=performance
    NOLM_AC_CPU_IGNORE_NICE_LOAD=0
    # Should laptop mode tools control the CPU throttling? This is only useful
    # on processors that don't have frequency scaling.
    # (Only works when you have /proc/acpi/processor/CPU*/throttling.)
    # This is only useful on older P4 processors that do not support frequency
    # scaling. On such processors, this is the only way to reduce power consumption
    # but at the cost of higher performance penalty.
    # Enable this only if you have a processor that does not support frequency scaling
    # On most new processors, you might want to disable it.
    # Set to 0 to disable.
    CONTROL_CPU_THROTTLING=0
    # Legal values are "maximum" for the maximum (slowest) throttling level,
    # "minimum" for minimum (fastest) throttling level, "medium" for a value
    # somewhere in the middle (this is usually 50% for P4s), or any value listed
    # in /proc/acpi/processor/CPU*/throttling. Be careful when using "maximum":
    # this may be _very_ slow (in fact, with P4s it slows down the processor
    # by a factor 8).
    BATT_CPU_THROTTLING=medium
    LM_AC_CPU_THROTTLING=medium
    NOLM_AC_CPU_THROTTLING=minimum
    I'm using kernel 3.1.6 with no testing repo.
    I'm using pm-utils to suspend.
    As far as I understand, the problem is in one of the file laptop-mode installs on my hd...the only solution I found was to remove laptop-mode...but I need it because it's simple and i have no time to find something else,
    Thanks everybody!
    Bye!
    Last edited by nierro (2011-12-31 10:19:09)

    Ok, after i removed laptop-mode-tools and managed to have my cpu freq scaling,lcd brightness and eeepc she through rc.local and acpid events , i found that the real problem is located in ondemand governor: after suspend it stays at lowest freq possible.
    If i change then my governor, with for example performance, it works, but if i change again to ondemand, it stays to its lowest...any idea?
    EDIT: tried with granola and userspace governor, but nothing changes... tried on my other laptop with kernel 3.1.5-ARCH, and there everything it's ok, but i noticed i haven't acpi and acpid installed there...so may be the problem is related to them? (i use the same cpufreq driver in these laptops)
    I'll try to kick out acpi and acpid and i'll make you know what happens.
    Last edited by nierro (2011-12-31 09:04:54)

  • Laptop-mode-tools/cpufrequtils Questions [SOLVED]

    I am running a Sony Vaio VGN-FW480J and am trying to optimize these two tools to save battery life and hard drive life span.   I have added @laptop-mode to my daemon array and acpi-cpufreq to modules. A few issues I immediately notice:
    1) cpufreq doesn't revert back to higher frequencies if I unplug and plug power source back in (before unplugging: CPU 0 - 800 MHz, CPU 1 - 2.00 GHz; after both are 800 and won't change if I plug power source back in)
    2) I believe the hard disk is actually spinning down more frequently (and fan is almost always on, even when no work is being done).  Here are the relevant files/the ones that I have altered.
    laptop-mode.conf
    # Configuration for Laptop Mode Tools
    # There is a "system" to the configuration setting names:
    # CONTROL_something=0/1 Determines whether Laptop Mode Tools controls
    # something
    # LM_something=value Value of "something" when laptop mode is active
    # NOLM_something=value Value of "something" when laptop mode is NOT
    # active
    # AC_something=value Value of "something" when the computer is running
    # on AC power
    # BATT_something=value Value of "something when the computer is running
    # on battery power
    # There can be combinations of LM_/NOLM_ and AC_/BATT_ prefixes, but the
    # available prefixes are different for each setting. The available ones are
    # documented in the manual page, laptop-mode.conf(8). If there is no LM_/
    # NOLM_ in a setting name, then the value is used independently of laptop
    # mode state, and similarly, if there is no AC_/BATT_, then the value is used
    # independently of power state.
    # Some options only work on ACPI systems. They are marked ACPI-ONLY.
    # Note that this configuration file is a fragment of shell script: you
    # can use all the features of the shell scripting language to achieve your
    # desired configuration.
    # Modules
    # Laptop Mode Tools modules have separate configuration files, that can be
    # found in /etc/laptop-mode/conf.d. Please look through these configuration
    # files as well, there are many useful power saving tools in there!
    # Enable/Disable laptop-mode-tools execution
    # Set it to 0 to completely disable laptop-mode-tools from running
    ENABLE_LAPTOP_MODE_TOOLS=1
    # Configuration debugging
    # Set this to 1 if you want to see a lot of information when you start/stop
    # laptop_mode.
    VERBOSE_OUTPUT=0
    # Set this to 1 if you want to log messages to syslog
    LOG_TO_SYSLOG=1
    # Run in shell debug mode
    # Enable this if you would like to execute the entire laptop-mode-tools program
    # in shell debug mode. Warning: This will create a lot of text output
    # If you are debugging an individual module, perhaps you would want to enable
    # each module specific debug mode (available in module conf files)
    DEBUG=0
    # When to enable laptop mode
    # "Laptop mode" is the mode in which laptop mode tools makes the computer
    # consume less power. This includes the kernel "laptop_mode" feature, which
    # allows your hard drives to spin down, as well as various other settings which
    # can be tweaked by laptop mode tools. You can enable or disable all of these
    # settings using the CONTROL_... options further down in this config file.
    # Enable laptop mode when on battery power.
    ENABLE_LAPTOP_MODE_ON_BATTERY=1
    # Enable laptop mode when on AC power.
    ENABLE_LAPTOP_MODE_ON_AC=1
    # Enable laptop mode when the laptop's lid is closed, even when we're on AC
    # power? (ACPI-ONLY)
    ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=0
    # Enable all simple zero-configuration auto modules
    # This option enables all simple modules (listed below) without requiring
    # the user to enable each module individually
    # List of modules which can be automatically enabled with this setting are:
    # ac97-powersave
    # cpufreq
    # dpms-standby
    # eee-superhe
    # ethernet
    # exec-commands
    # hal-polling
    # hdparm
    # intel-hda-powersave
    # intel-sata-powermgmt
    # runtime-pm
    # sched-mc-power-savings
    # sched-smt-power-savings
    # terminal-blanking
    # usb-autosuspend
    # wireless-ipw-power
    # wireless-iwl-power
    # wireless-power
    # Set this to 1 to enable all simple zero-configuration auto modules listed above.
    # NOTE: You can explicitly enable/disable any of the above modules by changing their
    # values in the individual settings file
    ENABLE_AUTO_MODULES=1
    # When to enable data loss sensitive features
    # When data loss sensitive features are disabled, laptop mode tools acts as if
    # laptop mode were disabled, for those features only.
    # Data loss sensitive features include:
    # - laptop_mode (i.e., delayed writes)
    # - hard drive write cache
    # All of the options that follow can be set to 0 in order to prevent laptop
    # mode tools from using them to stop data loss sensitive features. Use this
    # when you have a battery that reports the wrong information, that confuses
    # laptop mode tools.
    # Disabling data loss sensitive features is ACPI-ONLY, and it only works if
    # your battery gives off frequent ACPI events to indicate a change in battery
    # level.
    # NOTE: If your battery does NOT give off battery events often enough, you can
    # enable the battery-level-polling module to make this work. Look at the
    # file /etc/laptop-mode/conf.d/battery-level-polling.conf for more information.
    # Disable all data loss sensitive features when the battery level (in % of the
    # battery capacity) reaches this value.
    MINIMUM_BATTERY_CHARGE_PERCENT=3
    # Disable data loss sensitive features when the battery reports its state
    # as "critical".
    DISABLE_LAPTOP_MODE_ON_CRITICAL_BATTERY_LEVEL=1
    # Controlled hard drives and partitions
    # For spinning down your hard drives, laptop mode will remount file systems and
    # adjust hard drive spindown timeouts. These parameters specify which
    # devices and partitions are affected by laptop mode.
    # The drives that laptop mode controls.
    # Separate them by a space, e.g. HD="/dev/hda /dev/hdb". The default is a
    # wildcard, which will get you all your IDE and SCSI/SATA drives.
    HD="/dev/[hs]d[abcdefgh]"
    # The partitions (or mount points) that laptop mode controls.
    # Separate the values by spaces. Use "auto" to indicate all partitions on drives
    # listed in HD. You can add things to "auto", e.g. "auto /dev/hdc3". You can
    # also specify mount points, e.g. "/mnt/data".
    PARTITIONS="auto /dev/mapper/*"
    # If this is enabled, laptop mode tools will assume that SCSI drives are
    # really SATA drives that only _look_ like SCSI drives, and will use hdparm
    # to control them. Set this to 0 if you have /dev/sd devices and you want
    # laptop mode tools to use the "sdparm" command to control them.
    ASSUME_SCSI_IS_SATA=1
    # Hard drive behaviour settings
    # These settings specify how laptop mode tools will adjust the various
    # parameters of your hard drives and file systems.
    # Maximum time, in seconds, of work that you are prepared to lose when your
    # system crashes or power runs out. This is the maximum time that Laptop Mode
    # will keep unsaved data waiting in memory before spinning up your hard drive.
    LM_BATT_MAX_LOST_WORK_SECONDS=600
    LM_AC_MAX_LOST_WORK_SECONDS=360
    # Should laptop mode tools control readahead?
    CONTROL_READAHEAD=1
    # Read-ahead, in kilobytes. You can spin down the disk while playing MP3/OGG
    # by setting the disk readahead to a reasonable size, e.g. 3072 (3 MB).
    # Effectively, the disk will read a complete MP3 at once, and will then spin
    # down while the MP3/OGG is playing. Don't set this too high, because the
    # readahead is applied to _all_ files that are read from disk.
    LM_READAHEAD=3072
    NOLM_READAHEAD=128
    # Should laptop mode tools add the "noatime" option to the mount options when
    # laptop mode is enabled?
    CONTROL_NOATIME=0
    # Should laptop use relatime instead of noatime? The "relatime" mount option has
    # more standards-compliant semantics, and allows more applications to work,
    # while retaining a low level of atime updates (i.e., disk writes).
    USE_RELATIME=0
    # Should laptop mode tools control the hard drive idle timeout settings?
    CONTROL_HD_IDLE_TIMEOUT=1
    # Idle timeout values. (hdparm -S)
    # Default is 2 hours on AC (NOLM_HD_IDLE_TIMEOUT_SECONDS=7200) and 20 seconds
    # for battery and for AC with laptop mode on.
    LM_AC_HD_IDLE_TIMEOUT_SECONDS=20
    LM_BATT_HD_IDLE_TIMEOUT_SECONDS=20
    NOLM_HD_IDLE_TIMEOUT_SECONDS=7200
    # Should laptop mode tools control the hard drive power management settings?
    # Set to 0 to disable
    CONTROL_HD_POWERMGMT="auto"
    # Power management for HD (hdparm -B values)
    BATT_HD_POWERMGMT=128
    LM_AC_HD_POWERMGMT=254
    NOLM_AC_HD_POWERMGMT=254
    # Should laptop mode tools control the hard drive write cache settings?
    CONTROL_HD_WRITECACHE=0
    # Write cache settings for HD (hdparm -W values)
    NOLM_AC_HD_WRITECACHE=1
    NOLM_BATT_HD_WRITECACHE=0
    LM_HD_WRITECACHE=0
    # Settings you probably don't want to touch
    # It is usually not necessary to change these parameters. They are included
    # for completeness' sake.
    # Change mount options on partitions in PARTITIONS? You don't really want to
    # disable this. If you do, then your hard drives will probably not spin down
    # anymore.
    CONTROL_MOUNT_OPTIONS=1
    # Dirty synchronous ratio. At this percentage of dirty pages the process
    # which calls write() does its own writeback.
    LM_DIRTY_RATIO=60
    NOLM_DIRTY_RATIO=40
    # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been
    # exceeded, the kernel will wake pdflush which will then reduce the amount
    # of dirty memory to dirty_background_ratio. Set this nice and low, so once
    # some writeout has commenced, we do a lot of it.
    LM_DIRTY_BACKGROUND_RATIO=1
    NOLM_DIRTY_BACKGROUND_RATIO=10
    # kernel default settings -- don't touch these unless you know what you're
    # doing.
    DEF_UPDATE=5
    DEF_XFS_AGE_BUFFER=15
    DEF_XFS_SYNC_INTERVAL=30
    DEF_XFS_BUFD_INTERVAL=1
    DEF_MAX_AGE=30
    # This must be adjusted manually to the value of HZ in the running kernel
    # on 2.4, until the XFS people change their 2.4 external interfaces to work in
    # centisecs. This can be automated, but it's a work in progress that still
    # needs some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for
    # external interfaces, and that is currently always set to 100. So you don't
    # need to change this on 2.6.
    XFS_HZ=100
    # Seconds laptop mode has to to wait after the disk goes idle before doing
    # a sync.
    LM_SECONDS_BEFORE_SYNC=2
    cpufreq.conf
    # Configuration file for Laptop Mode Tools module cpufreq.
    # For more information, consult the laptop-mode.conf(8) manual page.
    # CPU frequency scaling and throttling
    # Laptop mode tools can automatically adjust your kernel CPU frequency
    # settings. This includes upper and lower limits and scaling governors.
    # There is also support for CPU throttling, on systems that don't support
    # frequency scaling.
    # This feature only works on 2.6 kernels.
    # IMPORTANT: In versions 1.36 and earlier, these settings were included in the
    # main laptop-mode.conf configuration file. If they are still present, they
    # overrule the settings in this file. To fix this, simply delete the settings
    # from the main config file.
    # Enable debug mode for this module
    # Set to 1 if you want to debug this module
    DEBUG=0
    # Should laptop mode tools control the CPU frequency settings?
    # Set to 0 to disable
    CONTROL_CPU_FREQUENCY="auto"
    # Legal values are "slowest" for the slowest speed that your
    # CPU is able to operate at, "fastest" for the fastest speed,
    # "medium" for some value in the middle, or any value listed in
    # /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies.
    # The "governor" can be any governor installed on your system, this usually
    # includes "ondemand", "conservative", and "performance". The
    # "IGNORE_NICE_LOAD" setting specifies that background programs that have
    # a low priority ("nice level") should not cause the CPU frequency to
    # be increased. (You generally want this to be enabled in battery mode.)
    BATT_CPU_MAXFREQ=fastest
    BATT_CPU_MINFREQ=slowest
    BATT_CPU_GOVERNOR=ondemand
    BATT_CPU_IGNORE_NICE_LOAD=1
    LM_AC_CPU_MAXFREQ=fastest
    LM_AC_CPU_MINFREQ=slowest
    LM_AC_CPU_GOVERNOR=ondemand
    LM_AC_CPU_IGNORE_NICE_LOAD=1
    NOLM_AC_CPU_MAXFREQ=fastest
    NOLM_AC_CPU_MINFREQ=slowest
    NOLM_AC_CPU_GOVERNOR=ondemand
    NOLM_AC_CPU_IGNORE_NICE_LOAD=0
    # Should laptop mode tools control the CPU throttling? This is only useful
    # on processors that don't have frequency scaling.
    # (Only works when you have /proc/acpi/processor/CPU*/throttling.)
    # This is only useful on older P4 processors that do not support frequency
    # scaling. On such processors, this is the only way to reduce power consumption
    # but at the cost of higher performance penalty.
    # Enable this only if you have a processor that does not support frequency scaling
    # On most new processors, you might want to disable it.
    # Set to 0 to disable.
    CONTROL_CPU_THROTTLING=0
    # Legal values are "maximum" for the maximum (slowest) throttling level,
    # "minimum" for minimum (fastest) throttling level, "medium" for a value
    # somewhere in the middle (this is usually 50% for P4s), or any value listed
    # in /proc/acpi/processor/CPU*/throttling. Be careful when using "maximum":
    # this may be _very_ slow (in fact, with P4s it slows down the processor
    # by a factor 8).
    BATT_CPU_THROTTLING=medium
    LM_AC_CPU_THROTTLING=medium
    NOLM_AC_CPU_THROTTLING=minimum
    battery-level-polling.conf
    # Configuration file for Laptop Mode Tools module battery-level-polling.
    # For more information, consult the laptop-mode.conf(8) manual page.
    # Battery level polling settings
    # This module allows laptop mode to react to battery level changes, even if the
    # battery does not send out frequent ACPI events for such battery level changes.
    # Note that this does NOT make ACPI-only features work on non-ACPI hardware.
    # Enable debug mode for this module
    # Set to 1 if you want to debug this module
    DEBUG=0
    # Enable this setting to enable battery level polling.
    ENABLE_BATTERY_LEVEL_POLLING=1
    hal-polling.conf
    # Configuration file for Laptop Mode Tools module hal-polling.
    # For more information, consult the laptop-mode.conf(8) manual page.
    # HAL polling settings
    # If you enable this module, laptop mode tools will control the polling of
    # your CD/DVD drives by HAL. Disabling polling saves a considerable amount of
    # power, but for some older CD/DVD drives it means that inserted CDs are no
    # longer autodetected. In such cases, you must turn this option off.
    # Alternatively, you can configure laptop mode tools to turn HAL polling on only
    # when the laptop is running on AC power. This would mean that CDs are not
    # autodetected while the laptop is running on battery power, but the power
    # savings may be worth the extra manual labour when you insert a CD.
    # Enable debug mode for this module
    # Set to 1 if you want to debug this module
    DEBUG=0
    # Control HAL polling?
    # Set to 0 to disablei, vs "auto".
    CONTROL_HAL_POLLING=0
    # Disable HAL polling on battery?
    BATT_DISABLE_HAL_POLLING=0
    # Disable HAL polling on AC?
    AC_DISABLE_HAL_POLLING=0
    # Drives to apply HAL polling settings to
    HAL_POLLING_DEVICES="/dev/scd?"
    Please let me know if you require any additional information. Thank you in advance for any help.
    Last edited by Aesir (2011-04-14 14:35:09)

    Aesir wrote:Can I make BATT_CPU_GOVERNOR=conservative even if it is not listed in the scaling_available_governors file?
    If your governor isn't listed in scaling_available_governors, it won't work.  See stqn's link for info on adding governors.
    stqn wrote:Edit2: oh well, scrolling a bit up, the wiki says you don't need to add governors if you're using laptop-mode-tools... I don't know.
    You do need governors if you're using laptop-mode-tools, because all laptop-mode-tools does is flip between them automatically.
    If you're using cpufrequtils, you'll need the userspace governor for it to work properly.  I don't use cpufrequtils personally, so I'm not sure how to get it to work in conjunction with laptop-mode-tools.  You may have to disable frequency scaling in laptop-mode-tools by changing CONTROL_CPU_FREQUENCY to 0 in cpufreq.conf
    Edit - now that I think about it, maybe laptop-mode-tools and cpufrequtils know how to load the modules themselves automatically.  I guess try it and see if they can.  You can check which governor is in use with:
    $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    You can also manually change governors by running (as root):
    #  echo "conservative" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    Of course, substitue the governor you want.
    Last edited by redden0t8 (2011-03-29 19:27:12)

  • Acpid vs dbus vs laptop-mode-tools - What's the relationship?

    I disabled acpid from daemons, and uninstalled it, and to my surprise, the Suspend option still appears in the XFCE4 logout window, and when I open the lid the lappy comes right back. I had been under the impression that acpid was required for actions to take place on lid open/close. After a bit more research it appears that acpid is nothing more than a daemon that watches /proc and /sys for power and laptop related events, and that any daemon can do this, and in fact, cpufrequtils is such a daemon that just has a subset of events that it watches.
    Then I noticed today that on my Arch that when I close the lid, my LCD brightness goes down, and I have to use the function keys to bring brightness back. If I don't have acpid or laptop-mode-tools installed, I assume that dbus is handling this dimming? Or the hardware BIOS?
    Why isn't dbus handling things like AC adapter plugging and unplugging, and button events? Is there any reason to use acpid at all these days?

    Confirmed that like pogeymanz, laptop-mode-tools really does nothing without acpid. I guess it will set some of the other static values for devices listed in /etc/laptop-mode/conf.d/ but that's it. Tested by setting laptop-mode-tools to change the cpu scaling governor to powersave on battery, disabling acpid and unplugging laptop, then running cpufreq-info. No change.
    Then started acpid again from the init script, plug and unplug, now governor is powersave.
    It appears that acpid is a hard dependency, and that package should really be changed to fix that. If you look at the file list, there are 6 scripts placed into /etc/acpi/events/
    etc/acpi/actions/lm_ac_adapter.sh
    etc/acpi/actions/lm_battery.sh
    etc/acpi/actions/lm_lid.sh
    etc/acpi/events/lm_ac_adapter
    etc/acpi/events/lm_battery
    etc/acpi/events/lm_lid
    So laptop-mode-tools isn't even watching the acpid socket itself (/var/run/acpid.socket), and it relies solely on acpid to tell it about AC and lid status, so any configuration that you do in laptop-mode-tools that depends on checking for normal status changes on a notebook computer will fail to change anything without acpid installed and running.

  • Laptop-mode / laptop-mode-tools lcd brightness issue

    I have an issue with my lcd brightness config in laptop-mode tools
    here is the brightness values
    [venky@ARCHROCKS ~]$ cat /proc/acpi/video/VID/LCD/brightness
    levels: 72 24 12 24 36 48 60 72 84 100
    current: 72
    [venky@ARCHROCKS ~]$
    following is my lcd-bightness.conf file under /etc/laptop-mode/conf.d
    # Configuration file for Laptop Mode Tools module lcd-brightness.
    # For more information, consult the laptop-mode.conf(8) manual page.
    # LCD brightness settings
    # Using these settings, you can make laptop mode tools automatically adjust
    # your LCD's brightness settings. The settings are extremely simple -- they
    # only allow for the execution of a command, nothing more. The reason for this
    # is that LCD brightness settings are very different between laptop vendors.
    # Suggestions for commands:
    # * If your system has the file "/proc/acpi/video/VID/LCD/brightness" (VID may
    # be VID1 or similar), use this file as BRIGHTNESS_OUTPUT, and use
    # the command "echo <value>". The possible values can be listed using the
    # command:
    # cat /proc/acpi/video/VID/LCD/brightness
    # * If you have a file /sys/class/backlight/.../brightness, then you can use
    # that file as BRIGHTNESS_OUTPUT, and the command "echo <value>".
    # As far as I understand it the values are between 0 and
    # the value contained in the file /sys/class/backlight/.../max_brightness.
    # * For Toshiba laptops, use the command "toshset" with the -lcd or -inten
    # command. Read the toshset(1) manual page for more information on the
    # parameters for this command. If you use this command, set
    # BRIGHTNESS_OUTPUT to "/dev/null".
    # IMPORTANT: In versions 1.36 and earlier, these settings were included in the
    # main laptop-mode.conf configuration file. If they are still present, they
    # overrule the settings in this file. To fix this, simply delete the settings
    # from the main config file.
    # Should laptop mode tools control LCD brightness?
    CONTROL_BRIGHTNESS=1
    # Commands to execute to set the brightness on your LCD
    BATT_BRIGHTNESS_COMMAND="echo 24"
    LM_AC_BRIGHTNESS_COMMAND="echo 100"
    NOLM_AC_BRIGHTNESS_COMMAND="echo 72"
    BRIGHTNESS_OUTPUT="/proc/acpi/video/VID/LCD/brightness"
    so basically while in AC power i want full brightness when on battery i want one notch more than the minimum brightness and when laptop-mode is not running i want 2 notches less than maximum brightness.
    the battery mode works fine when i unplug the computer but when i replug the AC power it goes to 72 instead of 100. I mean laptop mode is running coz when I remove ac power it goes to 24 again.
    Am I doing something wrong?

    When you plug in AC power, laptop-mode probably turns down, so LCD brightness is set to 72. It depends on if you have set in /etc/laptop-mode/laptop-mode.conf ENABLE_LAPTOP_MODE_ON_AC to 0 or 1.

  • Laptop mode tools shut off keyboard

    When I have the laptop mode tools daemon enabled in rc.conf, the keyboard will stop functioning if a) I'm in the console and b) I leave the keyboard alone for ~10 seconds. There's no freeze, because the cursor is actually still blinking, and if I keep typing it doesn't shut off. I assume this is the LMT disabling my keyboard after some degree of inactivity-- of course, I can't get back after this, because the mouse doesn't function in console and the keyboard can't reactivate itself. I don't see anything relating to the keyboard in the config, is this a bug?
    I have a Macbook 6.1, by the way... I'm not sure if the Mac's keyboard is any different from another laptop's in how it transmits data.
    EDIT: If I start X, then go back to the console, this still happens, but it gives a message this time:
    PCI_PM_runtime_suspend():hcd_pci_runtime_suspend +0x0/0x20 [USBCore] returns -16
    I think this is indeed LMT shutting off USB support when it's not in use-- but on the Macbook, the keyboard needs that function. 'options usbcore autosuspend=0' in modprobe.conf does not fix this, so I'm stuck at this point...
    Last edited by DrKillPatient (2011-08-31 13:18:23)

    Did you try turning off USB suspend in LMT itself?
    in /etc/laptop-mode/conf.d/usb-autosuspend.conf:
    CONTROL_USB_AUTOSUSPEND=0

  • How to Define Specific CPU Frequency in Laptop Mode Tools?

    I would like to know how to set a specific maximum and minimum frequency for Laptop Mode Tools. Here is my /etc/laptop-mode/conf.d/cpufreq.conf:
    # Configuration file for Laptop Mode Tools module cpufreq.
    # For more information, consult the laptop-mode.conf(8) manual page.
    # CPU frequency scaling and throttling
    #__COMMENT Laptop mode tools can automatically adjust your kernel CPU frequency
    #__COMMENT settings. This includes upper and lower limits and scaling governors.
    #__COMMENT There is also support for CPU throttling, on systems that don't support
    #__COMMENT frequency scaling.
    #__COMMENT
    #__COMMENT This feature only works on 2.6 kernels.
    #__COMMENT
    #__COMMENT
    #__COMMENT IMPORTANT: In versions 1.36 and earlier, these settings were included in the
    #__COMMENT main laptop-mode.conf configuration file. If they are still present, they
    #__COMMENT overrule the settings in this file. To fix this, simply delete the settings
    #__COMMENT from the main config file.
    # Enable debug mode for this module
    # Set to 1 if you want to debug this module
    DEBUG=0
    # Should laptop mode tools control the CPU frequency settings?
    # Set to 0 to disable
    CONTROL_CPU_FREQUENCY="auto"
    # Legal values are "slowest" for the slowest speed that your
    # CPU is able to operate at, "fastest" for the fastest speed,
    # "medium" for some value in the middle, or any value listed in
    # /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies.
    # The "governor" can be any governor installed on your system, this usually
    # includes "ondemand", "conservative", and "performance". The
    # "IGNORE_NICE_LOAD" setting specifies that background programs that have
    # a low priority ("nice level") should not cause the CPU frequency to
    # be increased. (You generally want this to be enabled in battery mode.)
    BATT_CPU_MAXFREQ=fastest
    BATT_CPU_MINFREQ=slowest
    BATT_CPU_GOVERNOR=ondemand
    BATT_CPU_IGNORE_NICE_LOAD=1
    LM_AC_CPU_MAXFREQ=fastest
    LM_AC_CPU_MINFREQ=slowest
    LM_AC_CPU_GOVERNOR=ondemand
    LM_AC_CPU_IGNORE_NICE_LOAD=1
    NOLM_AC_CPU_MAXFREQ=fastest
    NOLM_AC_CPU_MINFREQ=slowest
    NOLM_AC_CPU_GOVERNOR=ondemand
    NOLM_AC_CPU_IGNORE_NICE_LOAD=0
    # Should laptop mode tools control the CPU throttling? This is only useful
    # on processors that don't have frequency scaling.
    # (Only works when you have /proc/acpi/processor/CPU*/throttling.)
    # This is only useful on older P4 processors that do not support frequency
    # scaling. On such processors, this is the only way to reduce power consumption
    # but at the cost of higher performance penalty.
    # Enable this only if you have a processor that does not support frequency scaling
    # On most new processors, you might want to disable it.
    # Set to 0 to disable.
    CONTROL_CPU_THROTTLING=0
    # Legal values are "maximum" for the maximum (slowest) throttling level,
    # "minimum" for minimum (fastest) throttling level, "medium" for a value
    # somewhere in the middle (this is usually 50% for P4s), or any value listed
    # in /proc/acpi/processor/CPU*/throttling. Be careful when using "maximum":
    # this may be _very_ slow (in fact, with P4s it slows down the processor
    # by a factor 8).
    BATT_CPU_THROTTLING=medium
    LM_AC_CPU_THROTTLING=medium
    NOLM_AC_CPU_THROTTLING=minimum
    I have a new Intel Haswell CPU, so I know that CPU throttling isn't applicable to me. In the section about scaling, how do I set a specific GHz or MHz value for the minimum and maximum CPU?
    Thanks

    No, I just want to save battery power. I don't want the CPU to be clocked as high when I'm on battery. I would set the CPUFreq governor to ondemand, but when I issue sudo cpupower frequency-set -g ondemand, I get:
    Setting cpu: 0
    Error setting new values. Common errors:
    - Do you have proper administration rights? (super-user?)
    - Is the governor you requested available and modprobed?
    - Trying to set an invalid policy?
    - Trying to set a specific frequency, but userspace governor is not available,
    for example because of hardware which cannot be set to a specific frequency
    or because the userspace governor isn't loaded?
    The output of ls /lib/modules/$(uname -r)/kernel/drivers/cpufreq/ is:
    acpi-cpufreq.ko.gz cpufreq_stats.ko.gz powernow-k8.ko.gz
    amd_freq_sensitivity.ko.gz cpufreq_userspace.ko.gz speedstep-lib.ko.gz
    cpufreq_conservative.ko.gz p4-clockmod.ko.gz
    cpufreq_powersave.ko.gz pcc-cpufreq.ko.gz
    Doing modprobe cpufreq_ondemand and trying again does nothing.
    So, since I can't use the ondemand governor and then raise the threshold, I need to limit the CPU frequency.
    Thanks.

  • Laptop mode tools disables bluetooth.

    I have a weird issue with laptop mode tools, when i boot up on battery bluetooth is disabled until i plug in a power supply. After its enabled i can unplug it and bluetooth will work.
    Bluetooth control is disabled in bluetooth.conf. I tried switching off usb-autosuspend but that didn't help. The only thing that helped was turning off auto modules in laptop-mode.conf and enabling only cpufreq. I tried enabling everything by hand but the problem came back so it seems like some module other than usb-autosuspend or the bluetooth module is the problem.

    gh403 wrote:
    Laptop Mode Tools is configured to set my SATA link power management to "min_power".  Essentially, it does
    # echo "min_power" > /sys/class/scsi_host/host0/link_power_management_policy
    when I unplug, and
    # echo "max_performance" > /sys/class/scsi_host/host0/link_power_management_policy
    when I plug in the laptop.  I can check the value with
    $ cat /sys/class/scsi_host/host0/link_power_management_policy
    Setting max_performance when plugging works great.  Unfortunately, when I unplug, it stays stuck at max_performance.  Restarting the LMT daemon fixes this temporarily, until I unplug again.
    Is this a bug?  Or am I missing something?  I'm on a Dell Inspiron 7520, about 3 months old, and so far, Arch doesn't seem to like the more esoteric features of the laptop, like the switchable graphics card.
    Thanks for any help!
    Have you searched the all-powerful google or the Arch wiki, friend?
    Oh, and welcome to Arch Linux since this appears to be your first post!  Hope that you like it here and enjoy your stay!
    Also, I don't know anything about the Laptop Mode Tools, since I don't use them even though I have a laptop, perhaps I should take a look into them for my own benefit as well.
    Last edited by lspci (2012-09-15 12:12:02)

  • Trouble with Laptop-Mode-Tools, AC Plug-In

    I can't get Laptop-Mode-Tools to recognize when I plug my AC in, I have options for "AC_" as it says are allowed in the man page and ArchWiki, although there are no examples of just having the prefix "AC_".
    However, it says it should behave in the same way as "BATT_" does, independant of the laptop-mode status.
    I have LM enabled for AC in laptop-mode.conf, and acpi_listen has output for the AC in/out.   My current workaround is to have it as it is, with "LM_AC_*", but having entries for exclusively battery and AC is easier for me as I plan to always keep Laptop-Mode-Tools enabled.
    Is there something I misconfigured, or may I have misunderstood the manual/wiki?
    Alternatively, how would I go about debugging? I noticed there was a variable enabling debugging, but I couldn't find where the debugging output occurs.  I am a little new with regards to standard debugging practice.
    Last edited by mellowmaroon (2012-10-03 06:23:05)

    I'm terribly sorry, I fixed everything I had made bold.  I was trying to make the technical things stand out for people that were just glancing at the post. But you're absolutely right, I should have used more discretion.
    As for the configuration, I did not expect it to magically do what I want.  I will provide a more concrete example of what I am talking about, if it helps.
    In /etc/laptop-mode/conf.d/lcd-brightness.conf, I have BATT_BRIGHTNESS_COMMAND="echo 0".  This works: when I unplug AC, 0 gets output to /sys/class/backlight/acpi_video0/brightness.
    However, when I attempt AC_BRIGHTNESS_COMMAND="echo 15" (less than /sys/class/backlight/acpi_video0/max_brightness, hopefully demonstrating my reading of laptop-mode.conf), it is unsuccessful.  Instead, I currently use LM_AC_BRIGHTNESS_COMMAND="echo 15" as a workaround.  BATT_BRIGHTNESS_COMMAND works without editing /etc/acpid/handler.sh, I was simply wondering why the AC counterpart does not.
    I hope I have now supplied enough information now allows us to be on the same page, and I apologize again for the offensive formatting.

  • Laptop-mode-tools loops on lock_retry()

    I have been struggling with laptop-mode-tools for a while, so I am finally posting here.
    Short version:
    laptop-mode-tools never does anything on acpi events. Here is what happens in /var/log/everything.log when I unplug the ac adaptor:
    Jan 29 17:20:25 localhost laptop-mode: Determining power state from /sys/class/power_supply/ACAD/online.
    Jan 29 17:20:25 localhost laptop-mode: Not trying other options, already found a power supply.
    Jan 29 17:20:25 localhost laptop-mode: Battery level polling is disabled.
    Jan 29 17:20:25 localhost laptop-mode: Prelim lock acquisition on descriptor 8 with pid 8098
    Jan 29 17:20:25 localhost laptop-mode: Couldn't acquire prelim lock on descriptor 9 with pid 8098
    Jan 29 17:20:25 localhost laptop-mode: Now invoking lock_retry with arguments -- auto
    Jan 29 17:20:25 localhost kernel: [ 2961.821328] EXT4-fs (sda5): re-mounted. Opts: commit=300,commit=600
    Jan 29 17:20:26 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:27 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:28 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:29 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:30 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:31 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:32 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:33 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:34 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:35 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:35 localhost laptop-mode: Determining power state from /sys/class/power_supply/ACAD/online.
    Jan 29 17:20:35 localhost laptop-mode: Not trying other options, already found a power supply.
    Jan 29 17:20:35 localhost laptop-mode: Battery level polling is disabled.
    Jan 29 17:20:35 localhost laptop-mode: Prelim lock acquisition on descriptor 8 with pid 8188
    Jan 29 17:20:35 localhost laptop-mode: Couldn't acquire prelim lock on descriptor 9 with pid 8188
    Jan 29 17:20:35 localhost laptop-mode: Now invoking lock_retry with arguments -- auto
    Jan 29 17:20:36 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:37 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:38 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:39 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:40 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:41 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:42 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:43 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:44 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:45 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    To obtain this log, I switched to 1 the variables VERBOSE_OUTPUT, LOG_TO_SYSLOG and DEBUG in /etc/laptop-mode/laptop-mode.conf
    long version:
    If I understand correctly, when the ac adapter is unplugged, the script /etc/acpi/events/lm_ac_adapter (which basically grabs every acpi events starting with ac_adapter), triggers the script /etc/acpi/actions/lm_ac_adapter.sh, and this action triggers the command '/usr/sbin/laptop_mode auto'
    I could check that acpid does its work correctly by modifying /etc/acpi/actions/lm_ac_adapter.sh and checking it is called immediately when I unplug the adapter, so I tried to manually call '/usr/sbin/laptop_mode auto' after unplugging the adapter, and I discovered that laptop_mode gets stuck in calling lock_retry() 10 times and then exists.
    See this paste: http://pastie.org/3276821
    Any idea how to fix that?
    Last edited by duquesnc (2012-01-29 17:26:05)

    lucke wrote:Perhaps you have a battery-level-polling.conf.pacnew file in /etc/laptop-mode/conf.d/ - merging the changes might help.
    No, this installation is brand new (I just got this laptop).
    Removing lmt-*.lock files from /var/lock/ after having stopped the laptop-mode "daemon" could (temporarily?) help.
    Trying to apply this advice, I realized something strange: calling 'rc.d stop laptop-mode' does not really stop laptop-mode:
    I first reboot the laptop in order to get rid of everything I could have done previously that could mess with the daemon. Then I check the lock files you mentionned exist:
    ls /var/lock/lmt-*.lock
    /var/lock/lmt-battpoll.lock /var/lock/lmt-invoc.lock /var/lock/lmt-req.lock
    Then, when calling
    rc.d stop laptop-mode
    I get in /var/log/everything.log:
    Jan 29 18:47:08 localhost laptop-mode: Now invoking lock_retry with arguments -- stop
    Jan 29 18:47:09 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:10 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:11 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:12 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:13 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:14 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:15 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:16 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:17 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:18 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    If I check /var/lock/lmt-*.lock after that, all the files are still there (they were not removed)
    ls /var/lock/lmt-*.lock
    /var/lock/lmt-battpoll.lock /var/lock/lmt-invoc.lock /var/lock/lmt-req.lock
    If I unplug the laptop after having stopped laptop-mode, I still get messages from laptop-mode in /var/log/everything.log!!!
    Jan 29 18:53:06 localhost laptop-mode: Determining power state from /sys/class/power_supply/ACAD/online.
    Jan 29 18:53:06 localhost laptop-mode: Not trying other options, already found a power supply.
    Jan 29 18:53:06 localhost laptop-mode: Battery level polling is enabled.
    Jan 29 18:53:06 localhost laptop-mode: Lock acquisition on descriptor 7 failed with pid 20828
    Jan 29 18:53:06 localhost laptop-mode: Prelim lock acquisition on descriptor 8 with pid 20828
    Jan 29 18:53:06 localhost laptop-mode: Couldn't acquire prelim lock on descriptor 9 with pid 20828
    Jan 29 18:53:06 localhost laptop-mode: Now invoking lock_retry with arguments -- auto
    Jan 29 18:53:06 localhost kernel: [ 8514.884884] EXT4-fs (sda5): re-mounted. Opts: commit=300,commit=600
    Jan 29 18:53:07 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:08 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:09 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:10 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:11 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:12 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:13 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:14 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:15 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:16 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:16 localhost laptop-mode: Determining power state from /sys/class/power_supply/ACAD/online.
    Jan 29 18:53:16 localhost laptop-mode: Not trying other options, already found a power supply.
    Jan 29 18:53:16 localhost laptop-mode: Battery level polling is enabled.
    Jan 29 18:53:16 localhost laptop-mode: Lock acquisition on descriptor 7 failed with pid 20920
    Jan 29 18:53:16 localhost laptop-mode: Prelim lock acquisition on descriptor 8 with pid 20920
    Jan 29 18:53:16 localhost laptop-mode: Couldn't acquire prelim lock on descriptor 9 with pid 20920
    Jan 29 18:53:16 localhost laptop-mode: Now invoking lock_retry with arguments -- auto
    Jan 29 18:53:17 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:18 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:19 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:20 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:21 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:22 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:23 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:24 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:25 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:26 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    When I remove the files, I can stop laptop-mode for good, but when I restart it, it re-creates them and the problems start again after the next acpi event...
    Last edited by duquesnc (2012-01-29 18:10:23)

Maybe you are looking for

  • What will I lose by removing a folder and then resynchronizing?

    I am having a problem editing files that I imported into Lightroom from my photoshop elements 6 catalog. The details of what I've gone through are in the thread titled: Problem with "Edit in Photoshop" and Lightroom 2.1 failing to import new file I t

  • EWS Managed API 2.0 - Attachment.Inline property value incorrect

    I have an application where I am reading the emails from a mailbox using EWS managed api. One of the things that I check for in the email message is whether it has any inline attachments.  I am having this issue where I have an email with an image in

  • Loadind data from SAP ECC 6.0 system

    Hi! I am about to implement SAP Best Practices scenario "B34: Accounts Receivable Analysis". Therefore I load the data from SAP ERP IDES system into SAP NetWeaver 2004s system. My problems are: when I try to load the transaction data for Infosources

  • Updating color sequences from final cut

    I am completely new to Color but really like the extra control it seems to have over FCP color options. I am wondering how one goes about adding new clips to an already timed Color file? Basically, I have most of my fcp sequence in place and want to

  • ASA: OSPF Path Selection RFC1583 or 2328?

    Hi, I've been searching for this information but didn't find anything so far. Among other things, with RFC 2328 the way to determine the prefered path has been changed. However, per default Cisco IOS platforms still use the RFC 1583 mechanisms for co