Bug 725952 - gnome-power-manager thinks the battery is criticaly low when laptop is unplugged from ac
Summary: gnome-power-manager thinks the battery is criticaly low when laptop is unplug...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-power-manager
Version: 15
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Richard Hughes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-27 07:14 UTC by Alan McGinlay
Modified: 2012-08-07 20:03 UTC (History)
11 users (show)

Fixed In Version:
Clone Of: 509190
Environment:
Last Closed: 2012-08-07 20:03:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Alan McGinlay 2011-07-27 07:14:05 UTC
+++ This bug was initially created as a clone of Bug #509190 +++

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090507

As soon as i unplug the laptop (HP nx7000) from ac the message "laptop battery critically low" appears even thoug the battery is fully charged. Since the default setting of gnome-power-manager in such is to shut down the laptop it is impossible to use the laptop on battery until the setting is changed or the computer is on ac again. 






Reproducible: Always

Steps to Reproduce:
1. Unplug the laptop from ac.
Actual Results:  
When the configuration for "When battery power is critically low" is set to "do nothing" the gnome-power-manager exhibits the following behaviour:

1. Message "laptop battery critically low" appears.
   Power History -> Laptop battery shows a "Time to empty" of about 2 minutes (see screenshot 1)

2. After a few seconds the "Time to empty" changes to 1.7 hours which is about right for a fully charged battery when the computer is mostly idle (see screenshot 2)

3. After about 1 minute the message "laptop battery critically low" appears again and the "Time to empty" changes back to 2 minutes. 

Point 2 and 3 are repeated until the battery is out of juice.


Expected Results:  
gnome-power-manager should do nothing until the battery charge is realy low. 

Before I installed Fedora 11 I used Fedora 9 on this laptop. I cannot say if Fedora 10 already has the same problem on this hardware.

--- Additional comment from hfbt on 2009-07-01 13:26:26 EDT ---

Created attachment 350157 [details]
Screenshot 1

--- Additional comment from hfbt on 2009-07-01 13:27:07 EDT ---

Created attachment 350158 [details]
Screenshot 2

--- Additional comment from hfbt on 2009-07-01 13:27:41 EDT ---

Created attachment 350160 [details]
Screenshot 3

--- Additional comment from rhughes on 2009-08-20 08:04:41 EDT ---

Does installing the latest gnome-power-manager and DeviceKit-power packages in updates-testing (and then rebooting...) fix the problem?

--- Additional comment from hfbt on 2009-08-21 11:07:47 EDT ---

Installed gnome-power-manager-2.26.4-1.fc11.i586 and DeviceKit-power-010-0.3.20090810git.fc11.i586

Problem is still exists.

--- Additional comment from hfbt on 2010-01-20 03:09:21 EST ---

I upgraded to F12 -> same problem.

--- Additional comment from triage.org on 2010-04-27 11:24:36 EDT ---


This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

--- Additional comment from hfbt on 2010-06-16 12:08:32 EDT ---

Upgraded to F13. Problem is still there.

--- Additional comment from symphonic.mushroom on 2010-06-24 12:18:00 EDT ---

I have the same problem with my MSI Wind U100 (MS-N011) netbook.
I use F13 in 32 bits (actually 2.6.33.5-124.fc13.i686.PAE kernel).

--- Additional comment from sites07.au on 2010-07-08 09:25:54 EDT ---

Having the same issue with Fedora 13 from fresh install. as soon as AC power is disconnected, I get a warning message about battery critically low and goes into hibernation. No such problem with the fedora 13 LiveCD KDE version.

--- Additional comment from kaambuuu on 2010-10-17 02:34:04 EDT ---

I have had this problem from a very long time. Some folks on ubuntu have noted that this problem might have something to do with upower.

I typed this python script first:

import os
while (1):
        os.system("upower -d")

and ran it, redirecting the output into a file.
As it was running, I unplugged my AC cable. As expected, my laptop suspended.

After waking up my laptop, I stopped it and took a look at the output file. The problem seems to be with the energy-rate.

I ran "grep energy-rate:" on the output file and this is what I got:

[dilip@Blackpearl experiments]$ grep energy-rate upower.out
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         6.0495 W
    energy-rate:         0 W
    energy-rate:         0 W
    energy-rate:         0 W
    energy-rate:         0 W
    energy-rate:         0 W
    energy-rate:         0 W
    energy-rate:         0 W
    energy-rate:         0 W
    energy-rate:         0.4884 W
    energy-rate:         0.4884 W
    energy-rate:         0.4884 W
    energy-rate:         0.4884 W
    energy-rate:         0.4884 W
    energy-rate:         0.4884 W
    energy-rate:         0.4884 W
    energy-rate:         0.4884 W
    energy-rate:         0.4884 W
    energy-rate:         0.4884 W
    energy-rate:         0.4884 W
    energy-rate:         4.662 W
    energy-rate:         4.662 W
    energy-rate:         4.662 W
    energy-rate:         4.662 W
    energy-rate:         4.662 W
    energy-rate:         4.662 W
    energy-rate:         4.662 W
    energy-rate:         4.662 W
    energy-rate:         5.6832 W
    energy-rate:         5.6832 W
    energy-rate:         5.6832 W
    energy-rate:         5.6832 W
    energy-rate:         5.6832 W
    energy-rate:         5.6832 W
    energy-rate:         5.6832 W
    energy-rate:         5.6832 W
    energy-rate:         5.6832 W
    energy-rate:         6.7488 W
    energy-rate:         6.7488 W
    energy-rate:         6.7488 W
    energy-rate:         6.7488 W
    energy-rate:         6.7488 W
    energy-rate:         6.7488 W
    energy-rate:         6.7488 W
    energy-rate:         6.7488 W
    energy-rate:         6.7488 W
    energy-rate:         6.7488 W
    energy-rate:         6.7488 W
    energy-rate:         6.7488 W
[dilip@Blackpearl experiments]$



You can clearly see whats happening when I unplug the power supply.

Hope this helps. Please let me know if you need any more details.

Regards.
Dilip

--- Additional comment from rhughes on 2010-10-18 04:23:31 EDT ---

