[GUIDE][Nikel] Helio X20 power saving settings with (almost) stock performance.

Did you find it useful?

  • Yes :)

    Votes: 13 81.3%
  • No :(

    Votes: 3 18.8%

  • Total voters
    16
Search This thread

sobrus

Member
Apr 7, 2009
20
18
Lublin
Hi,

I've prepared two small CPU "fixes" for Xiaomi Redmi Note 4/4X Nikel (Mediatek MT6797 Helio X20 CPU).
There are several fixes on the web, but none of them actually worked good.

As you probably know, CPU in our devices are controlled by both standard cpufreq interactive linux CPU goveror and proprietary Mediatek Perfservice.

The problem is, that Perfservice tends to set max frequencies and waking up big cores on certain events like launching/switching app or simpy touching or rotating screen.
Providing excellent user experience, but wasting battery power at the same time.

Simply disabling Perfservice isn't good idea, as - contrary to governor settings - both A72 cores will be limited to 1,5Ghz (down from 2,1Ghz).
So while this is nice and power saving, it also limits single core performance considerably (to about 1200 points in Geekbench 4).
Multicore performance seems unaffected, though.

My modification aim to reduce power consumption and temperatures while still providing (almost) stock speed.
It comes in two "flavours", and please note you only need ONE of them (your choice).

Two files are included in this post:
perfservscntbl.txt is *only* for flavour 1.
unlock.sh is *only* for flavour 2.
But you can use both if you want to switch between flavours.

And of course they come without any warranty - I don't take responsibility for *any* damage and bricked devices.
They were prepared in two hours time, in fact I rooted my phone yesterday and have it for a week - so I didn't do much testing.
If you don't know what are you doing, never used linux before etc - please simply don't do it.
If you have TWRP use it and make backup just in case.


Prequisities :
- Unlocked and rooted Helio X20 device

Flavour 1
This modification alters perfservice settings to much simpler and less aggresive.
- backup your stock /system/etc/perfservscntbl.txt
- replace it with included file
- give it 644 permissions (rw-r--r--)
- reboot

That's it.

Flavour 2
This modification disables perfservice entirely and unlocks A72 cores high speed for standard governor
- disable mediatek perfservice by setting
ro.mtk_perfservice_support = 0
in your build.prop (/system/build.prop)
- reboot
- run incuded bash script with root privileges to unlock max frequencies (linux proc changes are not permanent, only until reboot!).
You can use something like ROMToolboxPro to execute script automatically after each reboot.
Or use terminal as root user to set it manually (just look what's inside).


Notes:
Due to lower average frequencies (and time that interactive governor will need to ramp them up) performance will most likely be still slightly inferior to stock and you will ocassionally feel UI shuttering.
Even though you should still be able to hit 1500+/4800 in Geekbench 4 on both variants, just like stock.

I hope it will help.

Q&A:

Q) How much more SOT and standby can I achieve with these patches?
A) I really don't have any idea. I don't do such tests.

Q) Which flavour is faster?
A) Probably first one, especially for UI. Tends to utilize mid cluster more. Second one is more energy-saving. But on multicore geekbench test I got opposite results (tested just once).

Q) How can I check that it is working?
A) Try DevCheck and observe frequencies before and after mod. Try switching applications, rotating and touching screen.

Q) Can I improve battery life even further and still have usable phone (without buying snapdragon version)?
A) Yes, you can disable A72 cores entirely and have ordinary octa-core CPU (4*1.8Ghz + 4*1.4Ghz):

echo Low_Power > /proc/ppm/mode

Performance will be around 650/3500 Geekbench4 points.

Alternatively you can do it this way (don't know what's the difference yet)
echo 2 > /proc/ppm/policy/hica_power_state

Or disable both high and mid cluster, and leave only low cluster (kind of super powersaving mode, x20 becomes quad core)
echo 0 > /proc/ppm/policy/hica_power_state

(echoing -1 there will re-enable all clusters)

Q) Can I improve perfservice settings further?
A) Yes, I spent only about one hour on them, and speak polish not chinese, so almost certainly they can be improved.

http://blog.csdn.net/zhangyongfeiyong/article/details/52946781
For example I don't have any idea what's the difference between vcore 1 and 3.
Even though 3 seems to be selected for better performance, I haven't noticed any speed difference.
I set it to 1, so it may run undervolted. Maybe. Hopefully. You can also remove vcore entries entirely.
I'm using flavour 2 though, so I'm not gonna work on it anymore.

Q) My AnTuTu score (or other benchmark score, or game X FPS) went down!
A) Unfortunately, this is what you should expect from battery saving modifications.
If you need top-notch performance these modifications are not for you.
You can try altering cpufreq governor settings, though.

