532h: battery status disappears

I'm posting from my daughter's place in Melbourne. She has cable Internet!

I brought the little Aspire One 532h with me, using it now.

There's an issue with the battery status applet, it dies after awhile. I found that the problem goes back to acpi itself. Early on, get this:

# cat /proc/acpi/battery/BAT0/info

present: yes
design capacity: 2200 mAh
last full capacity: 2112 mAh
battery technology: rechargeable
design voltage: 10800 mV
design capacity warning: 110 mAh
design capacity low: 66 mAh
capacity granularity 1: 264 mAh
capacity granularity 2: 3780 mAh
model number: UM09G31
serial number:
battery type: Lion
OEM info: SANYO


But after awhile, get this:

# cat /proc/acpi/battery/BAT0/info

present: no


I'm using 2.6.33-rc8, so I guess I should try with an older kernel.


Posted on 20 Feb 2010, 10:58


Comments:

Posted on 20 Feb 2010, 11:36 by BarryK
kacpid
There is a process, spawned by the kernel I think, kacpid:

# ps | grep 'acpid'
10 root 0:00 [kacpid]


...if I kill it, the battery becomes "present" again, but only for a short while. That kacpid comes back.



Posted on 20 Feb 2010, 12:20 by BarryK
noapic
Interesting, the boot parameter "noapic" seems to have fixed the battery applet.

I'm puzzled by this. Taking a very wild punt, it seems to be a problem in the kernel, as apic support seems to be tied into smp systems, whereas this kernel is configured for a uni-processor.



Posted on 20 Feb 2010, 13:53 by kirk
acpi
There are some acpi changes in the rc8-git4 patch. So maybe there's hope.


Posted on 20 Feb 2010, 21:49 by BarryK
noapic, nolapic
I "spoke too soon". the battery applet lasted for quite a long time (15-20 minutes, but then died. I have repeated this.

Interesting, looking at the files in /proc/acpi after the battery applet has died, the battery shows as "present: yes".

It would appear that momentarily the acpi is thinking the battery is not present, which kills the battery applet (asapm), but then "comes good" again.

This page is interesting:

http://evuraan.blogspot.com/2007_07_01_archive.html

...it lead me to wonder, and this is very speculative, that lapic, the timer in apic, is the cause of the trouble. Perhaps turning off apic entirely brings more problems, perhaps just turning off lapic (with boot parameter "nolapic") will fix the battery applet.

So that's what I've done. The battery applet has been up for over half an hour... looking good.

Just to clarify my reasoning with a bit more vague speculation, that reference explains that if the CPU goes to sleep, so does lapic, which makes it an unreliable clock source. As the Atom CPU is designed to minimise power consumption, it may have a mode change that causes lapic to falter.

Note, by disabling lapic at bootup, the kernel uses hpet.



Posted on 21 Feb 2010, 7:45 by BarryK
Battery monitor still weird
Not out of the woods yet!

Nice fresh day, it's 6.30am here, the battery monitor tray applet is working fine with that "nolapic" kernel boot parameter.

Er, except for one small thing... suddenly the 100% charged battery dropped from 100% to 12%.

The reason is this:

# cat /proc/acpi/battery/BAT0/info

present: yes
design capacity: 38929 mAh
last full capacity: 16392 mAh
battery technology: rechargeable
design voltage: 12296 mV
design capacity warning: 1945 mAh
design capacity low: 1167 mAh
capacity granularity 1: 264 mAh
capacity granularity 2: 3780 mAh
model number: UM09G3
serial number:
battery type: Lion
OEM info: COMPAL


The design capacity showing as '38929' was previously '2200'. 2200 mah is the correct capacity of this battery.

The 'remaining capacity' reading is still correct. I tested by turning off the mains power. Yep, remaining capacity is dropping as expected... now at 2070 mah.
design capacity still stuck at 38929 mah.



Posted on 21 Feb 2010, 15:12 by Sage
Tail chasing?
There is, of course, no way to measure the correct remaining charge of any battery. Voltage is no measure of this because the discharge curve of Li-ion cells is rather flat. It seems unlikely that a coulometer is incorporated - I've never seen one. So what are these programs trying to measure? Most likely it'll be total 'on-time' from which an interpolation based on a 'standard' algorithm leads to a guesstimate of 'q'? Not difficult for the x=0 and x^max values to be reset to some spurious figure leading to the above observations.
Furthermore, it is especially difficult to control overcharge/overdischarge in most rechargeables - it has to be achieved by the internal electrochemistry, a severe challenge for any sealed unit; the only moderately satisfactory cells to achieve this are Pb-acid ones!! Frankly, it's amazing that such progress that has been made with Ni-Cd/Ni-MH/Li-ion as is evident, although we are all familiar with unexpected, not to say sudden/dramatic failure all these types, including the infamous Dell firebombs.
For these reasons, battery condition, however displayed, needs to be viewed with considerable circumspection. The best guide to likely remaining battery capacity is the remaining time since last full charge based on the last full discharge cycle minus delta, where delta is hopefully a small value which decreases with time and cyclelife, bearing in mind that every cell is different in detail, however closely manufacturing tolerance are maintained. In other words, believe your eyes not some smart coding - keep a spare at hand for mission-critical applications.
When electric vehicles finally arrive, the infrastructure must include an extremely lucrative trade in roadside swap-out batteries. Let's hope that the world's motor manufacturers will have signed battery standardisation agreements - in blood.


Posted on 26 Feb 2010, 15:07 by Ap.Muthu
Blinky too not reverting
Puppy Linux v4.3.1 - After making a PPTP VPN connection, I find no way to disconnect - the disconnect button is greyed out. I tried to right-click the blinky icon and exit from it and all instances of blinky vanished from the system tray including the eth0 connection. How do we restore the blinky tray icon?


Posted on 27 Feb 2010, 17:08 by BarryK
Powerapplet
I'm back home. Did get much done while I was in Melbourne, but did play around with battery and CPU temp tray applet for my Aspire One 532h netbook. I was trying to work around the quirky acpi in this netbook, not entirely successfully.

But then of course, it may be that by the time 2.6.33 final is released, acpi may be fixed for my hardware. So, I should not be trying too much right now to create a workaround.

Actually, what I did was modify my 'freememapplet' as that is Xlib only and uses very few resources. Being an actual swallowed window is nice, as can display information without having to mouse-over or click-on. The GTK-based 'eggtray" and 'trayicon' applets only display icons.

But of course not too many system trays can swallow a window. One of the good things about JWM.

I'm playing with this 'powerapplet' but don't know if will stay with it. Jemimah's Vattery looks nice.