yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi 4C] nachtwacht:
Maybe I was not clear or, more likely I do not completely understand which is a fact for sure :)

Let me clear up the first part, then hopefully in the end I will also better understand :)

Your script chances several files if I understand correctly ? scaling_min_freq for example is the first one you change in the script ?

Could we not update all the files that you change using TWRP ?

My guess is, (that's just me trying to understand better.....) that I think that using TWRP it is possible to change these files without root, but in reality it is not because the phone is not rooted ? Maybe because only the complete system can be changed and not single files ? (without root)

I do know that in the end, for me it is possible to root my phone, apply the settings, and then unroot it again.... which hopefully have my phone working like it never was rooted... it's just a risk I would like to avoid if in any way possible, therefore I am investigating and trying to get it all clear for me, sorry for that ;)
[Xiaomi Mi 4C] siba01:
I'm using Resurrecction Remix.

Thanks for your answer.

Enviado desde mi Mi-4c mediante Tapatalk
[Xiaomi Mi 4C] solis_f:
I was pretty sure you will do such a good job for Mi4c! Well done!

Edit: btw big cluster values are not getting applied
[Xiaomi Mi 4C] GoldGanja:
What ROM are you using?
[Xiaomi Mi 4C] solis_f:
Mi-globe rom 6.10.13 dev
[Xiaomi Mi 4C] GoldGanja:
You should not have any issue then...

most common problem is that the Big cores are OFFLINE while you run my script, usually it happens if the phone is a bit hot that's why you should use my thermal-engine.

Another problem could be the core_ctl,

go check for /sys/devices/system/cpu/cpu4/core_ctl/min_cpus

if it's 0, then you have to set it to 2 and then apply my script.
[Xiaomi Mi 4C] solis_f:
Well it's not zero. It's 2. I was using my own thermal tweak. I'll try yours and report back

[MENTION=4440904]GoldGanja[/MENTION] nope, still the same with your thermal config
[Xiaomi Mi 4C] GoldGanja:
you replaced with my thermal-conf and rebooted or restarted the thermal engine?
[Xiaomi Mi 4C] solis_f:
Rebooted!
[Xiaomi Mi 4C] GoldGanja:
running out of ideas,

if you cat /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor does it give you back "interactive" ?

btw try to post what's inside TAO.log
[Xiaomi Mi 4C] solis_f:
Yes it does

20-10-2016 15:40:36 -- 97TAO -- PerfD Stopped

20-10-2016 15:40:36 -- 97TAO -- Applying settings to LITTLE cluster

20-10-2016 15:40:36 -- 97TAO -- Applying settings to LITTLE cluster - DONE

20-10-2016 15:40:36 -- 97TAO -- Applying settings to BIG cluster

20-10-2016 15:40:36 -- 97TAO -- Applying settings to BIG cluster - DONE

20-10-2016 15:40:36 -- 97TAO -- Enabling Input Boost at 600 MHz for the LITTLE cluster

20-10-2016 15:40:36 -- 97TAO -- Enabling Input Boost at 600 MHz for the LITTLE cluster - DONE

20-10-2016 15:40:36 -- 97TAO -- Kernel modifications for better task management - DONE

20-10-2016 15:40:36 -- 97TAO -- GPU default power level to 5

20-10-2016 15:40:36 -- 97TAO -- switch to NOOP scheduler

20-10-2016 15:40:36 -- 97TAO -- PerfD Started and default value changed

Log seems to be executed well. Btw in your init.d file has an error it says smiui logfile instead of logfile
[Xiaomi Mi 4C] GoldGanja:
Yhea log seems to be all fine,

Please paste a "cat" of /data/system/perfd/default_values and i will tell you if all the values are correct.

Oh and thanks for the input on the error, i'll correct and re-upload.
[Xiaomi Mi 4C] solis_f:
u0_a91@libra:/ $ su

root@libra:/ # cat data/system/perfd/default_values

ihf;960000

iahd;33000

ighl;300

itl;82 787000:85 960000:88 1248000:99 1440000:100

gpu_default_pwrlvl;5

sst;33

smil;20

sminr;3

sitl;65

sum;86

sdm;54

cbmf;1525

cbhdr;90

cbhip;16

ihf0;960000

iahd0;33000

itl0;82 787000:85 960000:88 1248000:99 1440000:100

imst0;0

ighl0;300

imf0;0

itr0;60000

its0;80000

iiib0;1

intb0;0

ibd0;0

root@libra:/ #

Here you go
[Xiaomi Mi 4C] GoldGanja:
I've updated the script, and just run it on my device ...

cat /data/system/perfd/default_values
ihf;960000
iahd;33000
ighl;300
itl;82 787000:85 960000:88 1248000:99 1440000:100
gpu_default_pwrlvl;5
sst;33
smil;20
sminr;3
sitl;65
sum;86
sdm;54
cbmf;1525
cbhdr;90
cbhip;16
ihf0;960000
iahd0;33000
itl0;82 787000:85 960000:88 1248000:99 1440000:100
imst0;0
ighl0;300
imf0;0
itr0;60000
its0;80000
iiib0;1
intb0;0
ibd0;0
ihf4;960000
iahd4;33000
itl4;86 960000:98 1689600:99 1824000:100
imst4;0
ighl4;90
imf4;20000
itr4;30000
its4;80000
iiib4;1
intb4;0
ibd4;0

This is what you should get when cat perfd. You don't have itl4, or any other value for the big cores (the ones with "4" at the end). This means your 2 big cores are still offline when you used the script, that's the issue for you. Don't know why ...
[Xiaomi Mi 4C] solis_f:
Nope still the same... [MENTION=4440904]GoldGanja[/MENTION]

Also the minimum frequency should be 600 for LITTLE based on what your script says but it is still 384

I even added a sleep 120 just in case but still acts the same after reboot. Through terminal everything is fine
[Xiaomi Mi 4C] GoldGanja:
Sorry to hear that... did you added gov-tuner mod when you builded your mi-globe rom 6.10.13? Because i really don't know what else could be...
[Xiaomi Mi 4C] solis_f:
no i didn't. I figured that it could be conflicting, because I usually have some init.d scripts around so I ticked it off.... I cannot understand why I'm having this problem while yours is ok... You said you are using stable. What supersu do you use? Maybe thats the cause...

Edit:

I managed to get it to trigger by letting the screen on by fast unlocking the screen on boot! It closed the screen for a split second so the script got half-applied. Why is closing the screen such a problem though?
[Xiaomi Mi 4C] GoldGanja:
When screen is off, the big cores are put at sleep ... that's why!
[Xiaomi Mi 4C] rdlegy:
Should I use the updated version or the first one?
[Xiaomi Mi 4C] GoldGanja:
Always use the last one available. About my quote over there, that's the default behavior of the system not something i've implemented. But because of this, you have to run my script when the screen is turned on....
[Xiaomi Mi 4C] akrai:
Script is not automatically executed with reboot, and i think it may be related with the reason that other scripts for mi4c makes use of a 120 second sleep before doing anything, because i edited the 5 seconds sleep the script already has for a 120s sleep and it does work in my slim rom

(other people also reported the same problem)
[Xiaomi Mi 4C] ermacwins:
Does this hinder the performance of the phone in any way?
[Xiaomi Mi 4C] YiPing_Huang:
After applying your script I found my phone to be laggy upon input.

I opened Kernel Adiutor and found that the input boost frequency core 1 is set to 600MHz.

That is to say, there is no input boost at all!

However, the core frequency ramps up nicely when executing apps.
[Xiaomi Mi 4C] GoldGanja:
Never tested Slim Rom, but glad to hear that with the 120 second sleep you could solve the problem. I use the last stable Xiaomi.EU (8.0.5) with a mod to enable init.d scripts. No problem at all with the script executing all of the commands with the sleep 5.

As already stated, keep in mind that the screen MUST be turned on while the script is executed, otherwise it will not apply all the settings due to the Big Cores offline during screen off.

As you can see from the first post, the score of a synthetic benchmark like AnTuTu is in loss of about 5k points. In daily usage i've yet to see some real difference...

With the script, Little Core

min frequency

is setted to 600MhZ, so yhea basically there is no input boost. One of the biggest battery hog of the default config was the input boost @ 1248MhZ, that means that each time you touch the screen the

current frequency

of the cpu ramp up. Imagine what happens when you are answering an instant message...

If you feel it to be laggy upon input, you could set the boost freq. to 960MhZ.

Happy to hear that the freq. ramps up nicely to you too!
[Xiaomi Mi 4C] senq87:
How can I turn off the two little cores?
[Xiaomi Mi 4C] GoldGanja:
you want to disable them permanently? Then you have to change the

/sys/devices/system/cpu/cpu0/core_ctl/min_cpus

to 2 instead of 4. But i would't do that, in my experience for both battery and performance is not good.
[Xiaomi Mi 4C] Danny94:
Something similar:

http://xdaforums.com/android/software-hacking/mod-gov-tuner-project-29th-june-2016-t3407828

Included in the latest "smiui" builds from mi-globe.
[Xiaomi Mi 4C] GoldGanja:
While it's very useful to enable init.d if your ROM doesn't have it, the profiles of gov tuner are too generic. Not saying that are bad or good because i didn't try them but they only changes the target_loads of the CPU and nothing more with frequencies that, for obvious reasons, are not suited around our device.
[Xiaomi Mi 4C] solis_f:
I tried your script for days and it was quite good. I don't get though why we had 600mhz for little cores minimum frequency
[Xiaomi Mi 4C] GoldGanja:
In term of battery drain there should not be a great difference between 364 and 600 MhZ , anyway i've made a new version with the minimum freq. to 364. Try it! and report back please ...;)
[Xiaomi Mi 4C] marios199546:
Hi ! I am using mokee rom and all cores never deep sleep.... Also big cores are never offline... Any idea ? (Also mokee rom doesnt use QCOMM hot plugs)
[Xiaomi Mi 4C] AceStroke:
Newbie question,

What are those numbers permission? I only know how to change read/write permissions
[Xiaomi Mi 4C] GoldGanja:
It would be a long things to explain, but fortunately you can read it all over the web ;)

