Degraded battery BCL device lag

Infy_AsiX

Senior Member
Feb 13, 2012
965
389
0
Brisbane
I've noticed a lot of posts on the subreddit recently complaining about lag when under a claimed particular battery percentage. This will explain the functional reason and allow some insight into perhaps modification using root.

I got my A7 new only a few months ago so my battery hasn't degraded enough to have the issue yet. I did notice the lagging symptom before I ran my battery flat recently. I've got an interest in battery life after modding around on my last device a Sony Z3C and since then the A7 too.

From experience I know /sys/class/power_supply/bms/device/v_cutoff_uv 3200000 is the voltage threshold at which my Z3C shuts down. Battery configuration varies a lot by models, the A7 lacks this writable file.

On the A7 I found these related writable files in /sys/class/power_supply/bcl/device/
high_threshold_ua 4200000
low_threshold_ua 3400000
vph_high_thresh_uv 35000000
vph_low_thresh_uv 3300000

Google search provides this generic related documentation. The initial description paragraphs translated in lay terms describes a CPU throttling function based on battery voltage and current load limits. https://android.googlesource.com/ke...mentation/devicetree/bindings/arm/msm/bcl.txt

Of direct interest is "vph-low-threshold-uv: The battery voltage threshold below which the BCL driver starts monitoring the battery current thresholds and mitigates the CPU on the event of high load."

Also "vph-high-threshold-uv: The battery voltage threshold above which the BCL driver clears the previously applied mitigation, disables the battery current monitoring, and starts monitoring for low battery voltage."

The "-threshold-uamp" descriptions don't match the A7's provided values of seemingly voltage rather than micro amps. Assuming they're voltages of 4.2 and 3.4 but I can't guess how they take effect.

What this means for those with slowed devices under a particular percentage, check your battery voltage to see if this is the cause using a battery app or something like DevCheck. BMS State of Charge fuel gauge percentage is a varying arbitrary number influenced by numerous functions and algorithms, in other words it's a meaningless number to troubleshoot. If your battery voltage is under 3.3V at something like 50%, your battery is severely degraded and the fuel gauge is completely off, you could perhaps try setting /sys/module/qpnp_fg/parameters/restart 1 (it will restart fuel gauge calibration and the setting will automatically go back to 0). Alternatively we could try to disable the Battery Current Limit but I suspect the purpose of it is to prevent Nexus 6P style sudden early shutdowns which require an external charger to jump start them again. In any case at least this info will help those diagnose why and how degraded their battery is.
 
Last edited:
  • Like
Reactions: Andrew-X

troy5890

Senior Member
Jun 14, 2014
1,572
541
143
I've noticed a lot of posts on the subreddit recently complaining about lag when under a claimed particular battery percentage. This will explain the functional reason and allow some insight into perhaps modification using root.

I got my A7 new only a few months ago so my battery hasn't degraded enough to have the issue yet. I did notice the lagging symptom before I ran my battery flat recently. I've got an interest in battery life after modding around on my last device a Sony Z3C and since then the A7 too.

From experience I know /sys/class/power_supply/bms/device/v_cutoff_uv 3200000 is the voltage threshold at which my Z3C shuts down. Battery configuration varies a lot by models, the A7 lacks this writable file.

On the A7 I found these related writable files in /sys/class/power_supply/bcl/device/
high_threshold_ua 4200000
low_threshold_ua 3400000
vph_high_thresh_uv 35000000
vph_low_thresh_uv 3300000

Google search provides this generic related documentation. The initial description paragraphs translated in lay terms describes a CPU throttling function based on battery voltage and current limits. https://android.googlesource.com/ke...mentation/devicetree/bindings/arm/msm/bcl.txt

Of direct interest is "vph-low-threshold-uv: The battery voltage threshold below which the BCL driver starts monitoring the battery current thresholds and mitigates the CPU on the event of high load."

Also "vph-high-threshold-uv: The battery voltage threshold above which the BCL driver clears the previously applied mitigation, disables the battery current monitoring, and starts monitoring for low battery voltage."

The "-threshold-uamp" descriptions don't match the A7's provided values of seemingly voltage rather than micro amps. Assuming they're voltages of 4.2 and 3.4 but I can't guess how they take effect.

What this means for those with slowed devices under a particular percentage, check your battery voltage to see if this is the cause using a battery app or something like DevCheck. BMS State of Charge fuel gauge percentage is a varying arbitrary number influenced by numerous functions and algorithms, in other words it's a meaningless number to troubleshoot. If your battery voltage is under 3.3V at something like 50%, your battery is severely degraded and the fuel gauge is completely off, you could perhaps try setting /sys/module/qpnp_fg/parameters/restart 1 (it will restart fuel gauge calibration and the setting will automatically go back to 0). Alternatively we could try to disable the Battery Current Limit but I suspect the purpose of it is to prevent Nexus 6P style sudden early shutdowns which require an external charger to jump start them again. In any case at least this info will help those diagnose why and how degraded their battery is.
Just curious since you pointed this out and me finding this delightful information, I'm at 92% right now with a voltage of 4064 MV, is that a bad sign of battery degradation?
 

Infy_AsiX

Senior Member
Feb 13, 2012
965
389
0
Brisbane
Just curious since you pointed this out and me finding this delightful information, I'm at 92% right now with a voltage of 4064 MV, is that a bad sign of battery degradation?
Can't really know by that. Easier to notice at the low end, if you get the CPU lag under a particular percentage, check if voltage is below 3.3V.

Sent from my ZTE Axon 7 using XDA Labs
 

troy5890

Senior Member
Jun 14, 2014
1,572
541
143
Can't really know by that. Easier to notice at the low end, if you get the CPU lag under a particular percentage, check if voltage is below 3.3V.
I did it get a little lag when I was playing an emulation at 15%. I checked and it had a voltage of 3504 MV.
 

Infy_AsiX

Senior Member
Feb 13, 2012
965
389
0
Brisbane
I did it get a little lag when I was playing an emulation at 15%. I checked and it had a voltage of 3504 MV.
Hm checking after when there's less current load won't show the real time voltage drop. To examine the BCL effect, probably need to watch voltage in real time, IIRC watching CPU freqs also shows the throttling. DevCheck pro can overlay cpu freqs, or Trepn profiler can for free IIRC. For a voltage and current overlay, can use CoolTool which is free for it's custom labels. Kind of technical yeah but has to be to figure this out. If anyone wants the CoolTool overlay custom settings, let me know.

If you straight up just want to test BCL off try setting the vph thresholds to 3000 3100 respectively, below shutdown cut off as to not take effect. Maybe it won't allow values less than cut off though, testing with monitoring the only sure way.

Sent from my ZTE Axon 7 using XDA Labs
 
Last edited:
  • Like
Reactions: troy5890

NEMESIS_9000

Member
Oct 1, 2010
42
2
0
Berlin
Mine lags at any percentage, I can't browse Chrome as fast as I was able to in the past. Whenever I launch it, it lags, when switching tabs it lags, tapping the search bar takes the keyboard up to 5 seconds to appear... And it's not just Chrome, the whole phone got slow but mostly Chrome. I used to be able to smoothly manage up to 200 tabs, but now it even lags with only 20. I might try a factory reset soon, I hope it helps. Clearing recent apps didn't help at all, clearing the cache partition helped for a few hours, then it was lagging again.
 

Predatorhaze

Senior Member
Feb 18, 2016
1,191
208
0
Gelderland
i executed this /sys/module/qpnp_fg/parameters/restart 1 and my battery % dropped from 8% to 2%.I put it on the charger and its charging normal,also normal speed.
Why i have the feeling this is our bsm reset?
 

Jirv0id

Member
May 5, 2012
30
9
0
Fordwich
My battery has about 51% of its life left estimated below 20% it chugs hard. When thrown on a charger 0-30% takes about 10 seconds. I don't have root but can look at some point. I've upgraded to a mi Max 3 but my A7 is now my car multimedia system.
 

Predatorhaze

Senior Member
Feb 18, 2016
1,191
208
0
Gelderland
I've noticed a lot of posts on the subreddit recently complaining about lag when under a claimed particular battery percentage. This will explain the functional reason and allow some insight into perhaps modification using root.

I got my A7 new only a few months ago so my battery hasn't degraded enough to have the issue yet. I did notice the lagging symptom before I ran my battery flat recently. I've got an interest in battery life after modding around on my last device a Sony Z3C and since then the A7 too.

From experience I know /sys/class/power_supply/bms/device/v_cutoff_uv 3200000 is the voltage threshold at which my Z3C shuts down. Battery configuration varies a lot by models, the A7 lacks this writable file.

On the A7 I found these related writable files in /sys/class/power_supply/bcl/device/
high_threshold_ua 4200000
low_threshold_ua 3400000
vph_high_thresh_uv 35000000
vph_low_thresh_uv 3300000

Google search provides this generic related documentation. The initial description paragraphs translated in lay terms describes a CPU throttling function based on battery voltage and current load limits. https://android.googlesource.com/ke...mentation/devicetree/bindings/arm/msm/bcl.txt

Of direct interest is "vph-low-threshold-uv: The battery voltage threshold below which the BCL driver starts monitoring the battery current thresholds and mitigates the CPU on the event of high load."

Also "vph-high-threshold-uv: The battery voltage threshold above which the BCL driver clears the previously applied mitigation, disables the battery current monitoring, and starts monitoring for low battery voltage."

The "-threshold-uamp" descriptions don't match the A7's provided values of seemingly voltage rather than micro amps. Assuming they're voltages of 4.2 and 3.4 but I can't guess how they take effect.

What this means for those with slowed devices under a particular percentage, check your battery voltage to see if this is the cause using a battery app or something like DevCheck. BMS State of Charge fuel gauge percentage is a varying arbitrary number influenced by numerous functions and algorithms, in other words it's a meaningless number to troubleshoot. If your battery voltage is under 3.3V at something like 50%, your battery is severely degraded and the fuel gauge is completely off, you could perhaps try setting /sys/module/qpnp_fg/parameters/restart 1 (it will restart fuel gauge calibration and the setting will automatically go back to 0). Alternatively we could try to disable the Battery Current Limit but I suspect the purpose of it is to prevent Nexus 6P style sudden early shutdowns which require an external charger to jump start them again. In any case at least this info will help those diagnose why and how degraded their battery is.
should we execute this line /sys/module/qpnp_fg/parameters/restart 1 (it will restart fuel gauge calibration and the setting will automatically go back to 0),when battery sits on 100%? then charge to 100% again,wipe batterystats,and reboot system? Can this be a proper way to calibrate the battery? When i charge my battery sometimes it says 5V at lockscreen