Opened 15 years ago

Closed 13 years ago

#5843 closed bug (fixed)

ACPI empty battery slots showing up in battery applet. Present battery is also missing.

Reported by: kallisti5 Owned by: czeidler
Priority: normal Milestone: R1
Component: Drivers/ACPI Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: x86

Description

in hrev36511 (and prior versions)

empty battery slots are showing up in the battery applet.

Attaching the following:

  • /dev/power/acpi_battery/0
  • /dev/power/acpi_battery/1
  • /dev/acpi/namespace
  • /var/log/syslog

Attachments (5)

0 (319 bytes ) - added by kallisti5 15 years ago.
/dev/power/acpi_battery/0
1 (380 bytes ) - added by kallisti5 15 years ago.
/dev/power/acpi_battery/1
namespace (34.9 KB ) - added by kallisti5 15 years ago.
/dev/acpi/namespace
syslog (188.5 KB ) - added by kallisti5 15 years ago.
syslog
screenshot4.png (14.6 KB ) - added by kallisti5 15 years ago.
battery app

Download all attachments as: .zip

Change History (15)

comment:1 by anevilyak, 15 years ago

Owner: changed from nobody to czeidler
Status: newassigned

by kallisti5, 15 years ago

Attachment: 0 added

/dev/power/acpi_battery/0

by kallisti5, 15 years ago

Attachment: 1 added

/dev/power/acpi_battery/1

by kallisti5, 15 years ago

Attachment: namespace added

/dev/acpi/namespace

by kallisti5, 15 years ago

Attachment: syslog added

syslog

by kallisti5, 15 years ago

Attachment: screenshot4.png added

battery app

comment:2 by stippi, 15 years ago

What hardware do you own? I have an IBM/Lenovo ThinkPad T60, and indeed my CD-ROM drive can be removed and the bay can be repurposed for another battery.

comment:3 by kallisti5, 15 years ago

HP nc6230.

One built-in battery (which was attached for the testing) one battery connector on the bottom for a larger battery (not-attached)

nc6230 is pretty much an HP clone of the Thinkpad t4x series

comment:4 by czeidler, 15 years ago

Ah ok seems there is a bug in the battery app. When I find time I will take a look into it. Did you try to click below the empty slot? maybe there is a drawing bug. Why it says 100% and not empty slot?...

comment:5 by kallisti5, 15 years ago

verified that clicking on/around/below the 100% battery does nothing.

ACPI/Battery app uses the BATTERY_CRITICAL_STATE identifier to mark disabled/not present batteries.

http://haiku.it.su.se:8180/source/search?q=BATTERY_CRITICAL_STATE&defs=&refs=&path=&hist=

BATTERY_CRITICAL_STATE is 0x04

My removed battery has a status of -1: /dev/power/acpi_battery/0

BATTERY_UNKNOWN_STATE of -1 need to be implemented within http://haiku.it.su.se:8180/source/xref/headers/private/device/power_managment.h and used in the power app?

comment:6 by kallisti5, 15 years ago

this looks like something partially implemented. Please note the -1 above should be 0 ;)

Maybe:

#define BATTERY_UNKNOWN_STATE		0x00
#define BATTERY_DISCHARGING		0x01
#define BATTERY_CHARGING		0x02
#define BATTERY_CRITICAL_STATE		0x04

comment:7 by kallisti5, 15 years ago

I checked what Linux did for these battery statuses, unfortunately they are a little more dynamic on ACPI battery states. The Linux Kernel checks other battery metrics when evaluating the status. However, I did find that Linux always assumes an unknown state for the 0 status verifying this is a needed addition.

I am working on a quick patch for the power_managment.h source to include the unknown state and for the battery app to act upon it.

anyone else notice "MANAGMENT" is misspelled in the power_managment.h sources and filename?

comment:8 by pulkomandy, 14 years ago

Milestone: R1/alpha3R1

Any news on that fix ? This doesn't really belongs in alpha 3, anyway...

comment:9 by kallisti5, 14 years ago

ack, this was already fixed in hrev39731 via #6951 (before I had commit). I submitted some patches that correct the -1 battery issue, although BATTERY_UNKNOWN_STATE should probably be implemented (which I will do here in a few minutes)

comment:10 by kallisti5, 13 years ago

Resolution: fixed
Status: assignedclosed

resolved long ago. Thanks!

Note: See TracTickets for help on using tickets.