[Goodies-dev] [Bug 2814] New: Battery level is not shown when using ACPI on FreeBSD

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Wed Jan 24 21:20:48 CET 2007


DO NOT REPLY TO THIS EMAIL.  Also, do not reply via email to the person
whose email is mentioned below.  To comment on this bug, please visit:
http://bugzilla.xfce.org/show_bug.cgi?id=2814

           Summary: Battery level is not shown when using ACPI on FreeBSD
           Product: Xfce Panel Plugins
           Version: unspecified
          Platform: PC (x86)
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: Medium
         Component: battery
        AssignedTo: goodies-dev at xfce.org
        ReportedBy: emmanuel.viaud at gmail.com


Hello.

I am using XFCE 4.4.0 with version 0.5.0 of the battery panel plug-in on
FreeBSD 6.2 RELEASE on an IBM Thinkpad T43.

Overview :
The level of the battery (either in percent or in the graphical display) stays
at 0 even if the battery is fully loaded.

Steps :
1) load the battery plug-in and check the "display percentage" button

Actual results :
The percentage stays at 0 (and thus an alarm is issued if the AC cord is
unplugged)

Expected results :
Display the correct battery level

More details :
The problem seems to lie in the way the acpi functions from libacpi.c & the
display functions from battery.c interact.

As a matter of fact, in the read_acpi_state function from libacpi.c, the way of
calculating the current state of the battery differs according to the OS :
 - on linux, it uses a formula (line 574) and sets both the percentage and the
rcapacity member of the ACPIstate structure
 - on FreeBSD, it only sets the percentage member

But, in battery.c (from line 340), no distinction is made between the two OS
and the calculation of the charge value is done in both cases using the
rcapacity member (which is still at 0 in the FreeBSD case). Thus, the displayed
value is always 0.

A very quick & (very) dirty proof of concept patch is available on
http://emmanuel.viaud.free.fr/patch_battery_c. It solves the problem on my
computer by actually differentiating between the linux case and the FreeBSD
one. With that patch applied, the correct value (the same as the one read by
using sysctl by hand) is displayed (the time seems to be correct too).

Hope this helps.
Thanks for your work and best regards.


-- 
Configure bugmail: http://bugzilla.xfce.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Goodies-dev mailing list