Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
battery charge sensing stopped workling
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
marinheiro
Tux's lil' helper
Tux's lil' helper


Joined: 16 Jan 2004
Posts: 140

PostPosted: Sun Mar 04, 2012 11:27 pm    Post subject: battery charge sensing stopped workling Reply with quote

I have an old 2nd-gen macbook. Somewhere after a recent emerge battery sensing stopped working. The battery always shows with a change of 0%. If I switch from mains to battery, It recognizes the switchover but sees the battery having zero charge and so goes straight into hibernation. It isn't a hardware problem, because I can boot into OSX which seems the battery as fine, and charging normally.

Can anyone suggest where I should look?

Thanks
Graham
Back to top
View user's profile Send private message
CrankyPenguin
Apprentice
Apprentice


Joined: 19 Jun 2003
Posts: 283

PostPosted: Mon Mar 05, 2012 1:49 am    Post subject: Reply with quote

Lets start by narrowing it down. In general the battery sensing is controlled by: the ACPI features; the /proc/ or /sys/ directories; and whatever charge sensing software you are using.

During or after this Emerge, did you:
  • Build a new kernel? In which case the culprit may lie in missing or incompatable acpi drivers or a missing proc or sys interface.
  • Change the system layout or some basic package which may also have played merry hell with your apis.
  • Update your battery monitor app? In which case it may want a new api.


Given that it detects the AC adapter I would suspect that you built a kernel and either the battery module was not built or is giving an error. First check to see that it is loaded and/or built into the kernel. Then if so I'd check dmesg for any errors associated with it, say when you add the battery or modprobe the module. Then if that passes I'd check to see if the /proc/acpi battery directory and/or the appropriate sys directories are present. If they are (or at least the one one you had before is) then I'd check your monitor app. Perhaps it was updated and now wants to look in Sys instead of proc.
_________________
Linux, the OS for the obsessive-compulsive speed freak in all of us.
Back to top
View user's profile Send private message
marinheiro
Tux's lil' helper
Tux's lil' helper


Joined: 16 Jan 2004
Posts: 140

PostPosted: Mon Mar 05, 2012 11:55 pm    Post subject: Reply with quote

I have gnome-power-manager, which apparently sits on top of upower.

Code:
upower -d



Code:
Device: /org/freedesktop/UPower/devices/line_power_ADP1
  native-path:          /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/ADP1
  power supply:         yes
  updated:              Mon Mar  5 20:56:29 2012 (9550 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
  power supply:         yes
  updated:              Mon Mar  5 23:35:38 2012 (1 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    energy:              0 Wh
    energy-empty:        0 Wh
    energy-full:         0 Wh
    energy-full-design:  0 Wh
    energy-rate:         0 W
    percentage:          0%
    capacity:            100%

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


The only relevant thing I can see from dmesg is:

Code:
0.317530] ACPI: Battery Slot [BAT0] (battery present)



My kernel cnfig just has:
Code:
CONFIG_ACPI_BATTERY=y


so maybe I'm missing a specific battery driver in the kernel, though I never deliberately set one before.

Graham
Back to top
View user's profile Send private message
CrankyPenguin
Apprentice
Apprentice


Joined: 19 Jun 2003
Posts: 283

PostPosted: Wed Mar 07, 2012 5:26 am    Post subject: Reply with quote

It sounds like that may be the case. I know that some parts of the kernel were restructured for the most recent releases and make oldconfig didn't always function properly. I suggest that you go into menuconfig and see what you can find. As a quick sanity check you could also poke around in the /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/ directory to see what is there. It is unlikely that the information would be correctly present in the sys directory and have upower be wrong but stranger things have happened.
_________________
Linux, the OS for the obsessive-compulsive speed freak in all of us.
Back to top
View user's profile Send private message
marinheiro
Tux's lil' helper
Tux's lil' helper


Joined: 16 Jan 2004
Posts: 140

PostPosted: Wed Mar 07, 2012 10:38 pm    Post subject: Reply with quote

Looks like this is a long-lasting and unsolved problem with the macbook batteries:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/215074

Booting into OSX is also a temporary fix for me.
Back to top
View user's profile Send private message
CrankyPenguin
Apprentice
Apprentice


Joined: 19 Jun 2003
Posts: 283

PostPosted: Mon Mar 12, 2012 3:05 am    Post subject: Reply with quote

Hmm, that stinks. Can you roll back to an older kernel?
_________________
Linux, the OS for the obsessive-compulsive speed freak in all of us.
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