Bug 161723 - battstat applet doesn't show when on battery
battstat applet doesn't show when on battery
Status: CLOSED CANTFIX
Product: Fedora
Classification: Fedora
Component: gnome-applets (Show other bugs)
4
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Ray Strode [halfline]
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-26 12:18 EDT by Gregory Gulik
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-08-14 11:47:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gregory Gulik 2005-06-26 12:18:05 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4

Description of problem:
Upon upgrading several laptops from FC3 to FC4 I found the battstat applet no longer reliably recognizes when the laptop is on battery vs. on AC.  

Version-Release number of selected component (if applicable):
gnome-applets-2.10.1-9

How reproducible:
Always

Steps to Reproduce:
1. Start up laptop on AC power and log in
2. Unplug laptop from AC power
3. Check status of battstat applet
  

Actual Results:  The battstat shows the laptop is still on AC power.  The "Show percentage remaining" does show the relative capacity of the battery decreases over time.  The "Show time remaining" option does not show anything.

Expected Results:  The battstat laptop should show the laptop is running on battery.


Additional info:

Contents of debugging output from acpid when run with the -d option:

[Sun Jun 26 11:15:31 2005] starting up
[Sun Jun 26 11:15:31 2005] DBG: parsing conf file /etc/acpi/events/sample.conf
[Sun Jun 26 11:15:31 2005] DBG:    key="event" val="button/power.*"
[Sun Jun 26 11:15:31 2005] DBG:    key="action" val="/sbin/shutdown -h now"
[Sun Jun 26 11:15:31 2005] 1 rule loaded
[Sun Jun 26 11:15:32 2005] client connected from 24624[103:101]
[Sun Jun 26 11:15:32 2005] 1 client rule loaded
[Sun Jun 26 11:15:35 2005] received event "battery BAT1 00000080 00000001"
[Sun Jun 26 11:15:35 2005] DBG: rule from 24624[103:101] matched
[Sun Jun 26 11:15:35 2005] notifying client 24624[103:101]
[Sun Jun 26 11:15:35 2005] DBG: rule from /etc/acpi/events/sample.conf did not match
[Sun Jun 26 11:15:35 2005] DBG: 1 total rule matched
[Sun Jun 26 11:15:35 2005] completed event "battery BAT1 00000080 00000001"
[Sun Jun 26 11:15:35 2005] received event "processor CPU0 00000080 00000001"
[Sun Jun 26 11:15:35 2005] DBG: rule from 24624[103:101] matched
[Sun Jun 26 11:15:35 2005] notifying client 24624[103:101]
[Sun Jun 26 11:15:35 2005] DBG: rule from /etc/acpi/events/sample.conf did not match
[Sun Jun 26 11:15:35 2005] DBG: 1 total rule matched
[Sun Jun 26 11:15:35 2005] completed event "processor CPU0 00000080 00000001"
[Sun Jun 26 11:15:39 2005] received event "battery BAT1 00000080 00000001"
[Sun Jun 26 11:15:39 2005] DBG: rule from 24624[103:101] matched
[Sun Jun 26 11:15:39 2005] notifying client 24624[103:101]
[Sun Jun 26 11:15:39 2005] DBG: rule from /etc/acpi/events/sample.conf did not match
[Sun Jun 26 11:15:39 2005] DBG: 1 total rule matched
[Sun Jun 26 11:15:39 2005] completed event "processor CPU0 00000080 00000000"

Contents of /proc/acpi/battery/BAT1/info:
present:                 yes
design capacity:         6000 mAh
last full capacity:      5218 mAh
battery technology:      rechargeable
design voltage:          14800 mV
design capacity warning: 300 mAh
design capacity low:     180 mAh
capacity granularity 1:  264 mAh
capacity granularity 2:  3780 mAh
model number:            Primary
serial number:
battery type:            Lion
OEM info:                Hewlett-Packard

Contents of /proc/acpi/battery/BAT1/state:
present:                 yes
capacity state:          ok
charging state:          discharging
present rate:            0 mA
remaining capacity:      4540 mAh
present voltage:         16026 mV

Contents of /proc/acpi/ac_adapter/ACAD/state:
state:                   off-line


The laptop in this case is a Compaq R3000Z with the 32 bit processor.  This problem also seems to happen on a Toshiba as well as a Dell.
Comment 1 Garry T. Williams 2005-07-17 00:11:07 EDT
I just installed fc4 on a new Sony VGN-FS640/W and I see the same
symptom.  The problem is that FC4 on this laptop doesn't produce
an ac_adapter (ACPI) event.  The battstat-applet depends on that
to "see" the transition.

Here's a patch to battstat-applet (against the 
gnome--applets-2.10.1/battstat directory) to work around the
missing event:

--- acpi-linux.c.orig   2005-01-13 23:06:40.000000000 -0500
+++ acpi-linux.c        2005-07-10 00:02:50.000000000 -0400
@@ -329,6 +329,7 @@
           break;
         case ACPI_EVENT_BATTERY_INFO:
           update_battery_info(acpiinfo);
+          update_ac_info(acpiinfo);
           result = TRUE;
           break;
       }

The root cause is the missing ac_adapter event.
Comment 2 Rod Nayfield 2005-07-18 12:15:33 EDT
Same issue on IBM T41.  This is a little more subtle on this platform.

Use case above works (unplug and status icon changes from plug to battery.  Plug
back in and icon changes back to plug).

However, if you:

1. boot while plugged in
2. suspend (close lid)
3. unplug
4. resume (open lid)

The applet indicates that the laptop is still plugged in.  The percentage view
is accurate (and goes down).  Plugging and unplugging will get it back to
battery icon.

Basically the applet seems to not poll anymore, and depends on getting the
events.  Obviously it doesn't get these events when suspended.



Comment 3 Garry T. Williams 2005-07-18 13:25:13 EDT
I can't understand that.

I can see that the (battery) event would get dropped while the system
was suspended to memory.  I can see that this would cause the adapter
status to be initially incorrect after wake-up.  But if the adapter
remains unplugged, there will eventually be another battery event and
from what I can see of the code, this will have to toggle the adapter
status.  Especially since you said the battery level gets updated.
Comment 4 Christian Iseli 2007-01-22 05:15:11 EST
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Thanks.
Comment 5 Ray Strode [halfline] 2007-08-14 11:47:14 EDT
The information we've requested above is required in order
to review this problem report further and diagnose/fix the
issue if it is still present.  Since there haven't been any
updates to the report in quite a long time now after we've
requested additional information, we're assuming the problem
is either no longer present in our current OS release, or
that there is no longer any interest in tracking the problem.

Setting status to CANTFIX, however if you still
experience this problem after updating to our latest Fedora
Core release and are still interested in Red Hat tracking
the issue, and assisting in troubleshooting the problem,
please feel free to provide the information requested above,
and reopen the report.

Thank you in advance.

(this message is mass message)

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