yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi 4C] t-ryder:
You removed the license from my hosts file.

But that's OK.

Here it is.

DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE **** YOU WANT TO.

See https://t-ryder.de/hosts.txt for possible updates. URL can be added to AdAway.
[Xiaomi Mi 4C] solis_f:
I'm terribly sorry. I just removed it because I thought it would interfere with Adaway's txt-importing procedure. Now that I tested it I can see the parser is not bothered at all. I'll reupload it with your licence, give you credit on the OP, and also, (I've checked your website) can I use your icon pack for this mod instead of "stealing" multirom's icons? They seem pretty awesome and it would be a great honor of having them!

Edit:

Updated OP with descriptions for each zip file and some general clarifications
[Xiaomi Mi 4C] t-ryder:
No need to be sorry, actually I was just joking. See, it's the WTF public license. I appreciate your interesting work and regarding the icon packs; multiROM icon pack is released under CC by-nc-sa license, so is MIA ex. MIA ex is partially based on multiROM pack. So just take what you need, give credits and all is good.

I wonder what APKs are really save to remove from MIUI 8 Android 6. I want to get rid of some stuff, but I don't know if it will break some framework stuff or give me the account verification on boot.

Gesendet von meinem Redmi Note 3
[Xiaomi Mi 4C] solis_f:
You can always ask ! Please, feel free.

Edit:

If I have free time I will write a post, explaining system apps and who does what.

Also, because I seem to be addicted to this I will be publishing soon (if everything goes well) a zip that uses fully hotplugged cores ( big and little cluster) and see how it goes !
[Xiaomi Mi 4C] .dot.:
Can you please confirm, all your zips contain the LG's thermal conf and interactive cpu governor right?

The alt version has a different thermal conf but the rest is the same right?

Personally I'm currently testing the alt version on globerom 7.3.30 (no mods) and battery drain and heating seems worse to me. I will downgrade to .16 because .30 rom is super buggy anyway and I will try the alt version again to see if there's any difference.

It's a hassle for me testing because my bootloader gets locked with every nougat flash and I need to edl flash an old 5.1 rom to unlock and then reflash twrp and globerom and your tweaks again. :)

Also can anyone confirm does the governor work on 5.1?
[Xiaomi Mi 4C] solis_f:
Lg thermal tweak is only on old zips. The new zips contain a custom thermal tweak and interactive governor tweaks. The difference between normal and alt debloater is the cpu tweak. If I remember correctly only an old zip is working with lollipop (Mi4Charged_L)
[Xiaomi Mi 4C] .dot.:
Oh I see.

Well with the alt version according to aida64 the cpu utilization and battery discharge is indeed lower when idle.

But with some minor usage like 5 minutes the battery draining begins. It's possible ofcourse that .30 is to blame.

In your experience do the new custom tweaks perform better to the lg's thermal?
[Xiaomi Mi 4C] solis_f:
It depends on what you mean by "performing better". The new thermal tweak has generally been better for me. It does cool the phone faster, it does keep it cool, it doesn't throttle much. I like it.

And yes, alt is supposed to be more battery efficient than normal debloater but sometimes it lacks performance. But after some usage I think normal is better after all. But I left it here if someone prefers it
[Xiaomi Mi 4C] .dot.:
Thanks for the info. Yes before .30 + alt I was briefly using .16 + normal and it did seem better to me also.

One more question regarding the custom icons. For me applying the default theme doesn't work I still get .eu icons. Is it possible your script copys them in the wrong folder?
[Xiaomi Mi 4C] anugra01:
I'm quite agree, will try the normal with the next miui globe update, seems that .30 is not a good update, i noticed lagging after deep sleep when typing, resulting in more typo error
[Xiaomi Mi 4C] solis_f:
Which icons are the same?
[Xiaomi Mi 4C] .dot.:
All icons are the usual xiaomi.eu icons. I can't get your icons to load with any theme.
[Xiaomi Mi 4C] a5m:
Funny thing. I have the same nick here as at 4pda, so XDA alerted my about your post.

