Bug 75946 - logout, if notbook is unplugged
Summary: logout, if notbook is unplugged
Status: RESOLVED INTENTIONAL
Alias: None
Product: klaptopdaemon
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Paul Campbell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-23 22:52 UTC by Thomas Vogt
Modified: 2009-12-25 15:08 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Vogt 2004-02-23 22:52:27 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    Debian testing/unstable Packages
OS:          Linux

If the Notebook is unplugged ( in Accu-Mode ) KDE logout. 

If the klaptopdaemon is removed, KDE doesnt logout and works fine.
Gnome 2.4 works fine , also the Notebook is plugged in on KDE.
Comment 1 Paul Campbell 2004-02-23 23:01:22 UTC
looks like you might have the 'log me out' option set for one of the 'battery low' or 'battery critical' panels and your system's power system glitches it's power state (battery reading) during the unplugging process - could you please give me some information about what sort of laptop it is, is it ACPI or APM etc etc - possible cat/tar up the contents of /proc/acpi/battery/... just after the battery's been removed - thanks Paul
Comment 2 Thomas Vogt 2004-02-23 23:34:02 UTC
Hi Paul,

the option 'log me out' is unset, and other options to.

At KDE 3.1.5 works it fine.

Its an Toshiba Satellite 3000-601 with ACPI and Kernel 2.4.25.

Kind regards

Thomas
Comment 3 bugs.kde.org 2004-03-08 21:38:35 UTC
Same symptoms here on my Acer TM 630 with KDE 3.2. KDE 3.1 works fine. No triggers are set in klaptop and no acpi helpers are running.

As soon as I disconnect from the power cord and klaptop notices that, the KDE window manager is shut down. Note: only the WM is shut down and X exits; there is no system shutdown.

plugged:
oglueck@gimli ~ $ cat /proc/acpi/battery/BAT0/state
present:                 yes
capacity state:          ok
charging state:          charging
present rate:            unknown
remaining capacity:      0 mAh
present voltage:         14800 mV

unplugged:
oglueck@gimli ~ $ cat /proc/acpi/battery/BAT0/state
present:                 yes
capacity state:          critical
charging state:          discharging
present rate:            unknown
remaining capacity:      0 mAh
present voltage:         14800 mV

The "remaining capacity" does not work with kernel >2.6.0. "present rate" does not work on this laptop at all (hard coded in ACPI DSDT).
Comment 4 Paul Campbell 2004-03-10 19:26:54 UTC
I fixed a bug yesterday (didn't make it to 3.2.1 sorry) that caused the laptopdaemon to crash (it might cause your symptoms) - a quick work around is to check the laptop control panel and make sure all 3 icons are set, if any are empty click on them to select real icons - if that's true and setting the icons fixes the problem please drop a note here
Comment 5 bugs.kde.org 2004-03-11 08:44:57 UTC
I can confirm that all 3 icons are set properly. So I assume I should not be seeing the bug you just fixed.
Comment 6 Bernd Wurst 2004-04-04 22:05:34 UTC
I can also confirm this bug on two machines, a Acer TM630 and a Acer TM800 with KDE 3.2.1.

Both of them showed this symptom but both of them don't do that reproducable.
Sometimes if klaptop "thinks" the battery power is running out (it does it without a reason sometimes), it shuts down KDE. It is a clean logout, the session contents are saved and restored on restart.

I don't know why klaptop sometimes thinks the battery is running out, it occures most times I disconnect the external power supply. But sometimes it just prints out a warning and sometimes KDE is shut down, it's really strange.
Both machines have a fully working ACPI with Linux 2.6, I can see everything I expect in /proc/acpi/battery... The status bar of klaptop does also show the right percentages.

All actions in klaptop are set to "Do nothing" for low and critical battery and klaptop_acpi_helper is not started.
Comment 7 Reza Jelveh 2004-05-18 13:24:57 UTC
hi im having the some behaviour on my acer aspire 1200.
also i dont have any triggers enabled. 

kernel 2.4.24
would be nice if someone fixed this bug sometime :)
regards
Comment 8 Adrian Holovaty 2004-05-21 03:53:58 UTC
I have the same problem on my Toshiba Satellite 1905-S303 laptop. I had the problem when I ran Fedora Core 1 (kernel 2.4.x and upgrade to KDE 3.2.0), and I continue having the problem in Fedora Core 2 (kernel 2.6.5-1.358 and KDE 3.2.2).

To recap: When klaptop is running and I unplug my laptop, KDE crashes after about 10 seconds. This is pretty critical, IMHO, as I've stopped using klaptop completely because of it.

Let me know what information to provide to help solve the problem.
Comment 9 Adrian Holovaty 2004-05-21 03:54:35 UTC
*** This bug has been confirmed by popular vote. ***
Comment 10 Antonios Christofides 2004-05-30 20:49:12 UTC
Except for the symptoms already mentioned, which I also have on an Acer Aspire 1400, if I login with the power unplugged, after a few seconds it logs me out. I try again, it logs me out. Usually on the third or fourth try I stay in.

I believe that there is a problem with the "remaining time" estimation. When you unplug it, or when you login while it is unplugged, it can't yet estimate remaining time, because it hasn't had the chance to know how fast the battery is draining. Somehow it makes the wrong decision that zero time remains. So there may be two bugs here; one is that wrong decision, and another is that it logs out despite the relevant options being off.
Comment 11 Jens Nachtigall 2004-06-04 23:30:55 UTC
Got the same problem here: Fujitsu Siemens Amilo M 7400 (centrino). This seems to
to a very common bug:
http://lists.debian.org/debian-laptop/2004/06/msg00014.html

I am running klaptopdaemon  (3.2.2) and a debian packaged 2.6.6 kernel.

The problem might be the miscalculation of the remaining time, which is calculated at 15:00 or 16:00 or even 00:00 when unplugged. The percentage is always OK. The workaround to prevent Klaptop to finish your session is to set "System State Change" to "None" in the  "Low Battery Warning" and also in the "Low Battery Critical" tab. However, this alone is not enough. Klaptop still finished my session about 10sec after I unplugged the cord. I had to enable all of the options in "ACPI Config" ("Enable Standby" etc.). I saved them and then I could even disable the options again. I did not finish the session any more. KLaptop still reports a wrong "Battery power is running out!", but does not finish the session any more.

Strange thing is, that the calculation for the remaining time is always OK on my most often used user account. However, I also don't get *any* notification about very low battery power there, although I have "Notify" enabled. So the laptop simply powers off here.

Strange bug, let me know if you need any more information.
Comment 12 Jens Nachtigall 2004-06-04 23:31:50 UTC
Got the same problem here: Fujitsu Siemens Amilo M 7400 (centrino). This seems to
to a very common bug:
http://lists.debian.org/debian-laptop/2004/06/msg00014.html

I am running klaptopdaemon  (3.2.2) and a debian packaged 2.6.6 kernel.

The problem might be the miscalculation of the remaining time, which is calculated at 15:00 or 16:00 or even 00:00 when unplugged. The percentage is always OK. The workaround to prevent Klaptop to finish your session is to set "System State Change" to "None" in the  "Low Battery Warning" and also in the "Low Battery Critical" tab. However, this alone is not enough. Klaptop still finished my session about 10sec after I unplugged the cord. I had to enable all of the options in "ACPI Config" ("Enable Standby" etc.). I saved them and then I could even disable the options again. I did not finish the session any more. KLaptop still reports a wrong "Battery power is running out!", but does not finish the session any more.

Strange thing is, that the calculation for the remaining time is always OK on my most often used user account. However, I also don't get *any* notification about very low battery power there, although I have "Notify" enabled. So the laptop simply powers off here.

Strange bug, let me know if you need any more information.
Comment 13 Jens Nachtigall 2004-06-04 23:41:25 UTC
There are other bug reports which sound very similar to our problem:
http://bugs.kde.org/show_bug.cgi?id=76961
http://bugs.kde.org/show_bug.cgi?id=81403
Comment 14 Jens Nachtigall 2004-06-04 23:45:45 UTC
This looks like anoter duplicate of the bug (on FreeBSD):
http://bugs.kde.org/show_bug.cgi?id=76715
Comment 15 Gary Smith 2004-06-14 13:28:52 UTC
I am running Fedora Core 2 on a Fujitsu Siemens Amilo M7400 with a 2.6.5 kernel.  
Comment #3 suggests that remaining capacity doesn't work on a 2.6.0+ kernel, but it seems to work fine on the Fedora stock kernel on this machine.

cat /proc/acpi/battery/BAT0/state
present: yes
charging state: discharging
present rate: unknown
remaining capacity: 2680 mAh
present voltage: 14800 mV

I have just removed klaptop and replaced with a cronned shellscript for now.
Comment 16 bugs.kde.org 2004-06-14 13:43:09 UTC
Gary,

You got me wrong, I'm afraid.
The 'remaining capacity' is computed from the ACPI DSDT code. That code resides in your BIOS Chip and is read and interpreted by the kernel's ACPI engine. 2.6 kernels *can* execute that code. However on certain laptop models (like my Acer TM630) those values are just hard coded in the DSDT and thus not read from the hardware. It's not the kernel's fault, but the manufacturer's.
Comment 17 Gary Smith 2004-06-14 13:49:45 UTC
Thanks Ortwin, apologies I picked this up incorrectly.

_____________________________________________________________
Linux.Net -->Open Source to everyone
Powered by Linare Corporation
http://www.linare.com/

Comment 18 richlv 2004-06-17 08:35:32 UTC
and again - probably the same problem.
fujitsu-siemens lifebook c-1020, different 2.6.* kernel versions

short history :
kde 3.2.0 - symptoms exactly like described, logging in with ac removed results in almost immediate logout, removing ac from logged in - also logout. when ac is just removed and screen blanked klaptop icon (battery) is shown in upper left corner - with 0%
3.2.2 - problem doesn't appear for me, although some persons that were using this laptop reported it.
3.2.3 - i saw what they were talking about. this time logging out is pretty random - and it happens even with ac plugged in.

all activities upon low/empty battery are disabled, all icons are shown ok.

/proc/acpi/battery/BAT0/state

present:                 yes
capacity state:          ok
charging state:          unknown
present rate:            unknown
remaining capacity:      36194 mWh
present voltage:         9600 mV

present:                 yes
capacity state:          ok
charging state:          discharging
present rate:            unknown
remaining capacity:      36194 mWh
present voltage:         9600 mV

although it seems that unability to show state as "charging" when plugged in is either hw either kernel bug, klaptop should never just close everything, especially if all actions at low power levels are disabled
Comment 19 richlv 2004-06-21 08:32:06 UTC
actually it seems that this time it was not a kde problem :)

syslog :

Jun 20 14:18:16 is kernel: mtrr: 0x90000000,0x1000000 overlaps existing 0x90000000,0x800000
Jun 20 18:23:12 is kdm[1019]: X server for display :0 terminated unexpectedly

message was repeated, probably for every time x crashed. ranges are the same in all messages. this was with 2.6.4, upgraded to 2.6.6 (this one has problems with acpi-irq...), haven't seen this again for a day.
Comment 20 Chris Ford 2004-07-12 11:56:51 UTC
I've had the "Warning Battery is Running Out: You have 0 min. remaining" message since I can remember in all versions of kde.  Once one of he kde devs posted a patch found here.
http://bugs.kde.org/show_bug.cgi?id=62297 

However, it no longer works for the newer versions of kde 3.2.2.  The patch basically changed the way that the remaining time was calculated, hence if that was corrected then there would be no auto logout problem.

Is there anyway that this alternate method could be hard coded in kdelaptop?  Maybe give us poor ppl with the buggy laptops a break?  Maybe have an alternate time calculation option to check in the Power Config in Control Center.

Thanks

Chris
Comment 21 arne anka 2004-07-14 14:39:30 UTC
nothing else to say than: experienced the same behaviour with an acer aspire 1315, debian/testing kde 3.2.2, kernel 2.4.26. plugging in an usb-stick _before_ login produces repeatedly logouts despite of disabling the relevant options.
deinstalling klaptopdaemon solved the problem.
remaining time is not computed but always 00:00 (obviously a known problem too) -- maybe klaptopdaemon could do some calculating on it's own utilizing /proc/acpi/?
Comment 22 Marc 2004-08-04 19:43:58 UTC
In case additional info helps:

- Same problem on a Compal CL56 (which is sold under various brands, in my case, a Hypersonic CX5 <http://www.hypersonic-pc.com/CX5/index.asp>
- Fedora Core 2, most KDE packages are at 3.2.2, including kdebase, addons, toys, and utils
- Kernel version 2.6.7 compiled from kernel.org sources, APM and ACPI enabled
- In order to run KDE on battery, I disabled klaptop
- With klaptop disabled, the Laptop Battery panel of the Control Center reports the correct battery charge percentage when on battery (it might do the same with klaptop enabled, but I can't get my machine to stay in KDE long enough to know :-)
- gkrellm and akpi work fine, even on battery
- Gnome's battery charge applet works fine too (in Gnome), even on battery
- In googling for a solution, I came across this web page <http://www.odi.ch/prog/tm630/gentoo.php>, which claims that the klaptop problem can be solved with the kernel patch attached to this bug <http://bugzilla.kernel.org/show_bug.cgi?id=2109>.  (I haven't tried it for lack of time, technical knowledge, and that I'm running on a production machine that I don't want to mess around with); maybe this will help determine the cause of the problem in klaptop
Comment 23 Marc 2004-08-05 07:36:34 UTC
An update on my comment (#22):

> In googling for a solution, I came across this web page
> <http://www.odi.ch/prog/tm630/gentoo.php>, which claims that the klaptop
> problem can be solved with the kernel patch attached to this bug
> <http://bugzilla.kernel.org/show_bug.cgi?id=2109>. 

I applied the patch mentioned in the kernel bugzilla page (comment #6) and recompiled my kernel.  Klaptop still gives me poor estimates of remaining battery time at first, but it does NOT automatically kick me out of KDE anymore.  This makes it useable again!  I hope this helps track down the cause of the bug...and provides people a workaround until the bug is fixed.

Marc
Comment 24 ieure 2004-09-17 22:38:36 UTC
Just thought I'd chime in and say that i do /not/ have this problem.

Dell Inspiron 8100 w/ A15 BIOS
Linux 2.6.8-2-686 (stock Debian sarge kernel)
KDE 3.3.0 (Debian sid packages)
Comment 25 bugs.kde.org 2005-01-09 23:25:52 UTC
works for me with KDE 3.3.1 now. Has not shown up for ages now and my battery is now broken and remains removed :-)
Comment 26 Anders Pettersson 2005-06-28 23:02:56 UTC
Hi
Ive got a F-S Amilo M3438G. I've got the same error, KDE logs out and X restarts. Then I did the same as above, activated all ACPI sleep... options in KLaptop. Since then, it works properly.

However, it is quite annoying to have a battery status indicator that is totally useless. The battery monitor reports almost random values, it can even report that the laptop is plugged in, when it is not. Sometimes it seems to indicate correct though. 
If I use acpitool or read the /proc/acpi/battery/BAT0/[state,info] files, the acpi part seems to work ok. Where does the KLaptop get its information and why isn't it reliable.
I would really like to see a new battery monitor, since it seems that it is the readout that fails.

Anyone agree?
Comment 27 Emmanuel 2005-07-25 00:38:52 UTC
same bug on mandriva 2005 UNDER KDE 3.4 
error of calculation of klaptop (?)
http://qa.mandriva.com/show_bug.cgi?id=16544
Comment 28 Dirk Mueller 2008-08-19 08:38:51 UTC
klaptopdaemon has been dropped from KDE 4.x