Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 197475 - gnome-power-manager-2.20.0 doesn't change hal powersave status
Summary: gnome-power-manager-2.20.0 doesn't change hal powersave status
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-30 00:57 UTC by Andrey Melentyev
Modified: 2007-11-23 12:04 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Melentyev 2007-10-30 00:57:24 UTC
AFAIK gnome-power-manager should change HAL PoweSave status according to the power supply if it is configured to do so in GConf /apps/gnome-power-manager/lowpower/on_battery

Current PowerSave status can be displayed by executing "hal-get-property --udi /org/freedesktop/Hal/devices/computer --key power_management.is_powersave_set"

The problem is that when I unplug the AC, powersave property doesn't change. However in the output of gnome-power-manager I can see that it is handling the cable unplug event, and my CPU frequency governer is changed by g-p-m correctly.

I have gnome-power-manager-2.20.0, hal-0.5.9.1-r2 and dbus-1.0.2-r2 installed on my laptop. The system is up-to-date ~x86.

Reproducible: Always

Steps to Reproduce:
1. start g-p-m
2. unplug the ac cable

Actual Results:  
the output of "hal-get-property --udi /org/freedesktop/Hal/devices/computer --key power_management.is_powersave_set" is still "false"

Expected Results:  
g-p-m should send HAL SetPowerSave(1) message and is_powersave_set property should be changed to true

# emerge --info
Portage 2.1.3.16 (default-linux/x86/2007.0/desktop, gcc-4.2.2, glibc-2.6.1-r0, 2.6.24-rc1 i686)
=================================================================
System uname: 2.6.24-rc1 i686 Intel(R) Pentium(R) M processor 1500MHz
Timestamp of tree: Mon, 29 Oct 2007 19:00:01 +0000
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.2-r1
dev-lang/python:     2.5.1-r3
sys-apps/baselayout: 1.12.10-r5
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.23
ACCEPT_KEYWORDS="x86 ~x86"
ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci"
ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol"
ANT_HOME="/usr/share/ant-core"
ARCH="x86"
AUTOCLEAN="yes"
CAMERAS="canon"
CBUILD="i686-pc-linux-gnu"
CCACHE_SIZE="2G"
CFLAGS="-march=pentium-m -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CLASSPATH="."
CLEAN_DELAY="5"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CVS_RSH="ssh"
CXXFLAGS="-march=pentium-m -O2 -pipe -fomit-frame-pointer"
DISPLAY=":0"
DISTDIR="/usr/portage/distfiles"
EDITOR="/usr/bin/vim"
ELIBC="glibc"
EMERGE_DEFAULT_OPTS="-v"
EMERGE_WARNING_DELAY="10"
FEATURES="autoaddcvs collision-protect distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
FETCHCOMMAND="/usr/bin/wget -c -t 1 -T 5 --passive-ftp ${URI} -P ${DISTDIR}"
GCC_SPECS=""
GDK_USE_XFT="1"
GENTOO_MIRRORS="ftp://kos.local/gentoo http://ftp.uni-erlangen.de/pub/mirrors/gentoo"
GUILE_LOAD_PATH="/usr/share/guile/1.8"
HOME="/root"
INFOPATH="/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.18/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.2.2/info"
INPUT_DEVICES="mouse keyboard synaptics evdev"
JAVAC="/etc/java-config-2/current-system-vm/bin/javac"
JAVA_HOME="/etc/java-config-2/current-system-vm"
JDK_HOME="/etc/java-config-2/current-system-vm"
KDEDIRS="/usr:/usr/local:/usr/kde/3.5"
KDE_IS_PRELINKED="1"
KERNEL="linux"
LANG="ru_RU.UTF-8"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
LDFLAGS="-Wl,--hash-style=gnu"
LESS="-R -M --shift 5"
LESSOPEN="|lesspipe.sh %s"
LINGUAS="ru en"
LOGNAME="root"
LS_COLORS="no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:"
MAKEOPTS="-j2"
MANPATH="/etc/java-config-2/current-system-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.18/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.2.2/man:/etc/java-config/system-vm/man/:/usr/kde/3.5/share/man:/usr/qt/3/doc/man:/opt/opera/share/man"
OPENGL_PROFILE="xorg-x11"
PAGER="/usr/bin/less"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.2.2:/usr/kde/3.5/sbin:/usr/kde/3.5/bin:/usr/qt/3/bin"
PKGDIR="/usr/portage/packages"
PKG_CONFIG_PATH="/usr/qt/3/lib/pkgconfig"
PORTAGE_ARCHLIST="ppc s390 amd64 x86 ppc64 x86-fbsd m68k arm sparc sh mips ia64 alpha ppc-macos hppa sparc-fbsd"
PORTAGE_BINHOST_CHUNKSIZE="3000"
PORTAGE_BIN_PATH="/usr/lib/portage/bin"
PORTAGE_CONFIGROOT="/"
PORTAGE_DEBUG="0"
PORTAGE_DEPCACHEDIR="/var/cache/edb/dep"
PORTAGE_ELOG_CLASSES="warn error log"
PORTAGE_ELOG_JABBERFROM="portage@jabber.ru:portage"
PORTAGE_ELOG_JABBERSUBJECT="Fresh elog info from portage@laptop"
PORTAGE_ELOG_JABBERTO="rikz@jabber.ru"
PORTAGE_ELOG_MAILFROM="portage@localhost"
PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for ${PACKAGE} on ${HOST}"
PORTAGE_ELOG_MAILURI="root"
PORTAGE_ELOG_SYSTEM="save jabber"
PORTAGE_GID="250"
PORTAGE_INST_GID="0"
PORTAGE_INST_UID="0"
PORTAGE_NICENESS="19"
PORTAGE_PYM_PATH="/usr/lib/portage/pym"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_RSYNC_RETRIES="3"
PORTAGE_TMPDIR="/var/tmp"
PORTAGE_TMPFS="/dev/shm"
PORTAGE_WORKDIR_MODE="0700"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/xeffects /usr/portage/local/layman/sunrise /usr/portage/local/layman/x11 /usr/portage/local/openchrome /usr/portage/local/overlay"
PORT_LOGDIR="/var/log/portage"
PRELINK_PATH_MASK="/usr/lib/gstreamer-0.10"
PWD="/home/rikz/tmp/gnome-power-manager-2.20.0.a"
PYTHONPATH="/usr/lib/portage/pym"
QMAKESPEC="linux-g++"
QTDIR="/usr/qt/3"
RESUMECOMMAND="/usr/bin/wget -c -t 1 -T 5 --passive-ftp ${URI} -P ${DISTDIR}"
ROOT="/"
ROOTPATH="/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.2.2:/usr/kde/3.5/sbin:/usr/kde/3.5/bin:/usr/qt/3/bin"
RPMDIR="/usr/portage/rpm"
SANE_CONFIG_DIR="/etc/sane.d"
SBCL_HOME="/usr/lib/sbcl"
SBCL_SOURCE_ROOT="/usr/lib/sbcl/src"
SHELL="/bin/bash"
SHLVL="1"
STAGE1_USE="nptl nptlonly unicode"
SUDO_COMMAND="/bin/su"
SUDO_GID="100"
SUDO_UID="1000"
SUDO_USER="rikz"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
TERM="xterm"
USB_DEVFS_PATH="/dev/bus/usb"
USE="X a52 aac acpi alsa bash-completion beagle berkdb bitmap-fonts bluetooth bzip2 cairo cdr chardet cli cracklib crypt cscope cups dbus dga djvu dri dvd dvdr emboss encode exif exiv2 fam ffmpeg flac ftp fuse galago gdbm gif gimp glut gnome gphoto2 gpm gsf gstreamer gtk gtkhtml hal hashstyle icc iconv imagemagick inotify isdnlog javascript jpeg kdeenablefinal lcms libnotify logrotate mad midi mikmod mmap mmx mmxext mono mp3 mpeg mudflap musicbrainz ncurses nls nptl nptlonly nsplugin ogg openmp pam pcmcia pcre pdf png pppd python qt3 qt3support qt4 quicktime readline real reflection sasl scanner sdl session slang speex spell spl sqlite sqlite3 sse sse2 ssl startup-notification svg t1lib taglib tetex tiff truetype truetype-fonts type1-fonts unicode usb videos vim vim-syntax vnc vorbis wifi win32codecs x264 x86 xattr xcomposite xine xml xorg xosd xscreensaver xulrunner xv xvid xvmc zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" CAMERAS="canon" ELIBC="glibc" INPUT_DEVICES="mouse keyboard synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru en" USERLAND="GNU" VIDEO_CARDS="vesa via"
USER="root"
USERLAND="GNU"
USE_EXPAND="ALSA_CARDS ALSA_PCM_PLUGINS CAMERAS CROSSCOMPILE_OPTS DVB_CARDS ELIBC FCDSL_CARDS FOO2ZJS_DEVICES FRITZCAPI_CARDS INPUT_DEVICES KERNEL LCD_DEVICES LINGUAS LIRC_DEVICES MISDN_CARDS USERLAND VIDEO_CARDS"
USE_EXPAND_HIDDEN="CROSSCOMPILE_OPTS ELIBC KERNEL USERLAND"
USE_ORDER="env:pkg:conf:defaults:pkginternal:env.d"
VIDEO_CARDS="vesa via"
XARGS="xargs -r"
XDG_DATA_DIRS="/usr/share:/usr/kde/3.5/share:/usr/local/share"
_="/usr/bin/emerge"
Comment 1 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-10-30 01:23:04 UTC
g-p-m doesn't appear to set is_powersave_set at all.  It's not in the source.  g-p-m only uses can_suspend and can_hibernate from power_management.  If you want g-p-m to set this, you'll have to get upstream to add it, as it's a feature request.
Comment 2 Andrey Melentyev 2007-10-30 05:58:29 UTC
(In reply to comment #1)
> g-p-m doesn't appear to set is_powersave_set at all.  It's not in the source. 
> g-p-m only uses can_suspend and can_hibernate from power_management.  If you
> want g-p-m to set this, you'll have to get upstream to add it, as it's a
> feature request.
> 

The content of the following file looks strange to me in that case gnome-power-manager-2.20.0/libhal-glib/libhal-gpower.c:

/**
 * hal_gpower_enable_power_save:
 *
 * @power: This class instance
 * @enable: True to enable low power mode
 * Return value: Success, true if we set the mode
 *
 * Uses org.freedesktop.Hal.Device.SystemPowerManagement.SetPowerSave ()
 **/
gboolean
hal_gpower_enable_power_save (HalGPower *power, gboolean enable)
{
	gint retval = 0;
	GError *error = NULL;
	gboolean ret;
	DBusGProxy *proxy;

	g_return_val_if_fail (power != NULL, FALSE);
	g_return_val_if_fail (LIBHAL_IS_GPOWER (power), FALSE);

	proxy = dbus_proxy_get_proxy (power->priv->gproxy);
	if (DBUS_IS_G_PROXY (proxy) == FALSE) {
		g_warning ("proxy NULL!!");
		return FALSE;
	}

	/* abort if we are not a "qualified" laptop */
	if (hal_gpower_is_laptop (power) == FALSE) {
		g_debug ("We are not a laptop, so not even trying");
		return FALSE;
	}

	ret = dbus_g_proxy_call (proxy, "SetPowerSave", &error,
				 G_TYPE_BOOLEAN, enable,
				 G_TYPE_INVALID,
				 G_TYPE_UINT, &retval,
				 G_TYPE_INVALID);
	if (retval != 0) {
		g_warning ("SetPowerSave failed in a horrible way!");
	}
	return ret;
}
Comment 3 Andrey Melentyev 2007-10-30 06:04:56 UTC
http://www.gnome.org/projects/gnome-power-manager/faq.html#set_power_save

The info is obsolute since HAL does already provide some actions to support SetPowerSave. But it confirms the fact that g-p-m uses this HAL functionality at least since 2006.
Comment 4 Rémi Cardona (RETIRED) gentoo-dev 2007-10-30 09:15:20 UTC
This requires HAL 0.5.10 if I'm not mistaken.

@Doug, btw I can confirm that the new hal from gentopia I built yesterday works with g-p-m 2.20. The cpu settings are indeed properly set.
Comment 5 Andrey Melentyev 2007-10-30 09:43:19 UTC
(In reply to comment #4)
> This requires HAL 0.5.10 if I'm not mistaken.
> 
> @Doug, btw I can confirm that the new hal from gentopia I built yesterday works
> with g-p-m 2.20. The cpu settings are indeed properly set.
> 

Rémi, but I have no warnings or errors in g-p-m output when it is (IMHO) sending the hal SetPowerSave(1). On the link that I gave in comment #3 there was a warning because that version of HAL didn't support SetPowerSave. Even with --verbose key I have no such warning messages in g-p-m output.

By the way, didn't you notice if hal-0.5.9.1-r2 was working with g-p-m on your system?
Comment 6 Rémi Cardona (RETIRED) gentoo-dev 2007-10-30 10:18:36 UTC
Honestly, I haven't really looked at g-p-m beyond "oh it's broken" and "oh it works again". That's about as much info I can give you :)

As for the latest hal in portage, I haven't tried it on my laptop as I'm using the gentopia overlay. I recommend you try the overlay, so far it seems to work much better with Gnome 2.20
Comment 7 Andrey Melentyev 2007-10-30 12:41:09 UTC
No luck with newer versions of hal and dbus from Gentopia overlay. Can somebody please test the behavior of their g-p-m + hal?
Comment 8 Rémi Cardona (RETIRED) gentoo-dev 2007-10-30 21:16:48 UTC
Do you have any stderr output from g-p-m? It's supposed to work with the version from gentopia ...
Comment 9 Andrey Melentyev 2007-10-30 22:57:57 UTC
(In reply to comment #8)
> Do you have any stderr output from g-p-m? It's supposed to work with the
> version from gentopia ...
> 

Nothing is particular. I've added a debug statement to the g-p-m source to see if SetPowerSave is called, here's the output:

$ LANG=C gnome-power-manager --no-daemon

(gnome-power-manager:5600): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed

(gnome-power-manager:5600): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed

(gnome-power-manager:5600): GStreamer-CRITICAL **: gst_bin_add_many: assertion `GST_IS_ELEMENT (element_1)' failed

(gnome-power-manager:5600): GStreamer-CRITICAL **: gst_element_link_many: assertion `GST_IS_ELEMENT (element_1)' failed
** (gnome-power-manager:5600): DEBUG: We are going to start SetPowerSave(0)
** (gnome-power-manager:5600): DEBUG: We are going to start SetPowerSave(1)
** (gnome-power-manager:5600): DEBUG: We are going to start SetPowerSave(0)

---
The first call is initial g-p-m call after start. The second was when I unplugged the ac cable. And the third when I plugged it back.

Here's the "patch" content, its very-very simple.
diff -Nru gnome-power-manager-2.20.0.a/libhal-glib/libhal-gpower.c gnome-power-manager-2.20.0.b/libhal-glib/libhal-gpower.c
--- gnome-power-manager-2.20.0.a/libhal-glib/libhal-gpower.c	2007-10-30 02:56:25.000000000 +0300
+++ gnome-power-manager-2.20.0.b/libhal-glib/libhal-gpower.c	2007-10-30 02:58:31.000000000 +0300
@@ -378,6 +378,8 @@
 		g_debug ("We are not a laptop, so not even trying");
 		return FALSE;
 	}
+	
+	g_debug ("We are going to start SetPowerSave(%i)", enable);
 
 	ret = dbus_g_proxy_call (proxy, "SetPowerSave", &error,
 				 G_TYPE_BOOLEAN, enable,

--
the only thing that I know now, is that dbus_g_proxy_call is called with right "enable" parameter. But HAL's power_management.is_powersave_on property is not set correctly. It may be due to different reasons:
1) some other dbus_g_proxy_call parameters are wrong
2) dbus_g_proxy_call doesn't work at all - I think that it is almost impossible because g-p-m can successfully get suspend and hibernate abilities from HAL.
3) HAL doesn't properly handle SetPowerSave
4) etc

It seems that we need some additional debugging. Any ideas?
Comment 10 Andrey Melentyev 2007-11-23 12:04:14 UTC
Works for me with new hal-0.5.10 from portage.