[Xiaomi Redmi Note 4 Guides, News, & Discussion] sobrus:
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