Bug 76715 - klaptop gets confused by some ACPI/APM implementations
Summary: klaptop gets confused by some ACPI/APM implementations
Alias: None
Product: klaptopdaemon
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: FreeBSD Ports FreeBSD
: NOR normal
Target Milestone: ---
Assignee: Paul Campbell
Depends on:
Reported: 2004-03-04 08:12 UTC by Daniel O'Connor
Modified: 2009-12-25 15:09 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Daniel O'Connor 2004-03-04 08:12:11 UTC
Version:           1.4 (using KDE KDE 3.2.0)
Installed from:    FreeBSD Ports
OS:          FreeBSD

Arguably this is a bug in my laptop's ACPI implementation but...

When the power is pulled APM reports the ERT (est run time) as 0sec on a 100% full battery :(
After 10 seconds or so it presumably has enough data on load and battery voltage to produce a more realistic estimate, but unfortunately this means I can use klaptop's shutdown feature otherwise my laptop gets powered off when I unplug AC :)

I attempted to work around this myself by hacking the portable.cpp file to report -1 as the ERT if the battery percentage is >10% and the ETR is exactly 0 but it doesn't appear to work, and I can't for the life of me get any debugging happening!

I am more than happy to fiddle with it myself to get it working but I can't actually get any debug output :(

I have tried kdDebug() but the output doesn't go anywhere, both cout and printf() only work for status requests done by the control panel applet, not the dock item (so it seems anyway). Does anyone have any hints?
Comment 1 Paul Campbell 2004-03-04 19:20:03 UTC
there's a bunch of related bugs, this description really helps. You don't say what sort of laptop you are using? (Toshibas seem to have problems at the moment) - there is no longer a klaptopdaemon thread/process, it runs inside of kded, you might look inside your ~/.xsession-errors for trace output
Comment 2 Daniel O'Connor 2004-03-05 03:28:47 UTC
Oops sorry, it's a Dell Inspiron 8600 running FreeBSD 5-CURRENT, I use ACPI not APM but the ACPI code provides a compatible interface.

I did look in .xsession-errors (my first guess 8-) but I couldn't see anything :(

I also tried fopen()ing (with append) a logfile, but the only appends I see to it are when I have the control panel applet open, so I came to the conclusion that even if I am fiddling with the right code (/tmp/work/usr/ports/misc/kdeutils3/work/kdeutils-3.2.0/klaptopdaemon/portable.cpp) it's either not getting installed properly, or isn't being reloaded properly.
Comment 3 Paul Campbell 2004-03-05 19:29:34 UTC
hmmm - portable.cpp is linked into both the daemon that's run under kded (and does the heavy lifting) and the control panel - you often need to log out and log in again to get the kded daemon to get reloaded (I know it makes development a pain, but the result is much more lightweight).

I must admit I don't know much about the BSD side, someone else did that part of portable.cpp - probably your glitch is different from the ones I'm seeing from other people in the Linux space - I bet that you need to do some filtering in the APM interface code to ignore the first sample or two from the kernel after the power goes away (there's probably a layer of filtering in the kernel that's returning 0 untill it gets a few samples of the battery state) 
Comment 4 Martin Eitzenberger 2004-03-22 11:53:45 UTC
I've the same problem on an Acer Aspire 1307LC (VT8363/8365 [KT133/KM133]) with Debian Unstable (KDE 3.2.1) with Linux 2.6.4 Vanillia (but i had this problem before with KDE 3.1.5 under Linux 2.5.x since the new ACPI Implementation in Linux)

When I unplug the cable under 3.2, KDE is logging out imediatly :-) ... I have to exit klaptop to prevent it... The Remaining time is wrong too, as reportet above.
Comment 5 Marek Wawrzyczny 2005-05-19 03:52:30 UTC
I have slightly different problem. Occasionally (not sure under what circumstances) KLaptop reports 0% battery level and shuts down the system. This happens while the laptop is plugged into AC, the icon actually shows the AC icon (not battery) when this happens. The laptop lights also show AC plugged in and battery at full level. 
It appears to happen more often when I use a PCMCIA Prism wireless card (but not always).
There is nothing in the kernel or ACPI logs that suggests anything amiss.

The laptop is Toshiba Tecra S1. 
(Gentoo - self compiled) Linux 2.6.11 and 2.6.12-rc1 to rc4.
KDE 3.4.0 - up-to-date with latest patches (Gentoo style).
Comment 6 Marek Wawrzyczny 2005-05-23 09:12:44 UTC
I think I might have solved it for my case (0% battery charge notifications even with AC plugged in). I had the laptop running for around 7 hours now without false notifications.

I noticed that /proc/acpi/event only had user (root) read permissions, adding read permissions for all users seems to have stabilized KLaptop for me... I also chmoded /proc/acpi/dsdt and /proc/acpi/fadt, just in case.
Comment 7 Dirk Mueller 2008-08-19 08:38:46 UTC
klaptopdaemon has been dropped from KDE 4.x