Q) Can I improve it further by altering cpufreq governor settings?
A) Probably yes, but not much. Default cpufreq settings are actually quite good.

Q) Will you tune cpufreq governor for my specific purposes?
A) I'm sorry I don't have time for it. As I said, default one is quite nice already.

Q) Can I improve overall device performance further?
A) Yes, you can for example enable zRAM and tune I/O schedulers, queues and low memory killer YMMV, though. And it depends on your workload.

Q) I really don't know how to do it, can you provide one click installer?
A) No, and I strongly advise against doing it if you don't understand.

Q) My device exploded!
A) You have been warned
 

Attachments

  • helio_cpu_mods.7z
    450 bytes · Views: 5,851
Last edited:
how to input these codes:

Alternatively you can do it this way (don't know what's the difference yet)
echo 2 > /proc/ppm/policy/hica_power_state

Or disable both high and mid cluster, and leave only low cluster (kind of super powersaving mode, x20 becomes quad core)
echo 0 > /proc/ppm/policy/hica_power_state
 

sobrus

Member
Apr 7, 2009
20
18
Lublin
how to input these codes:

Alternatively you can do it this way (don't know what's the difference yet)
echo 2 > /proc/ppm/policy/hica_power_state

Or disable both high and mid cluster, and leave only low cluster (kind of super powersaving mode, x20 becomes quad core)
echo 0 > /proc/ppm/policy/hica_power_state

You need to either access terminal with superuser rights (look for Terminal Emulator) or use app that can execute shell scripts (like Rom Toolbox or FX Explorer).
 

TwelveMoon

New member
Nov 9, 2017
4
1
Tried echo 1 > /proc/ppm/policy/hica_power_state
It will disable your 2x A72 + 4x A53 1.4GHz, leaving you with 4x A53 1.8GHz. Sounds like "not-so-aggressive ultra powersaving mode" for me :)
 
  • Like
Reactions: bennzer

sobrus

Member
Apr 7, 2009
20
18
Lublin
Tried echo 1 > /proc/ppm/policy/hica_power_state
It will disable your 2x A72 + 4x A53 1.4GHz, leaving you with 4x A53 1.8GHz. Sounds like "not-so-aggressive ultra powersaving mode" for me :)

But you'll lose lowest powered A53 cores. I wonder if L cores (1.8Ghz) consume more power than LL cores (1.4Ghz) when doing nothing.
Even in such case, this setting should be ideal for long term gaming - decent performance with probably no thermal throttling :)

Ah, there is also "/proc/ppm/mode" setting. I set it to "Just_Make" recently - seems to be between "Low_Power" and "Performance". Just_make doesn't limit any frequecies or affect GeekBench score.
 
Last edited:
  • Like
Reactions: bennzer

TwelveMoon

New member
Nov 9, 2017
4
1
But you'll lose lowest powered A53 cores. I wonder if L cores (1.8Ghz) consume more power than LL cores (1.4Ghz) when doing nothing.
Even in such case, this setting should be ideal for long term gaming - decent performance with probably no thermal throttling :)
Yeah, I've tried to use echo 0 on /proc/ppm/policy/hica_power_state as well, and it turns out that 4x A53 1.4GHz is still usable for low-end gaming. Tried Antutu benchmarking on echo 0 setting + CPU hifreq turned down to 1092MHz by tweaking governor values, I still get 50K++, which is quite good for me.

I also accidentally locked my lowest cluster to the lowest frequency possible (221 MHz) by simultaneously change the target_loads and go_hispeed_load values to beyond 100 (120 for example). My device became unimaginably laggy at that time :laugh:

FYI, those tweaks give me extra up to 2 hrs of SOT, which is good for someone who spent a lot of time with this device like me :laugh:
 

sobrus

Member
Apr 7, 2009
20
18
Lublin
I have my go_hispeed_load far beyond 100 (I don't quite like the idea of "hispeed" and "boost" and it's OK - not excellent, but passable, closer to conservative governor), but any target_loads beyond 90 will make UI choppy and beyond 100, as you noticed, will lock on lowest frequency.
If someone needs better UI experience, setting it to 80-85 would be my first experiment, then reducing timer to 10000.

Extra 2hr is nice improvement :)
 
Last edited:

blueasteroid

Member
Oct 20, 2016
32
6
I'm a little interested in htat. I have a Leeco s3 running MIUI 9 beta.
My problem is that in RR3 the a72 idles 1ghz to 1.5ghz, not more. And sometimes game is a little laggy.
Your tweak would fix that?
Is there anything I can do with kernel auditor more safety?
 

sobrus

