Heating Problems, Roms, Apps & Settings


Rui Cambraia

Members
Jan 3, 2016
150
52
Heat problems devide miui users, as well as Mi4C users.
Some have heat problems while others do not. Even though a "hot phone" is a subjective concept, it is commonly accepted that a phone running above 40 degrees celcius becomes unconfortable.
When I started using Miui 8 I also started to get heating problems.
Mi4C is a hexacore processor device. A Snapdragon (hot) processor's device. A lot of processing will normally heat up the phone. Why some guys do not have this problems still remains a mistery.
Recently @Raventlov suggested that I could try to configure the Governor parameters - which I did, step by step slowly and reading about it - here's a good starting point: http://en.miui.com/thread-20409-1-1.html - a nice and simple tutorial by Stempox @xiaomi.eu.
There, we start to understand that the kernel compilation and its Governor has a lot to do with "performance", "clock speed", "fluidity", etc: meaning heat and battery issues. It is not only Snapdragon processor's guilty...!
Now I start to understand why my phone goes up to 40-42 just by surfing the Internet, or even less, by just having the screen turned on...!
Again, why some guys do not have this problems still remains a mistery.
So, feel free to share your experience and make suggestions...! Half of us will be greatfull...!
 
It might be useful to say that messing with Governor parameters should be done carefully, with a lot of reading.
Also you have to root your phone, which can be done by installing SuperSu from recovery (TWRP). If you are not a Linux guru, you will need also an app to get to the Governor parameters. I am using the app Kernel Adiutor (yes Adiutor) which is very complex but has everything, meaning really everything about your phone guts...
 
This is what i get with Kestrel config on my 4c using miui 8 ver. 7.14
Screenshot_2016-07-26-23-42-14-320_com.miui.securitycenter.png Screenshot_2016-07-26-23-42-06-920_com.miui.securitycenter.png Screenshot_2016-07-26-23-42-03-434_com.miui.securitycenter.png Screenshot_2016-07-26-23-41-51-966_com.miui.securitycenter.png
 
  • Like
Reactions: Rui Cambraia
This is what i get with Kestrel config on my 4c using miui 8 ver. 7.14
View attachment 13148 View attachment 13149 View attachment 13150 View attachment 13151
Looks great. Well, I am going to take a while to get there - to understand all the parameters of the phone to count, all Governor settings, all the reading. But I will get there eventually (using my little spare time)...! For now I wish I could explore and understand the Kernel Adiutor a little bit more.
Thanks....!
 
Last edited:
One thing I have found out is that disabling MIUI optimization in the bottom of developers menu, can reduce CPU strain since it only forces CPU to wait for every app so animations could be smooth like on iPhone.
And without changing governor I can get 4h of SOT without problems, using MIUI EU from this forum.
 
  • Like
Reactions: Rui Cambraia
I didn't change the governor, just tuned the values. SoT is a relative value, like in how much time one get for example 4 SoT since last charge. And what you do when screen is on, like gaming or instead Facebook and messaging. Anyway is it true that turning off MIUI optimization in developers settings reduce the load, but I'm not sure it does ONLY that.
 
  • Like
Reactions: Rui Cambraia
I use ExKernel Manager app to mod the profiles, anyway even if you want to use the init script it's pretty simple.
Download the file and put it in /etc/init.d (not every rom support init.d so if folder is not present you have to use the script manually)
Rename the file with no extension and give permissions 744 (chmod 744) via terminal emulator, adb shell or a file explorer with root capabilities.

Reboot and you are done.

Putting it in init.d/ folders means that each time the terminal reboots it will execute the script.
Otherwise you have to run it manually from a terminal emulator or adb shell
 
  • Like
Reactions: Rui Cambraia
One thing I have found out is that disabling MIUI optimization in the bottom of developers menu, can reduce CPU strain since it only forces CPU to wait for every app so animations could be smooth like on iPhone.
And without changing governor I can get 4h of SOT without problems, using MIUI EU from this forum.
I got an opposite suggestion... but well, that's what a forum is for: exchanging experiences...! Thanks...!
 
Did you use kernel adiutor to manualy set all values or you used the bash/init script. If you used bash/init would you mind explaining how you did it ?

Thank you.
Yes, but I have to report something: even though I turned on the "aply on boot" the changes turn back to default - core top speed plus governor, I change this settings and some time later they get back to default.
 
I use ExKernel Manager app to mod the profiles, anyway even if you want to use the init script it's pretty simple.
Download the file and put it in /etc/init.d (not every rom support init.d so if folder is not present you have to use the script manually)
Rename the file with no extension and give permissions 744 (chmod 744) via terminal emulator, adb shell or a file explorer with root capabilities.

Reboot and you are done.

Putting it in init.d/ folders means that each time the terminal reboots it will execute the script.
Otherwise you have to run it manually from a terminal emulator or adb shell
I am very tempted to try that... but I need some time to understand all that. The difference between having the app or having the script, and then all that Linux guru thing: giving permissions, rename without extension, etc...
Need time to read about it...
Kernel Adiutor is not working as I expected, don't know why...
Thanks!
 
EX Kernel Manager is a paid app. No problem about that if it works better than Adiutor...
Kestrel is a Governor that comes with EX Kernel Manager, right...?
 
Kestrel is just a profile, like bluejay or ghost pepper... The governor is most of the time the same, interactive. If you don't want to pay for the app, just use the script. I'll write a mini guide later if I got the time to
 
  • Like
Reactions: Rui Cambraia
Kestrel is just a profile, like bluejay or ghost pepper... The governor is most of the time the same, interactive. If you don't want to pay for the app, just use the script. I'll write a mini guide later if I got the time to
That would be very nice, even though I think I still have to get more knowledge about this stuff.
Paying for the app is not a problem - besides the Interactive governor, is the Kestrel profile there too...? can you manage it from the app...? Thanks!
 
ExKernel manager is just a tool with no profiles pre-loaded, as said before you have to download the profile and then load it with ExKernel app.

They use this app because it's vastly used within the community of the Nexus 5X, so they makes profiles easier to manage with app.
 
  • Like
Reactions: Rui Cambraia
Guide to apply governor settings by script

So let us start, first we have to point out a couple of things:

Android is a linux based system, and linux based system have this so called “daemons”

Daemons are programs that works in background and gives you services, in our case, we want to look to a daemon called “perfd” and why it matters for us when we want to change values of the governor.

“Perfd” makes sure that the system is running with specified values for the governor, this values are written during the boot sequence and many of them are specified in a file called init.qcom.post_boot.sh (it’s under /system/etc)

So what we need to do?
· Stop the perfd daemon
· Modify the values we want to change for the governor
· Remove the default value file that perfd use as his configuration
· Restart the perfd daemon

We are going to do all of this by hand so pay attention at what you do, I take no responsibility.

First of all we need a computer and our device connected to the same network and an app called SSH DROID, we can find it on the Play Store. (Another option is to connect the device to the computer and use and ADB shell or using a terminal emulator directly on the device, but I’m not goin’ cover this).

***DEVICE MUST BE ROOTED***

On the computer instead we have to use a program capable of making SSH connection, if you use Windows download and install MobaXterm.

So when everything is set up we launch SSH DROID and grant root permission after that we have this screen:
Screenshot_2016-07-29-09-59-06-233_berserker.android.apps.sshdroid.png

Now place your device on the desk, and put yourself in front of the computer.
Open MobaXterm and write in the command line:
ssh “what is written in the address field of the app”, so in my case I’ll write:

Code:
ssh root@172.20.7.136

it will ask for the password, default is admin
Ok now we are connected to our beloved device and we can start doin things:

Code:
ssh root@172.20.7.136

SSHDroid

Use 'root' as username

Default password is 'admin'

sh: /usr/bin/X11/xauth: not found

root@libra:/data/data/berserker.android.apps.sshdroid/home #

First we want to know if perfd is running (because not all the roms with qualcomm processor enable the service)

Code:
getprop | grep perfd

and we should see something like:

Code:
[init.svc.perfd]: [running]

[ro.vendor.extension_library]: [libqti-perfd-client.so]

Perfd is is running, now let’s check the default values:

Code:
cat /data/system/perfd/default_values

the output of the command will be a long list of values, mines are already modded and look like this:

Code:
ihf;960000
iahd;33000 1248000:30000
ighl;99
itl;85 460800:30 600000:65 672000:72 787200:78 864000:92 960000:95 1248000:98 1440000:100
gpu_default_pwrlvl;4
...
...
...

Now let’s stop perfd

Code:
 stop perfd

Let’s remove all his default values:

Code:
rm /data/system/perfd/default_values

Now it’s time to set the parameters of the governor like we want.
Download the script we are goin to use with the device (let us assume it’s in the “download” folder)

Code:
cd /storage/emulated/0/Download/

rename the file

Code:
mv kestrel.pdf kestrel.sh

then we want to run the script so:

Code:
sh ./kestrel.sh

we will get a couple of errors, because in the script there are some parameters that our 4c don’t use but don’t worry.
Code:
----------------------------------------------------
Applying Kestrel v1.0 Interactive Governor Settings
----------------------------------------------------
Applying settings to LITTLE cluster
./kestrel.sh: line 28: can't create /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif: nonexistent directory
./kestrel.sh: line 30: can't create /sys/devices/system/cpu/cpu0/cpufreq/interactive/fast_ramp_down: nonexistent directory
./kestrel.sh: line 32: can't create /sys/devices/system/cpu/cpu0/cpufreq/interactive/migration_notif: nonexistent directory
Applying settings to Big cluster
sh: write error: Invalid argument
./kestrel.sh: line 56: can't create /sys/devices/system/cpu/cpu4/cpufreq/interactive/ignore_hispeed_on_notif: nonexistent directory
./kestrel.sh: line 58: can't create /sys/devices/system/cpu/cpu4/cpufreq/interactive/fast_ramp_down: nonexistent directory
./kestrel.sh: line 60: can't create /sys/devices/system/cpu/cpu4/cpufreq/interactive/migration_notif: nonexistent directory
Enabling Input Boost at 600 MHz for the LITTLE cluster
./kestrel.sh: line 66: can't create /sys/module/cpu_boost/parameters/input_boost_enabled: nonexistent directory
Disabling TouchBoost
./kestrel.sh: line 72: can't create /sys/module/msm_performance/parameters/touchboost: nonexistent directory
Disabling Aggressive CPU Thermal Throttling
51 /sys/module/msm_performance/parameters/temp_threshold
----------------------------------------------------
Settings Successfully Applied! You may now tweak them further in ElementalX Kernel Manager
----------------------------------------------------


Now let’s start perfd and we are done.

Code:
start perfd
 
ExKernel manager is just a tool with no profiles pre-loaded, as said before you have to download the profile and then load it with ExKernel app.

They use this app because it's vastly used within the community of the Nexus 5X, so they makes profiles easier to manage with app.
Got it - we have all the links needed above...! Thanks...!
PS: if you find some time please do the mini guide for the scrip option - it would be very nice to have that too here...! Thanks for all the help...!
EDIT: ok crossing thoughts - you already made the guide while I was posting....! Great, thanks...!
 
Great guide, really. I think I will have some fun...! Thanks a lot!
Just a couple of points before anyone try the scrip option to control the governor (because we are going deeper into the phone managing - not just looking for the best or worse ROM):
1- can this process be undone, how...?
2- is this process compatible with any rom including Miui 8+...?
3- is it possible to happen a conflict between the "governor manager" settings and the "developer options" settings...?
 
1- Can be undone, just reboot the phone
2- Yes i use it with miui 8, miui 7...any rom actually
3- No conflict

I use my phone as daily driver, last time i rebooted the phone was 12 days ago, and i did it while doin some test, so nothing to fear.
 
  • Like
Reactions: Rui Cambraia
1- Can be undone, just reboot the phone
2- Yes i use it with miui 8, miui 7...any rom actually
3- No conflict

I use my phone as daily driver, last time i rebooted the phone was 12 days ago, and i did it while doin some test, so nothing to fear.
You mean, if we reboot the phone we have to install the scrip again...?
Thanks for your answers...!
 
Yes you have to execute the script again
Ok... so for some one who reboot the phone often the app ExKernel Manager might be a better option, perhaps...?
For now my MobaXterm does not accept 'admin' as a password or another issue is playing around ;-)
I'll get into that later...
Thanks again...!
Clipboard02.jpg