KubuntuPowersave

Power management is one of key features required for great laptop support. Ubuntu is one of best distributions for laptop support, but there are still ways to improve this in Kubuntu.

(There should be one laptop daemon in *buntu and several GUIs talking to it.

I strongly stress a more universal approach here! You should stop thinking in ubuntu/kubuntu/xubuntu patterns. Explanation in comments Elias12)

Current Situation: KLaptop

Kubuntu by default comes with klaptopdaemon package which provides KLaptop applet in KDE systray and klaptopdaemon running in background and communicating with acpi-support scripts.

Pros:

  • Uses acpi-support infrastructure provided by Ubuntu

Cons:

  • klaptop is not maintained upstream (see post from author)

  • klaptop has many issues (and no one to fix them)
    • has all kind of acpi/apm cruft (messing with /proc filesystem) which is now replaced with hal/acpi-support
  • klaptop is not enabled by default (user has to configure klaptopdaemon and supported features manually)
  • no daemon process that control PM when user is not logged in

Alternative: Powersave/KPowersave

More info: KPowersave

Dapper Universe currently have kpowersave and powersave. The problem is that these packages cannot be installed if conflicting packages (powernowd, cpudyn, cpufreqd, apmd) are not deinstalled first. Since powernowd and ampd are required by *-desktop packages (including kubuntu-desktop), powersave package was prepared to Provide/Replace/Conflicts with problematic packages in order to allow proper installation.

Pros:

  • cleaner user interface
  • more functionality: multi battery monitor, CPU freq monitor, PM schemes...
  • clear Debian maintainer and active development team (that is accepting patches from distros)
  • power management done by daemon (powersaved) and works without active GUI (and logged user)
  • uses acpi-support infrastructure if configured EVENT_GLOBAL_SUSPEND2DISK_OTHER="suspend2" in /etc/powersave/events points to /usr/local/lib/powersave/scripts/suspend2 (fixed in v12 of powersave, works with suspend2 and with acpi-support infrastructure)

Cons:

  • conflicting with existing Ubuntu packages: powernowd, cpudyn, cpufreqd, apmd
  • duplication of functionality of Ubuntu acpi-support/hotkey-setup/laptop-mode-tools packages
  • needs more testing / feedback to be sure it can replace klaptop
  • no configuration module for System settings - would need to write one (SuSE has it in yast2)
  • not as good support on non-i386 platforms as Ubuntu acpi-support

How to get Powersave/KPowersave to mainstream?

DapperDrake

  1. Prepare latest test packages for Dapper - DONE

    • Mbiebl provided test packages (source and i386 binaries) that can be installed on Dapper - see announcement

    • packages have Conflicts/Provides rule for all conflicting packages (allow install on Dapper w/o removal of *-desktop)
    • redirect /etc/acpi/events to ignore (temporarily until better solution is implemented)
    • packages tested by: LukaRenko, Sebastian K├╝gler, AchimBohnet

    • these packages are now replaced by offical packages in Universe repository - see below
  2. Polish packages for upload to Universe and get the REVU-ed - DONE

    • address /etc/acpi/events redirection in a way that it does not break gnome-power-manager - DONE
      • this may require change to apci-support scripts to check for "powersaved" process
      • need to work with Ubuntu laptop team on how this should be done properly
    • fix kpowersave .desktop icon (not to show in GNOME menu) - DONE
  3. Request UpstreamVersionFreeze exception for powersave/kpowersave - DONE

    • since old version cannot be installed w/o removing *-desktop packages it makes sense anyhow
    • we have waited for final release of kpowersave 0.6.0
    • approved UVF exception request are here: powersave and kpowersave

  4. Get lots of testing by Kubuntu laptop users - DONE

    • we should confirm that kpowersave is as good as exiting klaptop
    • we should get feedback for all supported platforms (i386, amd64, ppc) - waiting for universe packages for non-i386 platforms

EdgyEft

  1. Consider main inclusion - not needed as guidance-power-manager is used instead

    • this is prerequisite to include it by default on Kubuntu
  2. Consider making kpowersave default for kubuntu-desktop - guidance-power-manager is used instead

    • as we now know it is better than klaptop Wink ;-)

  3. Consider ksmserver patch for logout dialog - similar patch was created that uses HAL directly

    • see below

Installing KPowersave from Dapper repository

If you would like to test kpowersave/powersave on your laptop, you can install it from Kubuntu Dapper universe repository:

  1. Add Universe repository to your /etc/apt/sources.list

  2. Install kpowersave (will install also powersave)
    •   sudo apt-get update
        sudo apt-get install kpowersave
  3. Start kpowersave
    •   kpowersave
  4. Reboot (check below notes first)

Note: powersave will remove apmd/powernowd/klaptopdaemon packages. If you want to go back to klaptop (not that this can happen in real life ;-)), you should remove powersave/kpowersave (sudo apt-get remove libpowersave10) and then reinstall kubuntu-desktop (sudo apt-get install kubuntu-desktop).

Note: if you have been using test repository version with acpid redirection (powersave 0.12.2, kpowersave 0.5.10), they you should do the folowing:

  • Remove divert for /usr/sbin/acpid: sudo dpkg-divert --package powersaved --rename --remove /usr/sbin/acpid

  • Reinstall acpid: sudo apt-get install --reinstall acpid

  • Reinstall acpi-support: sudo apt-get install --reinstall acpi-support

Configuration Tips

We do not have configuration GUI for all powersave options (like SuSE yast2), therefore you may need to edit configuration files in /etc/powersave directory.

  • CPU frequency scaling: by default it is performed by kernel, but leaving it to powersaved userspace daemon may be better
    set CPUFREQ_CONTROL="userspace" in /etc/powersave/cpufreq

  • automatic suspend on low battery/lid close via powersave
    see EVENT_BATTERY_WARNING, EVENT_BATTERY_LOW and EVENT_BUTTON_LID_CLOSED variables in /etc/powersave/events

  • automatic suspend on low battery/lid close via KPowersave
    add e.g. dcop kpowersave KPowersaveIface do_suspendToDisk command to the related event in KPowersave (discover via kdcop). You can configure this via the applet menu: "Configure Notifications ..." , select the related event (e.g. "Battery charge dropped to level LOW") and add the command to "Execute a program:".

  • disable kernel check before suspend to disk (if not using i386 or GRUB or false mismatch report)
    this might not work if you do not use GRUB as boot manager or using non-standard kernel naming - in such case you may want to set BOOT_LOADER="OTHER" variable in /etc/powersave/common. If this does not help (and you still get error that kernel version does not matches), you may want to disable this check completly by setting SUSPEND2DISK_IGNORE_KERNEL_MISMATCH="yes" variable in /etc/powersave/sleep.

Integration into logout dialog

Mbiebl has worked on patch for ksmserver to provide Suspend to Disk/RAM in logout dialog

logout.png

He has provided test package and proposed patch for Dapper:

Test reports

If you have tested Kpowersave on your laptop, please report it in this table:

Laptop

Tested by

Suspend RAM

Suspend Disk

Standby

CPU freq

Hotkeys

Notes

Apple Powerbook G4

RaphaelPinson

No

No

Untested

Improvement

Untested

When trying to SuspendtoDisk, I get a kernel error message. Choosing Suspend2Ram seems to block everything. However, I can still get in suspend mode by closing the lid.

Acer TravelMate 292LMi

GeorgeMoody4

Yes

Yes

Untested

Improvement

No

Suspend2Disk not reliable, screen freezes during suspend occasionally (using ATI's own drivers)

Acer TravelMate 3002WTMi

DannyKukawka

No

Yes

Unsupported

Improvement

Untested

need to run: noapic pci=noacpi vga=771

Acer TravelMate 8103

Beat Wolf

No

Untested

Untested

Improvement

Untested

Acer Ferrari 4000

DannyKukawka

Improvement (see notes)

No

Unsupported

Improvement

Yes

Suspend2Ram: klaptop hangs up, KPowersave suspend, but can't correct resume, shoudl work with s2ram tool; Suspend2Disk: need kernel parameter noapic

Asus L2400D

DannyKukawka

Improvement (see notes)

Yes

No

Improvement

Yes

Suspend2Ram: klaptop hangs up, KPowersave suspend/resume, but need kernel param acpi_sleep=s3_mode

Asus Z96J

Ltmon

Yes

No

No

Yes

No

Suspend2Ram: klaptop has about 50% success rate. Random errors on resume (no sound, no wired network). KPowersave doesn't reenable display out of the box, but once I installed s2ram and configured /etc/powersave/sleep with SUSPEND2RAM_VBE_POST="yes" it started working.

Compaq Evo n610c

dresnu

No

No

No

Improvement

No

Compaq Presario 2100

jetpeach

No

No

No

Improvement

No

Suspend-Screen does not return from black; Hibernate-crashes before hibernating (frozen mouse)

Dell Inspiron 8100

RyanNovosielski

No

Regression

Unsupported/Regression

Regression

Yes

Disk: klaptop works pretty reliably, kpowersave can't return display; 'RAM: klaptop screen does not return (used to work with "nv" driver, not with "nvidia"), kpowersave freezes machine on restore; CPU Freq: Causes machine to lag because of incessant changes -- load sensor TOO sensitive on Dynamic; Standby: Worked unreliably with klaptop (did restore a couple of times), grayed out in kpowersave

Dell Latitude C640

DannyKukawka

Improvement (with vga=0)

Yes

Yes

Improvement

Untested

need to press powerbutton to finish Standby (with klaptop and KPowersave), with vga=0 as boot parameter s2ram work with KPowersave

Dell Latitude D510

JbSegal

Regression AND Improvement

Untested

Untested

Improvement

Improvement AND Regression

1) Suspend to RAM actually suspends, which is good, but on unsuspend, my session has been killed and restarts. This is bad. 2) The Fn-Esc key combo (labeled Stand by actually does something, but what it does is power everything off. Fn-F1 (Hibernate) still does nothing.

Dell D600

AchimBohnet

Untested

No

Untested

Improvement

Yes

Regression: After every power plug in, I have to switch to powersaving mode, otherwise fan speed/noise increases

Dell Latitude D600

DannyKukawka

Improvement (with vga=0)

Yes

No

Improvement

Yes

after remove and plugin AC: max. CPUFreq not set to 1.7 GHz (kernelbug, see: SUSE bug #119836); can't reproduce the regression from AchimBohnet; Suspend2Ram: see C640

FujitsuSiemens Lifebook P1510

DannyKukawka

No

Yes

Unsupported

Improvement

Untested

Klaptop crash, (K)Powersave can Suspend2Ram, but can't reactivate screen (same on SUSE, looks like hw specific problem)

HP nw8240

LukaRenko

No

Yes

Unsupported

Improvement

No

ATI driver has

IBM ThinkPad 600E

DannyKukawka

Yes

Improvement (APM)

Yes

Unsupported

Untested

only support APM

IBM ThinkPad R32

DannyKukawka

Improvement

Yes

Unsupported

Improvement

Untested

Suspend2Ram didn't worked with klaptop, but with KPowersave

IBM ThinkPad R40

DannyKukawka

Improvement

Yes

Unsupported

Improvement

Untested

with klaptop Suspend2Ram failed and klaptop died (same on R32)

IBM ThinkPad T21

DannyKukawka

Yes

Improvement (APM)

Yes

Unsupported

Untested

work better with APM (use acpi=off kernelparam and start powersave after load apm module (see #37512)); with ACPI only Suspend2Disk work, klaptop doesn't support Suspend2Disk on APM, but KPowersave

IBM ThinkPad T42p

SamatJain

Regression

Regression

Untested

Improvement

Untested

Both suspend-to-ram and suspend-to-disk both freeze when trying to resume.

IBM ThinkPad T42p

Munk2

Regression

Yes

Untested

Improvement

Untested

suspend-to-disk works when setting SUSPEND2DISK_SWITCH_VT="yes" in /etc/powersave/sleep. At wake-up after suspend-to-ram, x-server and terminals still don't show up, but system responds to (blind) typing.

IBM ThinkPad T43

Nathaniel7

Regression

Regression

Untested

Yes

Yes

S2RAM does nothing at all, just says it's "saving my state" and locks the screen OR it suspends ok, resumes ok but the screen is turned off and can't be turned on. S2Disk suspends allright, but laptop boots normally afterwards.

IBM ThinkPad X40

AngeloLisco

Yes

Yes

Untested

Improvement

Untested

works great

MSI M630 (amd64)

DannyKukawka

No/Improvement

Yes

No

Improvement

Untested

Suspend2Ram: klaptop hangs up, KPowersave suspend, but can't activate display on resume, the rest works fine, Standby: kernel oops

Packard Bell EasyNote B3520 (AMD Turion64)

DannyKukawka

No

Yes

Unsupported

Improvement

Untested

Tested with i386 and old x86_64 packages; Suspend2Disk need more than ~10 min (work perfect with SUSE 10.1), Suspend2Ram: klaptop crash, KPowersave: refused because machine blacklisted

Panasonic CF-W2 (Japanese version)

PiotrSniady

No

Regression

Untested

Untested

No

Suspend RAM: system seems to wake up ok, except that the screen is switched off. Suspend disk: instead of waking up the system starts over (reboots). With klaptop suspend to disk worked perfectly

Samsung X20

Konrad27

Regression

Regression

Untested

Improvement

Improvement

Kubuntu with bin ATI drivers Suspend2RAM/Suspend2Disk will put the Notebook into sleep/hibernate, but resume fails; Screen seems switched of, played around with /etc/acpi/sleep.sh and /etc/powersave/sleep, but all I could get is the kdm login screen. For the moment switched back to klaptop!

Sony Vaio PCG-K13Q

mlaverdiere

No

Regression

Untested

Unsupported (reported as)

Untested

With regular Kubuntu/KLaptop, ramsusp was not working, but disksusp and cpufreq was. Nothing work here with Kpowersave, i.e. ramsusp freezes the system, resume is not completed with disksusp and cpufreq settings are not available, while they do work with Klaptop. Strangely, everything was working well with my previous Debian Sid system, except cpufreq which was not available either. Also, I have managed to solve my battery monitoring problem with Klaptop (relying on ACPI) with a simple workaround (see this thread: [url]http://www.ubuntuforums.org/showthread.php?t=167440)[/url]. But with Kpowersave, I'm back to square one, i.e. battery is reported absent, while it is present and full charge. Last thing, Kpowersave is conflicting with kde and kdeutils metapackages and Klaptopdaemon package, which is not nice for those of us who want to maintain a full KDE installation on Kubuntu. On my previous Debian Sid system, it was possible to have Kpowersave installed and to keep all kde packages, including klaptopdaemon...

Toshiba Portege M200

GabrielAmbuehl

Supported (see note)

Unsupported

Untested

Regression

Untested

Suspend2Ram: Suspend worked with hibernate script and some VBE hackery also resume did work. powersaved suspend works out of box, resume works after setting SUSPEND2RAM_SWITCH_VT="yes" in /etc/powersave/sleep. (if you don't do that, you will have to switch virtual consoles by hand to get screen back, you might also want to try deactivating bootsplash in grub if you run into issues) (this is on nvidia binary driver). Suspend2Disk works but resume crashes with nvidia driver. The CPU scaling worked at some point but currently seems somehow broken with 2.6.15-26, must investigate further.

Toshiba Portege M200

GabrielAmbuehl

Improvement

Untested

Untested

Unsupported

Untested

Suspend2Ram: Suspend worked with hibernate script and some VBE hackery also resume did work. powersaved suspend works out of box, resume works after setting SUSPEND2RAM_SWITCH_VT="yes" in /etc/powersave/sleep. (if you don't do that, you will have to switch virtual consoles by hand to get screen back, you might also want to try deactivating bootsplash in grub if you run into issues) (this is on nvidia binary driver)

Toshiba Satellite S1410

AndersBruunOlsen

Improvement

Untested

Untested

Unsupported

Untested

Suspend2Ram: Suspend worked with klaptop but resume did not. With kpowersave it not only suspends, resume is possible. The screenresolution is however screwed (screen content is moved half a screen up/down like a 35mm movie projection might sometimes do). A quick resolutionchange through xrandr gives me back a fully working machine. This is with nv driver. Binary NVidia driver so far untested.

Thinkpad R51

Tobias Heinemann

Regression

Untested

Untested

Untested

Untested

Suspend2ram only works if I set SUSPEND2RAM_SWITCH_VT="yes" in /etc/powersave/sleep

Notes:

  • Yes: it works like before (with klaptop)

  • No: it does not work (but it did not work with klaptop either)

  • Improvement: works better than with klaptop

  • Regression: works worse/broken (put details in notes/comments)

  • Untested: not tried (yet)

  • Unsupported: not supported by hardware

There is also discussion going on in this forum thread.

KPowersave Issues / Questions / Comments

This is a list of issues/questions that need clarification or discussion with developers of powersave/kpowersave:

Elias12

  • In order to make this thing successful I recommend to choose an approach similar to network-manager: A daemon running in the background and a KDE GUI to talk to it. Why? Because otherwise the point will come where you will throw away all your work and built a GUI for a daemon somebody else has written just like it was with knetworkmanager superseding kde-wireless-config or whatever it's name was.
  • The success of network-manager lies in the fact that KDE could use it's advantages eventhough it comes from the gnome community. Another example is dbus which will replace dcop in KDE4. Both nm and dbus could be used by anyone without having to install gnome. This freedom ensures a wide acceptance and potentially attracts a big community driving the development of the project.
  • On the contrary dcop did not survive since it was only available when installing all of kdelibs and all dependent packages (QT) as well.
  • Therefore I cannot stress enough, if you want to create something with sustained success, something long lasting, then split your project in a daemon and a GUI part. The daemon should exist as a seperate project and consequently as a seperate package with no dependency to KDE. This will make your work available for other desktops as well. Nobody will have to reinvent the wheel. And CPU frequenzy throttling and such could finally be available even for puristic console users - I never understood why all the cool stuff should only be available for desktop users. The GUI would either be a subproject of the daemon in a seperate package or some time become an official part of KDE with a dependancy to the daemon package.
  • This is especially important for a project like *buntu! The efforts of the one subproject should be beneficial for all the other subprojects as well! We have to stop acting like a bunch of competing projects and start acting like a family!
  1. Administration applet for KDE
    • SuSE uses YAST, what can we do in Kubuntu (kde-guidance/pykde applet?)
  2. Performance scheme is default when on power
    • if user changes this in sys tray, should this be saved as new default into config (for next start)?
  3. Screensaver dcop call should block until screen is locked
  4. Powersave on PPC - DONE

    • need to provide latest packages to verify bug 35006 - DONE (does not crash)

    • default config is not good enough for PPC (i386 specific modules for unload, GRUB boot loader checks by default...)
  5. Powersave on x86_64 / amd64 - DONE

    • need to provide latest packages (kubuntu.no-ip.org doesn't provide amd64 and universe contains only old version)
  6. s2ram Kubuntu packages
    • This program is supported by powersave and should fix suspend/resume on several machines. see: s2ram-project-page

  7. Suspend to Disk is slow if laptop-mode is active
    • we need to disable laptop-mode before suspend is started and reative it after resume (similar as acpi-support scripts are doing it)

KubuntuPowersave (last edited 2008-08-06 17:00:57 by localhost)