(In reply to comment #11)
> I have had this problem from a very long time. Some folks on ubuntu have noted
> that this problem might have something to do with upower.

UPower just proxies the values from the kernel.

> You can clearly see whats happening when I unplug the power supply.

I really can't that's just a list of rate values. Could you get the verbose output from upower please:

(as root)
killall upowerd
/usr/libexec/upowerd --verbose

and then *attach* the output to this bug please, showing the disconnect, suspend and then resume. Thanks.

--- Additional comment from kaambuuu on 2010-10-20 09:38:13 EDT ---

Sorry, I wasn't being very clear.

Anyway, something seems to be wrong. When I tried /usr/libexec/upowerd --verbose this is what happened:

TI:19:01:07	FI:egg-debug.c	FN:egg_debug_post_parse_hook,415
 - Verbose debugging 1 (on console 1)
TI:19:01:07	FI:up-main.c	FN:up_main_acquire_name_on_proxy,83
 - Failed to acquire org.freedesktop.UPower
TI:19:01:07	FI:up-main.c	FN:main,175
 - Could not acquire name; bailing out
[root@Blackpearl experiments]# /usr/libexec/upowerd --verbose
TI:19:01:15	FI:egg-debug.c	FN:egg_debug_post_parse_hook,415
 - Verbose debugging 1 (on console 1)
TI:19:01:15	FI:up-main.c	FN:up_main_acquire_name_on_proxy,83
 - Failed to acquire org.freedesktop.UPower
TI:19:01:15	FI:up-main.c	FN:main,175
 - Could not acquire name; bailing out

If anyone can help me fix this, I can try again and get the output. Thanks.

-Dilip.

--- Additional comment from rhughes on 2010-10-20 10:42:07 EDT ---

(In reply to comment #13)
> If anyone can help me fix this, I can try again and get the output. Thanks.

You need to do "killall upowerd" first.

--- Additional comment from cozzyd on 2011-01-01 01:55:05 EST ---

Created attachment 471316 [details]
upowerd --verbose log

I see the same thing on F14 too. Sometimes it manages to calculate the correct battery time remaining prior to shutting down / hibernating.

Attached is my upowerd --verbose log before it hibernates.

--- Additional comment from theholyettlz on 2011-04-18 19:46:19 EDT ---

Seeing this here on an Atom tablet (presumably the same as Bug 609081?), under Fedora 15 beta. Any progress on getting this fixed (aside from working around it with gconf settings)? Is there any info I can provide for my hardware?

--- Additional comment from theholyettlz on 2011-04-19 04:38:25 EDT ---

OK: In my case, I believe this to be a BIOS issue, specifically the "negative s16 current" issue found on some Acer notebooks and addressed in Kernel bug 13687 (see https://bugzilla.kernel.org/show_bug.cgi?id=13687 ). To test this, I modified driver/acpi/battery.c in the kernel source. Somewhere in it, there's a function


static void acpi_battery_quirks(struct acpi_battery *battery)
{
  if (dmi_name_in_vendors("Acer") && battery->power_unit) {
		set_bit(ACPI_BATTERY_QUIRK_SIGNED16_CURRENT, &battery->flags);
	}
}


and commented out 'dmi_name_in_vendors("Acer") &&' in the if(). With *this* kernel running, I no longer get spurious "critically" low messages.

How did I know this? Well, when running on power take a look at /sys/class/power_supply/BAT0/current_now. On battery, it shows a reasonable 931000 µA. Now, when AC is plugged in and the battery is charging ON A STOCK KERNEL, this value changes to 65336000 µA (if I recall the number correctly). This is clearly ludicrous, and is called by bad handling of a 16-bit current register. Maybe what's happening in this case is, when the AC is unplugged, g-p-m is using this high current to estimate remaining time (i.e., 3 minutes).

On a modified kernel, current_now is somewhat more sedate with AC attached (some 200000 µA); I presume this is the charging current.

I am going to report a new bug against kernel (both here and at kernel.org) documenting this. Seems the quirk needs broadening.

For gnome-power-manager:

 - Perhaps g-p-m could add a current plausibility check and warn the user
   that their BIOS is having a laugh?

 - Sometimes I now get ludicrously long battery life estimates (e.g. 15h) as
   AC is unplugged. This seems consistent with g-p-m using the value of
   current_now (i.e., charging current) to estimate usage. I suggest g-p-m
   waits a few seconds for things to settle when on battery power before
   taking a reading of current_now and making an estimate.

--- Additional comment from cozzyd on 2011-05-07 00:51:19 EDT ---

I have a Dell Mini 10; with my laptop plugged in, I get:

[cozzy@cozzy-nb ~]$ cat /sys/class/power_supply/BAT1/current_now 
37168000

Which seems to actually be the power (~37 W). 

Anyway, to work around the issue, I set the gconf key
/apps/gnome-power-manager/general/use_time_for_policy to false and it uses a percentage threshold rather than a time threshold, making the point moot. 

-Cosmin

--- Additional comment from michael.wiktowy on 2011-06-01 16:35:01 EDT ---

I am not sure if I should open a new bug or not but my scenario is similar on a System 76 Starling Netbook Model star1 using F15.

However, this *only* occurs if I suspend my laptop to RAM while unplugged and plug in the power *while the computer is still suspended*. After that, subsequent attempts to remove the power are met with panicky notifications that the system is about to hibernate ... although it only seems to hibernate prematurely if the battery is fairly drained.

My steps to reproduce:
1) Unplug power from laptop
2) Suspend to RAM
3) Plug power into laptop
4) Wake up from Suspend to RAM
5) Unplug power from laptop

Results: Hibernation warning even though power applet reports high percentage of battery left (94% in my current test case)

Could the original reporter and subsequent confirmers check if this is the specific scenario that they are seeing this as it might point to a specific fix or it might be that this is a separate issue (maybe a bad power drain estimate due to a power supply event missed while suspended ... in which case I will open a separate bug).

Thank you.

--- Additional comment from kaambuuu on 2011-06-02 01:11:10 EDT ---

Hello Michael.


I tried this on my Acer Aspire One netbook running Fedora 15. My laptop did not produce any hibernation warning.

Here is what happened in my laptop.

1. Plug power into laptop (battery 74%)
2. Unplug power
3. Laptop suspends to RAM by itself
4. Plug power into the laptop
5. Wake up from suspended state
6. Unplug power
7. Laptop suspends to RAM again

This happened every time I tried this. Does anyone else see the same response?


-Dilip

--- Additional comment from kaambuuu on 2011-06-02 01:19:45 EDT ---

Hello everyone.

I notice that my laptop does not suspend to ram if I unplug the power after switching to a terminal (Alt + Ctrl + F2) on my Fedora 15.

Steps to reproduce:
1. Plug power to laptop
2. Switch to a console terminal (Ctrl + Alt + F2)
3. Unplug power
4. Return to Gnome (Alt + Ctrl + F1 in my Fedora 15)

Results: Does not suspend to RAM.

Is anyone else able to observe the same behaviour or is this just my laptop? 

-Dilip

--- Additional comment from michael.wiktowy on 2011-06-02 13:24:34 EDT ---

(In reply to comment #21)
> Hello everyone.
> 
> I notice that my laptop does not suspend to ram if I unplug the power after
> switching to a terminal (Alt + Ctrl + F2) on my Fedora 15.
> 
> Steps to reproduce:
> 1. Plug power to laptop
> 2. Switch to a console terminal (Ctrl + Alt + F2)
> 3. Unplug power
> 4. Return to Gnome (Alt + Ctrl + F1 in my Fedora 15)
> 
> Results: Does not suspend to RAM.
> 
> Is anyone else able to observe the same behaviour or is this just my laptop? 
> 
> -Dilip

I do not see this. My netbook suspends fine after the above process.

It didn't suspend when closing the lid only once ... just yesterday though. I cannot figure out why it didn't that one time. Might have been in some weird state after cycling though those bug-inducing steps from comment 19.

--- Additional comment from triage.org on 2011-06-02 13:58:25 EDT ---


This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

--- Additional comment from michael.wiktowy on 2011-06-02 14:24:26 EDT ---

Created new bug 710226 to track my separate issue that may or may not be related to this one but it is relevant to Fedora 15 and this bug is about to be auto-closed.

--- Additional comment from triage.org on 2011-06-27 10:16:06 EDT ---


Fedora 13 changed to end-of-life (EOL) status on 2011-06-25. Fedora 13 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

--- Additional comment from mcginlay.alan on 2011-07-27 03:09:53 EDT ---

This is still happening with Fedora15. Dell latitude E6320

Comment 1 James 2011-08-20 14:00:53 UTC
This bug has reappeared for me (on my tablet) starting with gnome-power-manager-3.0.2-2.fc15, even with the kernel patched to work around the s16 battery issue. g-p-m thinks that a FULL battery is critical and shuts down, even if "use time for critical power" is disabled.

I have checked the discharge current values being reported by the kernel, and they seem sane. Maybe g-p-m should do a sanity check on the true state of the battery before shutting down?

While the old gnome-power-manager-3.0.0-2.fc15 has crazy backlight behaviour, it doesn't do this.

Comment 2 Richard Hughes 2011-11-15 13:20:16 UTC
Does this still happen in F16? Thanks.

Comment 3 James 2011-11-15 14:14:12 UTC
(In reply to comment #2)
> Does this still happen in F16? Thanks.

Yes, it does on my tablet (when use-time is enabled in dconf, even with the s16_battery kernel patch).

Comment 4 alan 2011-11-16 08:24:18 UTC
I am using fedora 16 upgraded to beta and then final release from fedora 15. So far there has been no re occurrence of this bug. I tested by putting the device into suspend, disconnecting power and then restarting, there was no error about the battery being critically low this time.

I will update the bug after a week or so as it was not 100% consistent before either.

Comment 5 James 2012-05-19 11:04:51 UTC
I've not seen this so far in Fedora 17, either.

Comment 6 Fedora End Of Life 2012-08-07 20:03:40 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


Note You need to log in before you can comment on or make changes to this bug.