Member
Apr 7, 2009
20
18
Lublin
Leeco S3 uses Qualcomm Snapdragon 652, so my tweak won't help.
And unfortunately I don't know have any Snapdragon phone to prepare tweaks for you :(

You can try to set performance cpu governor, but I don't know if it is possible on your device.
Are you sure your device is not throttling due to high temperatures?
 
Last edited:

andy_96

Senior Member
Feb 20, 2014
56
13
Leeco S3 uses Qualcomm Snapdragon 652, so my tweak won't help.
And unfortunately I don't know have any Snapdragon phone to prepare tweaks for you :(

You can try to set performance cpu governor, but I don't know if it is possible on your device.
Are you sure your device is not throttling due to high temperatures?

Maybe he meant x626?
 

cheapster8

Senior Member
Nov 22, 2016
108
16
These tweaks confirmed to be working on LeEco Le S3 X626 (MTK Helio X20)! The result is REALLY noticeable. I'd say around 50% increase in battery life. (I used method 2)
 
  • Like
Reactions: originalul

Votrexx

New member
Nov 15, 2016
4
0
How did you know the policy command, "echo 0 > /proc/ppm/policy/hica_is_limit_big_freq"

What is "echo 0"?

And what is mean by "hica_is_limit_big_freq"?

Where i can find any other policy command? :)
 

CSSman

Member
Nov 19, 2017
11
2
Can anyone explain me how to install that archive?and how to increase the working time of the phone with this archive?
 

sobrus

Member
Apr 7, 2009
20
18
Lublin
@Votrexx
I don't understand what your problem is :)

@BLINGER-PC, @CSSman
You need to ROOT your phone first, which may void your warranty, and by doing these changes improperly you CAN brick your phone too.
That's why I'm not going to give explanations easier than "modify your build.prop and echo this value". It is all you need to do.
You need basic understanding how linux and android work before you begin to be sure you won't damage your phone.
Sorry.
 

CSSman

Member
Nov 19, 2017
11
2
@Votrexx
I don't understand what your problem is :)

