Battery statistics are incorrect on krillin and vegetahd

Bug #1471913 reported by Ionut Negru
392
This bug affects 73 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Confirmed
High
Unassigned

Bug Description

Summary from this question: https://answers.launchpad.net/ubuntu/+question/268813

The battery percentage is not updated while charging and some times not even after rebooting the device. Battery statistics view also shows wrong information.

Thank you!

no longer affects: unity8 (Ubuntu)
Revision history for this message
Sturm Flut (sturmflut) wrote :

This is IMO a kernel issue.

The attached script dumps the contents of most files under /sys/class/power_supply/battery/ , plus the battery status as reported by upowerd, in CSV format every five seconds. I managed to have it running in the background nearly all of the time during the following routine:

- Started at 95% reported battery level, with WiFi connected and screen lock off, so the screen stayed on all the time.

- Ran Neverball as the active app and "yes" in the background to keep the system busy, at about 150% CPU, until the device shut off and could not be powered on anymore. The attached CSV file shows a near linear drop of the reported battery capacity percentage until the device shuts off after timestamp 1436220202.

- Attached the device to an USB charger rated at 5V/2A, and powered it on as soon as Little Kernel would let me. The CSV data shows some strange output of /sys/class/power_supply/battery/capacity : Despite the battery cell voltage continuously rising until it reaches its "full" level, the reported capacity percentage is first stuck at eight percent, then at ten and 15 percent and finally stays at 20 percent for the rest of the charging process (the rest of the night). So the hardware actually reports the battery voltage correctly, but the piece of software that converts it to a percentage is buggy?

- Shut off the device manually and reconnected the charger to start up the "charging while off" animation shown by Little Kernel. The battery level was immediately reported correctly as "100%". Little Kernel has its own drivers to talk to the battery charger and PMIC circuits, and it seems to do the voltage-to-percentage conversion correctly.

- Powered the device on at timestamp 1436246366. /sys/class/power_supply/battery/capacity now suddenly reported 100 percent as well.

Revision history for this message
Sturm Flut (sturmflut) wrote :
Revision history for this message
Sturm Flut (sturmflut) wrote :

Forgot to add my channel/image version information:

phablet@ubuntu-phablet:~$ system-image-cli -i
current build number: 47
device name: arale
channel: ubuntu-touch/rc-proposed/meizu.en
last update: 2015-07-06 14:22:52
version version: 47
version ubuntu: 20150706
version device: 20150701-cdd791c
version custom: 20150602-731-5-32

But most of the users affected by this are running ubuntu-touch/stable/meizu.en r2.

Revision history for this message
maarten klop (mjdklop) wrote :

I am also affected, running ubuntu-touch/stable/meizu.en r2.

I also experienced this lagging behind of battery% during discharging, also causing 'low battery' warnings to be delivered late. This behaviour is not consistent, as for instance yesterday this bug has not been affecting me at all.

Revision history for this message
Owen Llywelyn (owen-llywelyn) wrote :

Same problem for me MX4. Battery indicator sometimes correct but not updating while charging

Sturm Flut (sturmflut)
Changed in canonical-devices-system-image:
status: New → Confirmed
Revision history for this message
maarten klop (mjdklop) wrote :

I had a relapse of the bug yesterday evening up to this morning: The battery was around 10%, I hooked up the charger for the night, and it charged up to 24%, this morning it displayed 100%, but as soon as I unplugged fell back to 24%. After reboot, actual charge level was 24%. This means that the battery reading that was falsely indicating 100% charge stopped the battery from charging further. This could also mean that the same bug, when a lower than actual charge is shown, could lead to overcharging of the battery.

Revision history for this message
Ionut Negru (blackjohnny) wrote : Re: [Bug 1471913] Re: [MX4] Battery statistics are incorrect

Hi,

I hope your phone will not break. I also had it 100% charged then 10 mins
after I disconnected it from charger, it dropped to about 30% or so and
I've put it on USB and logged via phablet-shell to check if there is any
high usage process running. With nothing abnormal found on it I just forgot
it on USB till the morning when I found it unresponsive. That USB is
powered on even if the computer is shut-down.

On the other hand, I have not received the replacement battery yet to
confirm that it is the battery that is broken. However, I have tried
various methods to bring the phone in meta boot mode in order to check if a
corrupted emmc is the actual reason ... with no success. It is weird how
closed is the Meizu hardware while it hosts an open source OS on it. I
couldn't even find the pin specs for the JTAG interface that could tell me
if there is a hardware or a software issue. I am a bit disappointed on
Meizu.

I will keep you up to date.

Regards,
Ionut

On Tue, Jul 28, 2015 at 10:40 AM maarten klop <email address hidden> wrote:

