[Xiaomi Redmi Note 5 Pro Guides, News, & Discussion] otonieru:
Hi Guys, this is a continuation from initial discussion (and my promise) on InsigniuX kernel thread HERE

UPDATE 1 : After further testing, incorporate input boost to CPU 1 and 5 actually help the performance without affecting battery, as long as we set it within the optimal frequency. I also put fine tuning in hispeed_delay value, please use latest Profile File if you are using PRESET, or check the new values bellow if you do manual config

NOTE : If you are too lazy too read all the technical stuff, simply download the PRESET KERNEL ADIUTOR PROFILE HERE, and apply it to your Kernel Adiutor (choose "profile" from side bar, hit the (+) icon, and choose "import" and choose the downloaded .json file)

as we all know and aware, we always look and try to find the most optimum configuration to achieve best battery life without sacrificing performance. And while of course Qualcomm and Xiaomi have the most talented developers in their team, sometimes the implementation between both in their mass product might left a room for improvement. And in that exact room, we as community here play our role,

so, in an attempt to get a better fluidness out of this device, without sacrificing battery life, i remember one of the guide made by [MENTION=5886947]soniCron[/MENTION] i used to stumbled upon few years ago. This Guide give a very detail insight on how to optimize the interactive governor on almost any device/any kernel/any rom (as long as you have root), and thats what i gonna try to apply to our device - if you want to check the guide yourself : HERE

so i take a look into Whyred Kernel Sources to see the voltage values being used by our processor for each frequency step. And here's the voltage/speed table in case you want to see :

[IMG="table voltage image"]https://image.ibb.co/iGZg5A/SD636.jpg[/IMG]

from that table, we can see which frequencies are using most power, and where is the most jump in voltage usage happen when switching between frequency.

Higher voltage jump will cost more power, means less battery life.

in conclusion, i found few frequencies which are less favorable, which is

LITTLE CPU :

1136Mhz - step by step Speed Gain is fine, but when compared to straight jump to 1401Mhz, the Speed to Power Ratio is become less favourable

1536Mhz - Smallest Speed Gain compared to Power Usage

and i also found some which might be the best/favourite frequencies :

LITTLE & BIG CPU :

900Mhz - Best contender for base speed, as it use almost same power with 633Mhz, but with plenty of speed gain

1401Mhz - Good Speed to Power Ratio

and

1747Mhz - Good Speed to Power Ratio for BIG CPU

_____________________________________________________________________________________________________________________________________________________

Now we take into account of the minimum frequency needed to ensure smooth task (if you dont know what am talking about, read the GUIDE i mention in my opening paragraph) :fingers-crossed:

For Whyred, i've found the best frequency is as following :

Idle = 633MHz (Lowest we can go at the moment)

Scrolling = 900MHz (Use Chrome browser to scroll Facebook in desktop mode)

Video = 1401MHz (Play 1080p*60fps videos in Youtube app)

App load = 1747MHz (Can use any app really)

High load = 1843MHz (Max out just in case)

Using the formula take from soniCron guide, i tried calculate optimum CPU load (this will be used as target load config) config for each frequencies

If you want to see the formulas :

We want to determine 2 values for every available clock rate: the maximal efficient load and the minimal efficient load. To make this determination, we need to bust out our calculators. (Or spreadsheets!)

For the maximal efficient load, we want to correlate a load value no higher than 90% of a given clock rate before it would be more efficient to jump to the next clock rate–to avoid overwhelming a particular rate while avoiding premature jumps to the next. For this value, we calculate it as:

(clock rate * 0.9) / next highest clock rate

For example, the maximal efficient load for 600Mhz on the Nexus 5X would be calculated as:

(600000 * 0.9) / 672000 = 80.36% (rounded and normalized: 80)

For the minimal efficient load, we want to correlate a load value at which anything higher would be better served by a higher clock rate. To calculate this:

(1 - next highest clock rate / clock rate) * -1

For example, the minimal efficient load for 600Mhz on the Nexus 5X would be calculated as:

(1 - 672000 / 600000) * -1 = 12.00% (rounded and normalized: 12)

with this config, logically speaking we want to make the Governor to favour the "best" frequencies above, and minimize the usage of unfavourable freqs.

LITTLE

633Mhz : 63
900Mhz : 71
1136Mhz : 23
1401Mhz : 82
1536Mhz : 4
1612Mhz : 83

BIG

1136Mhz : 73
1401Mhz : 9
1747Mhz : 85
1843Mhz : 90

Now that we already get the optimum number, time to apply it

Use your favorite Kernel Manager, in my case, am using Kernel Adiutor, and go to CPU Config - CPU Governor Tunables and input these value (am using Hawktail base profile from soniCron thread, as it seems it work best for most of devices, and i already do trial & error with some other value like timer rate as well ) :

(LITTLE)

align_windows:1
go_hispeed_load: 95
above_hispeed_delay: 0 633600:60000 902400:75000 1401600:100000
timer_rate: 80000
hispeed_freq: 902400
timer_slack: 200000
target_loads: 70 633600:63 92400:71 1113600:23 1401600:82 1536600:4 1612800:83
min_sample_time: 35000
boost: 0
boostpulse_duration: 0

(BIG)

align_windows:1
go_hispeed_load: 95
above_hispeed_delay: 32000 1136000:60000 1401600:75000 1747200:80000
timer_rate: 60000
hispeed_freq: 1747200
timer_slack: 100000
target_loads: 98 1113600:23 1401600:9 1747200:85 1804200:94
min_sample_time: 20000
boost: 0
boostpulse_duration: 0

Other necessary adjustment :

Boost : ON For CPU 1 at 902400 and CPU 5 at 1401600 both for 100ms

Min Big CPU Hot Plug : 0

Disable all Toggle in Thermal Section

Run Terminal and command :

su
stop perfd

or Install this MAGISK MODULE to disable Stock Thermal & Hotplug Control (Courtesy of [MENTION=6872997]Mr.Nguyen0504[/MENTION])

Now you can test it. Do full charge and use it normally, see whether you can see the improvement or not,

be mind that this config is not really adjusted towards battery life, but rather overall fluidness/performance, yet without sacrificing too much power

Hopefully it helps you as it seems to help me (you can expect no less than 7-8Hrs SoT, am quite heavy user myself, with 2 WhatsApp account and 1 LINE account constantly active. YouTube & Gaming at least hour/day as well). Discussion is more than welcome here, as these are considered an initial calculations that still yet to furtherly fine tuned for our CPU.