Wrong battery status

Bug #270123 reported by Patrick
114
This bug affects 19 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Expired
Medium
Unassigned
Nominated for Karmic by josep
Nominated for Lucid by josep
Nominated for Maverick by Hans-Dominik

Bug Description

Binary package hint: acpi

Hi there

I have a Fujitsu Siemens Esprimo u9200, and it seems nearly all acpi stuff works: suspend, hibernate, events when closing the lid and gnome-power manager knows when the laptop is running on battery, when it's charging or when it is pluged in with missing battery or fully charged.

But there's one thing that bothers me: while gnome-power-manager 'seems' to be working correctly, the battery applet doesn't. It always shows the laptop being on running on ac power. In terminal, acpi -a -b shows the following:

patrick@patrick-laptop:~$ acpi -b -a
     Battery 1: charged, 41%
     AC Adapter 1: off-line

This happens with both ubuntu stock kernel and a .26 kernel. I suspect it could be some BIOS stuff, but I'm not sure. I've read the DSDT and it points to different places wether it's a linux OS, windows XP, windows XP SP1, SP2 or Vista. I've tried to recompile it pointing linux to the same place as all other options, but it still shows the same.

Any ideas?

[EDIT by Chris Coulson]

The battery status indicated in /proc/acpi and sysfs (and therefore HAL) is incorrect. With the AC adapter present and the battery charging, the battery status is 'charging', which is correct. When the battery becomes charged, the status appears to indicate 'discharging'. Without the AC adapter, the battery status says at 'charged', when it should be 'discharging'. The side effect of this is that the gnome-power-manager icon does not display when the AC adapter is disconnected (when it should do), and the battery status icon (which uses data from /proc/acpi) always shows the laptop as running on AC power.

This comment contains the information about the battery and AC adapter exported in /proc/acpi (with and without AC power): https://bugs.edge.launchpad.net/ubuntu/+source/linux/+bug/270123/comments/8

This comment contains the information about the battery and AC adapter exported from HAL (with and without AC power):
https://bugs.edge.launchpad.net/ubuntu/+source/linux/+bug/270123/comments/17

This comment contains the information about the battery exported from HAL (AC adapter conected and battery fully charged): https://bugs.edge.launchpad.net/ubuntu/+source/linux/+bug/270123/comments/18

Contents of /proc/acpi: http://launchpadlibrarian.net/17921644/proc-acpi.tar.gz

dmidecode, lspci and dmesg output: http://launchpadlibrarian.net/17954155/acpi%20bug.tar.gz (also includes contents of /proc/acpi with various combinations of battery/AC)

[/END]

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Thank you for taking the time to report this bug and help make Ubuntu better. Unfortunately we can't fix it without more information.

Based on the information you have given, I have reassigned this to gnome-power-manager for now, as it seems to be g-p-m which is indicating the wrong status. Could you please provide the information requested at https://wiki.ubuntu.com/DebuggingGNOMEPowerManager.

Thanks in advance.

Changed in acpi:
status: New → Incomplete
Revision history for this message
Patrick (patrick-voegeli) wrote :

Bug in gnome-power-manager? acpi never tells the battery is discharging, although it nows the ac adapter is off line, sure there's something wrong there, isn't it?

Anyway, I attach all information below. All is done with the ac-adapter unplugged, except lshal, which I run on battery, plugged in the ac adapter, then unplugged and then killed the command.

hope it helps

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Just to be clear, this is how I understand your problem - The battery status icon (which is drawn by gnome-power-manager) always says that the laptop is running on AC power even when it isn't. Is that correct?

Could you please also run the following (without the AC adapter connected);

hal-find-by-capability --capability "ac_adapter" | xargs -n 1 hal-device

Thanks

Revision history for this message
Patrick (patrick-voegeli) wrote :

To clarify things:

The gnome power manager tray icon now shows the battery icon, and if I move the mouse over, it says Computer uses battery power. Laptop battery 1h 30min remaining (58%). Battery discharging time is estimate. By the way, if in gpm preferences I select to only show the tray icon when battery charging or discharging, I don't get the icon (will only appear when charging)

If I add to the panel the battery charge monitor, it displays and ac plug and says system is run from ac power. If I select extended view, I get the ac plug and a battery, will show no time, but it will show how much % is remaing.

I hope things are a bit clearer now. If not, please ask.

The output:

patrick@patrick-laptop:~$ hal-find-by-capability --capability "ac_adapter" | xargs -n 1 hal-device
udi = '/org/freedesktop/Hal/devices/computer_power_supply_ac_adapter_ADP1'
  linux.sysfs_path = '/sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/ADP1' (string)
  ac_adapter.present = false (bool)
  info.parent = '/org/freedesktop/Hal/devices/computer' (string)
  info.product = 'Generic AC Adapter Device' (string)
  info.udi = '/org/freedesktop/Hal/devices/computer_power_supply_ac_adapter_ADP1' (string)
  info.category = 'ac_adapter' (string)
  linux.hotplug_type = 2 (0x2) (int)
  info.capabilities = { 'ac_adapter' } (string list)
  linux.subsystem = 'power_supply' (string)

Revision history for this message
Patrick (patrick-voegeli) wrote :

By the way, just in case. I have a script installed under /etc/pm/sleep.d/99-savings and /etc/pm/power.d/99-savings.

The script is something like:

#!/bin/sh

if on_ac_power; then

    bla bla bla

else

    bla bla bla

fi

Whenever I plug or unplug the ac adapter, the script does its work, so it detects fine wether it's running on ac power or not.

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Thanks. I understand now. So, G-P-M (and HAL) are both behaving correctly, but the battery status icon (part of gnome-applets) is incorrect. I'm assigning it to gnome-applets for now, and I'll have another look at this tomorrow. Note that the battery status icon gets the battery status from a different source than gnome-power-manager (it doesn't use HAL).

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Patrick - Could you please run the following command (both with and without the AC adapter present):

ls -la /proc/acpi/*/*
cat /proc/acpi/*/*/*

This should give us the raw information that the ACPI command line utility sees (and the battery status applet)

Thanks

Revision history for this message
Patrick (patrick-voegeli) wrote :

Here you go.

Thanx a lot for your dedication, I highly appreciate it.

By the way, remember I never get a discharging state, but charged with off-line ac and X time estimate left.

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Thank you for the information.

The information exported to /proc/acpi seems to be consistent with the behaviour of the battery status applet as I understand it (battery status is 'charging' when the AC adapter is present, but always 'charged' without AC adapter, and never 'discharging'). This defainately looks like a kernel bug.

For this reason, I will now reassign this to the kernel.

The next interesting thing would be to see whether the information in /proc/acpi is consistent with the information in sysfs (which is what HAL and gnome-power-manager uses). I suspect it may be, because you say that the gnome-power-manager icon only ever displays when charging, even though you have told it to display when charging and discharging. Also, the information you provided from HAL earlier suggests this already too (battery.rechargeable.is_discharging = false). If you feel like it, could you please run the following commands both with and without AC power:

ls -la /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0
cat /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0/*

I'm not familiar with the structure under this folder. If the files I'm interested in are in sub-folders, you will need to cd in to them in order to get the information.

In addition to this, could you also provide the standard information required by the kernel team for ACPI related bugs at https://wiki.ubuntu.com/DebuggingACPI, as separate attachments.

Thanks

Changed in gnome-applets:
assignee: nobody → chrisccoulson
Revision history for this message
Patrick (patrick-voegeli) wrote :

Ok, I do have a discharging state:

I was using the laptop while it was recharging when I suspended it. When I came back, the notebook's battery was fully charged (charge icon is off) and the gpm tray icon tells me: battery is discharging. Gpm's battery information is discharging, and when going over the tray icon, it tells it's running on ac power. acpi reports

acpi -a -b
     Battery 1: discharging, 100%, remaining
     AC Adapter 1: on-line

What's really odd is that as soon as I unplug my ac adapter, gpm says the battery is fully charged. Going over the tray icon tells running on battery power, and battery status is charged. acpi says

acpi -a -b
     Battery 1: charged, 97%
     AC Adapter 1: off-line

It's odd, isn't it? Does that confirm your thoughts?

I'll do what you suggested next week, since I'll be abroad until tuesday.

thanx for your help.

Revision history for this message
Patrick (patrick-voegeli) wrote :

patrick@patrick-laptop:~$ cat /sys/devices/LNXSYSTM\:00/device\:00/PNP0C0A\:00/power_supply\:BAT0/*
0
4896000
5200000
1081000
1492000
cat: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply:BAT0/device: Is a directory
Vendor12345678901234567890
Modelxxx
cat: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply:BAT0/power: Is a directory
1
SN
Full
cat: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply:BAT0/subsystem: Is a directory
Li-ion
Battery
PHYSDEVPATH=/devices/LNXSYSTM:00/device:00/PNP0C0A:00
PHYSDEVBUS=acpi
PHYSDEVDRIVER=battery
POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_STATUS=Full
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11100000
POWER_SUPPLY_VOLTAGE_NOW=10800000
POWER_SUPPLY_CURRENT_NOW=1492000
POWER_SUPPLY_CHARGE_FULL_DESIGN=5200000
POWER_SUPPLY_CHARGE_FULL=4896000
POWER_SUPPLY_CHARGE_NOW=1081000
POWER_SUPPLY_MODEL_NAME=Modelxxx
POWER_SUPPLY_MANUFACTURER=Vendor12345678901234567890
POWER_SUPPLY_SERIAL_NUMBER=SN
11100000
10800000

patrick@patrick-laptop:~$ cat /sys/devices/LNXSYSTM\:00/device\:00/PNP0C0A\:00/power_supply\:BAT0/subsystem/ADP1/*
cat: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply:BAT0/subsystem/ADP1/device: Is a directory
0
cat: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply:BAT0/subsystem/ADP1/power: Is a directory
cat: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply:BAT0/subsystem/ADP1/subsystem: Is a directory
Mains
PHYSDEVPATH=/devices/LNXSYSTM:00/device:00/ACPI0003:00
PHYSDEVBUS=acpi
PHYSDEVDRIVER=ac
POWER_SUPPLY_NAME=ADP1
POWER_SUPPLY_TYPE=Mains
POWER_SUPPLY_ONLINE=0

patrick@patrick-laptop:~$ cat /sys/devices/LNXSYSTM\:00/device\:00/PNP0C0A\:00/power_supply\:BAT0/subsystem/BAT0/*
0
4896000
5200000
912000
1410000
cat: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply:BAT0/subsystem/BAT0/device: Is a directory
Vendor12345678901234567890
Modelxxx
cat: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply:BAT0/subsystem/BAT0/power: Is a directory
1
SN
Full
cat: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply:BAT0/subsystem/BAT0/subsystem: Is a directory
Li-ion
Battery
PHYSDEVPATH=/devices/LNXSYSTM:00/device:00/PNP0C0A:00
PHYSDEVBUS=acpi
PHYSDEVDRIVER=battery
POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_STATUS=Full
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11100000
POWER_SUPPLY_VOLTAGE_NOW=10760000
POWER_SUPPLY_CURRENT_NOW=1410000
POWER_SUPPLY_CHARGE_FULL_DESIGN=5200000
POWER_SUPPLY_CHARGE_FULL=4896000
POWER_SUPPLY_CHARGE_NOW=912000
POWER_SUPPLY_MODEL_NAME=Modelxxx
POWER_SUPPLY_MANUFACTURER=Vendor12345678901234567890
POWER_SUPPLY_SERIAL_NUMBER=SN
11100000
10760000

By the way, this is running a 2.6.26 kernel. Ubuntu's standard kernel behaves exactly the same way. I also tried some intrepid (alpha 5 I believe) and it did the same thing.

If you need any more information, please ask.

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Thanks for that. The information is slightly more difficult to interpret than I first thought though. If you find some time, it would be good for you to collect some coherent data from /proc/acpi and sysfs for various different conditions (AC adapter present/not present battery full/discharging etc), so we can compare the two. You can do this with the following:

cp -r /proc/acpi /tmp
cp -r /sys/devices/LNXSYSTM:00/device:00 /tmp
tar -cvjf ~/acpi.tar.bz /tmp/acpi
tar -cvjf ~/sysfs.tar.bz /tmp/device:00

For each set of data, could you describe what the conditions are.

Would you mind also attaching the other bits of information requested in https://wiki.ubuntu.com/DebuggingACPI too (in particular, dmesg after fresh boot, and output of lspci -vvnn)

Thanks :)

Revision history for this message
Patrick (patrick-voegeli) wrote :

Here you are!

By the way, also tried 2.6.27-4-generic kernel from intrepid: the same happens. Also tried to pass acpi_apic_instance=2 to grub, with the same behaviour.

thank you very much

Revision history for this message
Patrick (patrick-voegeli) wrote :

forgot the attachment.. :P

Revision history for this message
Jono Bacon (jonobacon) wrote :

Just to add to this report - I am running intrepid and I am getting a battery icon that always suggests I am on battery power, even when the AC is plugged in - it also displays the wrong value. Right now the icon is just a batter (no AC), hovering over it says I am on AC, the battery icon is about 52% green but I get:

jono@forge:~$ acpi -a -b (with AC plugged in)
     Battery 0: Charging, 94%, 00:00:42 until charged
  AC Adapter 0: on-line

jono@forge:~$ hal-find-by-capability --capability "ac_adapter" | xargs -n 1 hal-device (with no AC plugged in)
udi = '/org/freedesktop/Hal/devices/computer_power_supply_ac_adapter_AC'
  linux.sysfs_path = '/sys/class/power_supply/AC' (string)
  info.subsystem = 'power_supply' (string)
  info.parent = '/org/freedesktop/Hal/devices/computer' (string)
  info.product = 'Generic AC Adapter Device' (string)
  info.udi = '/org/freedesktop/Hal/devices/computer_power_supply_ac_adapter_AC' (string)
  linux.hotplug_type = 2 (0x2) (int)
  info.category = 'ac_adapter' (string)
  linux.subsystem = 'power_supply' (string)
  ac_adapter.present = false (bool)
  info.capabilities = { 'ac_adapter' } (string list)

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Patrick - Unfortunately the tar of the stuff under /sys didn't work, because of the colons in the filenames :(

Would you mind running the following 2 commands with and without AC adapter:

hal-find-by-capability --capability "battery" | xargs -n 1 hal-device
hal-find-by-capability --capability "ac_adapter" | xargs -n 1 hal-device

Jono - Would you mind doing the same, as well as the output of "gnome-power-bugreport.sh" for both conditions too?

Once that is done, I shall move this to triaged and assign it to the kernel team.

Thanks

Revision history for this message
Patrick (patrick-voegeli) wrote :

here you go

Revision history for this message
Patrick (patrick-voegeli) wrote :

I've run the same stuff, but adding another state: battery is fully charged and ac power connected.

Changed in linux:
assignee: chrisccoulson → ubuntu-kernel-acpi
importance: Undecided → Medium
status: Incomplete → Triaged
description: updated
description: updated
Revision history for this message
kernel-janitor (kernel-janitor) wrote :

This bug report was marked as Triaged a while ago but has not had any updated comments for quite some time. Please let us know if this issue remains in the current Ubuntu release, http://www.ubuntu.com/getubuntu/download . If the issue remains, click on the current status under the Status column and change the status back to "New". Thanks.

[This is an automated message. Apologies if it has reached you inappropriately; please just reply to this message indicating so.]

tags: added: kj-triage
Changed in linux (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Morten Jensen (mortenut) wrote :

The problem also exists in Karmic Koala. When running om ac power the charging state says discharging and when running on battery is says charged.

Changed in linux (Ubuntu):
status: Incomplete → New
Revision history for this message
Christian Funder Sommerlund (zero3) wrote :

Confirmed on a Fujitsu Siemens P Series Lifebook with fully updated karmic.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
nameiner (nameiner) wrote :

I am not completely sure if this is the same bug but I have a similar effect on my HP dv4-1120us laptop. After suspending and restarting the laptop GPM thinks there is no battery in my system and always shows a power plug even when the AC adapter is unplugged. This is persistent until the system is rebooted. After hibernating the effect doesn't occur. Hibernating after the effect occurred doesn't change anything. Attached is the information requested in https://wiki.ubuntu.com/DebuggingACPI.

I will also attach 2 sets of files containing the output of

ls -la /proc/acpi/*/*
cat /proc/acpi/*/*/*
hal-find-by-capability --capability "battery" | xargs -n 1 hal-device
hal-find-by-capability --capability "ac_adapter" | xargs -n 1 hal-device

Set 1 contains the output of each command after a clean boot once with the AC adapter plugged in and once unplugged.
Set 2 contains the same output after waking up from suspend with the error present.

I can provide more information upon request. Just let me know.

Revision history for this message
nameiner (nameiner) wrote :

Output of

ls -la /proc/acpi/*/*
cat /proc/acpi/*/*/*
hal-find-by-capability --capability "battery" | xargs -n 1 hal-device
hal-find-by-capability --capability "ac_adapter" | xargs -n 1 hal-device

after a clean boot once with the AC adapter plugged in and once unplugged.

Revision history for this message
nameiner (nameiner) wrote :

Output of

ls -la /proc/acpi/*/*
cat /proc/acpi/*/*/*
hal-find-by-capability --capability "battery" | xargs -n 1 hal-device
hal-find-by-capability --capability "ac_adapter" | xargs -n 1 hal-device

after resuming from suspend (error occurred) once with the AC adapter plugged in and once unplugged.?

Revision history for this message
Leonardo (rnalrd) wrote :

Same problem here with DELL Studio 15

Revision history for this message
Raynald (lahondes) wrote :

Same pb on my Fujitsu it just occured when I switched from 9.06 to 9.10.

Revision history for this message
rhowe212 (rhowe-launchpad) wrote :

Seems like it might be a bug in the ACPI DSDT table.

See https://wiki.kubuntu.org/LaptopTestingTeam/FujitsuEsprimoU9200

Not tested the fix yet, but building a new kernel for my Debian box as per http://wiki.debian.org/OverridingDSDT

Revision history for this message
rhowe212 (rhowe-launchpad) wrote :

Tested the fix as suggested on the kubuntu wiki and it Works For Me(tm)

Revision history for this message
FAJALOU (fajalou) wrote :

I am not sure if this is the same bug... but I thought I could give it a try.

Running Lucid Beta 10.04 on a Dell Inspiron 5100.

As stated in the beginning, my battery applet currently states that the system is funny charged, with the system not plugged into an adapter for charging.
However,

louie@lrc-laptop:~$ acpi -a -b
Battery 0: Discharging, 31%, 00:48:15 remaining
Adapter 0: on-line

Which seems to be correct.

When I plug in the adapter the status of the power-manager applet does not change (still fully charged)
but:

louie@lrc-laptop:~$ acpi -a -b
Battery 0: Charging, 30%, 01:29:43 until charged
Adapter 0: on-line
louie@lrc-laptop:~$

Which is correct.

Attached is output of:
Output of

ls -la /proc/acpi/*/*
cat /proc/acpi/*/*/*
hal-find-by-capability --capability "battery" | xargs -n 1 hal-device
hal-find-by-capability --capability "ac_adapter" | xargs -n 1 hal-device

Once with adapter plugged in, and once with adapter unplugged.

So this seems to be a bug with the applet, and not acpi. Any other information needed for this (new?) but, I will be happy to give. Thank you team for your work on this bug!

Revision history for this message
Winston Smith (abgasturbolader) wrote :

I also have a Fujitsu Esprimo u9200, updated it to Lucid Lynx and I still have this bug. The fix for the DSDT table as described at https://wiki.kubuntu.org/LaptopTestingTeam/Old/FujitsuEsprimoU9200 didn't work for me, although i changed the dsdt.dsl instead of the dsdt.aml, because there was no file called dsdt.aml. If you need any further information, just ask.

Revision history for this message
potapuff (kuzikoff) wrote :

Have same problem with u9200 at 9.10 and 10.04, but not in 9.04

Revision history for this message
Patrick (patrick-voegeli) wrote :

Hi there all,

For the Fujitsu U9200 part, I think the bug should be Closed and/or marked as Invalid or Won't release a Fix, or something like that. In the U9200 the BIOS has a bug, thus you had to override the BIOS tables with a custom one that would output the correct information.

But, the information in the (K)Ubuntu wiki won't work anymore: I think somewhere in the 9.10 release cycle the devs decided to ditch the initramfs custom DSDT patch. Which means that, in order to include a custom DSDT, you need to build a kernel and specify the initramfs there or build a kernel including the initramfs-dsdt patch which can be found at http://gaugusch.at/kernel.shtml However, the latest patch available is for 2.6.30 (patch date june 2009) and it doesn't seem that any more patches will be done..

I've found a thread that maybe can help you with the DSDT issues: http://ubuntuforums.org/showthread.php?t=1341580

I don't have that laptop anymore, so I can't test anything related to the U9200.

Good luck!

Revision history for this message
Ketil Wendelbo Aanensen (ketilwaa-deactivatedaccount) wrote :

I'm not sure if this is the same bug, but I'm really annoyed with the fact that when I unplug my laptop, I get a message saying "Laptop battery critically low". This happens even though the battery is fully charged. The indicator also shows it being fully charged.

Revision history for this message
Raynald (lahondes) wrote :

Many thanks to Patrick. This solved the problem for me.

In short combine this to create a new DSDT (ref: https://wiki.kubuntu.org/LaptopTestingTeam/Old/FujitsuEsprimoU9200)

<code>
sudo apt-get install iasl
cd
mkdir DSDT
cd DSDT
sudo cat /proc/acpi/dsdt > dsdt.dat
iasl -d dsdt.dat
gedit dsdt.aml
</code>

Ok, now you should have your dsdt file open. So let's fix it, look for the following code in Device (BAT0), under the Method (UPBS, 0, NotSerialized) subsection:

<code>
     If (LEqual (Local0, 0x02))
     {
         And (Local7, One, Local0)
         If (LEqual (Local0, One))
         {
             And (Local7, 0x80, Local1)
             If (LEqual (Local1, 0x80))
             {
                 Or (Local4, 0x02, Local4)
             }
             Else
             {
                 Or (Local4, One, Local4)
             }
         }
      }
</code>

Ok, now let's fix it. Else code is misplaced, it has to be moved out of the If (LEqual (Local0, One)). So, it should be:

<code>
     If (LEqual (Local0, 0x02))
     {
         And (Local7, One, Local0)
         If (LEqual (Local0, One))
         {
             And (Local7, 0x80, Local1)
             If (LEqual (Local1, 0x80))
             {
                 Or (Local4, 0x02, Local4)
             }
             //ELSE WAS HERE
         }
         // ELSE CORRECT PLACE
         Else
         {
             Or (Local4, One, Local4)
         }
      }
</code>

Now, simply save and close gedit, and let's continue:

<code>
cd
cd DSDT
iasl -tc dsdt.dsl
</code>

OK now let's insert this in the kernel :

<code>
mkdir /dsdt
cp dsdt.hex /dest/dsdt_table.h
</code>

 - stop following what's written in FujitsuEsprimoU9200, the rest won't work. -

And follow what's here :

http://newyork.ubuntuforums.org/showthread.php?p=8707937

Revision history for this message
linuxrules (linuxrules) wrote :

would this help

save this as /etc/acpi/battery.sh
in a root shell run: chmod +x /etc/acpi/battery.sh

#!/bin/sh
# UGLY HACK

AC_state=/proc/acpi/ac_adapter/AC/state

if grep -q "on-line" ${AC_state} ; then

    hal-set-property --udi `hal-find-by-capability --capability ac_adapter` --key ac_adapter.present --bool true

else

    hal-set-property --udi `hal-find-by-capability --capability ac_adapter` --key ac_adapter.present --bool false

fi
linuxrules said 7 minutes ago:

if code is in battery.sh add to top (below #!/bin/sh)

# UGLY HACK

AC_state=/proc/acpi/ac_adapter/AC/state

if grep -q "on-line" ${AC_state} ; then

    hal-set-property --udi `hal-find-by-capability --capability ac_adapter` --key ac_adapter.present --bool true

else

    hal-set-property --udi `hal-find-by-capability --capability ac_adapter` --key ac_adapter.present --bool false

fi

Revision history for this message
Hans-Dominik (hdm-mail) wrote :

with or without the script i get this results

if AC_Adaptor is pluged

root@laptop:/etc/acpi# hal-get-property --udi `hal-find-by-capability --capability ac_adapter` --key ac_adapter.present
true

if AC_Adaptor unpluged

root@hdm-laptop:/etc/acpi# hal-get-property --udi `hal-find-by-capability --capability ac_adapter` --key ac_adapter.present
false

-

to get script working i hafe to change

AC_state=/proc/acpi/ac_adapter/AC/state
to
AC_state=/proc/acpi/ac_adapter/ADP1/state

Revision history for this message
Hans-Dominik (hdm-mail) wrote :

inspired by last mesage i have a look at /proc/acpi/battery/BAT0/state

and for me it looks like this is set wrong while ac_adapter state is still working correct

-

if AC_Adaptor is pluged

cat /proc/acpi/battery/BAT0/state

present: yes
capacity state: ok
charging state: discharging
present rate: 0 mA
remaining capacity: 4383 mAh
present voltage: 12382 mV

if AC_Adaptor unpluged

cat /proc/acpi/battery/BAT0/state
present: yes
capacity state: ok
charging state: charged
present rate: 2047 mA
remaining capacity: 4165 mAh
present voltage: 12066 mV

Revision history for this message
linuxrules (linuxrules) wrote :

yes the script does need to be configured

AC_state=/proc/acpi/ac_adapter/AC/state

to what ever the device is named

Ex. AC_state=/proc/acpi/ac_adapter/ACD/state

sorry for any unclear info

Revision history for this message
linuxrules (linuxrules) wrote :
Revision history for this message
Jeremy Foshee (jeremyfoshee) wrote :

removed deprecated team assignment as the Kernel Team no longer uses the ACPI team alias. This will now show back up on my radar as it was not due to the assignment.

~JFo

Changed in linux (Ubuntu):
assignee: Ubuntu Kernel ACPI Team (ubuntu-kernel-acpi) → nobody
Revision history for this message
spbrereton (simon-brereton) wrote :

I'm not sure if this is the same bug or a different one. All I know is that it makes my laptop unusable as a laptop since I never know when the battery is about to quit...

lsb_release -rd
Description: Ubuntu 10.04.2 LTS
Release: 10.04

acpi -b -a
Battery 0: Charging, 0%, charging at zero rate - will never fully charge.
Adapter 0: on-line

hal-find-by-capability --capability "battery" | xargs -n 1 hal-device
udi = '/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT0'
  linux.hotplug_type = 2 (0x2) (int)
  linux.subsystem = 'power_supply' (string)
  info.subsystem = 'power_supply' (string)
  info.product = '' (string)
  battery.type = 'primary' (string)
  battery.reporting.technology = 'Unknown' (string)
  battery.technology = 'unknown' (string)
  battery.model = '' (string)
  battery.vendor = '' (string)
  battery.voltage.design = 0 (0x0) (int)
  battery.voltage.unit = 'mV' (string)
  battery.reporting.design = 0 (0x0) (int)
  battery.reporting.unit = 'mWh' (string)
  battery.serial = '' (string)
  battery.present = true (bool)
  battery.voltage.current = 0 (0x0) (int)
  battery.reporting.rate = 0 (0x0) (int)
  battery.is_rechargeable = true (bool)
  battery.rechargeable.is_charging = true (bool)
  battery.rechargeable.is_discharging = false (bool)
  battery.reporting.current = 0 (0x0) (int)
  battery.reporting.last_full = 0 (0x0) (int)
  battery.charge_level.current = 0 (0x0) (int)
  battery.charge_level.last_full = 0 (0x0) (int)
  battery.charge_level.design = 0 (0x0) (int)
  battery.charge_level.rate = 0 (0x0) (int)
  battery.charge_level.percentage = 0 (0x0) (int)
  info.udi = '/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT0' (string)
  linux.sysfs_path = '/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0' (string)
  info.parent = '/org/freedesktop/Hal/devices/computer' (string)
  info.category = 'battery' (string)
  info.capabilities = { 'battery' } (string list)

Revision history for this message
Jorgen Bodde (jorgb) wrote :

Since Ubuntu 11.04, my battery (which should last for 5 hours as it did with 10.04) reports it only lasts 2 hours.

Furthermore after charging it fully, the indicator displays it at like 80% always, like it never fully charged, AND it shows two items in the menu bar.

Since 11.04, that indicator is hopelessly broken.

Revision history for this message
Dominic (djgarms) wrote :

I use Ubuntu 11.04 on Lenovo T410, around 1 year old. On Win7 I had a battery life of 2 hours, now I only get less than 1 hour. The ouput says:

present: yes
design capacity: 5616 mAh
last full capacity: 2606 mAh

This is very weird, before Ubuntu my battery life always recharged to 95 % at least.

Revision history for this message
penalvch (penalvch) wrote :

Patrick, this bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? Can you try with the latest development release of Ubuntu? ISO CD images are available from http://cdimage.ubuntu.com/releases/ .

If it remains an issue, could you run the following command in the development release from a Terminal (Applications->Accessories->Terminal). It will automatically gather and attach updated debug information to this report.

apport-collect -p linux <replace-with-bug-number>

Also, if you could test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please do not test the kernel in the daily folder, but the one all the way at the bottom. Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text. As well, please comment on which kernel version specifically you tested.

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel-unable-to-test-upstream', and comment as to why specifically you were unable to test it.

Please let us know your results. Thanks in advance.

tags: added: needs-upstream-testing
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.