-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
battery-applet: Look at upower slowness/weirdness (on N900 at least) #67
Comments
The rx51_battery seems to contain more useful charging states in upower. Weird. |
Here is the upower code reading the info: https://cgit.freedesktop.org/upower/tree/src/linux/up-device-supply.c#n533 - they seem to completely ignore the time_to_* sysfs values. Their interpretating of charging is also funny: https://cgit.freedesktop.org/upower/tree/src/linux/up-device-supply.c#n448 At least on the N900 the status seems to be 'Not charging' even when cable is not connected -- not 'Discharging'. That might explain the difference, and why UPower shows "Pending charging" all of the time. I think this also has an effect of it calculating the time-to-* values. |
After at least 30 minutes of discharging, the 'status' still says it's "Not charging", which apparently doesn't mean "Discharging". But the device is obviously discharding - capacity dropped 5 levels. Might be a kernel problem? root@devuan:/sys/devices/platform/68000000.ocp/48072000.i2c/i2c-2/2-0055/power_supply/bq27200-0# cat capacity https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/power/supply/bq27xxx_battery.c#n1663 |
Is Not Charging meant for when device is connected to charger but power supplied is not sufficient to charge the device, be it supply or rate of discharge. |
the other way around - battery is charged and device is powered from psu not from battery, afaiu - see mail thread as well :) |
The charging issue is now solved with these three commits: maemo-leste/n9xx-linux@32ae325 |
So sysfs usually updates within 5 seconds with the right value; UPower picks it up much later. But for now, I think this is OK. Since the charge detecting fixes (in kernel) it also shows the time until empty (or time until full) properly on the N900. |
I've just added the fully charged state to the applet -- this was missing. |
I think TimeToEmpty and TimeToFull work OK now that the state is fixed in the kernel. Left now is 'slowness' (maybe poll more often, or react on specific select()able events in UPower?). And the proper energy is the other thing to look at (upower doesn't report them at all it seems) |
I think I know why UPower updates slowly, and I've tried to explain it here: https://marc.info/?l=linux-omap&m=151977351627943&w=2 If people agree the approach is sensible, I'll write a patch to also send battery events on charging-status change. |
UPower not exporting the energy exposed in sysfs is something we'll have to patch in UPower, but this is lower priority for me. |
Even on CSSU-Testing version of Fremantle there is an issue with updating charge status uniformly. Battery applet on status bar updates instantly (almost) when disconnecting charger, where as status menu widget mAh figure often only shows what it was before starting to charge for a minute or so after disconnecting. Obviously not upower but might be worth looking at to see if it can shed some more light. |
I see. Well, the big problem is that udev doesn't report on the battery charging status changes. This is the first issue that needs to be fixed, I will have a patch ready soon (Compiling now). The second issue is that the kernel detects the charging status change only after a few seconds. But this is acceptable delay to me. I've mentioned it in the email still, though. |
This patch is supposed to improve the situation: maemo-leste/n9xx-linux@fd09cb9 It should fix the driver not sending updates on charge status, but it doesn't fix the delay in reporting in /sys in general. |
I am still left wondering if it really can't detect this way faster, but perhaps the poll interval is just too high at this point. |
An extreme value like this makes somewhat of a difference, but it still takes a while for the chip to realise it is being charged: |
Could be that it is using isp1707 to detect wall chargers/USB cable |
Yes, those events trigger instantly. But UPower does not look at them. |
Moving to beta. |
Perhaps we can detect the 'wall charger' 'battery' in UPower and use the on-battery status:
|
bq27200-0 seems to be broken in the current maemo leste n900 image. This command gives false POWER_SUPPLY_STATUS=Charging/Discharging |
bz27200-0 lags behind, a lot. It updates relatively slow, and upower even slower. This is why I suggested to combine the values with the usb power supply chip. Or are you saying it's wrong also after minutes of being connected? |
Some of this is being worked on here by @spinal84 |
Does something from the issue remain yet? |
No; it's all great and smooth now. Maybe even better than fremantle. ;) |
As a note, there are at least a few things to look at later:
The text was updated successfully, but these errors were encountered: