FORUMS
Remove All Ads from XDA

 View Poll Results: Did you find it useful?

Yes
 
12 Vote(s)
80.00%
No
 
3 Vote(s)
20.00%

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

20 posts
Thanks Meter: 18
 
By sobrus, Junior Member on 12th October 2017, 07:59 PM
Post Reply Email Thread
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/zhangyongfeiyon...tails/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
Attached Files
File Type: 7z helio_cpu_mods.7z - [Click for QR Code] (450 Bytes, 5232 views)
The Following 8 Users Say Thank You to sobrus For This Useful Post: [ View ] Gift sobrus Ad-Free
13th October 2017, 07:01 PM |#2  
Member
Thanks Meter: 54
 
More
amazing mate! waiting for some reviews of this, i am going to try it
30th October 2017, 05:35 PM |#3  
Senior Member
Thanks Meter: 8
 
More
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
1st November 2017, 05:30 PM |#4  
OP Junior Member
Flag Lublin
Thanks Meter: 18
 
More
Quote:
Originally Posted by iflawlietasgod

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).
9th November 2017, 01:50 AM |#5  
Junior Member
Thanks Meter: 1
 
More
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
The Following User Says Thank You to TwelveMoon For This Useful Post: [ View ] Gift TwelveMoon Ad-Free
10th November 2017, 07:20 PM |#6  
OP Junior Member
Flag Lublin
Thanks Meter: 18
 
More
Quote:
Originally Posted by TwelveMoon

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.
The Following User Says Thank You to sobrus For This Useful Post: [ View ] Gift sobrus Ad-Free
11th November 2017, 12:43 PM |#7  
Junior Member
Thanks Meter: 1
 
More
Quote:
Originally Posted by sobrus

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

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
11th November 2017, 07:49 PM |#8  
OP Junior Member
Flag Lublin
Thanks Meter: 18
 
More
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
8th December 2017, 10:13 AM |#9  
Member
Flag Jakarta
Thanks Meter: 8
 
More
flavour 2 is only use 2xA72 only? middle and low is disable?
8th December 2017, 07:36 PM |#10  
polomalkin's Avatar
Senior Member
Flag Ekaterinburg
Thanks Meter: 30
 
More
Flavour 1 - stuck on boot logo.
IS it for miui 8 only?
7th January 2018, 06:41 PM |#11  
Junior Member
Thanks Meter: 13
 
More
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?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes