Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
upower-0.9.8 + udev-164-r1 report incorrect battery stats?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Lupusceleri
n00b
n00b


Joined: 14 May 2010
Posts: 10

PostPosted: Sat Feb 05, 2011 6:23 pm    Post subject: upower-0.9.8 + udev-164-r1 report incorrect battery stats? Reply with quote

Hello all,

Last night, I let my ~x86 Dell Inspiron 6400 laptop perform an "emerge -DuNav world". Included with these updates was KDE 4.6.0, which has finally removed all HAL dependencies - making kde-base/solid-4.6.0 depend on udev's upower, udisks, et cetera instead.

Subsequently, I unmerged HAL as KDE was the last software in my system that was using it.

I received the following message after starting my laptop today: "Your battery capacity is 35%. This means your battery is broken and needs a replacement."

Worried, I shut down the OS and opened my BIOS. Unplugged/replugged the AC cable a few times, and every time I did that charge showed as 97% - which it has been for months, when fully charged. Started up Gentoo again, and opened a terminal:

Code:
martijn@martijnlaptop ~ $ upower -d
Device: /org/freedesktop/UPower/devices/line_power_AC
  native-path:          /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/AC
  power supply:         yes
  updated:              Sat Feb  5 19:09:09 2011 (682 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    online:             yes

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0
  vendor:               Sanyo
  model:                DELLJN1497
  serial:               1001
  power supply:         yes
  updated:              Sat Feb  5 19:20:15 2011 (16 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    energy:              30.2364 Wh
    energy-empty:        0 Wh
    energy-full:         86.58 Wh
    energy-full-design:  86.58 Wh
    energy-rate:         14.8074 W
    voltage:             12.298 V
    time to full:        3.8 hours
    percentage:          34.9231%
    capacity:            35.2949%
    technology:          lithium-ion
  History (charge):
    1296929925  34.923  charging
  History (rate):
    1296930015  14.807  charging
    1296929985  0.011   charging

Daemon:
  daemon-version:  0.9.8
  can-suspend:     no
  can-hibernate    no
  on-battery:      no
  on-low-battery:  no
  lid-is-closed:   no
  lid-is-present:  yes
  is-docked:       no


Yup.. confirmed my theory that the change to upower as power management backend was the culprit reporting an erroneous capacity/charge.

Looking for additional confirmation that it was a software bug, rather than a dieing battery, I started to experiment some with unplugging the AC line while monitoring the upower daemon, and changing things such as the LCD screen's brightness which should make a big impact on the estimated "time to empty".

Code:
martijn@martijnlaptop ~ $ upower --monitor-detail | grep "time to empty"
    time to empty:       1.6 hours # Unplugged battery, Powerdevil switched to profile Powersave.
    time to empty:       1.6 hours
    time to empty:       1.6 hours
    time to empty:       1.6 hours
    time to empty:       1.6 hours
    time to empty:       1.1 hours # Changed LCD brightness to maximum value, rather than the value Powerdevil had set.
    time to empty:       1.3 hours # Changed LCD brightness to minimum value, rather than the value Powerdevil had set.
    time to empty:       1.3 hours


For reference, using my laptop on a 100% charged battery for ~30 minutes used to put it at ~50-60% battery charge, so upower's approximation sounds realistic and unchanged from what it used to be under HAL. :)

Repeated the aforementioned test.

Code:
martijn@martijnlaptop ~ $ upower --monitor-detail | grep "time to empty"
    time to empty:       5.3 hours # Unplugged battery, Powerdevil switched to profile Powersave.
    time to empty:       5.3 hours
    time to empty:       4.7 hours
    time to empty:       4.7 hours
    time to empty:       4.7 hours
    time to empty:       3.7 hours
    time to empty:       1.3 hours # upower finally gives a realistic value.
    time to empty:       1.3 hours
    time to empty:       1.1 hours # Changed LCD brightness to maximum value, rather than the value Powerdevil had set.
    time to empty:       1.1 hours
    time to empty:       1.3 hours # Changed LCD brightness to minimum value, rather than the value Powerdevil had set.
    time to empty:       1.3 hours
    time to empty:       1.5 hours # Closed the lid, which deactivates the screen.
    time to empty:       1.4 hours
    time to empty:       1.4 hours
    time to empty:       1.1 hours #Reopened the lid, and set LCD brightness back to Powerdevil's default.
    time to empty:       1.1 hours


Is anyone else experiencing erroneous battery statuses from upower? Should I report this to upstream?

EDIT: The saga continues.

Code:
martijnlaptop ~ # cd /sys/devices/LNXSYSTM\:00/device\:00/PNP0C0A\:00/power_supply/BAT0/
martijnlaptop BAT0 # cat charge_full
2753000
martijnlaptop BAT0 # cat charge_now
2724000
martijnlaptop BAT0 # cat charge_full_design
7800000


So it would seem udev is getting the wrong stats, and upower is simply reading them out.
_________________
Main PC: Intel Core i7 920 -- Gentoo ~amd64 KDE4 -- Windows 7 Ultimate
Laptop: Intel Core Duo T2450 -- Gentoo ~x86 KDE4
Back to top
View user's profile Send private message
Zarhan
l33t
l33t


Joined: 27 Feb 2004
Posts: 996

PostPosted: Tue Feb 08, 2011 2:03 pm    Post subject: Reply with quote

I'm getting something similar.

My battery indicator in system tray now says 10%. However,

Code:
$ acpi -V
Battery 0: Unknown, 99%


This typically happens to me if I go through system/resume cycle.

As a result, I've had to take away all automatic reactions to battery status.

Oh, and I'm on udev-151-r4.
Back to top
View user's profile Send private message
Zarhan
l33t
l33t


Joined: 27 Feb 2004
Posts: 996

PostPosted: Tue Feb 08, 2011 3:13 pm    Post subject: Reply with quote

Found this:

https://bugs.freedesktop.org/show_bug.cgi?id=27399
Back to top
View user's profile Send private message
Lupusceleri
n00b
n00b


Joined: 14 May 2010
Posts: 10

PostPosted: Wed Feb 09, 2011 4:31 pm    Post subject: Reply with quote

Funny enough, I left the laptop off for a few days and today booted it up on battery power. The battery meter is now giving the correct %.

No package updates, no config changes, no nothing.

I don't understand. :P But well.
_________________
Main PC: Intel Core i7 920 -- Gentoo ~amd64 KDE4 -- Windows 7 Ultimate
Laptop: Intel Core Duo T2450 -- Gentoo ~x86 KDE4
Back to top
View user's profile Send private message
Lupusceleri
n00b
n00b


Joined: 14 May 2010
Posts: 10

PostPosted: Sun Feb 13, 2011 2:07 pm    Post subject: Reply with quote

Lupusceleri wrote:
Funny enough, I left the laptop off for a few days and today booted it up on battery power. The battery meter is now giving the correct %.

No package updates, no config changes, no nothing.

I don't understand. :P But well.

And we're back to erroneous battery status. It's almost like the thing is connected to a random number generator.
_________________
Main PC: Intel Core i7 920 -- Gentoo ~amd64 KDE4 -- Windows 7 Ultimate
Laptop: Intel Core Duo T2450 -- Gentoo ~x86 KDE4
Back to top
View user's profile Send private message
keba
Guru
Guru


Joined: 02 Jun 2006
Posts: 328
Location: Switzerland

PostPosted: Sat Mar 12, 2011 1:47 pm    Post subject: Reply with quote

I've got the exact same problem :( No idea what causes it. Screen brightness is not being adjusted either...
Back to top
View user's profile Send private message
hephooey
n00b
n00b


Joined: 24 Feb 2003
Posts: 74

PostPosted: Fri Apr 08, 2011 2:04 am    Post subject: Reply with quote

I had similar problems, it happens when I put the laptop to sleep or use the battery instead of AC, simply removing and pluging the battery back makes the report of upower -d normal again.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum