|Summary:||Battery monitor does not indicate remaining battery time|
|Component:||widget-battery||Assignee:||Plasma Bugs List <plasma-bugs>|
|Severity:||normal||CC:||alejandro_aero, andrej.mernik, annma, aspotashev, kde, kdebugs, lamarque, m2k.networx, rjwilmsi, ukyoi, volkangezer|
|Latest Commit:||http://commits.kde.org/plasma-workspace/fc3da7a59effbacbd1c21af5d011a8354040b1ca||Version Fixed In:||5.0|
Snapshots of recent updates and desktop with battery monitor displayed
KDE 4.8 battery applet on click
Snapshot on the applet
Plasma engine screenshot
plasma_engine_powermanagement.so with extra debug messages
Description ttom 2012-01-04 10:00:51 UTC
Comment 1 Anne-Marie Mahfouf 2012-01-04 10:19:57 UTC
Please explain better. IN KDE 4.8 when I click on the battery applet it indicates Remaining time (if AC is not plugged).
Comment 2 Anne-Marie Mahfouf 2012-01-04 10:23:07 UTC
Exact string is "Time Remaining:"
Comment 3 ttom 2012-01-04 10:30:37 UTC
Created attachment 67442 [details] Snapshots of recent updates and desktop with battery monitor displayed
Comment 4 ttom 2012-01-04 10:36:51 UTC
(In reply to comment #1) > Please explain better. IN KDE 4.8 when I click on the battery applet it > indicates Remaining time (if AC is not plugged). I am under KDE 4.7.3 and when I click on the applet it indicates : "Battery: XX% (discharging) -AC adapter: Not plugged in." Please have a look at my pdf attachment on page #8.
Comment 5 Anne-Marie Mahfouf 2012-01-04 12:06:26 UTC
Created attachment 67452 [details] KDE 4.8 battery applet on click Time Remaining is present
Comment 6 ttom 2012-01-04 12:30:17 UTC
Created attachment 67453 [details] Snapshot on the applet Time remaining not present any more when clicking on the applet (KDE 4.7.3)
Comment 7 Anne-Marie Mahfouf 2012-01-04 12:38:17 UTC
What was your previous KDE version where it works? (before your update) As I showed on the screenshot, it works on4.8 RC2.
Comment 8 ttom 2012-01-04 13:25:55 UTC
(In reply to comment #7) > What was your previous KDE version where it works? (before your update) > As I showed on the screenshot, it works on4.8 RC2. I suppose the problem occurred when I updated my system to KDE 4.7.3. but I have no certainty as I noticed it only today. As shown on the first attachment, the update I am thinking of was performed on 22nd December 2011. I presume the previous version where it worked was the 4.7.2. Is the version you are talking about already available for the Kubuntu 11.10 distribution?
Comment 9 Anne-Marie Mahfouf 2012-01-04 13:44:45 UTC
So actually you mean in the tooltip? Not when you click on the applet? The tooltip appears on mouve over the applet, no click involved. A tooltip is a short information only.
Comment 10 ttom 2012-01-04 14:13:34 UTC
(In reply to comment #9) > So actually you mean in the tooltip? Not when you click on the applet? The > tooltip appears on mouve over the applet, no click involved. A tooltip is a > short information only. The information is missing when I do click on the applet as shown in attachment #3 [details] (Snapshot on the applet) in which you will notice the difference between our two screenshots. It has never been present in the tooltip.
Comment 11 Anne-Marie Mahfouf 2012-01-05 14:28:28 UTC
Ah I did not notice it was my screenshot besides yours... Well it works for me as you can see and I can't say much more except that maybe your upgrade misses something. Try asking your distribution forum. What's your distribution so I can ask around if it works for other people?
Comment 12 ttom 2012-01-05 17:55:45 UTC
(In reply to comment #11) > Ah I did not notice it was my screenshot besides yours... > > Well it works for me as you can see and I can't say much more except that maybe > your upgrade misses something. Try asking your distribution forum. What's your > distribution so I can ask around if it works for other people? Ok... I run Kubuntu 11.10 Oneiric Ocelot. I will wait until the next KDE upgrade is available for it, maybe it will fix the problem. I want to thank you anyway for your time and help. It has been only a few months I changed over from Windows to Linux and I had to use the KDE bug report twice with an outstanding support from your side at KDE !
Comment 13 Lamarque V. Souza 2012-01-05 21:40:10 UTC
Other KDE developers decided years ago that remaining time was useless and default to no remaining time on the battery widget. You have to edit ~/.kde/share/config/plasma-desktop-appletsrc to configure the battery widget to show the remaining time, there is not graphical tool for that (also decided by the other developers). Unfortunately the configuration I used to use stopped working in 4.5 or so, I thought someone had completely removed the support for showing the remaining time. I will try to make it work here. And before anyone start to complain I was one of those that tried to convince the others that remaining time is usefull.
Comment 14 Lamarque V. Souza 2012-01-05 23:09:28 UTC
To activate the remaining time setting do the following: activate the "Show the state for each battery present" option in the battery plasmoid, click on the "Ok" button and then edit ~/.kde/share/config/plasma-desktop-appletsrc. Search for the string showMultipleBatteries and add the line below after that line: showRemainingTime=true now you need to restart kded4 or logout and login. Here the plasmoid take some time to start showing the remaining time. I looked at the source code and the string for remaining time is hidden if the value is zero and the value is set to zero initially, it is changed only when the battery changes to the charging or discharging state. I think PowerDevil or UPower is being a bit slow to detect the battery changed state.
Comment 15 ttom 2012-01-06 15:18:48 UTC
(In reply to comment #14) > To activate the remaining time setting do the following: activate the "Show the > state for each battery present" option in the battery plasmoid, click on the > "Ok" button and then edit ~/.kde/share/config/plasma-desktop-appletsrc. Search > for the string showMultipleBatteries and add the line below after that line: > > showRemainingTime=true > > now you need to restart kded4 or logout and login. > > Here the plasmoid take some time to start showing the remaining time. I looked > at the source code and the string for remaining time is hidden if the value is > zero and the value is set to zero initially, it is changed only when the > battery changes to the charging or discharging state. I think PowerDevil or > UPower is being a bit slow to detect the battery changed state. Great ! This tip seems to be a good step towards a solution... Forgive me but I am a fresh and new Linux user and so, a lovely ignorant in command lines... Could you tell if I have to copy/paste the line into the Terminal or should I go through a different way. I already tried to copy and run the command as you wrote it: "~/.kde/share/config/plasma-desktop-appletsrc" with no success as I got this result: "thomas@thomas-Inspiron-2200:~$ ~/.kde/share/config/plasma-desktop-appletsrc bash: /home/thomas/.kde/share/config/plasma-desktop-appletsrc: Permission denied"...
Comment 16 Lamarque V. Souza 2012-01-06 15:29:30 UTC
Copy the file ~/.kde/share/config/plasma-desktop-appletsrc to a temporary place (your home directory for examplo). You can use this command for that: cp ~/.kde/share/config/plasma-desktop-appletsrc ~/ Use the command below to edit the file: kwrite ~/plasma-desktop-appletsrc Then go to the menu option "Edit" -> "Find", type showMultipleBatteries. After the line found type: showRemainingTime=true The end result should look like this: [Containments][Applets][Configuration][Applets][Configuration] Share=false showBatteryString=false showMultipleBatteries=true showRemainingTime=true Then copy the file to the original location: cp -f ~/plasma-desktop-appletsrc ~/.kde/share/config/plasma-desktop-appletsrc
Comment 17 ttom 2012-01-06 15:58:50 UTC
Created attachment 67515 [details] Screenshot I followed your indications. All went well, I restarted my system but no change happened whereas the plasma-dektop-appletsrc file contains the lines I added. I attached a screenshot of how my file looks and the applet itself which is unchanged...
Comment 18 Lamarque V. Souza 2012-01-06 17:03:15 UTC
Have checked if the string showMultipleBatteries appear ony once in plasma-desktop-appletsrc? It is possible it can appear more than once and you edited the wrong place. If it appears only once then probably the battery data engine is not updating the remaining, in that case the plasmoid will hide the "Time remaining: " line as I said in comment #14. You can test the battery data engine using plasmaengineexplorer. Launch it and select powermanagement in the "Data engines" combo box, then expand the "Battery" entry, and check the value of "Remaining msec", if it is zero then that explains why the "Time remaining: " does not appear. Send me the outpout of the command below when the problem happens: upower --dump If upower reports the correct time remaining then there is a problem in the battery data engine or it is being very slow to update the battery's status. Can you wait a couple of minutes, launch plasmaengineexplorer as I described above and check the "Remaining msec" value again?
Comment 19 ttom 2012-01-06 17:22:19 UTC
Created attachment 67517 [details] Plasma engine screenshot This is what I get when I run the plasma engine. As you can see, there is no such "Remaining msec" as expected... And here is the result of the updevil dump : thomas@thomas-Inspiron-2200:~$ upower --dump Device: /org/freedesktop/UPower/devices/line_power_AC native-path: /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/AC power supply: yes updated: Fri Jan 6 17:32:34 2012 (2550 seconds ago) has history: no has statistics: no line-power online: no Device: /org/freedesktop/UPower/devices/battery_BAT0 native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 vendor: Sanyo model: DELL54DSN serial: 61 power supply: yes updated: Fri Jan 6 18:14:43 2012 (21 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: discharging energy: 44.8884 Wh energy-empty: 0 Wh energy-full: 71.7948 Wh energy-full-design: 65.12 Wh energy-rate: 17.1236 W voltage: 14.993 V time to empty: 2.6 hours percentage: 62.5232% capacity: 100% technology: lithium-ion History (charge): 1325870083 62.523 discharging 1325870053 62.729 discharging 1325870023 62.935 discharging 1325869993 63.100 discharging History (rate): 1325870083 17.124 discharging 1325870053 18.234 discharging 1325870023 17.124 discharging 1325869993 22.703 discharging Daemon: daemon-version: 0.9.13 can-suspend: yes can-hibernate yes on-battery: yes on-low-battery: no lid-is-closed: no lid-is-present: yes is-docked: no
Comment 20 Lamarque V. Souza 2012-01-06 17:52:29 UTC
There is something wrong in the powermanagement dataengine then.
Comment 21 ttom 2012-01-06 18:34:15 UTC
(In reply to comment #20) > There is something wrong in the powermanagement dataengine then. Am I able to change something about it as a user?
Comment 22 Lamarque V. Souza 2012-01-06 18:53:50 UTC
probably not. My battery plasmoid is working now, it shows the remaining time right after I disconnect from power, both for my notebook's battery and UPS. I have no ideia what could be causing this problem yet. Let's try a radical test (restart the desktop). Execute: kill plasma-desktop then press Alt+F2, type plasma-desktop, press ENTER, then check if it shows the remaining time.
Comment 23 ttom 2012-01-06 19:05:45 UTC
Well, this did not succeed either... As you can imagine I can not think of any other solution at my level. Can I count on this bug being followed at KDE in order to see if others experience the same situation? And by the way, is it naive to believe that a coming KDE update for Kubuntu 11.10 will reset the prior situation in which I had the time remaining indicated in the plasmoid?
Comment 24 Lamarque V. Souza 2012-01-06 21:19:50 UTC
(In reply to comment #23) > Well, this did not succeed either... As you can imagine I can not think of any > other solution at my level. It was just a test, which showed something really wierd in your computer. I wanted to test if the problem happens only when the plasmoid receive events from upower or also when the plasmoid retrieves the battery status, which is what it does during initialization (like in the test). Since it also did not show the remaining time then retrieving battery's remaining time is not working. That is strange because 'upower --dump' shows the remaining time. > Can I count on this bug being followed at KDE in order to see if others > experience the same situation? What do you mean? > And by the way, is it naive to believe that a coming KDE update for Kubuntu > 11.10 will reset the prior situation in which I had the time remaining > indicated in the plasmoid? I do not think anybody at Kubuntu will try to solve this problem :-/
Comment 25 Lamarque V. Souza 2012-01-07 05:18:44 UTC
Another test: send me the output of the command when on battery: qdbus org.kde.Solid.PowerManagement \ /org/kde/Solid/PowerManagement \ org.kde.Solid.PowerManagement.batteryRemainingTime
Comment 26 ttom 2012-01-07 11:04:34 UTC
(In reply to comment #25) > Another test: send me the output of the command when on battery: > > qdbus org.kde.Solid.PowerManagement \ > /org/kde/Solid/PowerManagement \ > org.kde.Solid.PowerManagement.batteryRemainingTime Here is what I get: thomas@thomas-Inspiron-2200:~$ qdbus org.kde.Solid.PowerManagement \ > /org/kde/Solid/PowerManagement \ > org.kde.Solid.PowerManagement.batteryRemainingTime 0
Comment 27 Lamarque V. Souza 2012-01-07 15:33:55 UTC
Ok, so the upower backend is not working properly since it is reporting zero instead of the real value. We are getting closer to where the problem is. Just to make sure, you do not have hal installed, right? Hal is the older backend Solid used to use to manage batteries. I just want to make sure you do not have both hal and upower installed since they can conflict with each other. I do not know which name Kubuntu uses for the hal package, you probably can use the usual Kubuntu upgrade software to search for the string "hal" and see what it returns. If it returns nothing then it is Ok.
Comment 28 Lamarque V. Souza 2012-01-07 18:00:51 UTC
Created attachment 67549 [details] plasma_engine_powermanagement.so with extra debug messages I guess your Kubuntu is compiled for 64-bit, right? If so I want you to test the attached plasma_engine_powermanagement.so. It will print some extra debug messages that can help me figure out why the remainig time does not work in yor system. Do the following as root, you can use 'sudo su' command to become root: . locate your current plasma_engine_powermanagement.so. You can do that using the following command: OLD_ENGINE=$(kde4-config --path lib --locate \ kde4/plasma_engine_powermanagement.so) . backup your current plasma_engine_powermanagement.so: cp $OLD_ENGINE /root . install the attached file: cp -f plasma_engine_powermanagement.so $OLD_ENGINE The following steps you can do as a normal user (not root): . run kdebugdialog, search for the string "solid-powermanagement". Check the checkbox that appear. Search now for the string "plasmaengineexplorer", check it and click on Ok button. . run plasmaengineexplorer like this: plasmaengineexplorer &> log.txt . in plasmaenginexplorer select the "powermanagement" data engine, close plasmaengineexplorer and send me the file log.txt.
Comment 29 ttom 2012-01-07 18:11:26 UTC
(In reply to comment #28) I run a 32bit version, will it work however?
Comment 30 Lamarque V. Souza 2012-01-07 18:21:10 UTC
(In reply to comment #29) > (In reply to comment #28) > > I run a 32bit version, will it work however? No, it will not :-(
Comment 31 ttom 2012-01-07 18:53:30 UTC
(In reply to comment #30) Never mind... I will get used to it I guess. Thank you for you time and help! It's been only a few months joined the Linux community; I would have waited a big deal more than that to get such help from Microsoft...
Comment 32 Lamarque V. Souza 2012-01-08 02:50:59 UTC
I think I may have found the cause of this problem. The explanation is technical, there is no other way to explain it. The type qulonglong is used to store the remaining time, but it looks like it is being typedef'ed to int instead of 'unsigned long long'. Because of this mismatch the dbus calls and signals are not working. I will add some debug messages to the powermanagementengine to warn people when the calls do not work.
Comment 33 Lamarque V. Souza 2012-01-08 02:56:37 UTC
Git commit 23a67ef1ef81b75ba6e427f31920cf30a366e665 by Lamarque V. Souza. Committed on 08/01/2012 at 03:54. Pushed by lvsouza into branch 'KDE/4.8'. Print DBus error message if battery remaining time call fails. (cherry picked from commit 9d7caa1f620c2b6af2ed8951738bc43bf3fe6341) M +3 -1 plasma/generic/dataengines/powermanagement/powermanagementengine.cpp http://commits.kde.org/kde-workspace/23a67ef1ef81b75ba6e427f31920cf30a366e665
Comment 34 Lamarque V. Souza 2012-01-08 02:57:47 UTC
When the error happens this message will appear in the log: "Unexpected reply signature: got "t", expected "i"" t means 'unsigned long long' i means int
Comment 35 ttom 2012-01-08 11:20:07 UTC
(In reply to comment #34) Ok, what do you want me to do with this?
Comment 36 Lamarque V. Souza 2012-01-08 17:20:34 UTC
Upgrade to the latest commit in KDE/4.8 branch, test using plasmaengineexplorer and see if any error messages is printed in method PowermanagementEngine::batteryRemainingTimeReply. If you are not used to compile KDE SC yourself then you will need to wait until Kubuntu provides newer packages for it. KDE SC 4.8 final is going to include this change, so you can wait until there to do the test.
Comment 37 Lamarque V. Souza 2012-02-04 02:22:31 UTC
Hi, can you test if this problem still happens in 4.8.0? If yes, can you send me the file ~/.xsession-errors?
Comment 38 ttom 2012-02-04 14:35:14 UTC
(In reply to comment #37) > Hi, can you test if this problem still happens in 4.8.0? If yes, can you send > me the file ~/.xsession-errors? No! Every thing is fine now after I updated Kubuntu on KDE 4.7.4! Thank you for your efforts!
Comment 39 Anne-Marie Mahfouf 2012-02-04 20:02:15 UTC
Closing as it works for you now, thanks for your follow-up!
Comment 40 Volkan 2013-08-01 19:33:23 UTC
Using KDE 4.10.5 under Kubuntu and the same problem here. Here is the output of 'upower': volkan@ubuntu:~$ upower --show-info /org/freedesktop/UPower/devices/battery_BAT1 native-path: /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:01/PNP0C09:00/PNP0C0A:00/power_supply/BAT1 vendor: LION power supply: yes updated: Thu Aug 1 21:32:20 2013 (27 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: discharging energy: 1.248 Wh energy-empty: 0 Wh energy-full: 4.4 Wh energy-full-design: 0.001 Wh energy-rate: 0.835 W voltage: 10.636 V time to empty: 1.5 hours percentage: 28.3636% capacity: 100% History (charge): 1375385540 28.364 discharging History (rate): 1375385540 0.835 discharging 1375385510 1.051 discharging 1375385480 1.338 discharging
Comment 41 Kai Uwe Broulik 2013-08-01 21:54:40 UTC
See Comment 14. It's been turned into a hidden config option that is still the same with the rewritten battery monitor in 4.11.
Comment 42 Volkan 2013-08-01 22:51:04 UTC
Why is it still not enabled by default? Comment 13 tells that this would be added again.
Comment 43 Alejandro Lorenzo 2013-11-09 14:07:52 UTC
I Agree that at least an estimation of remaining time is something really useful. My votes go for this one.
Comment 44 Andrej M. 2013-12-04 17:16:11 UTC
KDE 4.11.3, Kubuntu 13.10. The battery monitor shows only percentage, no time. I have this in my settings file: [Containments][Applets][Configuration][Applets] geometry=0,0,24,24 immutability=1 plugin=battery showRemainingTime=true zvalue=0 I don't remember editing the file, so this must be default. However there is also no way to tell if this is the correct applet, because of the cryptic heading. The only thing that points to the correct applet is the string battery.
Comment 45 Dan Duris 2014-01-25 05:29:01 UTC
still not showing time remaining in the latest KDE
Comment 46 Laurent 2014-01-26 15:20:06 UTC
FYI: There is an "Enhanced Battery Monitor" plasmoid...basically the old one, but it shows the remaining time. Panel settings -> Add Widgets... -> Get new Widgets -> search for 'Enhanced Battery Monitor'. You can use that one until this one is usable again.
Comment 47 Kai Uwe Broulik 2014-06-15 13:21:32 UTC
Git commit fc3da7a59effbacbd1c21af5d011a8354040b1ca by Kai Uwe Broulik. Committed on 15/06/2014 at 13:12. Pushed by broulik into branch 'master'. Always show battery remaining time I am really tired of this topic. Yes, the battery remaining time is not that accurate and jumps around (the latter is something that could be fixed using a moving average). But if we jump onto that train we would also need to remove the battery percentage itself as it's not accurate either. 30% on a dead battery can quickly become 5% and then the notebook suddenly turns off. "Battery: Present". The remaining time is in the battery's tooltip, many distributions have even patched the battery monitor to show the time by default, there's even a clone of the original battery monitor on GHNS just with that option enabled; every other desktop environment even emphasizes the remaining time, Windows prefers the time over percentage, Mac OS X allows you to put the remaining time in the panel rather than the percentage, etc etc. As a maintainer I now made the decision to show remaining time by default - it's no "in your face" display but in the battery's detail section - and I would kindly ask all the people involved in this discussion to respect this. Thank you! D +0 -14 applets/batterymonitor/contents/config/main.xml M +0 -1 applets/batterymonitor/contents/ui/PopupDialog.qml M +0 -1 applets/batterymonitor/contents/ui/batterymonitor.qml http://commits.kde.org/plasma-workspace/fc3da7a59effbacbd1c21af5d011a8354040b1ca
Comment 48 Kai Uwe Broulik 2014-06-15 13:22:26 UTC
Sorry to crush your hopes, but this is Plasma 5 stuff :-)
Comment 49 Ukyoi 2014-07-15 07:50:28 UTC
(In reply to comment #47) > Git commit fc3da7a59effbacbd1c21af5d011a8354040b1ca by Kai Uwe Broulik. > Committed on 15/06/2014 at 13:12. > Pushed by broulik into branch 'master'. > > Always show battery remaining time > > I am really tired of this topic. Yes, the battery remaining time is not that > accurate and > jumps around (the latter is something that could be fixed using a moving > average). But if > we jump onto that train we would also need to remove the battery percentage > itself as it's not > accurate either. 30% on a dead battery can quickly become 5% and then the > notebook suddenly > turns off. "Battery: Present". > > The remaining time is in the battery's tooltip, many distributions have even > patched the > battery monitor to show the time by default, there's even a clone of the > original battery > monitor on GHNS just with that option enabled; every other desktop > environment even emphasizes > the remaining time, Windows prefers the time over percentage, Mac OS X > allows you to put > the remaining time in the panel rather than the percentage, etc etc. > > As a maintainer I now made the decision to show remaining time by default - > it's no > "in your face" display but in the battery's detail section - and I would > kindly > ask all the people involved in this discussion to respect this. Thank you! > > D +0 -14 applets/batterymonitor/contents/config/main.xml > M +0 -1 applets/batterymonitor/contents/ui/PopupDialog.qml > M +0 -1 applets/batterymonitor/contents/ui/batterymonitor.qml > > http://commits.kde.org/plasma-workspace/ > fc3da7a59effbacbd1c21af5d011a8354040b1ca Thanks a lot! You are a good man! Waiting for this feature in Plasma 5.