I do not personally think using the LG G4 thermal for Mi 4c is a good idea. Mi 4c has its maximum restrictions at 50° by xo_therm_buf, which meant to reflect outer case/display temperature. The config from LG G4 goes up to 60°. I had an experience with heating my Mi 4c to 61° and the display caused a real burn to my lips. I think anything above 53° is extreme and can cause harm to the phone. Even 50° is probably not desirable in the long run. You should also consider that 60° is a hotplug temperature (big cores goes off) on G4, while it is only 45° on Mi 4c (and many calls it "hot" even at this level), meaning that you can really reach temperatures far over 50° using the G4 thermal (the big cores can heat up to 100° according to the cores thermal sensors, so there is no way to prevent the overheating under load if you do not cut them off). You do not have to play heavy games, many casual time-killers are overly aggressive in the terms of CPU usage (they do not know the word "optimization" nowadays).

Anyway, it was just my opinion. What is important is that MiUI Nougat and most of the latest custom ROMs (RR, AICP) use an encrypted thermal configuration file. When replacing it with a usual thermal-engine-8992.conf, you are leaving the system without protection at all. There is a trick to make them working (placing decrypt.txt to /data and data/thermal) , but it is not failsafe.

I found that you are using the templates from v. 170326. I have introduced a nasty bug in this version, preventing the hotpluging of the big cores on MiUI if is_android7 is set to 1, which is corrected in v. 170401. Though I see, you have corrected the bug too, removing the condition from insmod core_ctl when you are switching on is_android7 trigger. However, I see a potential problem in those scripts where you use is_android7=0, because this prevents executing restorecon -R /sys/devices/system/cpu, which I think is required on Nougat after changing the governor to interactive as it creates a new file tree (though, I should say in my tests I never saw the contexts became broken even with this command not used, but it is probably safer to execute it anyway).

And, just in case, maybe I should mention that if cluster1_on is set to 0, the big cores will be turned off anyway, so the trigger cluster1_off_when_idle will do nothing. I found this in Optimiser_N and Debloater_N from a "new zips" set.
[Xiaomi Mi 4C] solis_f:
1) Thanks for the heads ! Very nice work out there! This wouldn't be possible without you. I will fix the thermal tweaks and remove the LG G4's thermal tweak.

2) Also, ill try to fix the scripts so that they include all the required commands to be executed.

3) I have in mind a workaround for the correct application of multirom.me icons

Edit: [MENTION=7762377]a5m[/MENTION], also what do you think about turning off little cluster cores off? Do you think it's gonna give us some battery savings or not?
[Xiaomi Mi 4C] solis_f:
Updated zips with bug fixes. Naming goes as usual
[Xiaomi Mi 4C] a5m:
I don't think so. At least it is not a good-for-all thing. Rapid switching the cores on and off not only hinders the performance, but for some reasons it causes more heating and battery drain. Even if we are switching off only one little core, I can see it constantly being switching on/off when the phone is in use. So I think we can expect some battery savings only when the phone is idle. However, this usually means that our screen is turned off and the cores goes to the deep sleep anyway. And these savings must counteract the increased drain while CPU is in use.

Finally, even with the screen on, how much is the difference between the core being switched off and the core idling at minimal frequency? I can't measure it in any eligible way. Some other things to think about. Nexus 5x sets the minimal frequency for the big cores to 633 MHz instead of 384. In the source code (or from the custom cores) we can find out that the minimal frequency for Mi 4c is 302 MHz, however the stock ROM use 384 instead. Redmi Note 3 Pro use 691/883 MHz, even so it has 400/400 MHz available. So we can see the guys, who should know something about Qualcomm CPUs, make these interesting decisions to use higher frequencies than available. In my experience, fine tuning of CPU parameters can often either to not have an impact on the battery, or it can be very small. But, of course, it will depend on how you actually use your phone.

With all this in mind, I prefer to keep even big cores always on. With stock script from MiUI Android 5.1, where migration intensity was rather high (upmigrate/downmigrate = 85/70), I found switching on/off the big cores can increase the drain and heating when the load is above average. MiUI Nougat stock script is far more reserved here with its 99/85 upmigrate/downmigrate values. Using these values, switching the big cores off while idle has some sense. But the little cores? Rather not, as they do not have such constraints and are being disturbed constantly.
[Xiaomi Mi 4C] solis_f:
I have my concerns about turning off little cores also. But for big cores since they can be turned off for a commendable amount of time without being disturbed, I think we can get some battery savings from this. What I don't know and I can't even find such thing on the internet, is the voltage/amperage required for a power-gated core to turn on. I know that turned-off components need a hefty amount of power for turning back on. If this event happens a lot in a small period of time, it is usually better to leave it turned on as the switching power greatly exceeds the nearly idle state power required to leave the cores turned on.

So, if I understand correctly, you prefer your STANDARD script without the turned off big cores?
[Xiaomi Mi 4C] a5m:
Yes, especially on MiUI, because I find it a little sluggish. LineageOS-based ROMs, on the other hand, are less demanding, so I don't see a problem turning the cores off over there.

P.S. I have two scripts with similar names, but quite a different settings: "standard+" for MiUI and "standard" for LineageOS/RR/AICP. I feel simple "standard" is a bit slow for MiUI.
[Xiaomi Mi 4C] solis_f:
And staying with the default thermal config (I guess) since we can't change it anymore on MIUI Nougat ?
[Xiaomi Mi 4C] a5m:
I use a trick with decrypt.txt file (found by michфуд @ 4pda.ru) to set up a cooler thermal config named "0906 mod47", which resembles to some degree a thermal from Mi 4s. I have some pictures from my post at 4pda.ru displaying the difference between thermal configs:

36-56 — temperature scale (xo_therm_buf data);

numbers — throttling to these frequencies at their corresponding temperatures, 0 means one of big core or both big cores are hotplugged at this point;

orange/red boxes — it is when big cores are switching back on.

However, as I said this method is not very safe. We need to put decrypt.txt (it can be empty, but I prefer to put the copy of actual thermal config inside) into /data and /data/thermal folders, then OS will accept an unencrypted thermal config from its usual place: /system/etc/thermal-engine-8992.conf.

But the system may delete those files when we boot into the OS the first time after applying the config, so we have to restore decrypt.txt again. It may take several reboots until the files are anchored (usually it works right away). Then, files seem to settle down "forever" (I tested it for a week or two in a row and more than a month in total), though I can't be sure it will not stop working. That is why I discourage to use custom thermal configs on MiUI Nougat and other ROMs with encrypted thermal.

Note: If we want to put back the original encrypted thermal config, we have to remember deleting decrypt.txt files.
[Xiaomi Mi 4C] solis_f:
Just a thought:

If we did a script that runs on boot and checks if the correct decrypt.txt files are present in the needed folders? Then if they don't exist, or got deleted they will automatically copied back to the right directories from sdcard or another place in system partition. Then restart the the thermal engine service so that it accepts the new values