https://www.linux.com/learn/understanding-linux-file-permissions

Long story short, when you replace the file... open the proprieties of the newly copied file with the help of a file explorer, like root explorer, and set his permission to 644.
[Xiaomi Mi 4C] AceStroke:
Now i get it! Thanks!
[Xiaomi Mi 4C] djtutis:
Does anybody knows how to set permission to 644 on solid explorer;
[Xiaomi Mi 4C] AceStroke:
I've tried setting permission by number with different apps but i think only Root Explorer lets you do that.

But basically your permissions have to be like this:

RW--R--R--
[Xiaomi Mi 4C] qvanphong:
Nice work but how can i disable it?
[Xiaomi Mi 4C] solis_f:
Test results: To be honest, there hasn't been much improvement from stock since when the big cluster comes online it jumps to top frequency. I have near 80%time at top frequency on big cluster
[Xiaomi Mi 4C] GoldGanja:
Talkin about v0.8? because that's what i get in terms of times spent at each freq. after a while.
[Xiaomi Mi 4C] solis_f:
Well I think something went wrong because it seems the governor for big cluster was set to performance for some unknown reason... This phone is driving me crazy
[Xiaomi Mi 4C] Danny94:
[MENTION=4440904]GoldGanja[/MENTION]

i would test your script now but i have seen root is necassary and i removed root for SafetyNet :(.

But i would test your thermal-engine with some small modifications. Just have a few questions (im not android programmer =)).

