Opened 9 years ago

Closed 7 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:
Has a Patch: no 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 9 years ago.
/dev/power/acpi_battery/0
1 (380 bytes) - added by kallisti5 9 years ago.
/dev/power/acpi_battery/1
namespace (34.9 KB) - added by kallisti5 9 years ago.
/dev/acpi/namespace
syslog (188.5 KB) - added by kallisti5 9 years ago.
syslog
screenshot4.png (14.6 KB) - added by kallisti5 9 years ago.
battery app

Download all attachments as: .zip

Change History (15)

comment:1 Changed 9 years ago by anevilyak

Owner: changed from nobody to czeidler
Status: newassigned

Changed 9 years ago by kallisti5

Attachment: 0 added

/dev/power/acpi_battery/0

Changed 9 years ago by kallisti5

Attachment: 1 added

/dev/power/acpi_battery/1

Changed 9 years ago by kallisti5

Attachment: namespace added

/dev/acpi/namespace

Changed 9 years ago by kallisti5

Attachment: syslog added

syslog

Changed 9 years ago by kallisti5

Attachment: screenshot4.png added

battery app

comment:2 Changed 9 years ago by stippi

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 Changed 9 years ago by kallisti5

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 Changed 9 years ago by czeidler

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 Changed 9 years ago by kallisti5

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 Changed 9 years ago by kallisti5

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 Changed 9 years ago by kallisti5

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 Changed 8 years ago by pulkomandy

Milestone: R1/alpha3R1

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

comment:9 Changed 8 years ago by kallisti5

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 Changed 7 years ago by kallisti5

Resolution: fixed
Status: assignedclosed

resolved long ago. Thanks!

Note: See TracTickets for help on using tickets.