xfce battery indicator is wrong

Bug #181144 reported by BotLobsta
12
Affects Status Importance Assigned to Milestone
xfce4-battery-plugin (Debian)
Fix Released
Unknown
xfce4-battery-plugin (Ubuntu)
Fix Released
Medium
Cody A.W. Somerville

Bug Description

Binary package hint: xfce4-battery-plugin

I am running Xubuntu Hardy on a Dell Latitude D830. Under the new 2.6.24-2-386 kernel, the xfce4-battery-plugin indicator does not work correctly. The power adapter status is correct (whether it is plugged in or not), however the percentage is wrong. Most of the time it says 28%, regardless of how much charge the battery actually has left. If the adapter is plugged in or unplugged, it will show 100% for about a minute before going back to 28%. However, the output of "acpi -b" is always correct. This problem did not occur under 2.6.22-14-386.

Revision history for this message
Jérôme Guelfucci (jerome-guelfucci-deactivatedaccount) wrote :

Thank you for your bug report. I'm marking this as triaged and will forward upstream.

Changed in xfce4-battery-plugin:
importance: Undecided → Low
status: New → Triaged
Changed in xfce:
status: Unknown → Confirmed
Revision history for this message
BotLobsta (kjenks-deactivatedaccount) wrote :

I have been running the 2.6.24-3-386 kernel for a few days now and I have not noticed any problems at all. It seems to be an issue with the 2.6.22-2 kernel for some reason. I will post again if it occurs with any other kernel later on.

Revision history for this message
Jesse Burt (avsa242) wrote :

I was going to chime in when I first saw this bug report, as I have the same problem, but decided not to when I saw the bug had been triaged already. However ;) I confirm this problem on my laptop even with 2.6.24-3-386.

Revision history for this message
Linard Verstraete (linardv) wrote :

I can also confirm this problem on my Xubuntu Hardy Alpha 4 with 2.6.24-5-386.

Revision history for this message
KnuX (hidden-palace) wrote :

Same bug for me on 2.6.24 and xfce from hardy.

Changed in xfce4-battery-plugin:
status: Unknown → New
Changed in xfce4-battery-plugin:
status: New → Confirmed
Revision history for this message
Alfred Rossi (alfredr) wrote :

I think the package just needs rebuilt.

After an apt-get install of the xfce4-battery-plugin and building the unaltered source everything worked fine upon restart of xfce.

I don't have an explanation of what's wrong but I don't think this bug has anything to do with the kernel. /proc/acpi reported correctly while the indicator was held fixed at 28%

For reference I'm using a Toshiba Satellite U305-S7467

Revision history for this message
Alfred Rossi (alfredr) wrote :

Sorry, I meant apt-get install of the xfce4-battery-plugin _source_,

Revision history for this message
Ofer Cohen (oc666) wrote :

Could you tell us how to this install from source?
Thanks.

Revision history for this message
Alfred Rossi (alfredr) wrote :

sudo apt-get build-essential
sudo apt-get build-dep xfce4-battery-plugin
sudo apt-get --compile source xfce4-battery-plugin

this will make a binary .deb that you can then install with:
sudo dpkg -i whatever_your_deb_file_is_called.db

or by browsing to the file, double-clicking, and letting the package manager gui do the work.

Revision history for this message
connyno (c-nothhelfer) wrote :

I'm quite sure that this _is_ a kernel problem. It happens with Gentoo Linux Kernel >=2.6.23 as well as with Ubuntu / Kubuntu Hardy (2.6.24). Gentoo with 2.6.22 and Ubuntu / Kubuntu Gutsy are working fine.

Revision history for this message
Alfred Rossi (alfredr) wrote :

connyno: what do you get when you execute "acpi -b" and "apm"?

Revision history for this message
connyno (c-nothhelfer) wrote :

I forgot to describe my hardware:

MSI Megabook S271

acpi -b
     Battery 1: charging, 0%, 05:20:00 until charged