Why do you use "quiet_therm" sensor instead of "xo_therm_buf" for the clusters (i think this sensor is near the battery) ?

Can i take some lower sampling as 5000 and 10000 like 1000 ? Or does lower sampling stress the performance ?

As i said i really like the way you manage to throttle step by step .
[Xiaomi Mi 4C] solis_f:
[MENTION=4440904]GoldGanja[/MENTION] what are your stats of usage so I can compare mine
[Xiaomi Mi 4C] GoldGanja:
As you can see not much of difference between the two...

As for the sampling rate, that value is in milliseconds. So sure you can lower it if you want, in the default configuration it was set to 1000.
[Xiaomi Mi 4C] GoldGanja:
What kind of stats? Screen on time, etc. ?
[Xiaomi Mi 4C] Danny94:
[MENTION=4440904]GoldGanja[/MENTION]

thanks for your answer. On my device after some usage (gaming - video) there are ~3-5°c difference between both sensors [quiet_therm ~47°c and xo_therm_buf ~50°c]. Thats why i ask.

Edit: I tested now and it works perfectly, i have nothing to change ;D. Constantly 63k antutu instead of 57k and just a little bit more heat. Good jop mate. I just edited the sensor and the sampling a little bit, but it seems the sensors are almost same, i think on higher heat it changes more (but i don´t reach 50°c + anymore =)). Nice, thanks for your share.

