Your message dated Wed, 30 Jan 2008 19:51:35 +0100
with message-id <[EMAIL PROTECTED]>
and subject line gnome-applets: battstat don't show correct values at startup
on some hardware
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--- Begin Message ---
Package: gnome-applets
Version: 2.8.2-1
Severity: minor
Tags: patch
Battstat on my laptop (Toshiba P20-311) don't show the correct value of the
charge of the battery at startup. I have to wait several minutes to get it.
I've made some test and discoveded that "cat /proc/acpi/battery/BAT1/*"
give the wrong value the first few time.
So I patched battstat_applet.c to get acpiinfo 10 times at startup.
It works for me and don't think would harm others.
-- System Information:
Debian Release: 3.1
APT prefers unstable
APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.10-1-686-smp
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)
Versions of packages gnome-applets depends on:
ii gnome-applets-data 2.8.2-1 Various applets for GNOME 2 panel
ii gnome-panel 2.8.2-2 launcher and docking facility for
ii gstreamer0.8-alsa [g 0.8.7-3 ALSA plugin for GStreamer
ii gstreamer0.8-esd [gs 0.8.7-3 Enlightened Sound Daemon plugin fo
ii gstreamer0.8-oss [gs 0.8.7-3 OSS plugin for GStreamer
ii libapm1 3.2.2-3 Library for interacting with APM d
ii libart-2.0-2 2.3.17-1 Library of functions for 2D graphi
ii libatk1.0-0 1.8.0-4 The ATK accessibility toolkit
ii libbonobo2-0 2.8.1-2 Bonobo CORBA interfaces library
ii libbonoboui2-0 2.8.1-2 The Bonobo UI library
ii libc6 2.3.2.ds1-20 GNU C Library: Shared libraries an
ii libgail-common 1.8.2-1 GNOME Accessibility Implementation
ii libgail17 1.8.2-1 GNOME Accessibility Implementation
ii libgconf2-4 2.8.1-4 GNOME configuration database syste
ii libgcrypt11 1.2.0-11 LGPL Crypto library - runtime libr
ii libglade2-0 1:2.4.2-2 library to load .glade files at ru
ii libglib2.0-0 2.6.3-1 The GLib library of C routines
ii libgnome2-0 2.8.1-2 The GNOME 2 library - runtime file
ii libgnomecanvas2-0 2.8.0-1 A powerful object-oriented display
ii libgnomeui-0 2.8.1-3 The GNOME 2 libraries (User Interf
ii libgnomevfs2-0 2.8.4-2 The GNOME virtual file-system libr
ii libgnutls11 1.0.16-13 GNU TLS library - runtime library
ii libgstreamer-plugins 0.8.7-3 Various GStreamer libraries and li
ii libgstreamer0.8-0 0.8.9-1 Core GStreamer libraries, plugins,
ii libgtk2.0-0 2.6.2-4 The GTK+ graphical user interface
ii libgtop2-2 2.6.0-4 Libraries for gtop system monitori
ii libice6 4.3.0.dfsg.1-12.0.1 Inter-Client Exchange library
ii liborbit2 1:2.10.5-0.1 libraries for ORBit2 - a CORBA ORB
ii libpanel-applet2-0 2.8.2-2 library for GNOME 2 panel applets
ii libpango1.0-0 1.8.1-1 Layout and rendering of internatio
ii libpopt0 1.7-5 lib for parsing cmdline parameters
ii libsm6 4.3.0.dfsg.1-12.0.1 X Window System Session Management
ii libx11-6 4.3.0.dfsg.1-12.0.1 X Window System protocol client li
ii libxklavier8 1.03-1 X Keyboard Extension high-level AP
ii libxml2 2.6.16-3 GNOME XML library
ii xlibs 4.3.0.dfsg.1-12 X Keyboard Extension (XKB) configu
ii zlib1g 1:1.2.2-4 compression library - runtime
-- no debconf information
--
Ciao
Marco Innocenti
diff -r -u gnome-applets-2.8.2.orig/battstat/battstat_applet.c
gnome-applets-2.8.2/battstat/battstat_applet.c
--- gnome-applets-2.8.2.orig/battstat/battstat_applet.c 2005-03-09
20:58:00.302510520 +0100
+++ gnome-applets-2.8.2/battstat/battstat_applet.c 2005-03-09
17:24:47.000000000 +0100
@@ -232,7 +232,7 @@
#ifdef __linux__
struct acpi_info acpiinfo;
-gboolean using_acpi;
+gboolean using_acpi, started_now=TRUE;
int acpi_count;
#endif
@@ -310,6 +310,14 @@
* Updated by David Moore <[EMAIL PROTECTED]> 5/29/2003 to poll less and
* use ACPI events. */
if (using_acpi && acpiinfo.event_fd >= 0) {
+ /* By Marco Innocenti <[EMAIL PROTECTED]> 09/03/2005
+ * Some hardware need several requests to warm up and give correct
results. */
+ if (started_now) {
+ started_now=FALSE;
+ for (acpi_count=1; acpi_count < 10; acpi_count++) {
+ acpi_linux_read(&apminfo, &acpiinfo);
+ }
+ }
if (acpi_count <= 0) {
/* Only call this one out of 30 calls to apm_readinfo() (every 30
seconds)
* since reading the ACPI system takes CPU cycles. */
--- End Message ---
--- Begin Message ---
Version: 2.6.22-1
most likely fixed due to newer acpi,
thanks for report.
--
maks
--- End Message ---