> I had a relapse of the bug yesterday evening up to this morning: The
> battery was around 10%, I hooked up the charger for the night, and it
> charged up to 24%, this morning it displayed 100%, but as soon as I
> unplugged fell back to 24%. After reboot, actual charge level was 24%.
> This means that the battery reading that was falsely indicating 100%
> charge stopped the battery from charging further. This could also mean
> that the same bug, when a lower than actual charge is shown, could lead
> to overcharging of the battery.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1471913
>
> Title:
> [MX4] Battery statistics are incorrect
>
> Status in Canonical System Image:
> Confirmed
>
> Bug description:
> Summary from this question:
> https://answers.launchpad.net/ubuntu/+question/268813
>
> The battery percentage is not updated while charging and some times
> not even after rebooting the device. Battery statistics view also
> shows wrong information.
>
> Thank you!
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/canonical-devices-system-image/+bug/1471913/+subscriptions
>

Revision history for this message
maarten klop (mjdklop) wrote : Re: [MX4] Battery statistics are incorrect

I'll dose the charging myself for now, to prevent overcharging. 1 or 2 hr at a time, and then use for a day. Should be fine more or less.

It's really weird at the moment, I hooked up the charger for 1 hr to recharge the battery. It has seemingly charged to 100% in that time, and stays at 100% when I disconnect and reboot. So the bug is persistent this time. Or the 24% was wrong. The power has dropped to 99% now, so it might actually be correct now... I don't know anymore what to think or believe.

tags: added: power-bugs
Revision history for this message
Ionut Negru (blackjohnny) wrote :

I managed to fix my phone by booting without battery (testpin hardware mode = void warranty ) and then erasing user data and cache with 'fastboot -w'. I dished the old battery as, probably being depleted, can not be charged properly anymore by the phone. With the new battery everything seems ok however the battery reports are still incorrect. In order to avoid any charging issues I will power off the phone while charging as the animation in this mode seems to report the correct battery level.

tags: added: upower
Revision history for this message
Ionut Negru (blackjohnny) wrote :

I started to suspect this is in fact a hardware issue. I had a very similar behaviour after I have flashed Flyme OS on it. However, I can't be 100% sure because it died again during the first charge under android, with the same "stuck on a percentage" behaviour as it did under Ubuntu. I cant restart either it using the very same procedure I have used the first time to confirm this behaviour. Any of you affected by this bug had sudden device power off's?

Revision history for this message
Robie Basak (racb) wrote :

I unexpectedly found my phone dead yesterday. It wouldn't turn on without putting it on charge. Immediately it said 10%, but still refused to power on for a few minutes until after it said 12%.

This is what I think is some kind of minimal initrd that displays the battery charging full size display, rather than booted into Ubuntu.

My guess is that the hardware is able to detect the real amount of charge remaining, but the readout available to the software was false - both when booted into Ubuntu and when booted into the minimal "battery is charging" thing (when it sets the indicator LED to solid red).

So I think it's a software issue, or perhaps a driver issue reading the battery status wrong, or a battery indication calibration issue.

It feels to me that it gets worse at detecting remaining battery correctly when on standby for long periods, which results in a false high reading.

Revision history for this message
Ionut Negru (blackjohnny) wrote :

Bad news ... maybe?! ... I've got my second MX4 Ubuntu today and stressed it all day long while charging and discharging it and, the battery does not jump from one percentage to another. The stats are OK, the bug is not there, ... yet. I will dump every partition from the new one and flash it to the old one to see if having the same binaries will fix it, but I have some doubts.

Revision history for this message
Ionut Negru (blackjohnny) wrote :

PS: the old one was dead till today when it simply started on a push of a power button ... I guess it realised the new one is arriving :))

Revision history for this message
Ari Salonen (ari-salonen) wrote :

Hello!

I have had same issues with my Meizu MX4 Ubuntu Edition. Battery statistics does this time to time: http://i.imgur.com/IbNJzAU.png
I have been able to get around this with shutting down and booting up the phone sometimes with charger on, sometimes off, sometimes putting it charging when booting. Little bit of doing that and it shows correctly 100% and works just fine all the way 0%.

Now problem has changed and phone won't charge from 66 %. I took charger off and used some battery and plugged it in again at 64 % and now it's stuck there. I tried to charge it booted up and shutted down, but that is not making no difference.

Here is current battery statistics:
http://i.imgur.com/YTIUTUM.png

Hopefully it won't get stuck at 0 %...

Revision history for this message
Ari Salonen (ari-salonen) wrote :

PS: Okay... 15 minutes lates i checked my phone and:
http://i.imgur.com/5BKMggf.png

I took charger off and it dropped 98 %, good enough for me. In my opinion, definetly software issue.

Two days ago i just had my phone charged to 100 %. I plugged and plugged off my charger and everytime i took charger off i lost 4 %. Did that so long that my battery percentage was 50 %. Plugged phone back to charger. Waited few minutes and it was 100 % again.