RR 5.7.1 had a modified thermal engine already, maybe the governor is modified too.
[Xiaomi Mi 4C] GoldGanja:
This is right now, one hour sot, half hour of calls... Very light usage.
[Xiaomi Mi 4C] solis_f:
On what rom?
[Xiaomi Mi 4C] GoldGanja:
Stable xiaomi.eu 8.0.5
[Xiaomi Mi 4C] YiPing_Huang:
What if my perfd is different from yours.

Should I replace my perfd by the one you provided before applying version 0.8?
[Xiaomi Mi 4C] eraganxs:
You set cpu min freq to 600mhz.

can I set it to 384 mhz?

Does it help me save battery more ?
[Xiaomi Mi 4C] GoldGanja:
[MENTION=5977075]YiPing_Huang[/MENTION] the default values are generated when the perfd starts. So of its different,it means that the script was not applied correctly.

[MENTION=5967940]eraganxs[/MENTION] in v0.8 they are already at 384.
[Xiaomi Mi 4C] AceStroke:
EDIT:

I asked something that was already answered, sry!
[Xiaomi Mi 4C] solis_f:
I got it applied. I was using EXKM and it was conflicting with the script. Now I switched to Kernel Adiutor and everything is fine. Idle drain is very good, also very good sot. It seems it will be my daily driver now! Btw, a little of topic but why do you prefer stable miui?
[Xiaomi Mi 4C] nachtwacht:
Hello,

to run this script, I know root is needed.

Will following work ?

1) Install clean rom with root (SMIUI is the rom I have in mind at the moment)

2) Apply script

3) Unroot

4) enjoy better performance etc.

The question is ofcourse, after unrooting, will I be able to enjoy the script's changes or are they undone when you unroot ?

TIA !
[Xiaomi Mi 4C] GoldGanja:
Glad that you made it! I prefer stable because i don't like to flash each week a newer version for minor updates, plus each time i should re-install all the things like xposed etc.

[MENTION=7670415]nachtwacht[/MENTION]

you can't re-apply it if you reboot your device if not rooted so it's a no-no
[Xiaomi Mi 4C] nachtwacht:
ok, so if I understand correctly your script is a temporary solution and not a permanent one (therefore you have to apply it every time at reboot)

ok... clear, very unfortunate... Thanks for the clarification.
[Xiaomi Mi 4C] akrai:
Please change sleep time to 120 so it avoids problems with some devices not executing the script for trying too quickly to execute as I reported before

---------- Post added at 10:58 PM ---------- Previous post was at 10:23 PM ----------

You don't need root for using the script, is the system who executes the script, root is needed only for placing the script in the correct place in case that your android have init.d support, smiui have init.d I think so just place the script in the folder, test if it gets executed and unroot
[Xiaomi Mi 4C] steviejrdn:
Hi, how can i enable init.d on boot? I have to reapply it every time i reboot. On xiaomi.eu stable 8.0.5 with kernel auditor. Init.d enable on boot kernel auditor, kernel auditor autostart on security
[Xiaomi Mi 4C] blagru:
Same issue here.
[Xiaomi Mi 4C] akrai:
instead of kernel auditor's init.d emulator, use this one https://play.google.com/store/apps/details?id=com.androguide.universal.init.d

then you can put the script to be autexecuted in the init.d folder (/system/etc/init.d i think)

---------- Post added at 04:39 PM ---------- Previous post was at 04:35 PM ----------

one whole cicle done with your script and thermal, 0.8v, very happy, no lags experienced, no hot phone, overall happy

and only 4h30m because as u can see, 2 days of use without charging, in the same day i probably would have reached 5.30 or 6h
[Xiaomi Mi 4C] marios199546:
Which rom do you use ?
[Xiaomi Mi 4C] akrai:
slim from csolanol
[Xiaomi Mi 4C] greytex:
Can you show me step by step how you install the script on Slim rom. I also have Slim rom
[Xiaomi Mi 4C] akrai:
1. put the script in /etc/init.d

2.
[Xiaomi Mi 4C] Redshift2:
what is the difference between versions 0.7 and 0.8?
[Xiaomi Mi 4C] steviejrdn:
That app always force close in my rom, i think reapply the script everytime i reboot wont hurt anyway...

Also, 5.20ish is also the best sot when i used kumajaya's CM13 without any script, and i'm not so happy about it..
[Xiaomi Mi 4C] greytex:
Ok. I copied TAO file to init.id folder and rebooted. After reboot i checked for file TAO under the SD card and couldn find it. Its hard to get 2 days.

Just for info. Here are my results. It think its pretty por.

[IMG="1"]https://drive.google.com/uc?id=0B76pgAVgKIwmOHNhOWs4OXpEeUU[/IMG]

[IMG="2"]https://drive.google.com/uc?id=0B76pgAVgKIwmXzBjZ2xPbl9IeEU[/IMG]
[Xiaomi Mi 4C] eraganxs:
Use fx explorer to execute it for sure
[Xiaomi Mi 4C] akrai:
if you dont have TAO.log is because script didnt got executed. Edit the script and in the line where says sleep 5, change the 5 for 120, save and reboot. Use also Granja's thermal
[Xiaomi Mi 4C] greytex:
Still not working...

First i copied file to etc/init.id

[IMG="1"]https://drive.google.com/uc?id=0B76pgAVgKIwmRDV3ZDhkSnB0cnM[/IMG]

Than i changed 5 to 120

[IMG="2"]https://drive.google.com/uc?id=0B76pgAVgKIwmcW83NUViNkQxVTQ[/IMG]

Rebooted and after than still no TAO.log file

[IMG="3"]https://drive.google.com/uc?id=0B76pgAVgKIwmMk5SQVlOQ0JKZGM[/IMG]
[Xiaomi Mi 4C] eraganxs:
press on it to choose execute you haven't execute it
[Xiaomi Mi 4C] Danny94:
Well i got root and Safety Net running again so i tried your script v 0.8 and is working very very well. Less heating and higher performance, but i got some freezes (had to hard reboot, but i will test a little bit more because im not sure why and if your script causes. )

Thank you [MENTION=4440904]GoldGanja[/MENTION]

But im using the RR-Thermal engine, because there is no gpu throttling and less heating (I don´t understand why is less). RR Thermal engine in the attachments, who wanna try.

Edit:

3 more freezes after this Post above. Most frequently while playing PoGo. Maybe the Rootswitch apk (don´t now) ?

Edit2:

Does i have to use quick mode (power settings) ? If yes please note that in your first post.

Edit3:

My perfd/default_values doesn´t look like that you postet in your first post.

Im using Kernel adiutor for applying your script and there i got no log file, just if i execute it.
[Xiaomi Mi 4C] GoldGanja:
The thermal engine from RR is pretty similar to mine but as you said there is no thermal control over the gpu.

About the Quick mode in the battery for CM related rom, i can't say anything because i don't know what Quick does in your rom or in other. I suppose that quick should be something similar to the default values of our device, so you should be able to execute the script with no problem. Show me your default_values and i'll tell you what is correctly applied and what not...
[Xiaomi Mi 4C] Danny94:
[MENTION=4440904]GoldGanja[/MENTION]

I still have overheat problems :(. Until now i don´t have any freeze, i used the first method now withouth Kernel Audiutor but i will keep an eye on it.
[Xiaomi Mi 4C] GoldGanja:
It seems that no values are applied to the BigCores, as you can see the main difference is the lack of values with a 4 before the semicolon ( itl4; for example stand for interactive target load of cpu4) , plus i was looking at sum and sdm (upmigrate and downmigrate) and this values are not what i've written in my script. BUT it was applied for the LilCores... since you are using RR , maybe the hotplug is messing with my script and you should be sure to have all cores online before trying to apply the script.

I'd run the script manually in your case just to see what the shell output is.

For the overheat, really i can't say much... right now my xo_therm_buf sensor is @ 29° celsius. Keep in mind that the modified thermal config (both mine and the RR ones) is made to keep higher frequency when the temperature get higher. So, if it's overheating while you are doin nothin but web browsing texting etc. there could be a problem, but if it's overheating while you play...well i don't think there is actually a problem.
[Xiaomi Mi 4C] Danny94:
[MENTION=4440904]GoldGanja[/MENTION]

No while broswer texting etc i never had overheating problems. Just while playing or watching videos 2k, but thats a problem for me.

Maybe i will try with quick mode again.

Edit:

To apply the script manually while big cores are running isn´t as easy at it looks like =). Thats because of enable core_ctl maybe. But my rom has that too i think, so no chance.
[Xiaomi Mi 4C] waingro808:
Excellent work OP!!! I have only been using this half a day, but I can tell it's amazing. I have 50% left with 2h45m SOT while downloading tons of stuff and running benchmarks. I am using this with Globe ROM 8.0.5 stable. I had a LG G4 before, so I knew this SD808 chipset could easily last me 2 days with my normal usage. Thanks to you, now it's the same on Mi4C!

It looks like Globe ROM latest update now has hotplugging by default:

http://mi-globe.com/index.php/2016/...-mpdecision-for-all-xiaomi-snapdragon-phones/

Does your script conflict with this? Bad idea to use together?
[Xiaomi Mi 4C] Danny94:
Well i can say now that not your script caused those hard freezes i mentioned some posts before. I removed your script and still have so something else will disturb. (systemless xposed maybe or a combination with root switcher)

Have still problems to apply your big core settings.
[Xiaomi Mi 4C] solis_f:
Well i was using their rom but i didn't find any good way to ensure that mpdecision works on mi4c. Until now I can say that most probably it doesn't work
[Xiaomi Mi 4C] hasi64:
Excellent!

Hi, I'm very satisfied with your work. Using it on rooted MI4c with xiaomi.eu 6.5.26 (Miui 7.4).

I get more than 2 days battery life! I'm running the script V0.8 using app "init.d scripts support". dont have init.d folder . No problems at all! :)
[Xiaomi Mi 4C] GoldGanja:
I'll check what their mod do and report back...thanks for the feedback! :)

It seems it's not working right now, it's even stated in the page:

Mi 2/s (aries)	working

Mi 3 / 4 (cancro)	working

Mi 5 (gemini)	working

Redmi3 / Pro (ido)	working

Mi Note (virgo)	working

Mi 4c (libra)	not working

RedMi Note 3 Pro (kenzo)	not working
[Xiaomi Mi 4C] solis_f:
A little off topic but anyone knows when are we getting the next stable MIUI ROM? The last one is almost two months behind on updates! I want to use it but it's very old.
[Xiaomi Mi 4C] naaiil:
[MENTION=4440904]GoldGanja[/MENTION] what mod are you using to enable init.d on 8.0.5.0 xiaomi.eu? i try some init.d enabler but doesnt work..

thanks..
[Xiaomi Mi 4C] waingro808:
Yes, that's because me and another person tried it, and told them it's not working on Mi4c :)

---------- Post added at 01:20 PM ---------- Previous post was at 01:16 PM ----------

I switched from stable to dev yesterday because stable is too old. I don't think anyone knows.

---------- Post added at 01:22 PM ---------- Previous post was at 01:20 PM ----------

I can confirm Kernel Adiutor app works. Just make sure it's allowed to boot on startup in the app/security settings.
[Xiaomi Mi 4C] solis_f:
Have you noticed huge battery drain in last dev rom?

I can confirm that kernel auditor works too. You can also check globe-rom stable
[Xiaomi Mi 4C] GoldGanja:
hehehe i used the one from govtuner to enable it... there is a script inside of the zip if you don't want to flash all of it.
[Xiaomi Mi 4C] GoldGanja:
Yes indeed, set the securty app to let Kernel auditor run at boot!
[Xiaomi Mi 4C] GoldGanja:
BTW, i switched to CM 13.1 from TeamSuperluminal to do some tests. I've managed to apply my settings through their ts_power.sh script, plus i'll update my script soon and release a ts_power.sh to use with that rom too.

One of the main reason that made me make the switch to CM was the native support to Xposed and selinux set to permissive, to let me use PowerNap module. I've tried to use it with MIUI but selinux is a problem and i could't get statistics for it...

Have to say, for the idle drain, it's a huge help.