Summary: | gnome-power-manager-2.20.0 doesn't change hal powersave status | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Andrey Melentyev <andrey.melentyev> |
Component: | [OLD] GNOME | Assignee: | Gentoo Linux Gnome Desktop Team <gnome> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | gentopia |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Andrey Melentyev
2007-10-30 00:57:24 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. (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; } 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. 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. (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? 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 No luck with newer versions of hal and dbus from Gentopia overlay. Can somebody please test the behavior of their g-p-m + hal? Do you have any stderr output from g-p-m? It's supposed to work with the version from gentopia ... (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? Works for me with new hal-0.5.10 from portage. |