Just a quick solution I came up with. Tell me if I'm missing something
[Xiaomi Mi 4C] .dot.:
Right now (because I'll rather wait until stable nougat) I'm using the last 5.1 miui globerom build and the interactive governor + lg's thermal conf provided in old zips and I see a big increase in battery life. The one thing that always bothered me with 5.1 miui was the lack of governor settings and I didn't know there were miui builds with this possibility out there. I don't notice any special overheating and I notice much more optimal battery usage, but true I'm not a heavy user. Which thermal conf would you guys recommend to replace the lg's one to keep it safer?

Just my noob 2 cents. From my experience even though turning big cores on/off constantly might consume more power at the time, it's still better average than having them on all the time, because for simpler tasks they are not needed. I think the higher minimal frequency settings you guys mentioned with other phones could actually improve battery life because utilization of small cores would be better and the task at hand would be "completed" sooner?

I noticed this with my gf's mi4 which has 4 2.7ghz cores. With mpdecision completely disabled the battery improved dramatically with all 4 cores constantly on. Cpu usage dropped drastically (prolonging battery life) because all cores were helping instead of just 2 churning at higher frequency to do the job.

But Mi4'c small cores are weak and maybe making the minimal frequency a bit higher might help to do the task faster and prevent big cores from kicking in too often? :)
[Xiaomi Mi 4C] solis_f:
Use this (change extension to .conf)

Well GoldGanja made a similar test script using 600 mhz as minimum for little cores and it did fairly well. I will make a test script today and publish it here for testing.
[Xiaomi Mi 4C] .dot.:
Thanks for the conf. I'm curious to see the results.

I have a few questions. What exactly causes the big cores to turn on? Is it purely cpu load or any other factors like heat from small cores? Would it be possible to prevent big cores from kicking in too soon and when they do is it possible to keep them ON for a little bit longer so they gradually turn off because of further spikes in cpu usage? Also can big cores be individually controlled meaning only 1 kicks when needed and 2nd again later if needed. And perhaps control their interchangeability? Right now which one turns on and off looks random to me.

The reason I'm asking is because I've seen this work in some aosp marshmallow rom I tried some time ago.

In my opinion this chipset is a fail anyway so heat is inevitable so maybe a little more usage (and heat) out of the small cores before big ones kick in isn't such a bad idea. :P
[Xiaomi Mi 4C] a5m:
We can do a script to check if thermal-engine-8992.conf is encrypted and if not make a check for decrypt.txt.

Recreating decrypt.txt is easy. No need to store it somewhere. We can create it from unencrypted thermal-engine-8992.conf with "cp" command (=copy):

cp -f /system/etc/thermal-engine-8992.conf /data/decrypt.txt

Restarting thermal engine service is not an option, I'm afraid. In many tests decrypt.txt was deleted when meddling with thermal-engine daemon:

stop thermal-engine
start thermal-engine

I thought about scripting this too, but I don't know how the things actually work and the scripting will add complexity, making the method even more prone to errors. In the end a user is required to keep an eye if thermal config is working anyway.

There is one more thing about restarting the daemon, which I found while experimenting with changing thermal configs without restarting the system. If there were any throttling at the moment, it will remain until we restart the phone. I have no skill to debug this.

I think, the only really safe method is to learn how to encrypt custom configs, so they will be accepted in "natural" way.
[Xiaomi Mi 4C] solis_f:
In my plane of understanding we can't have that much control of core through the core control module by qualcomm for this device. They are woken up based on load, but which one goes first is not known to me. I can make them so that they stay awake for longer periods of time, but this goes both ways. If they just turned on and they have very little load to handle, they will still stay awake despite almost zero usage, because we set that delay of turning off again.

Well, i'll stick to the default one, since until we find a feasible solution, I will be buying a new phone anyways :P But thanks for the input anyway!
[Xiaomi Mi 4C] solis_f:
It seems that this conversation got you all fired up :P I have to welcome you to xda thought, it seems you are a new member :P no problem about being off-topic since this discussion is about making our phone better (this is what my zip is trying to achieve). There are a lot of things going wrong with thermal throttling but the ratio of fixing them and getting better experience with your phone is making this subject not worth the effort after all, since msm8992 is a faulty SoC to begin with. Not much you can do. Also, considering the relatively high temperatures this phone maintains even in somewhat small load/usage/activity, battery life suffers even more. You wouldn't believe how much easier a battery can get depleted when the phone is hot(electrons move faster). One particular day in winter this year, room temperature about 20C, I forgot Mi4C near a heating element. It wasn't near enough to damage the phone but it was enough to keep it hot (at around 42-43C, I checked immediately when I picked it up) and I found out that it had lost almost 30% of battery just by lying idle for an hour in hot temperatures. So keeping the phone cool (for user experience and avoiding battery leaks) and keeping consistent performance throughout everything (like heavy gaming) seems impossible to me. So in everything I make, and tweaks I applied on this phone was always by taking in consideration that I can't have that. I tuned my phone to suit my needs which are a lot of texting, browsing, emails and stuff. Thus, what I need is the most battery I can get, without compromising user experience. And that is what I want this zip to achieve after all
[Xiaomi Mi 4C] .dot.:
I understand yes. Basically I was wondering if the big cores could be controlled to the effect that 1 big core kicks in when small cores can't handle the load (or get too warm) and then more slowly turns itself off because of further spikes in cpu usage (for example when background crap starts up when phone is supposedly idle), otherwise it's too much on/off going on which causes again more drain. This kind of coincides wih [MENTION=7762377]a5m[/MENTION] theory that there isn't much difference if big core is asleep or idling at min. frequency so in effect staying on at min. freq. for a bit longer shouldn't cause too much drain but could help with temperatures maybe too. While the 2nd core is more "dynamic" in it's on/off switching.

This is so cool what you have done with scripts and a great explanation I agree. In your scenarios it really does come down to what you need at the moment.

From a purely selfish point of view as I'm not a gamer but I do check my phone often for emails etc. and do require a bit of SOT sometimes, my thinking is that by forcing small cores to handle a bit more load thus preventing big brothers from kicking in too often could save some battery. But then again this causes more heat and in return more battery drain? So I'm kind of back to what I said earlier that at least 1 big core (if possible) could be tweaked to stay on for a bit longer to help handle the load and spikes. Then this in return I'm guessing would prevent too much heat and actually prolonging battery life.
[Xiaomi Mi 4C] liddx:
The icons on your zip doesn't seem to be working sir. I used the N_Alt one on miui 7.3.30. Thanks for your hard work.
[Xiaomi Mi 4C] solis_f:
I'll take a look at that

Edit: I think it's fixed
[Xiaomi Mi 4C] BTBK:
[My 2 cents] From my testing and experience with this phone I found 2 big heat sources :

1. Little cores max.ed out :: so just by setting little cores to 1200MHz I can get much lower temps in simple but long task ( eg. web browsing)

2. throttling loop ( heavy task >> throttling >> task gets heavier >> more throttling) :: thermals from G4 works really well for me

but I think a better solution will be a more balanced load on All cores. Instead of waiting until little cores will get loaded and hot, then kick in big ones, there should be a smaller threshold.

For example little one go to 60 %> big one turn on with medium freq. > task is done, if not increase freq until max.

So all cores ( and maybe GPU) will be kinda even underclocked until needed. I know that governors are doing it by default, but they aren't working together witch are making phone most of the time quad-core because of throttling ( or hot as hell :D )

Maybe someone test something similar :confused:
[Xiaomi Mi 4C] solis_f:
This gave me an idea to try. Thanks!

Also, you have to keep in mind that big cores are not the same in any way with little cores so they can't be used in the same manner. Big cores are burst cpus, designed to engage in really fast and urgent work tasks and don't work good even in sustained low loads. They use too much energy to make everything faster so under prolonged periods of load, the energy used will be very large. They only need to engage when things are about to get laggy
[Xiaomi Mi 4C] BTBK:
[MENTION=6537267]solis_f[/MENTION] if you need something to test just PM me ;) . I'm always on AICP