Hope this helps.

Revision history for this message
Ari Salonen (ari-salonen) wrote :

As a temporary fix i let phone charge to 100 % (if phone is for example 51 % and i start charging it. it won't show 52% 53% 54% and so on. It's 51% and it jumps straight to 100%) If i take charger off when it's 100 % it drops instantly to 98 % and uses battery faster until it's 71%. But if i shutdown my phone when it's 100 % and plug the charger off and boot it again it will show 100 % correctly and won't use battery incorrectly.

So is there something wrong with my phone? Anyone else have same issue?

TWN EDU (twnedu)
Changed in canonical-devices-system-image:
assignee: nobody → TWN EDU (twnedu)
assignee: TWN EDU (twnedu) → nobody
Changed in canonical-devices-system-image:
assignee: nobody → Yuan-Chen Cheng (ycheng-twn)
importance: Undecided → High
Revision history for this message
Ionut Negru (blackjohnny) wrote :

Pls let me know if you need testing for this issue. I have two MX4 devices, one affected by this issue the other one not. Thanks!

Revision history for this message
Yuan-Chen Cheng (ycheng-twn) wrote :

@lonut, thanks for offering this, I'll keep updating here.

Revision history for this message
Ari Salonen (ari-salonen) wrote :

Today i noticed that battery is charging properly when i use my phones 4G connection for my laptop and download large files with it.http://i.imgur.com/MlBN1Go.png

I have not tested yet if it's connection sharing high battery usage because of 4G use or would it be enough if i run stress test while charging.

Revision history for this message
Ari Salonen (ari-salonen) wrote :

I can confirm that battery statistics are increasing correctly when battery usage is high when charging. I tested it by running 'glmark2' while charging phone. If more testing is needed to solve this issue, let me know.

Revision history for this message
Yuan-Chen Cheng (ycheng-twn) wrote :

Said to be a "MTK pmic fuelguage issue", per talk with hw vendor.

Currently we still don't have work around code from vendor.

Changed in canonical-devices-system-image:
importance: High → Medium
Changed in canonical-devices-system-image:
assignee: Yuan-Chen Cheng (ycheng-twn) → Jason Yen (jasonyen)
Revision history for this message
Ionut Negru (blackjohnny) wrote :

Although the battery statistics is still buggy my phone does not shut down without any reason after ota6. When it wrongly detects that the battery is low it does not shut down... I have found it complaining about a 0% level several times. Is it maybe because the ubuntu-touch team modified the "auto-shutdown on low battery" behavior.

Revision history for this message
Marc Nieper-Wißkirchen (marc-nieper-wisskirchen) wrote :

@Ionut: In post #12 you wrote that your second Ubuntu phone hadn't exhibited the battery statistics problem so far. Is it still without any flaw in this regard? (That is, does the problem described in this bug affect only a percentage of all Ubuntu MX4s?

Revision history for this message
Ionut Negru (blackjohnny) wrote :

