GNOME Bugzilla – Bug 332055
g-p-m doesn't suspend when power is critical
Last modified: 2006-02-25 12:30:53 UTC
Please describe the problem: I am using the new version (CVS, yesterday) of g-p-m and configured to suspend my system when power is critical A lot time later (my battery last 5 hours :) ) i saw g-p-m warning that my battery was really low (3%). I waited and some minutes later my battery died and i lost all my data :( Steps to reproduce: 1. configure gnome-power-preferences to suspend in critical battery 2. wait till battery runs uot Actual results: the battery dies Expected results: the computer should sleep Does this happen every time? yes Other information:
I forgot to say something.... If i press "suspend" in g-p-m, the system suspends normally... it works great manually and when i close the lid
Did your computer "die" at 3% charge, or did it make it to 0%?
I keep looking at the tooltip and it went 3% -> 2% -> 0% ...satyed that way a couple of minutes and then it died.. BTW: the title of the bug says shutdown.. it should be suspend... can you fix it?
At 3%, what was the time-to-discharge value? What was it's value (aprox) at 2%, 1%, etc.
I don't remeber... i discharge my batt again to try it ... in a cuople of hours I answer that... I think it was somthing like 5 minutes....
I took a screenshot at 3% :D I'll attach to the bug... It was 9 minutes at 3%
Created attachment 59900 [details] Warning at 3%
Created attachment 59920 [details] [review] test patch Alejandro, can you try the attached patch please? If that doesn't work, can you open src/gpm-manager.c, and change the values: #define BATTERY_LOW_PERCENTAGE (10) /* 10 percent */ #define BATTERY_VERY_LOW_PERCENTAGE (5) /* 5 percent */ #define BATTERY_CRITICAL_PERCENTAGE (2) /* 2 percent */ #define BATTERY_ACTION_PERCENTAGE (1) /* 1 percent */ #define BATTERY_LOW_REMAINING_TIME (20 * 60) /* 20 minutes */ #define BATTERY_VERY_LOW_REMAINING_TIME (10 * 60) /* 10 minutes */ #define BATTERY_CRITICAL_REMAINING_TIME (5 * 60) /* 5 minutes */ #define BATTERY_ACTION_REMAINING_TIME (2 * 60) /* 2 minutes */ to something more suitable for your super-large battery. We can do clever things automatically when can we parametise your battery. Richard.
Hello Richard I tried the patch and observed My battery have 30 left at 10% and 6 minutes at 2% When it reached 5 minutes left, it suspended my notebook and worked wonderful! i didn't lost anything :D. I didnt need to change the other defaults But I noticed something wrong... when nb was suspended, I plug the AC adaptor, then resumed the computer. When it waked up it saw that were very low power and went to suspend again... i think that there is vero low critical battery BUT the notebook is charging, then it didn't need to suspend... Must i fill another bug or that is the apropiate behavior??? Thanks again for the patch.
Alejandro, I'm glad the patch worked, but this probably needs more discussion about the defaults. It would appear that your battery does not report the correct time exactly, but does report the correct percentage, as I'm sure you'll notice by the comment in the source. At the very least, we need to make this a gconf configurable. As for the other problem, can you open a new bug please, thanks.
I've committed this to CVS: 2006-02-24 Richard Hughes <richard@hughsie.com> * data/gnome-power-manager.schemas.in: Add the new key: /apps/gnome-power-manager/use_time_for_policy to set the policy for per-time or per-percentage critical and low power actions. * src/gpm-prefs.h: Add GPM_PREF_USE_TIME_POLICY * src/gpm-manager.c (gpm_manager_init): set the per-time policy type from GPM_PREF_USE_TIME_POLICY. This still needs to be documented. Fixes #332055. Closing this bug. If it's wrong, or doesn't work, can you re-open please.
Hello Richard That is a key in gconf? how to i change it? in gconf-editor i didnt find it... i still change the relevant line in the source ... Thanks for the wonderful job... and for solving bugs... i've commited bugs in other project and almost no one ever fix the problem... you code fast :D
>Thanks for the wonderful job Thanks, that means a lot. You can get pretty low sometimes when you get 20+ emails a day about people with problems with your code! >you code fast :D Blessing and a curse :-) Try this, it manually creates the key: gconftool-2 --type bool --set /apps/gnome-power-manager/use_time_for_policy false This should be automatic, but isn't until you install a packaged version. You probably havn't got the newest schema installed, which is done automatically when you install a packaged version of g-p-m. You can manually install them with gconftool-2, and I don't remember the exact commands, but google will :-) For now, the manual --set command should work well. Richard.
Hi... it work'd :D I use a packaged version (deb, made my own) but i didnt know where to look :D Well... i think it closes the bug...