Glad to help anytime !
[Xiaomi Mi 4C] HairyMerkin:
What zips do I need for the AICP 7.1 nightlys?
[Xiaomi Mi 4C] solis_f:
Read the first post
[Xiaomi Mi 4C] liddx:
Are you cooking now for 7.4.6 sir? It seems that the new update has this thing "A smarter and more efficient CPU allocation strategy" so they say.

Might help with your future tweaks about the core thing.
[Xiaomi Mi 4C] solis_f:
I'm installing the update now and check what we've got here
[Xiaomi Mi 4C] solis_f:
I'm trying to understand that new cpu allocation strategy miui has implemented. There are some new system apps that seem to be the new changes but I didn't quite get what the change is... Any help would be appreciated.

Well, xiaomi seems to have suspended the update after all for our device due to a bug in themes app, but Xiaomi.eu released it and I didn't find any themes app bug in there.

Also, we have:

HybridPlatform.apk

MiuiDaemon.apk (seems to have replaced Performance.apk which I didn't know also what it did, not much I suppose since removing it changed nothing)

Mqsas.apk

com.quicinc.wbcserviceapp.apk

SYSOPT.apk

The above apps seem to be the framework behind that so called better cpu allocation. If I don't find what these apps do and what this cpu optimization is all about, I don't know if these are worth removing or not. I'll release an update later today on all zips and provide something new also.
[Xiaomi Mi 4C] BTBK:
In that case we will have warm hands, always :D

So is there a way to actually optimize heat/performance ? It's a shame that phone may start throttling in like 1 min after unlocking.

I saw a video with a guy who replaced SoC cover with a coin shaped to fit in (for heat spreading). He got like -5c in average. Maybe undervolting can help :confused: