Use acpi-support event handling

Bug #45661 reported by John Dong
10
Affects Status Importance Assigned to Milestone
powersave (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

powersave on Ubuntu should utilize acpi-support's scripts for ACPI events (handling hotkeys, buttons, sleep/resume scripts, hibernating and so on) instead of using its built-ins. Thanks to all the work the acpi-support folks have done these past few releases, the acpi-support system works great on much of the hardware out there, while powersaved seems to work somewhat less effectively particularly in the suspend/resume arena.

In addition, the duplication of work between maintaining two separate set of scripts is not efficient, not to mention confusing to users trying to tweak their ACPI setup.

Revision history for this message
Luka Renko (lure) wrote :

True - powersave is completely own subsystem with own benefits/drawbacks. This is why it is only available in Dapper universe and did not replace klaptop (which is default in Kubuntu).

We will see if this can be changed for Edgy.

Changed in powersave:
status: Unconfirmed → Confirmed
Revision history for this message
Nikolaus Filus (nfilus) wrote :

BTW: after installing KDE (including kpowersave) on ubuntu, powersave is used for suspend/resume instead of pmi, what BREAKS resume (black screen) on my Samsung P35 laptop. Disabling powersave lets resume work as expected.

Revision history for this message
Daniel Hahler (blueyed) wrote :

I can suspend to disk fine through
/usr/share/hal/scripts/hal-system-power-hibernate, but not through kpowersave. Screen goes off, but the computer does not halt. I have to forcefully turn it off and then resuming does not work.

From looking at kpowersave.cpp, it does this:
"""
        // sent to admin interface if we are run as root
        if (getuid() == 0)
                res = dbusSendSimpleMessage(ADMIN_MESSAGE,
                                            "SuspendToDisk");
        else
                res = dbusSendSimpleMessage(ACTION_MESSAGE,
                                            "SuspendToDisk");
"""

And this seems to arrive in /usr/lib/powersave/do_acpi_sleep here:
   suspend2disk)
        IMG_SZ=0
        read IMG_SZ < /sys/power/image_size
        $MYECHO /sys/power/state disk
        RET=$? # 28=ENOSPC, "not enough swap."
        #
        # the logic here is:
        # if image_size > 0 (without kernel support, IMG_SZ will be zero),
        # and we got ENOSPC, then try again with image_size set to zero.
        if [ $RET -eq 28 -a $IMG_SZ -ne 0 ]; then # try again with minimal image size
                echo 0 > /sys/power/image_size
                $MYECHO /sys/power/state disk
                RET=$?
                echo $IMG_SZ > /sys/power/image_size
        fi
        [ "$SUSPEND2DISK_RESTORE_CLOCK" == "yes" ] && $HWCLOCK $OPT
        ;;

I've found a patch for kpowersave which seems to use HAL (and therefor acpi-support) instead:
http://www.mail-archive.com/powersave-devel%40forge.novell.com/msg00687.html
This might be available in a new upstream release.

Revision history for this message
Luka Renko (lure) wrote :

kpowersave 0.7.2 in feisty does not use powersaved anymore, therefore it uses HAL features.

powersaved is now only useful on machines without DE (servers) and it is not clear how it will be developed in future.

Changed in powersave:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.