@BLINGER-PC, @CSSman
You need to ROOT your phone first, which may void your warranty, and by doing these changes improperly you CAN brick your phone too.
That's why I'm not going to give explanations easier than "modify your build.prop and echo this value". It is all you need to do.
You need basic understanding how linux and android work before you begin to be sure you won't damage your phone.
Sorry.
What to modify at build.prop
?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    Hi,

    I've prepared two small CPU "fixes" for Xiaomi Redmi Note 4/4X Nikel (Mediatek MT6797 Helio X20 CPU).
    There are several fixes on the web, but none of them actually worked good.

    As you probably know, CPU in our devices are controlled by both standard cpufreq interactive linux CPU goveror and proprietary Mediatek Perfservice.

    The problem is, that Perfservice tends to set max frequencies and waking up big cores on certain events like launching/switching app or simpy touching or rotating screen.
    Providing excellent user experience, but wasting battery power at the same time.

    Simply disabling Perfservice isn't good idea, as - contrary to governor settings - both A72 cores will be limited to 1,5Ghz (down from 2,1Ghz).
    So while this is nice and power saving, it also limits single core performance considerably (to about 1200 points in Geekbench 4).
    Multicore performance seems unaffected, though.

    My modification aim to reduce power consumption and temperatures while still providing (almost) stock speed.
    It comes in two "flavours", and please note you only need ONE of them (your choice).

    Two files are included in this post:
    perfservscntbl.txt is *only* for flavour 1.
    unlock.sh is *only* for flavour 2.
    But you can use both if you want to switch between flavours.

    And of course they come without any warranty - I don't take responsibility for *any* damage and bricked devices.
    They were prepared in two hours time, in fact I rooted my phone yesterday and have it for a week - so I didn't do much testing.
    If you don't know what are you doing, never used linux before etc - please simply don't do it.
    If you have TWRP use it and make backup just in case.


    Prequisities :
    - Unlocked and rooted Helio X20 device

    Flavour 1
    This modification alters perfservice settings to much simpler and less aggresive.
    - backup your stock /system/etc/perfservscntbl.txt
    - replace it with included file
    - give it 644 permissions (rw-r--r--)
    - reboot

    That's it.

    Flavour 2
    This modification disables perfservice entirely and unlocks A72 cores high speed for standard governor
    - disable mediatek perfservice by setting
    ro.mtk_perfservice_support = 0
    in your build.prop (/system/build.prop)
    - reboot
    - run incuded bash script with root privileges to unlock max frequencies (linux proc changes are not permanent, only until reboot!).
    You can use something like ROMToolboxPro to execute script automatically after each reboot.
    Or use terminal as root user to set it manually (just look what's inside).


    Notes:
    Due to lower average frequencies (and time that interactive governor will need to ramp them up) performance will most likely be still slightly inferior to stock and you will ocassionally feel UI shuttering.
    Even though you should still be able to hit 1500+/4800 in Geekbench 4 on both variants, just like stock.

    I hope it will help.

    Q&A:

    Q) How much more SOT and standby can I achieve with these patches?
    A) I really don't have any idea. I don't do such tests.

    Q) Which flavour is faster?
    A) Probably first one, especially for UI. Tends to utilize mid cluster more. Second one is more energy-saving. But on multicore geekbench test I got opposite results (tested just once).

    Q) How can I check that it is working?
    A) Try DevCheck and observe frequencies before and after mod. Try switching applications, rotating and touching screen.

    Q) Can I improve battery life even further and still have usable phone (without buying snapdragon version)?
    A) Yes, you can disable A72 cores entirely and have ordinary octa-core CPU (4*1.8Ghz + 4*1.4Ghz):

    echo Low_Power > /proc/ppm/mode

    Performance will be around 650/3500 Geekbench4 points.

    Alternatively you can do it this way (don't know what's the difference yet)
    echo 2 > /proc/ppm/policy/hica_power_state

    Or disable both high and mid cluster, and leave only low cluster (kind of super powersaving mode, x20 becomes quad core)
    echo 0 > /proc/ppm/policy/hica_power_state

    (echoing -1 there will re-enable all clusters)

    Q) Can I improve perfservice settings further?
    A) Yes, I spent only about one hour on them, and speak polish not chinese, so almost certainly they can be improved.

    http://blog.csdn.net/zhangyongfeiyong/article/details/52946781
    For example I don't have any idea what's the difference between vcore 1 and 3.
    Even though 3 seems to be selected for better performance, I haven't noticed any speed difference.
    I set it to 1, so it may run undervolted. Maybe. Hopefully. You can also remove vcore entries entirely.
    I'm using flavour 2 though, so I'm not gonna work on it anymore.

    Q) My AnTuTu score (or other benchmark score, or game X FPS) went down!
    A) Unfortunately, this is what you should expect from battery saving modifications.
    If you need top-notch performance these modifications are not for you.
    You can try altering cpufreq governor settings, though.

    Q) Can I improve it further by altering cpufreq governor settings?
    A) Probably yes, but not much. Default cpufreq settings are actually quite good.

    Q) Will you tune cpufreq governor for my specific purposes?
    A) I'm sorry I don't have time for it. As I said, default one is quite nice already.

    Q) Can I improve overall device performance further?
    A) Yes, you can for example enable zRAM and tune I/O schedulers, queues and low memory killer YMMV, though. And it depends on your workload.

    Q) I really don't know how to do it, can you provide one click installer?
    A) No, and I strongly advise against doing it if you don't understand.

    Q) My device exploded!
    A) You have been warned
    3
    Thank you for your feedback :)

    Now for those who want even better battery life, here are my current settings.
    But before you apply them, go to developer options and disable "MIUI Optimizations".
    Otherwise, your UI may (or may not) shutter or be choppy.
    These setting should also considerably improve your battery life in standby mode (ie with screen off) or when listening to music with screen off.

    Please note that this is only for "flavour 2".

    echo 0 > /proc/ppm/policy/hica_is_limit_big_freq
    echo "20000 624000:40000 1495000:80000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
    echo "99" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
    echo 338000 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
    echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
    echo 0 > /proc/gpufreq/gpufreq_input_boost
    echo Just_Make > /proc/ppm/mode
    echo 4 0 > /proc/ppm/policy_status
    echo 6 0 > /proc/ppm/policy_status
    echo 7 0 > /proc/ppm/policy_status
    echo 8 0 > /proc/ppm/policy_status
    2
    To make a long story short, it makes reaching higher clock frequencies a bit harder and disables some mediatek clock policies.
    The most important one is LCM off, which makes your phone spend a lot of time at 624Mhz instead of 221Mhz when your screen is off.
    For example all your background email, facebook, telegram etc activity is normally done at 624Mhz.
    With LCM off disabled, I get noticeably better standby time, but of course YMMV.
    1
    Tried echo 1 > /proc/ppm/policy/hica_power_state
    It will disable your 2x A72 + 4x A53 1.4GHz, leaving you with 4x A53 1.8GHz. Sounds like "not-so-aggressive ultra powersaving mode" for me :)
    1
    You can't use both of them. If you apply both of them (install modified perfservice config and disable perfservice at the same time) you will be just using flavour 2, because perfservice will be disabled anyway.
    I don't use magisk, so it's hard to tell how will it behave. Personally I would backup my entire system with TWRP and try.