cat /proc/acpi/battery/BAT1/*
alarm: unsupported
present: yes
design capacity: 35601 mAh
last full capacity: 12302 mAh
battery technology: rechargeable
design voltage: 26169 mV
design capacity warning: 0 mAh
design capacity low: 0 mAh
capacity granularity 1: 1 mAh
capacity granularity 2: 1 mAh
model number: MS-1058

serial number:

battery type: LION

OEM info: MSI Corp.

present: yes
capacity state: ok
charging state: charged
present rate: unknown
remaining capacity: unknown
present voltage: 10000 mV

cat /sys/class/power_supply/BAT1/*
0
12302000
35601000
14000
2304000
cat: /sys/class/power_supply/BAT1/device: Is a directory
MSI Corp.

MS-1058

cat: /sys/class/power_supply/BAT1/power: Is a directory
1
Charging
cat: /sys/class/power_supply/BAT1/subsystem: Is a directory
Unknown
Battery
POWER_SUPPLY_NAME=BAT1
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_STATUS=Charging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Unknown
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=26169000
POWER_SUPPLY_VOLTAGE_NOW=4928000
POWER_SUPPLY_CURRENT_NOW=2304000
POWER_SUPPLY_CHARGE_FULL_DESIGN=35601000
POWER_SUPPLY_CHARGE_FULL=12302000
POWER_SUPPLY_CHARGE_NOW=14000
POWER_SUPPLY_MODEL_NAME=MS-1058
POWER_SUPPLY_MANUFACTURER=MSI Corp.
26169000
4928000

Revision history for this message
Alfred Rossi (alfredr) wrote :

connyno: Was your battery dead when you ran this? If not, I think that your bug is distinct from the one reported here. Yours does really look like a kernel issue. In contrast, we usually see the battery indicator fixed at 28% (as given in the bug description above) while acpi -b prints correct information. The correctness of acpi is what leads me to believe that the bug (as described above) is an issue with xfce4-battery-plugin itself and not a kernel problem.

I think multiple bugs are being reported here.

Revision history for this message
litemotiv (nospam-capstone) wrote :

the indicator is fixed at 0% here (instead of 28%), unplugging the power cable also pops up immediate 'critical' messages.

acpi -b and /proc/acpi/battery/BAT0 output are correct, so it's definitely a battery-plugin issue.

Revision history for this message
connyno (c-nothhelfer) wrote :

Alfred Rossi: My battery is not dead, it is quite good, 3 hours without AC is no problem :-) But I have read some discussions on the net which I do not fully understand. They talk about the change from CONFIG_ACPI_PROCFS_POWER to CONFIG_ACPI_SYSFS_POWER interfaces in the kernel which some userspace programs can not handle. Maybe it has to do with this problem.

Revision history for this message
Lee Garrett (leegarrett) wrote :

I have exactly the same problem here. But what is quite interesting is that with Xubuntu Gutsy the battery plugin worked fine, but after updating to Hardy it showed the symptoms described by the original poster (showing correct info at the beginning, then being stuck at 28%. Right now its showing 0% and has triggered the low and critical battery alarm once.).

But the kernel stayed the same, as I have a custom built kernel 2.6.24.3 .... so by vote is for a package problem, not a kernel problem!

bye,
Lee

Revision history for this message
Lee Garrett (leegarrett) wrote :

I have rebuilt this package for myself, and deleted the 04_use-sysfs in debian/patches/ of the source package. Now it works. So this patch is faulty, as it is hinted in the upstream bug report.

Dear maintainers,
could you upload a package without this patch then? I guess that patch will be fixed sometime, but it isn't urgent as the old interface will be around until vanilla kernel 2.6.26.

Thanks.

--Lee

Revision history for this message
Alfred Rossi (alfredr) wrote :

Lee's fix works for me. In fact explicitly applying only the 04_use-sysfs.patch breaks a working copy.

When I built this before from source I naively ran configure, make, and make install. I didn't realize that by doing that I was bypassing the application of the patches.

This also explains why my instructions to oc666 about rebuilding via "apt-get --compile" failed to produce a working copy with the same source.

So patches/debian/04_use-sysfs.patch is the problem here too.

Changed in xfce4-battery-plugin:
assignee: nobody → cody-somerville
importance: Low → Medium
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xfce4-battery-plugin - 0.5.0-5ubuntu2

---------------
xfce4-battery-plugin (0.5.0-5ubuntu2) hardy; urgency=low

  * debian/patches/04_use-sysfs.patch: Patch removed.
   - RATIONALE:
    . Patch results in breakage on some machines.
    . Legacy interface will still be around until 2.6.26
   - Closes lp: #181144
  * debian/control: Updated maintainer to Xubuntu Developers.

 -- <email address hidden> (Cody A.W. Somerville) Sat, 29 Mar 2008 00:35:24 -0300

Changed in xfce4-battery-plugin:
status: In Progress → Fix Released
Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

This is indeed not fixed:
- the old interface is marked as deprecated so that's not really a long term solution
- the plugin with or without the 04_use-sysfs.patch is still broken for me.

The only (working) long-term fix is to use the new hal based battery-plugin branch when it's released, otherwise there will be the same issue each time the kernel batteries interface changes.

Changed in xfce4-battery-plugin:
status: Fix Released → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xfce4-battery-plugin - 0.5.0-6ubuntu1

---------------
xfce4-battery-plugin (0.5.0-6ubuntu1) hardy; urgency=low

  * Fake-sync (different orig tarballs) with Debian unstable.
  * debian/control:
    - Update maintainer fields.
    - Updated long description to be more user friendly. :)
  * Close lp: #181144

 -- <email address hidden> (Cody A.W. Somerville) Wed, 09 Apr 2008 19:46:37 -0300

Changed in xfce4-battery-plugin:
status: Triaged → Fix Released
Changed in xfce4-battery-plugin:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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