@Marc: my second MX is still without any flaw while my first one is still showing wrong battery statistics ... however, Yuan (post #21) said that it is a confirmed MTK issue (no clue if it is software fixable)

Revision history for this message
Marc Nieper-Wißkirchen (marc-nieper-wisskirchen) wrote :

Thanks for the quick reply. If the second one is still working without any flaw, it would make sense to have the broken MX4s replaced, wouldn't it?

Revision history for this message
Ionut Negru (blackjohnny) wrote :

I guess it makes sense.

Revision history for this message
Nicola Jelmorini (jelmorini) wrote :

Just received the OTA7, but the issue is still present.
Wrong battery statistics when charging.

Revision history for this message
Ionut Negru (blackjohnny) wrote :

Same for my device but I didn't expect this to change with ota7. Maybe to see some changes on with some major kernel update

Revision history for this message
Nicola Jelmorini (jelmorini) wrote :

Perhaps it's possible to use a command or a script in the Terminal, that allow to reset the battery statistics without the need to reboot?

Changed in canonical-devices-system-image:
milestone: none → backlog
Revision history for this message
Stefan de Groot (stefandegroot) wrote :

It seems that I'll have the same problem with my MX4.
Luckely I have an old micro-USB charger from an old smartphone and then it works well, but with every other charger the battery level is not changing when charging.
Hopely others will report the same with an old charger.

Not everyone has this problem with issue. Use Meizu different batteries for the MX4?

Revision history for this message
Ionut Negru (blackjohnny) wrote :

I have opened my MX4 and replaced the battery but it seems that is not the issue ... so don't bother with that

Revision history for this message
Ari Salonen (ari-salonen) wrote :

I tried to charge my MX4 with 2600Mah 5V 1A battery pack.

- I started charging at 94 %
- Battery reaches 98 %, battery pack shuts down automaticly.
- I try to turn on battery pack.
- Battery charge immediatly drops back to 94 %.

This happened two times in row now, but time to get from 94 to 98 is much shorter. After this i tried to turn off battery pack and now it's not even changing to 98. It just shuts off battery pack after around 2 minutes.

I have also tried to charge with old chargers with less ampere than MX4 charger. Tried to charge from computers USB port. No difference to MX4 charger.

Revision history for this message
Stefan de Groot (stefandegroot) wrote :

My old charger with 850 mA(output) works with my MX4, but not always. When I am so stupid to try an other charger and then use directly the 850 mA charger then it don't work. First it has a bit to discharge and then it will work.
The first time I was using that charger it didn't charge too.

Revision history for this message
Víctor R. Ruiz (vrruiz) wrote :

This is a screenshot for the Battery chart in krillin stable (OTA7).

Changed in canonical-devices-system-image:
importance: Medium → High
Revision history for this message
Olivier Tilloy (osomon) wrote :

I’ve observed a similar issue with my krillin (BQ aquaris E4.5) running the latest rc-proposed image (#163 yesterday).
My phone was sitting idle at ~40% battery. Next thing I know, it had turned off and I couldn’t turn it back on. I plugged it into my laptop, and it wouldn’t turn on immediately as if the battery was too low, but the charge screen indicated that it had 23% left.
After charging for a bit, I managed to switch it on. Attaching a capture of how the battery charge screen looked like just after switching it on.

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

I have been told this is a known issue in the MTK pmic fuelguage. So far we have no way to work around it in the upper software layers.

Revision history for this message
Henry (6-ubuntuone-4) wrote :

OTA8 battery flat statistics - 81% after 77hours

Revision history for this message
Henry (6-ubuntuone-4) wrote :

Note to the above attached picture: I am on BQ E4.5 with OTA8, seeing this "flat line" issue since I have the phone with r21 and went through all updated till now.
The most annoying is the "unpredictability" when the battery will discharge and phone will simply switch off - which happening during night means it does not wake me up in the morning by buzzer :-(

Revision history for this message
maarten klop (mjdklop) wrote :

Meizu MX4, OTA-8, I've had a few recurrences of this bug, and possibly related issues. For one, since the last update, my phone lasts longer on one charge. I think. If true, it's nice. I've charged twice last week, because it didn't drop under 50% before wednesday afternoon (charged the sunday afternoon before). Sometimes I do find it switched-off in my pocket, which also helps battery life, but is not nice for the friends who want to call me (luckily I don't have many). If that occurs, sometimes the phone won't start because it's drained and needs to be charged before I can power on. But sometimes it's just at 30% or something, boots happily, and lasts another day, with no clear errors on battery stats. Which one do you experience, Henry?

I must say it's a very annoying bug when present, but seems not to affect me constantly or even often.

Revision history for this message
Henry (6-ubuntuone-4) wrote :

I experience that looking on the phone before going to sleep seeing 35% I fall a sleep fine. Then I am not waken up by buzzer in the morning as the battery went off within 6-7h.
Looking into battery stats I mostly see flat line (check my attached picture above) - so I can't really guess if I shall put it on charger or not.
And charging at 50% seems to me as a way to decrease a battery life - at least this is how I remember it from the past, so I stick to this approach.
Also I do not see/notice any "I am almost empty battery" screaming/notifications - so usually I just find my phone switched off - for me personally not nice at all :-(

summary: - [MX4] Battery statistics are incorrect
+ Battery statistics are incorrect on MTK based devices
Changed in canonical-devices-system-image:
assignee: Jason Yen (jasonyen) → Yuan-Chen Cheng (ycheng-twn)
Henry (6-ubuntuone-4)
tags: added: bq e4.5
31 comments hidden view all 111 comments
Revision history for this message
the.wraith (marin-krastanov) wrote : Re: Battery statistics are incorrect on MTK based devices

I only had problem with the battery statistics.
Didn't have the second problem.

And there was a fix, if I hold the power button for few seconds so the phone turns off, after that
the battery statistics were ok, well until next recharge. Then the problem is there again.

Here is screenshots:

And how about the fix proposed by Yuan-Chen Cheng on #43, have you tested it?

Revision history for this message
royden (ryts) wrote :

Concerning the Mx4, I trust if anything emerges that indicates a warranty replacement of affected devices (eg. defective pmic), it would be announced and not glossed over? As Pat McGowan noted, this was reported in mid-2015 and is tedious to say the least....

Revision history for this message
Michael S. (i-mich9el-s) wrote :

With OTA-9 everything look fine (see attachment). In my case (BQ Aquaris E4.5) it doesn't seems to be a pmic issue.

Revision history for this message
Reynaldo Cordero (reynaldo-cordero) wrote : Re: [Bug 1471913] Re: Battery statistics are incorrect on MTK based devices

Ubuntu Phone (MX-4) "up to date" is OTA-9.5 and the battery statistics
issue is killing my patience.

On Sat, Jan 30, 2016 at 12:46 PM, Michael S. <email address hidden>
wrote:

> With OTA-9 everything look fine (see attachment). In my case (BQ Aquaris
> E4.5) it doesn't seems to be a pmic issue.
>
> ** Attachment added: "Log, Screenshot"
>
> https://bugs.launchpad.net/canonical-devices-system-image/+bug/1471913/+attachment/4559788/+files/ota-9.tgz
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1471913
>
> Title:
> Battery statistics are incorrect on MTK based devices
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/canonical-devices-system-image/+bug/1471913/+subscriptions
>

Revision history for this message
Riccardo Padovani (rpadovani) wrote : Re: Battery statistics are incorrect on MTK based devices

I just experienced this bug on MX4 with OTA-9.

It's the first time in months.
Two nights ago it died after a long day, I recharged it and worked well yesterday, until the night - it had for some time the critic warning "0% of battery left" - I recharged it for all the night again, but this morning it was just at 4% - and after at least 4 hours, it is still at 4%, so I'm quite sure it's about stats and not about the battery itself

Revision history for this message
Reynaldo Cordero (reynaldo-cordero) wrote : Re: [Bug 1471913] Re: Battery statistics are incorrect on MTK based devices

My bad: the current update is OTA-8.5 ( Meizu MX4). Battery statistics
are not working properly on my phone.

On Sun, Jan 31, 2016 at 9:56 AM, Reynaldo Cordero <
<email address hidden>> wrote:

> Ubuntu Phone (MX-4) "up to date" is OTA-9.5 and the battery statistics
> issue is killing my patience.
>
> On Sat, Jan 30, 2016 at 12:46 PM, Michael S. <email address hidden>
> wrote:
>
>> With OTA-9 everything look fine (see attachment). In my case (BQ Aquaris
>> E4.5) it doesn't seems to be a pmic issue.
>>
>> ** Attachment added: "Log, Screenshot"
>>
>> https://bugs.launchpad.net/canonical-devices-system-image/+bug/1471913/+attachment/4559788/+files/ota-9.tgz
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1471913
>>
>> Title:
>> Battery statistics are incorrect on MTK based devices
>>
>> To manage notifications about this bug go to:
>>
>> https://bugs.launchpad.net/canonical-devices-system-image/+bug/1471913/+subscriptions
>>
>
>

Revision history for this message
royden (ryts) wrote : Re: Battery statistics are incorrect on MTK based devices

fix proposed by Yuan-Chen Cheng on #43, "flight-mode":

Mx4 Arale rc-proposed current - flight-mode charging might improve matters but overall it does not stop the precipitous drop in displayed capacity (in my case ~40%) after unplugging charger.

Better result obtained charging, unplugging, switching off phone, plugging until (Android??) charging state reached and displays 100%, unplugging and then switching on phone. I think it then is more likely to display correctly.

Revision history for this message
Krzysztof Tataradziński (ktatar156) wrote :

Hello,
I found another problem with statistics, steps to reproduce:
1. 20:00 - started charging phone
2. 23:00 - battery fully charged, but phone still connected to charger.
3. 8:00 unplug phone from charger
in example at 9:00 phone will show time in last full charge 10 hours, instead of 1 hour.
The problem is that counter starts counting when phone get 100% battery instead of unplug charger.

Revision history for this message
Henry (6-ubuntuone-4) wrote :

BQ E4.5, OTA9, problem still in place, only slightly changed:
 - I got 99% then 80% then 66% then 34% as numbers
 - I am 80 hours from last full charge
 - the chart was working (probably first 24h), since then there is no line in the graph - it is just empty
 - that 34% is there for about 20-30 hours (hard to say because of the above point)

Issue persists, battery indication still not working.

If you want/need data/something, please let me know.

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

On a MX4 phone with the battery removed (replaced with a bench power supply), I noticed that the reported percentage kept dropping over time despite a steady 4.35V input voltage. When it got low enough to pop up warnings (which interrupted and invalidated tests), I checked the kernel's reported power stats.

The kernel reported 10% full and 4.193V.

I then unplugged USB, disconnected a power lead, waited a moment, then reconnected everything to boot the phone fresh (hard power cycle), and checked the kernel stats again.

This time it reported 77% full and 4.356V.

I checked the input voltage both times with a separate DMM, and it measured at 4.42V.

The expected voltage range of these cells is about 4.35V for "full" and about 3.0V to 3.3V for "empty".

So, two notable things:
* The kernel's initial reported voltage was 0.23V lower than reality, but corrected itself to only 0.07V low with a power cycle.
* The reported capacity was off in both cases, but in the "10%" case it was nowhere near the truth. Instead of 10% and 77% it should have been more like 77% and 100%, going strictly by voltage.

I'm assuming there is some sort of automatic curve calibration going on, so it tries to create a voltage-to-percent curve automatically based on recent measurements and previous discharge-charge cycles. If this is true, I should be able to temporarily improve the behavior by artificially dropping the input to 3.3V, leaving it overnight, then restoring it to 4.35V and leaving it a few hours. This would hopefully reset the curve. However, it might be simpler and more reliable to drop the auto-calibration entirely and go with a fixed curve calibrated once for each phone model. It would at least be more predictable, and less prone to the weird behaviors people have reported.

So, something in hardware or firmware or the kernel seems to be getting mildly incorrect readings in some situations. However, even as-is, using data from the known-weird kernel, behavior could be improved by relying more on voltage measurements and less on clever userspace algorithms.

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

While doing some other testing today, I noticed this battery charge graph. It's, um, not physically possible. Pretty cool graph bug though.

Version info from channel.ini:
[service]
base: system-image.ubuntu.com
http_port: 80
https_port: 443
channel: ubuntu-touch/rc-proposed/meizu.en
device: arale
build_number: 253
version_detail: ubuntu=20160220,device=20160111-51982fc,custom=1452441600,version=253

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

The plot thickens. I plugged in USB, turned the voltage back up to 4.35V, and let it sit idle for a few hours. Now the power graph is even weirder.

BTW, it has been in airplane mode and completely idle the whole time. There shouldn't be any NTP or other time corrections going on, with no radios enabled and no other source of network access.

Revision history for this message
Julia Palandri (julia-palandri) wrote :

@toykeeper thanks a lot for the info! I hope some of the engineers can take a look at it :)

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

So, one day later...

I left the phone unplugged with the screen set to never shut off. The power supply has been steady at 4.35V the whole time (during the 100% to 1% straight downward ramp). A bit less than 24 hours later, the phone reported critical battery charge, just 1%, so I took another screenshot and checked what the kernel was reporting. The screenshot is attached, and the kernel reports 4.356V. So, the 1% is not based *at all* on the voltage level. It's fabricated based on some clever algorithm rather than the actual measurements.

phablet@ubuntu-phablet:~$ cat /sys/class/power_supply/battery/uevent
POWER_SUPPLY_NAME=battery
POWER_SUPPLY_STATUS=Charging
POWER_SUPPLY_HEALTH=Good
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_MANUFACTURER=SONY
POWER_SUPPLY_CAPACITY=1
POWER_SUPPLY_CURRENT_NOW=-1910
POWER_SUPPLY_BATT_VOL=4356
POWER_SUPPLY_BATT_TEMP=310
POWER_SUPPLY_TEMPERATURER=7848
POWER_SUPPLY_TEMPBATTVOLTAGE=690
POWER_SUPPLY_INSTATVOLT=4356
POWER_SUPPLY_BATTERYAVERAGECURRENT=396
POWER_SUPPLY_BATTERYSENSEVOLTAGE=4356
POWER_SUPPLY_ISENSEVOLTAGE=4360
POWER_SUPPLY_CHARGERVOLTAGE=5002
POWER_SUPPLY_STATUS_2ND=Discharging
POWER_SUPPLY_CAPACITY_2ND=50
POWER_SUPPLY_PRESENT_2ND=0
POWER_SUPPLY_ADJUST_POWER=-1
POWER_SUPPLY_VOLTAGE_MAX_DESIGN=4200000
POWER_SUPPLY_VOLTAGE_NOW=4356000
POWER_SUPPLY_TEMP=310

I unplugged USB again a moment later and the phone immediately shut itself off since it thought the battery was too low to function.

I hope this is enough data for now. I'm switching the phone back to automated test duty.

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Oh, I grabbed the contents of /var/lib/upower/ too.

This was after I turned the phone back on. The power graph changed retroactively again, but it's still funky. Maybe the attached files will help with identifying what causes the spurious data points?

Some of the timestamps are out of order, some lines are "unknown", the graph has a tendency to change old values retroactively, and the values apparently have very little relation to actual voltage. There are probably several bugs happening here.

Revision history for this message
Julia Palandri (julia-palandri) wrote :

In case it's useful, I've got a couple screenshots of the battery of my arale going up and down without a clear pattern. Worst thing is it's now showing at 20% (after a night charging) and if I need to go out don't know how long it will last (even if I know the battery has been charging) Maybe a power cycle could 'correct' the battery status? If you need any logs or find the screenshots useful I can upload them.

Revision history for this message
royden (ryts) wrote :

@julia-palandri : try turning the phone off, plug-in charger and let it boot into charging mode (led glows solid). Press power button to see charge level. Then power on the device to boot normally.

So far, this method works for me and the battery level is shown correctly throughout.

Revision history for this message
Julia Palandri (julia-palandri) wrote :

@ryts thanks! I'll give it a try

Revision history for this message
Reynaldo Cordero (reynaldo-cordero) wrote : Re: [Bug 1471913] Re: Battery statistics are incorrect on MTK based devices

That works for me, but I must say it's a horrible workaround!

On Fri, Feb 26, 2016 at 11:15 AM, royden <email address hidden> wrote:

> @julia-palandri : try turning the phone off, plug-in charger and let it
> boot into charging mode (led glows solid). Press power button to see
> charge level. Then power on the device to boot normally.
>
> So far, this method works for me and the battery level is shown
> correctly throughout.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1471913
>
> Title:
> Battery statistics are incorrect on MTK based devices
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/canonical-devices-system-image/+bug/1471913/+subscriptions
>

Revision history for this message
danilo (tatonilo) wrote : Re: Battery statistics are incorrect on MTK based devices

Hello ALl,
I'm experiencing the same issue:

charging is usually normal and problemless.

My BQ E5 HD standard use time was around 3-4 days long (i'm not an heavy user indeed). but from around 30/40 days i got this:

Battery fully recharged (100%, it takes longer time than usual)
-no issue using it up to 56% (battery use chart and last charging date are correctly showed)
- 56% residual charging remain steady showed for about 2-3 days (using the phone as well) (battery use chart is empty and "last charging date" is "unknown")
- suddenly 54% ---> 40%----> battery low alert . (to be noticed: last three levels occurs in around 10-20 minutes_ reported levels are always the same)
- if I reconnect the charger in a short time, OK, anyway the system dies and it will be necessary to recharge it up to 20% at least to recovering boot capability

I own the device from Xmas 2015 and my system is OTA 9.1 (but issues started when it was still 8.5).

I noticed that using a standard (BQ original as well as another producer one) wall plug 5V USB charger, the charging time (from alert up to 100%) is around 3 to 4 hours long.
I used also a PC USB port and the charging time (from alert up to 100%) takes up to 8hrs long.
Thanks.
D

Revision history for this message
Henry (6-ubuntuone-4) wrote :

I would like to add a really nice screenshot of my battery stats chart: screenshot20160328_132642694.png
Last night I have seen there 219 hours since last full charge. Now it shows just: N/A.
And I still have 62% of the battery - I am really curious to see how long it lasts.

Revision history for this message
Nicola Jelmorini (jelmorini) wrote :

OTA-10 is out, but this nasty bug is still present.
Perhaps OTA-11 will be the good one? :-)

Revision history for this message
Henry (6-ubuntuone-4) wrote :

BQ Aquaris E4.5, OTA 10.1 (r32) - please see attached screenshot:
 - battery dropped from ~70% to 8% in about 1 hour
 - I got sound notification on 10% (at last, thanks)
 - the battery dropped from 10% to 8% before I was able to unlock the phone and get to the battery stats - I almost have seen it falling live

Just that I know what to count with - is there any chance at all that this, obviously SW - see posts around #85, bug will ever get fixed? Thank you in advance for answer.

summary: - Battery statistics are incorrect on MTK based devices
+ Battery statistics are incorrect on krillin and vegetahd
tags: removed: meizu mx4
Revision history for this message
Yuan-Chen Cheng (ycheng-twn) wrote :

please kindly put arale related information to LP: #1575683 here after.

Revision history for this message
Victor gonzalez (victor-gonzalez-0) wrote :

@pat-mcgowan, I think this is also happening with Frieza. We've got customer reports about quick battery drain or bad statistics behaviour, here are a couple of examples from the users:

- Scenario 1(1.png): after 2 days without use, statistics are empty and 4% battery left.
- Scenario 2(2.png): battery dropped suddenly

We're currently asking for upower+syslog. If there's something else we can do please let us know.

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

Scenario 1 could be a normal case if the device was powered off for two days.
Scenario 2 is the issue we can't seem to resolve.

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Scenario 2 is one which could likely be fixed by using the kernel's voltage value directly instead of passing it through an intermediate and laggy algorithm. I find that the kernel's reported voltage tends to respond faster and more accurately than the percent reported by upower.

Revision history for this message
Julia Palandri (julia-palandri) wrote :

@pat would this be feasible? (fixing scenario 2)

as per scenario 1, the way i understand it is the user left the device turned on, but idling without any use - so if power has been consumed so as to arrive at 4% two days after, the battery graphics should show this decrease over time. (so myabe both scenarios are the same bug, really)

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

@julia a more complete description is at bug #1537668
I need to find a new person to assign to it.

Revision history for this message
Ondrej Kubik (ondrak) wrote :

I did some investigation on this bug. Looks like there are several causes associated with this bug. Just some to mention:
 - looks like original Android 4.4 based firmware has similar issue with battery and it has been gradually remedied with later releases, this goes all the way to Android 5.0
 - I can't confirm we do any battery calibration at all. This would mean that eventually battery charge level curve we use to calculate capacity and real one will drift enough that number presented to user is completely off, or phone is not discharging linearly (from user perspective)
 - I can't confirm this, but if charging characteristic should be adjusted based on battery calibration, we are likely to overcharge battery as its condition deteriorate
 - when comparing to Android, kernel seems to be reporting wrong battery states. When battery is fully charged and phone connected on USB, Android reports fully charged, while Ubuntu reports discharging. Again this would indicate we will wreck batteries in devices which are connected 24/7

Revision history for this message
Henry (6-ubuntuone-4) wrote :

So, high priority since July 2015, till now no fix available :-( Or is the new repowerd in OTA-13 supposed to fix this issue?

Revision history for this message
dinamic (dinamic6661) wrote :

i'm on arale rc-proposed and battery stats are very wrong. i don't even remember how many times my phones just dies (shuts off) at 15, 20, 25%

Revision history for this message
danilo (tatonilo) wrote : Re: [Bug 1471913] Re: Battery statistics are incorrect on krillin and vegetahd

  Hi,
I am on Vegeta (aquaris BQ E5 HD) and after a refreshment period
with Android (installed for around 3 days, and charging discharging
battery), and right now situation is working realy good.
no more sudden
shuts OFF at 40% or around it.

Il 19.09.2016 16:53 dinamic ha scritto:

> i'm on arale rc-proposed and battery stats are very wrong. i don't
even
> remember how many times my phones just dies (shuts off) at 15,
20, 25%
>
> --
> You received this bug notification because you are
subscribed to the bug
> report.
>
https://bugs.launchpad.net/bugs/1471913 [1]
>
> Title:
> Battery
statistics are incorrect on krillin and vegetahd
>
> Status in
Canonical System Image:
> Confirmed
>
> Bug description:
> Summary from
this question:
> https://answers.launchpad.net/ubuntu/+question/268813
[2]
>
> The battery percentage is not updated while charging and some
times
> not even after rebooting the device. Battery statistics view
also
> shows wrong information.
>
> Thank you!
>
> To manage
notifications about this bug go to:
>
https://bugs.launchpad.net/canonical-devices-system-image/+bug/1471913/+subscriptions
[3]

--
------------
Saluti
Danilo Montevecchi
349-3767797

Con Smart 3 Giga a 9 euro/4 sett navighi veloce, chiami e invii SMS dal tuo smartphone verso tutti i fissi e mobili in Italia. Passa a Tiscali Mobile! http://casa.tiscali.it/mobile/

Revision history for this message
Guillaume F (marsguo) wrote :

Hi,
My phone died again today (krillin, OTA-13). One thing seems to have changed though: when the phone has recharged enough to power on, the battery indicates 13% whereas it turned off with (supposedly) 40%. Last time I had this issue, the battery still showed 40%.

Revision history for this message
Nicola Jelmorini (jelmorini) wrote :

I can confirm that this issue is still present even after OTA13 on my Meizu MX4

Revision history for this message
Michael S. (i-mich9el-s) wrote :

The battery statistic is much more wrong than before. On my BQ Aquaris 4.5 (krillin, OTA-13) it shows a flat line at 98% since 44 hours (see attachment )!!!

Revision history for this message
advocatux (advocatux) wrote :

After updating my BQ Aquaris 4.5 to OTA-13 the battery stats went crazier than before (that says something) and left the phone running for less time until need a new charge.

Recharging the phone once it's low keeps this behaviour.

*But* I thought that maybe the new software needs a new calibration and so I left the phone discharge completely until it went off, and fully charged it while off.

Now the battery stats are way better than before, and the running time as well.

Revision history for this message
Dubstar_04 (dubstar-04) wrote :

Battery stats are very broken on MX4.

Revision history for this message
Dubstar_04 (dubstar-04) wrote :
Changed in canonical-devices-system-image:
assignee: Yuan-Chen Cheng (ycheng-twn) → nobody
Revision history for this message
Henry (6-ubuntuone-4) wrote :

Bump.

Issue still in place and now there is no assigned person to actually solve it? I have heard that some bugs in Ubuntu are simply left untouched till the support on the version is expired and then they are closed, but for sure was not expecting it in this case and/or platform.

Well, lets see. Even if it is probably good idea start looking for new phone, one shall be prepared.

Displaying first 40 and last 40 comments. View all 111 comments or add a comment.