Red Magic 5G MOD Kernel GPUOC 900/940mhz +battery 1.4 STABLE! - Nubia Red Magic 5G / 5S ROMs, Kernels, Recoveries

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
*** NOTE THAT 3.16 NA OR 4.13 Red Magic 5G SPECIFIC ROMS SHOULD BE USED WITH THIS KERNEL! THE COMBINED ROM (WITH RM5S) HAS UPDATED KERNEL CODE THAT IS NOT FULLY COMPATIBLE AND NUBIA HAS NOT UPDATED THEIR SOURCE CODE ***
*** Please click Thanks (Thumbs up icon) on my post here if you like my kernel and rate the thread 5 stars, then just use it and enjoy - if you want to send me a beer or two feel free - you don't have to use PayPal - Revolut and Amazon.com (USA) gift cards avoid fees. I like to hear from happy users I hope you are glad that you have the fastest phone in the world currently. The active cooling in this device is utilized to the extreme with MOD kernel, meanwhile your battery usage will be much improved at the same time. How? Well, that's all in the source code, free for all to fork it on GitHub and modify to your liking. Just don't forget to credit me and the many great devs that made the improvements possible... without them, there would be no MOD kernel. This is just a hobby of mine and I like to produce a nice product that all can enjoy. I'm also quite friendly and although I may tell you no I won't add that feature (such as network hacking tools), I won't hold anything against you for asking. I have not been compensated other than by some generous folks on my Telegram channel, so this whole project is basically self funded. Red Magic will not support it, unfortunately, but you can if you feel the improvements are worth it. I believe they are, but I come from a biased point of view as the sole developer for RM5G ***
********************************************************************************************************************************************************************************************************************************
NOTICE: YOU ASSUME FULL LIABILITY FOR ANYTHING THAT MAY HAPPEN TO YOUR PHONE USING THIS KERNEL. ALTHOUGH IT WORKS 100% ON MY PHONE, IT MAY NOT WORK THE SAME ON YOURS. THE PROCESS OF ROOTING A PHONE AND INSTALLING A CUSTOM KERNEL ALWAYS HAS RISKS, SO IF YOU ARE NOT COMFORTABLE ASSUMING THOSE RISKS, DON'T INSTALL THE KERNEL! THIS IS A TYPICAL DISCLAIMER FOR CUSTOM KERNELS I HAVE FOUND NO BUGS WITH IT AT ALL. USERS ON CN, GLOBAL, AND NA ALSO HAVE NOT FOUND ANY PERFORMANCE ISSUES OR BUGS (DO NOT USE V7.14 or V8.11) IF YOU DON'T KNOW WHAT YOU ARE DOING, IT'S BEST TO REMAIN STOCK. OR JOIN THE TELEGRAM GROUP, AND GET SOME REAL HELP.
********************************************************************************************************************************************************************************************************************************
Easy root method: https://forum.xda-developers.com/nu...nner-tutorial-unlock-bootloader-t4131585/amp/ although I suggest still using Magisk 20.4 for root.
Note: if you've already rooted and want to upgrade, people have had success saving the kernel as boot.img and TWRP as recovery.img in SmartPack, vbmeta skip as vbmeta.img and placing into the ROM update.zip using MT Manager (a root browser) and saving the updated file. Then do a Settings / System Update / click the 3 dots / local update and select your modified file. In fact I upgraded from 3.13 to 3.16 NA ROM without losing anything this way. Now for normal installation:
Custom kernels require root and Magisk to be installed. This is due to the signature not being signed by Red Magic (the company) itself. Following the above method you will still pass SafetyNet and most apps will work without trouble. If you have a specific app that detects root, well, Magisk Hide the app from Magisk Manager and see if that fixes it. You should also Hide Magisk Manager from various forms of detection (under Settings). Last case is to move the installation of Magisk under a random directory (which I have not had to do and all my banking apps still work), only if the root detection methods used by your app providers are more picky.
MOD KERNEL 1.4 STABLE:
RELEASE NOTES:
Block mode I/O has been changed to Multi-Queue from Single-Queue so your default scheduler is now MQ-deadline (credits to PappaSmurf, excellent kernel dev). You can choose between mq-deadline, kyber, and none in a kernel manager under I/O scheduler. From my benching with Androbench, it doesn't make much difference which one you use. Some have parameters you can tweak. None literally means no scheduler which is fine on an SSD, and has no overhead if you want to select it in a kernel manager. I always recommend SmartPack. To get settings to stick you Toggle "Apply on Boot" and it will go to what you've selected after 5-10 seconds on the next boot.
All debugging has been turned off completely on BBRv2 - thanks to PappaSmurf (I missed a few spots), and debug can't be turned back on from the userspace now. BBRv2 is selected as the default TCP algorithm which users have explained as a "no-lag" algorithm while gaming. It's just generally a fast algorithm all around. For me it works great, but you can still choose from many different algorithms in a kernel manager if you want to.
In SmartPack / Misc / TCP Congestion Algorithm, you have many choices: reno / bbr / bbr2 / bic / cdg / cubic / dctcp / westwood / highspeed / hybla / htcp / vegas / veno / scalable / lp / yeah / illinois. A SmartPack script is included below you can add in SmartPack to show the true TCP algorithm as it will always show Reno (a bug also shared by FK kernel manager). Below it's called Check_TCP.sh just go to SmartPack / Script Manager / Import / Check_TCP.sh. Afterwards, click Execute to see the active algorithm. If you set it on boot, this is the algorithm that will run, despite what the field says in Misc.
Battery is running very well on normal usage I'm getting around 7.5% active screen on drain over 7 hours and <0.7% screen off drain over 13 hours at 90hz screen setting. This is with actively using the phone for multiple "normal" purposes, reading emails, browsing websites with Chrome, reading news, streaming videos, etc. various shopping (Amazon/eBay) and tracking, Reddit feeds and live video, and other random "daily" tasks, up to 10 apps open at a time. Gaming of course will drain more, as will 144hz. I also have dark mode enabled in Settings. To get idle drain down I disabled 3 additional wakelocks that were causing high screen off drain, and so far I haven't seen an issue with blocking them. I also removed wakelocks that no longer exist since the Boeffla WL Blocker default list was created (it was quite old) so it now should be relevant for this device, with no interaction on the users part to disable anything via a kernel manager. Still, in SmartPack you will see a Wakelocks menu in case you install an app that causes idle drain to rise, this can be used to find and block wakelocks causing the problems. It can sort by wakeups and also by time. As it states though, you should be very careful what you disable. There can be unintended consequences and most wakelocks are not well documented as to what they actually control.
Dynamic Stune Boost is entirely removed from the kernel code now, as I didn't see any benefit from using it with this kernel.
Don't forget Dynamic Fsync is hidden under Misc in SmartPack which if you turn on will speed up your SQLite speeds. AnTuTu will penalize you for this, ignore it, your phone will be faster - but I leave it off by default. Androbench will show the true memory benefit. It is significant if an app does a lot of operations on databases. Journaling for the database is held in memory until the screen is off, then it is written. Although there is a chance of a data loss or corruption with this on if the device were to crash, it is safer than just turning off fsync. If you have any unstable apps, just leave it off - better to be safe. On a solid system though, you may notice better performance.
Also remember under SmartPack / GPU there is AdrenoBoost - it is set to low. You can alter to medium or high to get faster transfer between GPU frequencies, although it has worked great for me the way I use the phone. For you another setting may suit you better. Recall RedMagic OS only allows several frequencies which I spaced out as well as possible at 305mhz, 400mhz, 525mhz, 670mhz, 800mhz, and either 900 or 940mhz depending on the version you installed.
Overall I'm very satisfied with this kernel build and don't plan on adding or subtracting anything from it for the time being. It does what it should do, gives solid performance, and good battery life. My last score on AnTuTu setup with defaults 12GB/256GB was 682K which currently is still the top performing phone out there - running at 940mhz GPU. Not all phones can handle 940mhz so use 900mhz if yours cannot. If there are enough requests for an intermediate build (say 925mhz) I can add one later off the same code base. Also note in releases there are "gaming" builds that don't keep track of CPU times at each frequency, which was a request by users to remove any potential lag while gaming. I run the non gaming version, useful if you want to tweak battery usage, but nonetheless, both versions are there for you to use.
I'm on Telegram t.me/NubiaRedMagic5G_Mods as long as I have the phone. Which will be quite a while if Red Magic / Nubia decides to fix N41 5G in the USA.
Also note that all the features of this kernel (besides ones specifically added by me) are the creation of other developers whose contributions are all notated in the kernel source code. Some of the developers that have contributions here or helped me in some fashion: Resurrect88, DD3Boh, PappaSmurf, kdrag0n, Ayrton990, Flar2, Lord Boeffla, plus many more across the globe. Without them, I wouldn't be making any kernels! And I'm sure there are many other devs I've forgotten to mention, I thank all you guys for your help and support.
MOD 1.4 Download Link:
https://github.com/mrslezak/NX659J_Q_kernel/releases/tag/1.4
PRIOR RELEASES BELOW:
8th Release:
MOD KERNEL 1.35-BBRv2 STABLE:
RELEASE NOTES:
This is an intermediate release - I realized that the prior release was draining far more battery than it should, and I found the source was debug related code in BBRv2 from Google. So this is the updated kernel that gives you battery life like before this TCP algorithm was added.
CONFIG_CPU_FREQ_TIMES=y has also been added so you can see in a kernel manager how much time is spent in each mhz block for each set of processors. This can be useful if you set in a kernel manager (like SmartPack) a minimum CPU mhz to see how much time is actually spent at each level.
The code base also has Dynamic Stune Boost, but I haven't had time to optimize it for the device, so it's just on default settings. So there are 2 versions of this 1.35-bbr2 release. At some point it will be enabled as part of a regular release (some 17 commits squashed together into 1, Stune Assist was causing issues so I turned it off). The main idea of that set of code additions is to run the device at lower frequencies, saving battery, while still achieving the same performance level to the user of the phone. If you want to try different options for it in SmartPack or FK Kernel Manager you can.
Downloads:
https://github.com/mrslezak/NX659J_Q_kernel/releases/tag/1.35-bbr2
7th Release:
MOD KERNEL 1.3-BBRv2 STABLE:
RELEASE NOTES:
Added the 31+ commits for BBRv2 from Google. Squashed the commits down to 6 by author from Google (for easy code maintenance). It's said to be the best TCP (internet congestion) algorithm so this sets it by default. You can still select from the others added in 1.3, as mentioned only EX Kernel manager properly shows them. But SmartPack if you choose the one you want under Misc, then click Apply on Boot, it actually will load the TCP algo you selected. It's just a visual defect. I also made a script for SmartPack uploaded to show you the TCP algo that's selected in my repo you can install so you can verify for yourself. Give it 10 seconds (default on boot setting) before you check.
Downloads:
https://github.com/mrslezak/NX659J_Q_kernel/releases/tag/1.3-bbr2
6th Release:
MOD KERNEL 1.3 STABLE
RELEASE NOTES:
All this release adds is TCP congestion algorithms. The only kernel manager which correctly shows the algo set correctly is EX Kernel Manager. Using SmartPack or FK Kernel Manager will tell you that you're always on Reno, when in fact, you aren't. I'm not quite sure if this is bug related to 865 kernels as a fellow dev had the same experience (on an Op8 Pro). Now the default is set to BBR. Why? No reason specifically, although it is one of the better algorithms for internet usage. You can easily change in any kernel manager and set on boot which one you'd like to use (see above RELEASE NOTES if using SmartPack). But this gives you plenty of options:
BBR, BIC, CDG, CUBIC, DCTCP, WESTWOOD, HSTCP, HYBLA, HTCP, VEGAS, RENO, VENO, SCALABLE, LP, YEAH, ILLINOIS
You can Google the benefits of each and pick what you like. Or just leave it alone. The prime idea of MOD kernel is that you don't need to adjust anything it just works optimally without any intervention. Read the release notes for prior features that have been added. There are many just not summarized in a single place at the moment. All the optimization has been done for Red Magic OS.
Downloads:
https://github.com/mrslezak/NX659J_Q_kernel/releases/tag/1.3
5th Release:
MOD KERNEL 1.25BETA
RELEASE NOTES:
This release is mostly about battery savings. I'm averaging around 6.5% active drain on normal tasks with this version (90hz setting), and around 0.5% screen off drain. A big improvement over the stock kernel. So I ended up with about 13 hours SOT + 24 hours screen off on 1 charge! See the picture, I stopped at 11% left. Now I didn't say anything about gaming. If you want to game and have power saving benefits, don't enable any of the built in boosting modes in the game launcher - the Red Magic OS will override everything. Let the kernel do the work for you. And if you're seeing any graphics lag, go into SmartPack kernel manager (free) and go under GPU, Adreno Boost is enabled on low, you can set it to medium or high. That will increase the speed at which the GPU throttles up and down.
1) Switch to the Energy Model for CPUs: Several subsystems (thermal and/or the task scheduler for example) can leverage information about the energy consumed by CPUs to make smarter decisions. This config option enables the framework from which subsystems can access the energy models.
2) Added CPUMASKS for the Little, Big, and Prime cores from Sultan Alsawaf Sultan: SultanXDA, prime added by Danny Lin: kdrag0n.
3) Added kernel control of the minimum frequencies for the little and big clusters by Danny Lin kdrag0n. They are set to run at their minimum running frequencies when idle 691mhz (little) and 710mhz (big) which results in nice power savings when web browsing or just under low load in general. Prime cluster min is not set as it makes the CPU scheduler function poorly.
4) Added AdrenoBoost by Aaron Segaert: Flar2, with all its changes squashed into 1 commit. Defaults to low setting. As mentioned before, you can change in SmartPack, and set on boot if you need a higher value than low: https://github.com/SmartPack/SmartPack-Kernel-Manager/releases
5) Uploaded the various GPU OC files to the repo, It still will just build off the default one, but they are here to be complete. 940mhz version again is posted, Building direct from the repo will give you 900mhz max GPU.
Downloads:
https://github.com/mrslezak/NX659J_Q_kernel/releases/tag/1.25BETA
4th Release:
MOD KERNEL 1.2 BETA
RELEASE NOTES: (Note a 940mhz GPU clock edition is available, if you want to try it, a few of us have had good results on it. Likely the max an 865 GPU can run. You'll sacrifice the power savings, however):
1) Enable Power-efficient workqueues by default, add a toggle that can turn this off via a kernel manager (under CPU in SmartPack). Enabling this makes the per-cpu workqueues which were observed to contribute significantly to power consumption unbound, leading to measurably lower power usage at the cost of small performance overhead. Have also added many other power saving features to the defconfig. The phone is a beast, power savings is a good thing to implement.
2) Update the LZ4 decompressor algorithm with a much faster variant for the ZRAM swap, now version 1.8.3-9 credits Gao Xiang [email protected] and many others (check commits). Speed improvement below (should help on 8GB devices):
Compressor name Compress. Decompress. Compr. size Ratio Filename
lz4hc 1.7.3 -9 12 MB/s 653 MB/s 42203253 42.20 enwik8
lz4hc 1.8.3 -9 11 MB/s 965 MB/s 42203094 42.20 enwik8
3) Default scheduler is set to SQ deadline. Should see minimal improvements in speed until I get a MQ variant working. On the task list ahead.
Download Link:
1.2BETA: https://github.com/mrslezak/NX659J_Q_kernel/releases/download/1.2BETA/MOD-RM5G-GPUOC-Beta1.2.zip
940mhz GPU release here, it's still 1.2BETA, just with the max clock a few of us have been able to use. That doesn't mean your device can for sure handle it, but give it a try if you'd like! Note the power savings will likely not be there vs the other release at 900mhz:
https://github.com/mrslezak/NX659J_...oad/1.2BETA/MOD-RM5G-GPUOC-940mhz-Beta1.2.zip
3rd Release:
1.15BETA: https://github.com/mrslezak/NX659J_Q_kernel/releases/tag/1.15BETA
This is a HEAVILY updated release of the MOD kernel 1.10BETA - I realized the phone's software will allow 6 frequency clocks, although 1 did not have a regulator defined (now patched). NOW I VERY HIGHLY suggest installing SmartPack Kernel manager. It will give you insights into the kernel and how it's performing and it's free. It also will let you adjust added options now in the kernel. Just root your phone and flash from TWRP. If you haven't already installed Magisk, then install that too. There's a guide I posted on XDA about that. Use the experimental method there is no reason to unlock your bootloader. https://forum.xda-developers.com/nu...how-to-unlock-bootloader-redmagic-5g-t4081743
RELEASE NOTES:
1) Bugfix: there was 1 missing 800mhz GPU frequency regulator clock on the prior version. This has been set to TURBO, 1 level under the 900mhz regulator of TURBO_L1.
2) Boeffla WakeLock blocker (v1.10 + tweaks) has been added to reduce battery drain when the phone is not being used, using the latest version and all patches. A default block list is included. You can access in SmartPack Kernel Manager under the new menu that will appear "Wakelocks" - especially investigate if your phone has high idle drain, you can experiment with blocking other wakelocks (which don't allow your phone to sleep). Or you can leave as is. I get just under 1% drain (screen off) and the phone sleeps quite often with this version. Take a look at the screen shot! That's just normal phone usage, not gaming.
3) All debug entries (except those required) have been stripped completely out of the kernel. This results in less wasteful debug information being generated.
4) The default algorithm for ZRAM has been changed from LZO (high compression, but slow) to LZ4 (slightly less compression, but fast). LZ4 algo was added. It still defaults to 4GB.
5) Dynamic Fsync has been added to the kernel as well. This patch allows journal entries to be written only when the screen is off. I.e. they are cached and written afterwards. This increases database performance. It is disabled by default so in SmartPack Kernel manager, if you'd like to turn it on, go under Misc, select Dynamic Fysnc, and select apply on boot. There is always a risk of data loss when delaying writes, although I've personally never have had issues - it only happens if the phone crashes, and mine has never crashed on this kernel. This won't normally increase your benchmark scores (except AndroBench), it increases SQLite database access speed. Up to you to use or not, works fine on my device.
6) Here are the updated frequencies (note there is 1 more). Will have to wait for AOSP before I can add back more. Note the 670MHz is likely the 865+ max frequency per the release notes today on the device (which I assumed by the source code anyhow pre-announcement): 900MHz / 800MHz / 670MHz / 525MHz / 400MHz / 305MHz
AS ALWAYS, USE AT YOUR OWN RISK!!!
Github Source:
https://github.com/mrslezak/NX659J_Q_kernel
Initial Release:
https://github.com/mrslezak/NX659J_Q_kernel/releases/tag/1.0.BETA
Second release - gets over the "reset to 490mhz" bug caused by the system software, at the expense of reducing frequencies to 6 total:
https://github.com/mrslezak/NX659J_Q_kernel/releases/tag/1.10BETA
Newest release -> will be posted on the top from now on.
Telegram:
https://t.me/NubiaRedMagic5G_Mods
And note the AnTuTu benchmark is just a first run after installing. 670K is likely a record on any 865 phone. The last bench turning off 4GB ZRAM (12gb/256gb device) I got 673K. AnTuTu doesn't equal performance, but if you've benched you'll see this is an insane improvement over the stock kernel. Only when the demand is there will it scale up to 900mhz. I've been using for a while now and notice no difference in battery life. The Adreno driver is very good at handling extra clock frequencies efficiently without modification (despite an "Adreno Boost" that is often added to kernels). The gamers using the kernel are making statements that they couldn't imagine the game play any better than it already was, but now it's even smoother.
Unfortunately the way the Nubia software behaves, it auto-resets to power level 5 (which was 490mhz) on the 1.0BETA on boot and also after boosting the frequencies up. I tried every possible way to bypass this but eventually just gave in and removed frequencies. So the BETA1.10 and above have less frequencies but will always revert to 305mhz, the base minimum frequency of the device. Hopefully once we have AOSP ready I can add more.
MattoftheDead
I.e. M.O.D. Kernel Developer
The first Red Magic 5G OC kernel.
Xiaomi Mi9 / Mi9T Pro Pie V2 and Q V1.5 Kernel Dev

Nice work. Do you notice any benefits to OCing the GPU like that? I don't think there are many games that would benefit atm.

This is amazing !!! :laugh:

Is this going to work on all roms like CN, NA or EU Roms? Im currently running NA 3.11 flash from CN rom with root and twrp

We have people using it on CN Global and NA versions no problem at all. Works fine on every model.

Kernel is fully functional no issues at all.
CN Rom to NA Rom v3.11
305mhz min to 900mhz max confirmed and using smart pack to control the frequency
Thank you for this hopefully there is more development i really appreciate ur effort

Kernel building is just a hobby of mine, I was posting a minimal kernel to get some more kernel developers on board to hopefully add more features. I usually add Boeffla Wakelock Blocker and Dynamic Fsync and call it a basic kernel. The last super kernel I made took way too long, and I don't have that kind of time anymore - boost functions and underclocking to balance out the battery life and such. Development work doesn't pay anything, I didn't get the phone free, all my donations go to other developers. And I have a full time job and family. But if anyone wants to port over my MOD Kernel Q 1.5 Mi9 features, well that would be a super kernel. It's just really, really time consuming, time I don't have at the moment. And the merging of source has to be EXACT or you end up with a really slow phone rather one that balances underclocking, boost, and overclocking.

MishaalRahman said:
Nice work. Do you notice any benefits to OCing the GPU like that? I don't think there are many games that would benefit atm.
Click to expand...
Click to collapse
All the gamers using the kernel are reporting that the games run smoother than before, which no one thought was possible. It is already a flagship device. But the GPU OC with the Adreno driver scales when needed up to the frequencies that it has in the table and has no issue on 670, 800, and 900mhz reported so far. There are gamers on NA, Global, and CN ROMs, with no bugs reported. No issues and everything works properly. I have tested myself and although I'm not a gamer, all the functions work as they should. It still connects via Bluetooth, it still takes photos and videos, etc. There is no lag whatsoever. Overall I think the frequencies are ideal for this device with it's advanced active cooling system. Other devices however, with passive cooling, are unlikely to handle the increased GPU clocks.

I found an unusual bug where the GPU Minimum Frequency will reset on its own to 490mhz even if i set the minimum frequency to 305mhz im using smart pack kernel manager that you provided and cool tool btw to monitor the gpu frequency.
I also set the battery optimization to off on smart pack so it wont turn off itself.
This also happens when i played games that actually boost to 800 to 900mhz then after i close the game it sets back the minimum frequency to 490mhz so i have to set it again to 305mhz on the kernel manager to save more battery and lower the temps.
I also notice it sets back to 490mhz minimum frequency by just watching youtube videos so i have to set it back to 305mhz again. I tried different kernel manager too like Franco Kernel Manager and Kernel Audiator and still doesnt fix the issue
I think this was a minor bug for sure
I never touch the GPU governor btw
Performance was super nice thou i scored 645k on antutu on my first run but for now im going back to stock and gonna wait for your next update

What to do to root the phone without breaking the fingerprint please. I read the article publish nothing understood someone can explain to me step by step. I am an amateur I never root a phone. I have cn 2.55 16gb.

I don't have the same issue - I just tried to recreate it by watching a YouTube video and I went back to SmartPack and it still shows 305MHz GPU frequency. Although I'm using the debloated / optimized ROM I created Black Magic 5G which has everything setup properly, Nubia apps frozen, everything moved to 3rd party apps. NETFLIX patched to 4K HDR10, YouTube Vanced, a ton of root utilities, AdAway ad blocker, etc. You can find it on the Telegram channel (I'm using the NA/Global version of Black Magic 5G). Then I watched Netflix, still at 305mhz. As I have no idea how you've setup your phone, I just can't recreate it.
shaifabra5 said:
I found an unusual bug where the GPU Minimum Frequency will reset on its own to 490mhz even if i set the minimum frequency to 305mhz im using smart pack kernel manager that you provided and cool tool btw to monitor the gpu frequency.
I also set the battery optimization to off on smart pack so it wont turn off itself.
This also happens when i played games that actually boost to 800 to 900mhz then after i close the game it sets back the minimum frequency to 490mhz so i have to set it again to 305mhz on the kernel manager to save more battery and lower the temps.
I also notice it sets back to 490mhz minimum frequency by just watching youtube videos so i have to set it back to 305mhz again. I tried different kernel manager too like Franco Kernel Manager and Kernel Audiator and still doesnt fix the issue
I think this was a minor bug for sure
I never touch the GPU governor btw
Performance was super nice thou i scored 645k on antutu on my first run but for now im going back to stock and gonna wait for your next update
Click to expand...
Click to collapse

Yeah maybe because you modified the rom.
Im currently running Flash Global V3.11 when i tested your kernel no modification made im just rooted with TWRP Installed and i posted this kernel on red magic 5g group on facebook and 3 of us having the same issues as well.
Im gonna try it again on V3.13
UPDATE:
still returning to 490mhz as minimum frequency after gaming and after watching one youtube clip
kinda sad hopefully you can fix this bug on the global rom that nubia provided if you have the time, great kernel for gaming because of the 900mhz boost and the phone can sustain this boost because of the active fan

Why don't I have a roughly similar score?

Is it possible to overclock the CPU as well? They officially release the specs sheet of ROG Phone 3 it has overclocked CPU (3.091ghz) and an overclocked GPU. I know this phone can keep up with those clocks because of the cooling system but the problem is the battery life. But still, its worth it.

Blink003 said:
Is it possible to overclock the CPU as well? They officially release the specs sheet of ROG Phone 3 it has overclocked CPU (3.091ghz) and an overclocked GPU. I know this phone can keep up with those clocks because of the cooling system but the problem is the battery life. But still, its worth it.
Click to expand...
Click to collapse
I believe Qualcomm blocked overclocking of CPUs quite a while ago from SD845. Only GPUs can be overclocked.
Though I don't know if devs have gotten tools to get around it.

The 490 bug looks like it's related to the gaming mode APK resetting the min frequency. I can't decompile or recompile APKs so I don't have a way to get around the system reverting to 490 without removing 3 other frequencies. It seems hard-coded in the app that it only expects to see 5 frequencies so to have all working properly, 3 need to be removed. This is in contrast to what my buddy dev on the Op8 Pro can do, but this device is designed differently in how it boots and custom apps that increase frequency clocks. If any devs are good with APKs it's a very simple function call that sets the minimum GPU frequency. The only odd thing I see is that the minimum power level stays at 8 (minimum) which corresponds to the lowest clock speed. That number doesn't change in a kernel manager when the min GPU clock reverts to 490.
I'm off on vacation not near a PC but will try to come up with a stock # of clock frequencies that still scrolls smoothly between them and the Adreno GPU driver. May take a few tries but it's quite easy to modify. I already think 180mhz is too low from using it, it's more of a sleep frequency some suggested going this low but I think the phone design is for 300+. I prefer to use more clocks for better throttling but have to work with what we are given and do the best inside those boundaries.
No you can't raise CPU clocks on 865 devices that ROG device is supposedly using the 865+ or whatever the mid device is named between the 865 and 875. They have blocked CPU OC hardware wise for some time now.

mslezak said:
No you can't raise CPU clocks on 865 devices that ROG device is supposedly using the 865+ or whatever the mid device is named between the 865 and 875. They have blocked CPU OC hardware wise for some time now.
Click to expand...
Click to collapse
Qualcomm's Meizu’s CMO Wan Zhiqiang recently commented on Weibo saying that there won’t be a Snapdragon 865 Plus this year.
We will see!

No 865+ this year..
Trust me whatever they call it it's already defined in the source code as a second GPU bin clock for another device ID. So maybe it won't be called an 865+ but there is some device between the 865 and 875 coming out. I have OEM confirmation as well this device exists the name isn't important. I can tell you the top GPU frequency is 670mhz that's it, vs. the 587mhz default on the 865. Still the 865 handles 900mhz GPU no problem the only benefit would be higher CPU clocks. And an extra GPU clock. Which I'll attempt to spoof next time I get near a PC.

mslezak said:
Trust me whatever they call it it's already defined in the source code as a second GPU bin clock for another device ID. So maybe it won't be called an 865+ but there is some device between the 865 and 875 coming out. I have OEM confirmation as well this device exists the name isn't important. I can tell you the top GPU frequency is 670mhz that's it, vs. the 587mhz default on the 865. Still the 865 handles 900mhz GPU no problem the only benefit would be higher CPU clocks. And an extra GPU clock. Which I'll attempt to spoof next time I get near a PC.
Click to expand...
Click to collapse
Is it possible to overclock the memory clock too? I assumed that 900mhz is the core clock.

mslezak said:
Trust me whatever they call it it's already defined in the source code as a second GPU bin clock for another device ID. So maybe it won't be called an 865+ but there is some device between the 865 and 875 coming out. I have OEM confirmation as well this device exists the name isn't important. I can tell you the top GPU frequency is 670mhz that's it, vs. the 587mhz default on the 865. Still the 865 handles 900mhz GPU no problem the only benefit would be higher CPU clocks. And an extra GPU clock. Which I'll attempt to spoof next time I get near a PC.
Click to expand...
Click to collapse
You're right, that makes sense.
I'm glad they are making a refreshed chip.
On another note, do you think we will see an overclocking tool in the future?
Possibly with a custom ROM?

Related

[Kernel] Flykernel-13 "Back from the Grave"

FlyKernel is an overclockable kernel for the Hero GSM, aimed to improve stability, battery life and performance (generally in that order).
The Hero GSM now also has a newer .35 kernel "Las Venturas" you should also check that one out. At the time of writing these lines, the newest version of Las Venturax is found on the second post of the above thread (my post ) - you should check which post is more up-to-date on that thread.
Download and instructions are on this post.
FAQ and advanced subjects are on the second post.
Change log and previous versions are on the third post.
WARNING: Please make sure to have an up-to-date backup before you flash this kernel!
FlyKernel-13 (#253)
FlyKernel 13 - Desean
FlyKernel 13 - Mediafire
FlyKernel 13 - Multiupload
This is a post-LasVenturas update for FlyKernel, after quite some time without any updates.
Although I currently have a bit of a personal preference for Las Venturas, I believe that it is even better to have two excellent kernels for the hero (internally totally different ), so that the users can choose whichever works best for them. Possibly, on some of the older ROMs this kernel might work better. This should also help isolate kernel issues vs. ROM issues.
SmartassV2 (informal description and comparison with the first smartass)
SmartassV2 is a governor (controls the frequency of the CPU at each give moment) which like the first smartass is generally based on the implementation of interactive with some major changes and the addition of a built in sleep profile (behaves a bit differently when screen is off vs. on).
The smartassV2 improves the very naive scheme which the first smartass had: The first smartass (with the values I set for the hero), would cap the max frequency at 352Mhz for sleep and when screen is on, would do the opposite and keep the frequency at 518Mhz or above. For sleep this was very effective but a bit crude and unclean, and there could be some cases where you would need processing power even when screen is off (something is updating and music is playing and etc.). For screen on, smartass1 was too quick to jump to the max available frequency and again would never go below the 518Mhz, so in a nutshell its was using "too high" frequencies.
SmartassV2, introduce (internally) an "ideal" frequency which is the frequency we are "aiming" for, in some sense. The way I see it is that the "ideal" frequency is a hint to the governor what is a good balance between performance and battery life. Now when screen is on, I set (on the hero) the ideal frequency to 518Mhz which will ensure nice responsiveness but limit unnecessary use of higher frequencies when they are not needed. When screen is off, I set the ideal frequency to 352Mhz (0 will disable the screen state tracking all together). From my testing this will "convince" the governor to spend most of the its time during sleep at the lowest available frequencies. Note, that both during sleep and when awake the entire frequency range (as defined by the "user" - i.e. selected with SetCPU) is used by smartassV2. For example, when the CPU is loaded heavily, the highest available frequency will be used regardless if screen is on or off.
Boot OC and optional tweaks
Optionally, you can rename the update file before you flash to change bootup frequencies and other options.
If you don't rename the file and flash "FlyKernel-13.zip" you will get the default tweaks and the min/max frequencies will remain as they where before.
For example, to set the max/min frequencies on boot to 614/176, rename "FlyKernel-13.zip" to "FlyKernel-13-M614-m176.zip".
Supported "flags" are:
Notice, all flags are case sensitive.
-MXXX - set max frequency to XXX
-mYYY - set min frequency to YYY
Supported max frequencies:
518 576 614 633 652 672 691 710 729 748
Supported min frequencies:
19 176 264 352 518 576 614 633 652 672 691 710 729 748
Default behavior, if these flags aren't given, is not to change your current settings.
For frequency recommendations and more info see FAQ #5.
Technical details: max/min frequencies are set in the kernel's ramdisk init.hero.rc file. Previous settings will be replaced. Furthermore, if one of your init.d script sets the max/min frequencies, these lines will be removed.
If you have SetCPU or other program changing the speed at boot, their change will take effect and overwrite this setting as soon as the ROM completes to boot.
-nologo - Don't show boot animation.
-logo - Show boot animation.
Default behaviour, if no flag is given, is not to change your current settings.
-noatime - Mount all partitions with -noatime to improve IO.
-atime - Mount no partition with -noatime.
Assuming, your ROM did not mount any partition with noatime, then the -atime option should undo the -noatime option perfectly. Unfortunately, it seems some ROMs (i.e. VR12) mount only some of the partitions with -noatime. It seems that in some cases, changing the noatime configuration causes boot problems.
Therefore, I highly recommend you make a backup before trying the -noatime flag - this is the only full proof way to go back if it messes something up.
Notice, this does not effect the ext partition as it is not mounted in the ramdisk init.rc. As far as I know, all ROMs mount the ext partition with noatime.
-notweak
By default, the updater will remove scheduler tweaks which exists in the ramdisk init.rc script, in order for the scheduler default compiled into the kernel to apply. This flag will disable this behavior.
More techinical information for developers about the smart update package has been updated in my github wiki.
Limitations and known bugs:
- This kernel will not make you coffee (I hope)!
Integrating kernel in a custom ROM (for ROM developers)
You can use my from above:
http://floyo.desean.net/FlyKernel-13-Floyo.zip
This file has a regular boot.img with a ramdisk compatible with Floyo 1.4, boots at 576/352 (smartassV2) and has all the kernel modules unpacked.
If you need to edit the ramdisk, you can either unpack the above boot.img as explained here. Or you can get the kernel binary file from my smart update package, under tmp/flykernel/kernel. The kernel modules are package in the smart update package under tmp/flykernel/syslibs.tar.
Kernel Sources
My sources with all my updates and changes are found on github:
http://github.com/erasmux/hero-2.6.29-flykernel
Use hero_defconfig for the regular version and hero-bfs_defconfig for the BFS version.
See the wiki for more information about building the kernel and more.
Please feel free to contact me regarding my sources and kernel development.
Using my Kernel Sources
Feel free to use my kernel sources, fully or partially in any (legal) way you see fit.
If you modify the sources, I urge you to share your changes with the community (as GPL obliges you to do), preferably using github. You can fork my sources on github, and this will make it easier for you to grab new changes from me and also allow you to fill pull requests so I can pull your changes back to my kernel.
GPL
Yes I am GPL complaint, all is included inside the sources, including the GPL license itself.
Thanks
Huge thanks to Desean for giving me file hosting that makes my life easier
Many thanks to all the Kernel/ROM developers here, especially those with open source kernels on github - LoxK, Cyanogen, Ninpo, Radu and especially Decad3nce.
Big thanks to all those who helped test the pre versions and reported bugs, specifically also to my long time testers (moonshield and floomat)
Donations are always welcome and accepted but are in no way required.
FAQ and Advanced Subjects
FAQ
0. When reporting a problem, do I need to include the ROM and exact kernel version I am using?
YES!
1. How do I flash the kernel update file?
You flash it from recovery, like any other custom ROM. If you are not familiar with recovery and/or haven't rooted your phone, start here.
2. Do I need to wipe anything when installing the kernel?
No you don't need to do any wipes. Just install the kernel through recovery and reboot
3. The update from recovery failed with errors/warning?
Please, in the same recovery session which you tried to apply the update and failed, select the "Move recovery.log to SD" from the "Other" menu and post in this thread with the recovery.log attached (for example in a .zip file).
4. After flashing the kernel my ROM does not boot
A logcat of the boot process might help me understand the problem. Using adb you can generate one with the following command and attach it to your report:
Code:
adb logcat > logcat.txt
You need to run this command relatively close to the start of the boot. Close the window after the phone is stuck for few minutes (say 2 mins with no change should do). You can start by running "adb logcat" and seeing if you get any output at all. If so, reboot once more and run the above command from the start of the boot (approximately).
Please also clearly state which ROM you are using and which kernel did work for you (which one did you use before).
To recover from such a scenario, boot into recovery and restore a backup of your working state. If you do not have a backup, and its the kernel fault, flashing your old kernel should solve the problem.
5. What min/max frequencies should I choose?
The short answer: min 176, max 614, if you have wake up issues up the min speed to 264 and then to 352.
To play with the speeds I suggest you install SetCPU (or similar app), so you can view and change your settings interactively. To change it permanently from the bootup see instructions on first post. You also use options like "Set on boot" in SetCPU if you prefer that.
The long answer:
The max frequency will effect the speed and responsiveness of your phone when screen is on. Note, that any speed above 528Mhz is above the specification of the manufacturer, hence is overclocking and could, in theory, shorten the life of your device. At high enough frequencies all devices will stop functioning, the exact threshold depends on your luck with your specific device. From my experience and knowledge, running at stable frequencies (or say one or two steps down to be on the safe side), should not harm your device - of course all overclocking is done at your sole responsibility.
As far as I know, almost all device can handle 652Mhz, most can reach the 691/710 area and some can even reach higher than the 748Mhz cap of this kernel. To find out which speed your phone supports, use SetCPU (or similar app), start from 614 for example and up the speed one tick a time. Don't select "Set on boot". At each step play with the phone a minute or two. If the phone gets stuck, reboot it (take out battery if necessary) and go one tick down.
Additionally, note the higher your max frequency the higher the battery drain will be when the screen is on. It is true that the display, data, wifi, gps, etc. should drain much more than the cpu. Still, I recommend staying in the sane frequencies range, no more than say 691Mhz (even if you phone can handle it).
Finally the min speed will effect standby battery life (when screen is off). From my experience there is a difference in battery life between 19Mhz and 352Mhz min frequencies but it is relatively small (much less than I expected). 19Mhz is not stable for me, almost stable, but over a period of weeks you will probably experience weird and possibly very rare instabilities. For me this was the when playing music with screen off the phone got stuck at 19Mhz (very hard to find this out), and became totally unresponsive until I rebooted it. Therefore, I recommend starting from 176Mhz, and if you have wakeup issues to bring it up. With 352Mhz you should have no wake up issues at all.
6. I am having wakeup issues (such as unresponsiveness to wakeup, weird coloring after wakeup, screen inversion, caller id not working on wakeup)
Up the min speed to 264 and then to 352. With a min frequency of 352 you should not have any wake issues.
See the FAQ #5 above for more information.
7. I am experiencing bad battery life with FlyKernel
First, please make sure to reboot the ROM at least one time after you flash the kernel. There have been reports that ROM/kernels behave badly on the first boot.
Personally, I do not do battery calibration, but if it makes you happy go for it. I do recommend at least charging the battery overnight, or a couple of hours after it has reached 100% to be sure it is full. Then use it, your regular usage for a few days and only then judge the battery life.
The battery percent indicator, over short periods of time seems extremely inaccurate and its very hard to reach any correct conclusions based on it.
If you do want to report bad battery life, please state your settings (kernel version, min/max speeds, governor, etc.), over which period you have been testing the battery, under what usage, what is the battery life you are used to having with which kernel and what is the battery life you are experiencing now.
Note, that roughly speaking, I lose less than 1%/hour when screen is off (wifi, data, gps, etc. also off), and about 10%/hours when just screen is on but phone does nothing at all (again wifi, gps, etc. off). About 20%+/hour when stressing my phone (although I have no data plan so can't test that). I am using the latest FlyKernel @ smartass 614/176.
8. What size should I give the swap partition?
short answer: 0.
long answer: I do not recommend using swap on the hero, hence 0. If you have a very fast SD card, and want to try it, give it say 64Mb. Note that I know of no ROM for the hero which activates swap automatically - you'll need to add a init.d script or something to activate it (see a bit more info here). Let me know if you find a scenario where the swap gives substantial improvement over no swap.
Finally note that FlyKernel versions before 12 do not support swap.
9. Should I use ext2, ext3 or ext4 for my ext partition?
Short answer: ext4. Note that FlyKernel versions before 12 did not support ext4, ext3 is supported since version 10.
Long answer:
Previously, I was under the impression that a journaling file system is a very bad idea for flashable storage. I still think its not ideal but better than the other alternative:
I have been using dual booting, placing an entire development ROM on an ext2/4 partition and using it for development. And when using ext2 it would get errors almost every boot and every couple of days get corrupted to the point I needed to manually restore damaged files to get it working....
It seems that if you only use it for app2sd, there are very infrequent changes to this volume (only when you install a new app), hence it does not get corrupted. But this also means that ext4, in this scenario, will not pay much overhead because there are very few changes. And in the case there are many changes, if I have to choose between a slightly shorter SD life with ext4 (and then I can finally get a faster one ) or risking my data getting corrupted on a daily basis with ext2 - I prefer the first (ext4).
Questions 10-13 are now obsolete with smartassV2 - see the first post for details about it
10. Do I need a SetCPU (or similar) screen off profile with smartass?
No, smartass automatically limits the screen on frequency to >= 518Mhz to ensure responsiveness, and screen off frequency to <= 352Mhz to keep standby battery life under control. Much like HTC's perfllock, it does this at the kernel level so it is much better than app level screen off profiles.
11. Using smartass the CPU frequency does not drop below 518Mhz (with screen on)
Intentional to ensure responsiveness. From my testing, when screen is on battery drain difference of speeds < 518Mhz is not significant relative to the drain by the screen itself.
12. Using smartass the CPU frequency does go above 352Mhz (with screen off)
Intentional to keep standby battery life under control.
13. Using smartass the CPU frequency is always at its max (or always at 352Mhz when screen is off)
See "Monitoring the CPU frequency" in the "Advanced subjects".
14. I am experiencing spontaneous reboots
Please post, in this thread, with as much detail as possible about the problem.
Please also attach the last_kmsg, which you can get from example using:
Code:
adb pull /proc/last_kmsg
15. What happend to the BFS version?
With the FlyKernel-12 scheduler tweaks (CFS scheduler), it surpasses the BFS version in every way. I tried to compile a BFS from the FlyKernel-12 code but even in neocore, in which the BFS was always much better, the new tweaked CFS leaves the BFS in the dust. Hence, I see no reason to continue and build/support a BFS version. The hero-bfs_defconfig is still up to date in my sources if anyone wants to build it themselves.
*. I am experiencing an issue not covered in the FAQ which I believe is kernel related
Please post, in this thread, with as much detail as possible about the problem.
Please also detail why you believe this kernel related. The best "proof" that it is the kernel's fault, is to flash back your old kernel and verify the problem is solved, then reflash the new kernel and verify the problem reappears. In any case please detail the kernel and version(s) on which your are experiencing the problem and those on which you do not.
Advanced Subjects
* Monitoring the CPU frequency
Will rewrite this more clearly. In the meantime:
http://forum.xda-developers.com/showpost.php?p=9925116&postcount=903
http://forum.xda-developers.com/showpost.php?p=9929325&postcount=919 <-- Mainly this one!!!
http://forum.xda-developers.com/showpost.php?p=9989996&postcount=970
http://forum.xda-developers.com/showpost.php?p=10010110&postcount=990
Change log and previous versions
FlyKernel-13
- Scheduler tweaks: use the scheduler settings that worked well on flykernel-11c and 12pre6 (tweaked them very very little), responsiveness should now be better than on the FlyKernel-12 release
- Backported the new smartassV2 - now the default
- Added interactiveX governor also
- A few config changes and compiler optimizations
FlyKernel 12a (mediafire)
- Fix wake up issues with new scheduler tweaks
- Smart update script: make noatime tweak option to (hopefully) solve boot problems
FlyKernel 12
- Smart update script
- Optimized scheduler parameters
- Fix Usb mass storage after usb tethering (at least on CM ROMs)
FlyKernel-12pre6
- Align ext2/3/4 config options
- Merge small fixes to lowmemorykiller module.
FlyKernel-12pre5
- Backport of smd rpcrouter to avs333 request.
FlyKernel-12pre4
- Partial fix for the lockscreen flickering when locked/unlocked rapidly (with smartass).
- Very small tweak to other smartass parameters.
FlyKernel-12pre3
- Fixed frequency table according to Radu's comments. Frequencies which are not on PLL2 have been removed!
- Tweaked smartass to spend more time at the lower frequencies to improve battery life. Also smartass's allergy to 19Mhz has been cured!
- Some configuration tweaks, mostly sleep related.
- 528Mhz frequency does not work well with OC, so it has been replaced with 518Mhz which does work fine.
FlyKernel-12pre2
FlyKernel-12pre2 optimized for CM based ROMs (default speed 576/352)
- Added compcache support
- Added 19Mhz and 264Mhz frequencies
FlyKernel-12pre1
- Lower voltages of high frequencies (>= 528Mhz)
- Added ext4 support (I currently use it for dual booting)
- Interactive updated (does anyone find it better than smartass? in what scenario?)
- Smartass fixes and optimizations - should be more responsive now and battery life should (hopefully) still be excellent.
- Camera backport from .32 (12pre1-cam32)
FlyKernel-11c
FlyKernel-11c #66 (Generic)
FlyKernel-11c-BFS #67 (Generic)
- Smartass: now wakeups up from sleep first at 528Mhz (no OC), to hopefully help with wake up issues.
- Bunch of fixes/optimization from CM espresso kernel and from Decad3nce (see github)
- BFS version
"Optimized Kernel Packages" (only for CM6 based ROMs: Floyo, Elelinux, Froyd):
Find the appropriate kernel for you by its name in the FlyKernel-11c directory
The naming conversion is:
flykernel-11c-CM-<min>-<max>.zip (with boot animation)
flykernel-11c-CM-<min>-<max>-nologo.zip (no boot animation)
flykernel-11c-BFS-... (BFS version)
FlyKernel-11
- New smartass governor (see technical detail below). Previous governors still supported.
- Added IPv6 (only for Google Googles?!)
- Fixes camera freezing CM6-based ROMs (thanks Ninpo for a "code cleanup" which fixed this )
- Fixes detection of USB connection during boot on CM6-based ROMs.
- Various squash-sets imported (see github)
- NORMALIZED_SLEEPER disabled.
FlyKernel-10a (rapidshare megaupload)
- Optimize some sleep/idle code (thanks to ninpo)
- Add module for IP header compression - hopefully this helps google apps (inspired by ninpo).
FlyKernel-10a-BFS (rapidshare megaupload)
- BFS version of 10a.
- Whats is BFS? see wikipedia and more details here.
FlyKernel-10
- Fixes for Froyo ROMs (FroydVillain and Elelinux)
- Added some more modules inside the kernel (notably using VPN should now work). I am now more aligned with the modules included in other kernels (well mainly ninpo's kernels), so hopefully you should not run into any missing modules.
I even added support for ext3.
- Generic update for all ROMs.
Flykernel-09:
FlyKernel-09 for VR12,RCMix,ChoclateEclair,Modaco and SuperHero
FlyKernel-09 for Kimera and Sensehero
FlyKernel-09 for MMod 1.2.3
FlyKernel-09 for FroydVillain and elelinux - Beware there are problems with 09 and Froyo ROMs.
FlyKernel-09 for CM6
- Added the excellent minmax governor.
- Removed interactive as it does not behave well at all - just use minmax
- added version which supports the 288M data partition - removed now since MAX appears to be fading out - just use dalvik2SD instead.
FlyKernel-08
FlyKernel-08 for Froyo and ASOP
Added Mike Chan's interactive governor, adaptation to Hero by Nadlabak and Ninpo. Added some tweaks of my own - now works well also with big frequency table.
Tweaked conservative governor for better performance.
Fixed/cleaned kernel co/nfig and modules - among other things iptables should work fine now.
Bigger frequency table.
FlyKernel-05 (BFS)
BFS version of the FlyKernel-04
FlyKernel-04
Based on HTC 2.6.29 official kernel source.
Includes patchset 2.6.29.6 and various fixes
Boot OC - Only for Sense based ROMs (The smart update script added in FlyKernel-12 provides a cleaner and better solution for all ROMs)
Boots very quickly by setting the OC speed right from the start. Also sets the original HTC boot animation which is quicker for most ROMs. Finally, replaces the 09zipalign with 09betterzipalign (again thanks ninpo).
Please have a backup before you try this, as there is no other easy way to undo this.
Select the update file according to the speed your phone can handle:
boot @ 653/160: http://www.multiupload.com/5RAXNJ7AWY (rapidshare megaupload)
boot @ 672/160: http://www.multiupload.com/RRQ0HYI8O8 (rapidshare megaupload)
boot @ 691/160: http://www.multiupload.com/20AJV7FLQI (rapidshare megaupload)
boot @ 710/160: http://www.multiupload.com/WHROUYNGQ6 (rapidshare megaupload)
Theoretically, this should now work on any ROM and any OC kernel. I have tested the 691 update on VR12 and Froyd 1.4 with my kernel and it works fine. Above files (now with "_" at end of name) updated to also work on ChocolateEclair and hopefully other ROMs on 31/8.
Note that in my recent kernel versions the lowest frequency is 176, so it will boot with a min frequency of 176.
cool.. will try. like the idea of overclocking before boot
can you post a diff file of what you modified?
diffs of which change?
there are a lot of changes and fixes, which range from fixes by me in the source code, to just copying/applying files from others.
I think it would be better to keep this thread open for issues and questions about the usage of these fixes. Still I will be more than happy to share anything I have done - please contact me with the exact change you are interested, either by PM or open a new thread if you think it is of general interest for developers.
There are literaly dozens of different kernels floating arround, all of which are always "brand new super fast ultra optimized". From a user perspective it's hard to tell which one is the best. I think this community needs more openness in the developpement. I think it would be a good habit if developpers posted their diff files (of everything) instead of just saying that they made "optimizations".
thanks for your work
zorxd said:
There are literaly dozens of different kernels floating arround, all of which are always "brand new super fast ultra optimized". From a user perspective it's hard to tell which one is the best. I think this community needs more openness in the developpement. I think it would be a good habit if developpers posted their diff files (of everything) instead of just saying that they made "optimizations".
thanks for your work
Click to expand...
Click to collapse
Trying it out might help in deciding which is the best for you. There is no such thing as an absolute best, sorry. To each his needs and his preferences. I also included a convenient undo update script which restores the original kernel.
Personally, I am not aware of any other kernels for the VillainROM (except the original one by ninpo) and for me my kernel works better. Additionally, I have gotten very good feedbacks for my kernel and fixes on iandroid (using HebVillain which is very tightly based on VR12). So I thought others here might want to try it and maybe would also like it. Please also feel free to bash it, but please try it first and then reply with comments which I can relate too.
Finally, I am all for complete openness: If you are really interested in the kernel sources, you can find them along with all my changes here which could be of great to help to you especially if you want to compile the hero kernel yourself. In such a case I would recommend starting from here. The biggest other change is the RTL fix, for which you find the diffs here (it is verses the eclair branch of the android source code). As for the other files & changes I did, I have tried to detail as much as possible in my original post.
Feel free to contact me (also by PM) if you want more info or help.
I just installed your Kernel and the Boot Optimization and brother my phone is flying!!!! GREAT JOB!!!
100% recommended flash for your VR12
THANKS!!!
yep!
all great! you are the MAN =)
good work erasmux, does it work with Arabic language with Arabic fonts installed ? I mean connected letters
Thanks a lot
I hope it does. I don't use Arabic, but if there are problems, report them and I'll do my best to fix them.
Good job erasmux!
Problems for me.....
Installed Kernel & Optimization and Boot time optimization
Made all my icons go to pot,
"problem loading gadget" on powerbar,
"problem loading gadget" on Battery Meter Widget
Game Icons, CoPilot live, System Widget all showing default app icon.
Lost a WHOLE LOAD of installed apps, simply not there listed any longer. So many gone I can't recall what I have lost.
Tried the undo file Original VR12 Kernel:
Got my apps back but still probs with some widgets, boot screen remained the HTC one (didn't revert to the villian screen)
First, I have fixed the kernel restore file in the original post to also restore the original villain boot animation, note that the new file is called: V12-RestoreKernel_.zip (with additional _ at end)
Thanks, for the remark.
Regarding the apps, that is very weird. Did you get these "problem loading gadget" on the screen or where? A logcat from the start of the boot would be very helpful (although I can understand if you don't want to flash it again just to help me debug...).
Regarding the widgets (when the apps do appear) ,try clearing the HTC Sense data (unfortunately this will reset your desktop but it should restore your widgets and its better than having to reinstall everything).
I'll have to have a go later.. tied up at the mo..
Prob loading gadget appeared on the screen (still does).
Will try clearing sense and post back later.
EDIT: Clearing Sense worked. Thanks.
made battery callibration (http://www.villainrom.co.uk/viewtopic.php?f=97&t=1789&start=20#p19769).. full charge (~17:15).. after 5 hours using phone.. 5-7 calls (1-5min each), 30 min wifi and playing =) and now ( 22:40) 99% battery!!! blja, im very happy!!!!!!!!!!
cpu always 245-576mhz
only like with original VR12 kernel after few hours of use at 576mhz linpack score down from 2.5 to 1.8 , but after installed autokiller ( preset 60mb) it's always 2.45-2.57
now i think VR12 the best!
Thank you one more time! will write back tomorrow eve =)
is this included stuff really usefull or it can be disabled?
ipv6 (lot of different options)
LZO and ARC4 crypto stuff
extra PPP stuff (MPPE, PPPOLAC, PPOPNS)
DSCP and TCPOPTSTRIP
INET_TUNNEL
XFRM_IPCOMP
CPU_FREQ_GOV_CONSERVATIVE
the /proc/config.gz (kernel .config support)
Also, I noticed that the device boot with mem=64M. Does it mean that the rest of the RAM isn't used?
AFAIK the only way to change this is to recompile the kernel.
Many of what you said I saw requests here on XDA that kernel developers add (there applications which use it). Please note that many of those modules do not automatically load and need to be manually loaded so they should not have any effect.
Others stuff, mainly the IPv6 stuff i doubt anyone uses - must have "inherited" it from the config i used as a base. I will look into it for future release if I can remove that stuff.
About the mem=64 I am not sure what that is, my phone is definitively using the full memory. I will also try to understand and possibly adjust that for future releases.
Thanks for the input.
An other question, is a kernel really tied to a specific ROM? I have VR12 right now so I could try it, but I was also thinking of upgrading to a 2.2 ROM.
About the modules, I think that most of the stuff that I noticed was compiled in (=y) and not as modules (=m). If they are only used by 1% of the users, I think it would be better to have them as modules and make sure that they don't load automatically at boot.
Also, do you know if it is better to have a small frequency table (with, let say, only 3 choices) to avoid excessive frequency switching?
Is the dalvik to SD trick included worth it for those of us with the original 2GB SD card?

[KERNEL][AOSP4.4/5.1/6.0/7.1] dkp - d2att - 2/4/18

Welcome to decimalman's kernel playground!​
As the name suggests, dkp is a hodgepodge of features and tweaks that I wanted to play with. It should get excellent battery life without feeling sluggish. It doesn't come with its own tuner app, so pick your favorite. Personally, I like Trickster MOD and Kernel Adiutor, so I go out of my way to make things work in them. Most other apps should work, too.
Features:
Overclocking up to 2.1 GHz, but you'll need to increase your voltages to get there (if you can get there at all)
Underclocking down to 54 MHz, with stability improvements
Undervolting compatible with most apps
Fast charge without unplugging first
Glorious animations for the notification and softkey LEDs
Well-integrated erandom means you don't need CrossBreeder or Seeder (recent AOSP builds use ISAAC instead)
freelunch and tierservative governors for optimal battery life without sacrificing responsiveness
Automatic mpdecision and auto-hotplug are only enabled when needed
Adjustable minimum voltage for stability on finicky processors
Optimized UKSM to free up some extra memory
Code optimizations for size and speed
Compiler optimizations (-O3, LTO, and more) because faster is better
Donors: Thanks, everyone! Your generosity is much appreciated. :good:
drpenguino, 0xScott, vmancini3 (twice! :good, Ch4m3l30n, rompnit, Mystique, ryandubbz, techdog, ElwOOd_CbGp, ScOULaris, ZipAddict
Remember:
Nandroid!
last_kmsg and/or logcat or it didn't happen.
Other kernels have their own threads or forums. Discuss them there.
Image dumps (settings, battery life, whatever) belong inside [HIDE][/HIDE] (that's HIDE, if you're on the mobile app) tags.
Be silly. We're here to have fun.
Installation:
Reboot to recovery. I recommend that one recovery...you know, the one that flashes zips? I forget what it's called.
Flash dkp. Optionally, rename and flash dkp-vmin-XXX.zip (see below).
Reboot.
Undervolting:
Undervolting on dkp is more complex than other kernels. Some processors get unstable at lower voltages, so (like the stock kernel) dkp keeps the processor voltage above 1150 mV by default. I refer to this limit as the minimum voltage. In order to undervolt, you'll need to lower the minimum voltage: if you use Trickster MOD or Kernel Adiutor, just disable "Override Minimum Voltage", otherwise rename dkp-vmin-XXX.zip to e.g. dkp-vmin-600.zip (which would apply a 600 mV minimum voltage) and flash it. If this causes instability (crashes, audio/video glitches, etc.), try using dkp-vmin-XXX.zip to apply a higher minimum voltage (somewhere between 950 and 1050 mV seems to work well for most people).
Downloads:
MediaFire:
All Downloads
dkp-vmin-XXX.zip
Solidfiles (Make sure you have an adblocker!):
All Downloads
dkp-vmin-XXX.zip
Source: I'm always happy to see my code used, so cherry-pick away. I'll even put together feature patches if you ask nicely.
Bugs:
Let me know.
Stable changelog:
3/3/13: Initial release for d2spr. Didn't get around to making threads for other carriers.
4/8/13 (3.0):
FauxSound support
Strip more useless stuff
A few bonus optimizations
4/8/13 (3.4):
Port everything except erandom from 3.0
Enhance cpufreq for easier configuration
4/24/13 (3.4):
Bugfixes: better support for tuner apps, fixed potential SOD bugs, automatic mpdecision fixups, etc.
Lots of CM/CAF/Linux updates
Working AssWax governor
Trinity colors support
sio, zen I/O schedulers
erandom is back!
Built with a super-fancy Linaro GCC 4.8.1-dev compiler toolchain for maximum -O3 goodness
Probably lots more, but there's hundreds of commits to sort through...
5/29/13 (3.4):
Bugfixes: better overclocking support, better hwrng support, etc.
Updates: new CM updates, Linux 3.4.47, updated FauxSound driver, added invisiblek's new panel colors interface
Automatic auto-hotplug
New optimizations, including link-time optimization and an updated GNU+Linaro GCC 4.8.1-dev toolchain
6/14/13 (3.4):
Bugfixes: fix several critical bugs in the 5/29 release.
9/7/13 (3.4):
Fixes for OC, UV, auto-hotplug.
A few new optimizations.
Synced up with CM.
9/20/13 (TW):
Ported everything from AOSP to TW.
9/20/13 (4.3):
Merged 4.3 from CM into the existing 4.2 code.
Current experimental branches:
Nothing interesting at the moment.
Goodies:
dkp doesn't come with its own splash screen. However, the dkp installer (i.e. the install zip) is smarter than you think, and can apply a custom splash screen for you. Here's how:
Create a folder on your internal storage named "dkp"
Copy a PNG image into the directory, and rename it "splash.png". Alternatively, copy an RLE image (i.e. from a flashable custom splash screen zip) and rename it "splash.rle". Ideally, the image should be roughly 1280x720 to begin with, since it won't be resized.
The image will be used as your splash screen whenever you flash dkp. Reflash to apply initially.
mikedavis120 has put together a how-to video that covers tweaking dkp for optimal battery life. If you're new to dkp, take a look! He also put together a zipped collection of apps that will come in handy while tuning dkp. It also includes a flashable zip, "dkp-debug_v1.zip". After flashing it, running
Code:
su
dkp
from a terminal emulator will collect lots of useful debug information that will make it much easier for me to track down the issue you're having. :good: mikedavis120 recommends installing SuperSU (included in the zip) instead of what's included in you ROM.
sysfs:
It's possible to adjust all the settings available in dkp without using apps. Because they show up as files, settings can be adjusted with file managers, terminal emulators, adb and initscripts. Here's the most interesting files inside sysfs:
/sys/devices/platform/mipi_samsung_oled.513/lcd/panel/panel_colors (not available on newer AOSP builds): display tint (0 = very red, 2 = default, 4 = trinity colors)
/sys/class/misc/gammacontrol (only available on newer AOSP builds): various color controls. See this post for details on enabling Trinity colors on builds that use these controls.
/sys/devices/system/cpu/cpu<N>/cpufreq/UV_mV_table: voltage table
/sys/devices/system/cpu/cpu<N>/cpufreq/scaling_...: scaling_governor is the governor, scaling_min_freq and scaling_max_freq are the minimum and maximum frequencies, scaling_available_governors and scaling_available_frequencies show the available governors and frequencies
/sys/kernel/dkp/force_fast_charge: fast charge
/sys/kernel/dkp/link_core_settings: when linked (the default), frequency settings and some governors are automatically copied to the other core
/sys/kernel/dkp/vmin: minimum processor voltage in mV
/sys/kernel/mm/uksm/run: activate UKSM
auto-hotplug tuners:
These show up in the governor settings for any governor that doesn't do its own hotplugging. They only take effect when using auto-hotplug, so you'll probably need to disable mpdecision in Trickster.
hotplug_intpulse: when set to 1, automatically turns core 2 on whenever the screen/buttons/whatever is pressed. Default is 0.
hotplug_sampling_periods: number of samples to use for average number of running tasks. Default is 15.
hotplug_sampling_rate: number of 'jiffies' (currently 1 jiffy = 10 ms) between each sample of running tasks. Default is 20 (0.2 sec).
hotplug_enable_one_threshold: the average number of running tasks required to turn core 2 on, multiplied by 100. Default is 125 (1.25 tasks on average).
hotplug_disable_one_threshold: the average number of running tasks required to keep core 2 on, multiplied by 100. Default is 250 (2.5 tasks on average).
freelunch/nanolunch tuners:
freelunch and nanolunch aren't materially based on other governors, so their configuration is quite different than other governors. There's lots of tuners, since I haven't really decided on an ideal tuning. I encourage experimentation! I'll explain a bit of how these governors work before actually listing the tuners.
Generally speaking, there are two modes: in "normal" mode, sampling is done occasionally and frequency is generally increased slowly; in "interactive" mode, sampling is done much more quickly, and frequency increases much more quickly. "Interactive" mode ends after several samples of very low usage. The idea of a "hispeed" frequency is used in lots of governors, and it refers to the frequency that the CPU will jump to when more CPU usage is needed; generally, it's a generous estimate of how much CPU will be needed. Here, the hispeed frequency is adjusted on-the-fly, increasing when more CPU is needed and gradually decreasing when the CPU is idle. In "interactive" mode, the hispeed frequency is kept fairly high so that everything will feel snappy.
Hotplugging is taken care of in the least complicated (and in my opinion, most reasonable) way possible: if core 1 is using lots of CPU, and there are several tasks running (in other words, if it's likely that core 2 will have something to do), core 2 is turned on; if either core isn't doing much except using power, core 2 is turned off.
sampling_rate: the usual
hotplug_up_cycles: number of consecutive heavily-loaded samples before core 2 is turned on
hotplug_down_cycles: number of consecutive lightly-loaded samples before core 2 is turned off
hotplug_up_load: number of running tasks required to bring core 2 online
hotplug_up_usage: number of used CPU cycles (in thousands per second) required to bring core 2 online
hotplug_down_usage: number of used CPU cycles (in thousands per second) required on both cores to keep core 2 online
overestimate_khz: number of CPU cycles to overshoot usage by in "normal" mode
hispeed_thresh: if CPU usage is within this many cycles (in thousands per second) of the maximum frequency, frequency will be increased to the hispeed frequency. Generally, hispeed is pretty low in "normal" mode, and fairly high in "interactive" mode.
hispeed_decrease: when the CPU is sitting idle, the hispeed frequency is decreased by this amount each sample (this isn't ideal, but it works)
interaction_hispeed: the initial hispeed frequency when switching to "interactive" mode
interaction_return_cycles: number of consecutive lightly-loaded samples before returning to "normal" mode
interaction_return_usage: number of used CPU cycles (in thousands per second) required to stay in "interactive" mode
interaction_panic (nanolunch only): when set to 1, allows aggressively jumping past the current hispeed frequency under some circumstances
interaction_sampling_rate/overestimate_khz: equivalent to the "normal" versions of the tuners, these take effect in "interactive" mode
Just loaded it on pa 3.15
Sent from my SAMSUNG-SGH-I747 using xda premium
It doesn't say that it has morfic colors, but looks like it does. Gonna give it a whirl
Sent from my SGH-I747 using xda app-developers app
rmead01 said:
It doesn't say that it has morfic colors, but looks like it does. Gonna give it a whirl
Sent from my SGH-I747 using xda app-developers app
Click to expand...
Click to collapse
It doesn't, but I'll merge it and put out a test build.
decimalman said:
It doesn't, but I'll merge it and put out a test build.
Click to expand...
Click to collapse
Is it possible they are left over from a previous kernel? Because I can def tell the difference usually and seems like it does.
Either way, advise when its updated. This governor seems solid so far.
Sent from my SGH-I747 using xda app-developers app
rmead01 said:
Is it possible they are left over from a previous kernel? Because I can def tell the difference usually and seems like it does.
Either way, advise when its updated. This governor seems solid so far.
Sent from my SGH-I747 using xda app-developers app
Click to expand...
Click to collapse
dkp is based off clean CM source, so it shouldn't have been merged already.
I've got test builds compiling now, and the 3.4 builds will be up shortly. Flashing the trinity-colors test build and this zip will enable trinity colors. You can toggle it with
Code:
su
echo X >/sys/class/mdnie/mdnie/trinity_colors
where X is 0 to disable or 1 to enable.
Edit: and sorry for taking so long to respond.
Edit 2: 3.4 builds are up. http://d-h.st/7Ae
Thnx for this kernel
decimalman said:
dkp is based off clean CM source, so it shouldn't have been merged already.
I've got test builds compiling now, and the 3.4 builds will be up shortly. Flashing the trinity-colors test build and this zip will enable trinity colors. You can toggle it with
Code:
su
echo X >/sys/class/mdnie/mdnie/trinity_colors
where X is 0 to disable or 1 to enable.
Edit: and sorry for taking so long to respond.
Edit 2: 3.4 builds are up. http://d-h.st/7Ae
Click to expand...
Click to collapse
Maybe I was just seeing things, had just watched jurassic park in 3d.
New "test" build flashed as well as the file to enable it. Thanks for the addition. It's very hard to go back to normal once you've been smurfed depending on your display.
Only issue i'm having ATM is the ability to change the voltage table. My phone doesn't handle undervolting as well and i run a minimum of 950 baseline, if not 975. One of my normal apps wasn't able to set the voltage at all. I'm trying to use performance control which I don't like. It crashes trying to set the voltage on boot but at least I can go in and manually set the values on boot and they stick.
One last question, since this is your kernel, what scheduler do you recommend pairs well to freelunch? What would you use for performance and what would you use for batt?
rmead01 said:
One last question, since this is your kernel, what scheduler do you recommend pairs well to freelunch? What would you use for performance and what would you use for batt?
Click to expand...
Click to collapse
+1 on these questions
Sent from my AT&T Samsung Galaxy S III
rmead01 said:
Only issue i'm having ATM is the ability to change the voltage table. My phone doesn't handle undervolting as well and i run a minimum of 950 baseline, if not 975. One of my normal apps wasn't able to set the voltage at all. I'm trying to use performance control which I don't like. It crashes trying to set the voltage on boot but at least I can go in and manually set the values on boot and they stick.
Click to expand...
Click to collapse
Answered my own problem. I installed trickster as mentioned in OP and all voltage settings stick no problem with no issues.
rmead01 said:
New "test" build flashed as well as the file to enable it. Thanks for the addition. It's very hard to go back to normal once you've been smurfed depending on your display.
Only issue i'm having ATM is the ability to change the voltage table. My phone doesn't handle undervolting as well and i run a minimum of 950 baseline, if not 975. One of my normal apps wasn't able to set the voltage at all. I'm trying to use performance control which I don't like. It crashes trying to set the voltage on boot but at least I can go in and manually set the values on boot and they stick.
One last question, since this is your kernel, what scheduler do you recommend pairs well to freelunch? What would you use for performance and what would you use for batt?
Click to expand...
Click to collapse
Personally, I don't like trinity colors, but I definitely understand the appeal. I merged this into 3.0 and 3.4, so it'll be standard from here on. I'll add a link to the enabler zip in the OP as well.
What app would you normally use? I'll try to support it, since I already provide several voltage interfaces. I didn't realize performance control was crashing (I'm not a fan either, so I only lightly tested). I recently installed Trickster and liked it, so I've been going out of my way to support it. It's also really easy to write support for, so that's a bonus for me.
As for schedulers, I'm not fussy. I've never exhaustively tested performance and battery life, so I don't have a preference and usually run noop or deadline. However, I've had nothing but bad results with ROW (phone never deep sleeps, and I haven't looked into why).
decimalman said:
Personally, I don't like trinity colors, but I definitely understand the appeal. I merged this in, so it'll be standard from here on. I'll add a link to the enabler zip in the OP as well.
What app would you normally use? I'll try to support it, since I already provide several voltage interfaces. I didn't realize performance control was crashing (I'm not a fan either, so I only lightly tested). I recently installed Trickster and liked it, so I've been going out of my way to support it. It's also really easy to write support for, so that's a bonus for me.
As for schedulers, I'm not fussy. I've never exhaustively tested performance and battery life, so I don't have a preference and usually run noop or deadline. However, I've had nothing but bad results with ROW (phone never deep sleeps, and I haven't looked into why).
Click to expand...
Click to collapse
good to know. Trickster mod works fine and you mention it in the OP and it's at no cost in the play store. I wouldn't worry.
I was using an app called kernel tuner because some others would only set 1 core to the governor and not both. I checked that trickster does indeed set both cores to freelunch so once that figured out I removed kernel tuner. Kernel Tuner also has the options for profiles which can be toggled in tasker for varies states. freelunch so far hasn't needed any changing so not worried about it at this point. just as an example, some governors would be better for screen on/off and tasker could switch these to edge out battery life.
The voltage app i was using is simply called voltage control. Kernel tuner doesn't do a nice job of voltage changes. But since trickster does both governor and voltage adjustments well. i'm using that with no problems now.
Thanks for the morfic, having a way to toggle it works well for people. it's as simple as a script so there's that.
rmead01 said:
good to know. Trickster mod works fine and you mention it in the OP and it's at no cost in the play store. I wouldn't worry.
I was using an app called kernel tuner because some others would only set 1 core to the governor and not both. I checked that trickster does indeed set both cores to freelunch so once that was made it was no problem. Kernel Tuner also has the options for profiles which can be toggled in tasker for varies states. freelunch so far hasn't needed any changing so not worried about it at this point.
The voltage app i was using is simply called voltage control. Kernel tuner doesn't do a nice job of voltage changes. But since trickster does both well, i'm using that with no problems now.
Thanks for the morfic, having a way to toggle it works well for people. it's as simple as a script so there's that.
Click to expand...
Click to collapse
I meant to test Voltage Control but Google wasn't letting me download anything. It's a common app, so I'll try to get it working regardless. Kernel Tuner doesn't currently work well with freelunch, and tends to hang when it's trying to read settings in the CPU screen. Otherwise, it's a nice app. I didn't realize it had Tasker support (I use Llama).
I've added a few extra bits to the cpufreq core, so governors that need to be set on both cores (like freelunch) will automatically apply to both cores regardless of what app is used. cpufreq will even enable and disable mpdecision depending on whether a hotplugging governor is running (though Trickster won't show that it's disabled).
I owe ktoonsez for the toggleable trinity colors. I slightly rewrote his patch, but it's still largely his code. It's my policy that anything that not all users will want should be optional and easily configurable.
Edit: I think I've got Voltage Control fixed. I should be able to get Kernel Tuner working without too much work. I haven't even looked into Performance Control yet.
decimalman said:
I meant to test Voltage Control but Google wasn't letting me download anything. It's a common app, so I'll try to get it working regardless. Kernel Tuner doesn't currently work well with freelunch, and tends to hang when it's trying to read settings in the CPU screen. Otherwise, it's a nice app. I didn't realize it had Tasker support (I use Llama).
I've added a few extra bits to the cpufreq core, so governors that need to be set on both cores (like freelunch) will automatically apply to both cores regardless of what app is used. cpufreq will even enable and disable mpdecision depending on whether a hotplugging governor is running (though Trickster won't show that it's disabled).
I owe ktoonsez for the toggleable trinity colors. I slightly rewrote his patch, but it's still largely his code. It's my policy that anything that not all users will want should be optional and easily configurable.
Click to expand...
Click to collapse
well good job so far. batt life has been top notch. minimal drain in use and my over night idle drain was only a few %. I have things setup to disable wifi when sleep and also turn off mobile data when wifi is connected. A bit over the top but every bit helps.
:good::highfive:
I know I've been grilling you today but...
Kind of curious what the new tunables do. I haven't touched anything since it's working so well but there is always that part of me that wonders what adjust parameters will do. Is there any kind of reference for this governor that could indicate that type of info?
Does your kernel support faux sound app?
stevehkim said:
Does your kernel support faux sound app?
Click to expand...
Click to collapse
Yes. 3.0 and 3.4 both have support.
As for tuneables, I've been meaning to post a writeup but haven't gotten around to it. You're not the first to ask about it.
Sent from my SPH-L710 using xda app-developers app
This is a fantastic Kernel! The battery life has been outstanding so far. Thank you for your amazing work!

[GUIDE] Custom Kernels: A Guide on What you Need to Know

I was searching for info about MPDecision and stumbled upon this..it's a very good read specially for beginner and those that want to know more about kernel specifics and how they work..this was written back in 2012:
---What IS a kernel?---
The ELI5 answer: "An analogy: the Kernel is like the Engine, Electrical system and the Transmission to a car. The Library, Framework and the Apps [AKA ROM] are the body frame and the rest of the Car." - faux123
In other words, the kernel is the software that controls the hardware at a very low level.
---The Stock Kernel---
The "stock" kernel is the kernel that comes with your Nexus 4 out of the box. It's compiled directly from Google's kernel source code and shipped on your device with zero modifications. A custom kernel, on the other hand, compiles the stock kernel source and adds various modifications to that code.
What are those modifications that kernel devs employ?
To understand what they mean, you need to understand the features of the stock kernel first!
What are the stock kernel parameters?
CPU min frequency: 384 MHz
CPU max frequency: 1512 MHz
Governor: Ondemand
I/O Scheduler: CFQ
What does each parameter represent?
CPU frequency: you can simply think of this as the "speed" the CPU is running at
Governor: regulates the CPU frequency based on many different parameters such as load and time-in-state. Here is an excellent list of many of the most common CPU governors and how each works. Note that you will only see a couple of the CPU governors on this list in whatever kernel you use. Ondemand and Interactive are by far the most widely used, and are the ones you should look at.
I/O Scheduler: handles how the system makes disk access; Please refer to the previous linked thread and scroll down to the 4th post for a detailed list.
What else do you need to know?
--PowerHAL--
PowerHAL is what makes Project Butter. The powerHAL is a ROM component that tells the kernel to BOOST the CPU frequency to higher values in response to UI inputs. The higher CPU frequencies can better respond to UI demands so the overall experience is smoother than without. - faux123
--mpdecision--
All Qualcomm based phones have Qualcomm prorprietary userspace binary called "mpdecision" aka m(ake)p(oor)decision. Instead of letting the kernel itself to decide what frequencies and how many cores to run, this "mpdecsion" binary polls the kernel run queue statistics and decides for the whole system the "optimal" frequency and the "optimal" number of cores to use. The concept is fine, except the decision making is done in userspace and it's 100% closed source so there's no way to tweak it and there's a latency (because all userspace binaries needs to "poll" the kernel for the latest information which is slightly delayed). - faux123
ELI5: mpdecision is a proprietary Qualcomm daemon that makes calls to the SoC (the entire chip your phone uses) to manage the cores. The OS (PowerHAL) makes a request to mpdecision and then mpdecision makes a request to the first two cores to ramp them up. - _motley
Why do kernel devs mess with these?
In practice, the PowerHAL ramping up trick successfully got rid of a lot of the UI lag since Android 4.1. However, this comes at the cost of battery life (and heat generation!) The reason for this is because the system ramps up its CPU on every touch input, rather than waiting for the kernel to calculate the load and ramp up accordingly. On the Nexus 4, when the PowerHAL makes a call to mpdecision it locks the minimum CPU to 1026 MHz upon touch input for the first two cores. While this DOES give you the buttery-smoothness you would expect, it's a bit overly aggressive. This is part of the reason why stock kernel tends to heat up your phone when you play around with it a lot.
---Custom Kernels---
What changes should I look out for?
--mpdecision--
Many kernel devs don't like Qualcomm's implementation, so they work around or get rid of it. Franco, Faux, Bricked, Matr1x, Motley, and Trinity have gotten rid of it/used their own implementations. Harsh and IntersectRaven's leave it intact. Every kernel dev implements things in their own way, and the only way to tell which is better for you is to try each one. This is by far the biggest change any kernel dev can make, as it completely alters how the system handles hotplugging and CPU scaling. In general, you'll find kernels without mpdecision running cooler, with greater battery life, but with a little more lag (made up for by other tweaks).
--thermald--
A binary that controls how to throttle your CPU based on CPU and battery temperatures. You can find the config file in /system/etc/thermald.conf. Stock configs lead to aggressive thermal throttling (battery temp. at 36 degrees C for example, which is easily achieved). You can look into the file and see the various thresholds and actions that the system takes to lower the temperature of the CPU and battery, but it isn't really necessary. Just know that some kernel devs may have changed this in order to allow your phone to run at higher frequencies for an extended period of time, or to further make your phone run cooler.
--Underclocking--
Quite straightforward, by limiting the max frequency your CPU can use, you use less power (higher frequency results in more power dissipated by the CPU).
P = C(V^2)f where C is capacitance, V is the voltage, and f is the current frequency
..gives you an idea of how underclocking (and undervolting) uses less power.
--Undervolting--
This is all the rage today, with many users trying to get as low as possible stable voltage. It's arguable how much undervolting saves battery life, but there's no doubt it reduces heat dissipated from the CPU (see: the above formula). Your CPU is located on the top half of your phone, which is likely where you've felt the heat before. How much your chip can successfully undervolt depends on what type of binned CPU you have. If you want to undervolt, I recommend checking if the voltages you set are stable by running the StabilityTest app and doing the Scaling Stability Test. The frequencies' voltages definitely don't scale linearly, so don't assume that doing global undervolts will be the best you can do. You'll have to apply voltages one by one if you truly want the lowest your chip can possible handle.
--Overclocking/overvolting--
Bricked, Trinity, and Motley's kernel implement this, because it CAN be dangerous. Overclocking usually requires overvolting the processor (so the overclock is stable) but overvolting carries with it the risk of bricking your phone by frying the CPU. Know that doing this has some risks before you try it. Some kernels like Matr1x and Faux's also allow for the GPU to be overclocked if games run a little slowly for you.
--Hotplugging--
Hotplugging is where the individual cores on your phone switch on/off depending on the load on the CPU. The advantage of hotplugging is a reduction in power used because the cores will only turn on when needed. Kernels that use the auto_hotplug binary by Thalamus (that would be Matr1x, Motley, Trinity, Bricked at the moment) allow you to fine tune the enabling and disabling thresholds. These parameters are generally for advanced users only as they require you to write scripts to control them.
--Color Control--
Gives you the ability to change color multipliers and gamma settings to calibrate your display. If you feel your display is too yellow, or you miss the previous feel of your previous phone, then you can mess around with this to get better color reproduction. You can find some user examples here to give you a good idea of what can be done. Gamma control currently requires either Faux's control app or for certain kernels you can use scripts to control them.
--Wakelock reduction--
Some kernels have reduced the msm_hsic_host wakelock duration so your phone enters deep sleep more often. How much improvement this makes is debatable, and whether or not this wakelock is even an issue is also debatable.
--Kernel modules--
Some kernels make modifications to the low-level drivers that interact with the components of your phone. An explanation of what is commonly touched can be found here. You don't really have to worry about this, just know that something is being improved when a kernel dev mentions it.
---Installing a Custom Kernel---
Just flash the zip in your recovery of choice. No need for wiping cache or anything. However, one thing to note that might save you some headache in the future is: what exactly are you flashing? When you flash a kernel, you are not just flashing the kernel, you are writing to the entire boot partition. The boot partition is made up of the kernel AND the ramdisk (the ramdisk is an image that the kernel mounts read-only at boot, it is basically used by the kernel to mount the rest of the system images). Some kernel devs pack their own ramdisk into their boot.img that you are flashing, so when you try to flash a DIFFERENT kernel, you end up in a bootloop. (An example: flash Franco kernel --> flash Faux kernel on top = bootloop.) To solve this you need to reset the ramdisk by flashing a stock reset kernel with the stock ramdisk.
Click to expand...
Click to collapse
all content taken from [URL="http://www.reddit.com/r/nexus4/related/158t1i/custom_kernels_a_guide_on_what_you_need_to_know/"]a reddit post i found which was originally written [/URL]by reddit user IAmAN00bie

[PnP&Thermals tweak] Custom profiles for battery saving and/or better performance-v24

Addon was originally only available on Venom HUB but i decided to release it for everyone to use.Here is copy paste of description and changelogs from the HUB.I will update thread as i update it on HUB.
Also big thanks to @hamdir for testing my performance profile on various games, he will also post later hes review, pictures and comparisons to stock.
This addon is designed to save some extra battery, and reduce heat.Magic is done in 2 files:
1:Thermal-engine is tweaked in order to provide much better sustained performance and cooler phone, without big impact on performance.
2np file is another key component, its HTCs CPU/GPU/EMMC/MODEM and many more control engine.Here many tweaks where done, but gonna quickly list some of the important ones:
-Per app control, automatically suspends 2 BIG cores, and runs on 2 low power ones, it also limits the GPU speed to lowest.This will do only for some most commonly used apps, like Sense Prism, Nova launcher, Apex, other HTC apps, various chat programs(hangouts, facebook, messanger, whatsap etc), YouTube and some more.. as those apps dont require a lot power.
-Screen off is set to 2 low power cores for nice standby times
-Power saver is tweaked to actually save some power and not just lower screen brightness
-Extreme powersaver is also tweaked down to save even more power
-Input boost frequencies are also lowered (CPU ramps up moment you touch screen)
-And alot of other minor tweakups..
Also its recommended not to change anything CPU/GPU related in any other apps, like EX and just let this files do the job for you.
If for some reason you dont like this mod or have any problems with it, installer includes revert to stock option
Click to expand...
Click to collapse
Read more info in changelogs below.
List of battery optimised apps (feel free to post your suggestions):
Code:
com.ninefolders.hd3
com.applisto.appcloner
com.livae.apphunt.app
com.fillobotto.mp3tagger
org.polaric.cluttr
com.rgiskard.fairnote
com.glextor.appmanager.free
com.catchingnow.undo
kik.android
de.onyxbits.listmyapps
org.zloy.android.downloader
com.slaughter.look.of.disapproval
gaurav.lookup
cn.wq.myandroidtoolspro
com.embermitre.pixolor.app
de.toastcode.screener
de.munichsdorfer.screenittrial
com.glitch.stitchandshare
com.stumbleupon.android.app
org.de_studio.recentappswitcher.pro
com.happening.studios.swipeforfacebookfree
com.laurencedawson.reddit_sync
com.fifthelement.trimmer
com.camel.corp.universalcopy
com.google.android.apps.inbox
com.riversoft.android.mysword
com.taxis99
com.tbig.playerpro
com.tomtom.gplay.navapp
com.xda.labs.play
com.google.android.apps.translate
com.safeincloud
com.mobisystems.msdict.embedded.wireless.collins.p ortuguese.full
com.mobisystems.msdict.embedded.wireless.oxford.es sentialportuguese
com.accuweather.paid.android
com.mobilesrepublic.appy
com.pandora.android
com.slingmedia.slingPlayer
com.bumble.app
com.tinder
com.klinker.android.twitter_l
com.nam.fbwrapper.pro
com.timehop
jp.naver.line.android
com.linkbubble.playstore
kr.co.vcnc.android.couple
com.joshua.jptt
com.noinnion.android.greader.reader
com.netbiscuits.kicker
com.redictandcgdstudios.projectslenderonline
com.teotlstudios.slenderrisingfree
com.dvloper.slendermanriseagainfree
com.RexetStudio.SlenderTheRoad
air.com.sticksports.sticktennis
com.sticksports.sticktennistour
com.bauermedia.tvmovie
de.wetteronline.wetterapppro
com.redictstudios.projectslender
se.feomedia.quizkampen.de.premium
com.quoord.tapatalkHD
com.droid27.transparentclockweather
com.speedsoftware.rootexplorer
pl.solidexplorer2
com.appseleration.android.selfcare
com.google.android.apps.chromecast.app
rpkandrodev.yaata
com.andrewshu.android.reddit
com.xodo.pdf.reader
com.microsoft.office.word
com.microsoft.office.excel
com.kmobile.cb
com.nianticlabs.pokemongo
com.google.android.apps.maps
com.htc.laputa
com.papago
com.mapbar.android.mapbarmap
com.autonavi.cmccmap
com.baidu.BaiduMap
com.pdager
com.kingwaytek.naviking
com.htc.lockscreen
com.htc.fingerprint
com.xda.labs
org.mozilla.firefox
org.mozilla.firefox_beta
com.emoji.keyboard.touchpal.oem
com.nitrodesk.honey.nitroid
com.android.calculator2
com.estrongs.android.pop
com.tbig.playerpro
org.telegram.messenger
com.instagram.android
org.wordpress.android
com.touchtype.swiftkey.beta
com.gsamlabs.bbm
com.htc.android.worldclock
com.quoord.tapatalkpro.activity
com.anddoes.launcher
com.google.android.gms
android.uid.systemui
com.android.systemui
com.chrome.beta
com.android.chrome
com.chrome.dev
com.teslacoilsw.launcher
com.spotify.music
com.quoord.tapatalkxdapre.activity
com.google.android.apps.plus
com.twitter.android
com.htc.AutoMotive
com.google.android.talk
com.viber.voip
com.ninegag.android.app
com.android.settings
com.devhd.feedly
com.htc.weather
com.google.android.phone
com.htc.sense.mms
com.htc.contacts
com.htc.htcdialer
com.htc.music
com.maxmpz.audioplayer
com.google.android.apps.photos
com.htc.launcher
com.htc.sense.news
com.whatsapp
com.facebook.katana
com.facebook.orca
com.m0narx.hub
com.ice.tweaks
com.m0narx.tweaks
com.google.android.youtube
com.google.android.videos
Compatibility:
All 1,8x, 1.9x and 2.x based roms bases and kernels(even stock roms/kernel's).
Not compatible with 1.5 or below bases (will cause random crashes), use Version v8 for older 1.5x and 1.2x bases.
Download:
Version v24
Download link flashable ZIP - AFH
Older versions:
Version v23
Download link flashable ZIP - AFH
Version v22
Download link flashable ZIP - AFH
Download:
Version v21
Download link flashable ZIP - AFH
Version v19
Download link flashable ZIP - AFH
Version v18
Download link flashable ZIP - AFH
Version v17
Download link flashable ZIP - AFH
Version v16
Download link flashable ZIP - AFH
Version v15
Download link flashable ZIP - AFH
Version v14
Download link flashable ZIP - AFH
Version v13
Download link flashable ZIP - AFH
Version v12
Download link flashable ZIP - AFH
Version v11
Download link flashable ZIP - AFH
Version v10
Download link flashable ZIP - AFH
Version v9 TEST
Download link flashable ZIP - AFH
Version v8
Download link flashable ZIP - AFH
Version v8 for older 1.5x and 1.2x bases
Download link flashable ZIP - AFH
Changelog:
Code:
24.04.2017
v24:Fixed remove 50 -> 60 fps boost on touch on performance profile(60fps locked now)
- MaxPowerSaving profile optimizations to get even more battery life.
27.03.2017
v23:Added more user requested apps(30) for battery optimised profiles
- Attempt to smoothen Facebook app scrolling (App still lags while loading items on any phone)
- Increased touch input boost speed for MaxPowerSaving profile(smoother scrolling)
16.01.2017
v22:Viper Magisk compatible
- Merged with 2.41 base changes
- Added a lot more apps for battery optimised profiles
- Added new MaxPowerSaving profile:
Limits CPU to 1.3/1.78GHz(LC/BC), GPU 510MHz
Launching apps bypasses above limit for fast app starting/switching
Still uses balanced mode per app profiles which saves even more power
- Cleaned installer from unnecessary files (smaller zip size)
9.12.2016
v21:Lowered input boost, touch boost, long duration touch boost, app launch and per app frequencies for even more battery savings(N is still very smooth)
-Cleaning of code and some other fine tuning
24.11.2016
v20:Merged with Android 7.0.0 changes
-Also backwards compatible with 1.5x + bases
26.09.2016
v19:Fixed CPU doesnt drop to lowest speed for some users/kernels
- Merged v18 balanced changes into performance profile
22.09.2016
v18:(Balanced changes only)
- Adjusted CPU scheduler load distributions and frequencies in order to fix some stutters,
but also to save power while phone is idle with screen ON (drops to lower frequencies faster)
- Fixed weird HTC bug where task migration gets stuck in loop and cause phone to heat up for no reason
- (thermal file)Make it a bit cooler on higher loads
- Minor fine tuning here and there..
29.08.2016
v17:Prevent cores going offline if running Android auto (fixes lag on screen off)
- (Balanced)Tweaked 15+ various governor and boost settings for even more power savings
- (Balanced)Added more appps for CPU limiting profiles
- Allow 4 threads for oat proces if PlayStore in focus(faster app install)
23.08.2016
v16:Merged latest HTCs changes realted to PokemonGo thermals
- Removed 50 -> 60 fps boost on touch on performance profile(60fps locked now)
- Forced 60 fps for YouTube and Google videos on balanced profile
- Tweaked thermal file on balanced profile for better performance
07.08.2016
v15:Balanced and Performance profile update
- Fine tuned values
- Big cores go offline during screen off for Performance profile
- Tweaked low memory killer values on both profiles,
prevents often app reloading, which is waste of time and battery.
04.08.2016
v14:Balanced and Performance profile update
- Implemented dynamic swappiness
- Default swappiness reduced from 60 to 30 (less writes to nand)
- During app launch or touching screen event swappiness is reduced to 0
- During screen off swappiness is set to default 60 so it can do its job when we are not using phone
- Increased dirty_ratio to reduce even more writing to nand
- Overall goal is to reduce I/O on NAND while using phone and in that way improve performance,
but also improve battery by better utilizing the 4gb RAM that this device has.
- Added more apps for CPU limiting profiles(balanced only)
v13:
-Merged with changes from 1.9x base
(Mostly fine tuning battery saving for various video chat programs)
v12:Balanced profile changes
- Added more commonly used apps for lower power CPU profiles
- More fine tuning
v11:
- Fine tuned balanced profile to prefer a bit more battery life
- Cleaned up aroma installer (wont create unnecessary Venom folders for non-Venom users)
v10:Balanced profile rebuild
- Merged and fine tuned/adjusted thermal configuration from performance profile
- Should improve responsiveness and fix stuttering on some apps that happend before
- changed around 100+ lines of code, lazy to write full changelog :p
v9:TEST balanced profile update
- Big cores will now go fully offline during screen off and while in Extreme powersaver
- Lowered screen refresh rate while in Extreme powersaver(even more saving)
- Max GPU speed limited to 214MHZ while in Extreme powersaver
- Max GPU speed limited to 510MHZ while in powersaver
- Reduced app launch boost MIN frequencies speeds to 1.3gz for all cores.
v8: complete rebuild of performance profile
- Added extra 560mhz frequency step between 630 and 510 for GPU throttling
- Added 5 additional throttling steps for each CPU cluster per temperature
- Prevent big cores dropping to 1.3ghz too soon which drops FPS in games.
- Prevent killing one big CPU core too soon, instead 2 will run at half migration performance.
- Everything fine tuned and balanced, 10+ FPS boost in most games compared to stock
v7
- 1.8x base compatibility update
v6
-Removed battery saving profile as balanced does such good job, both smoothness and performance! :)
v5
-Many changes to balanced profile
-Lowered app launch Max CPU speed locking to more reasonable levels(Still ramps up to max if load demands)
-Reduced input boost duration a bit
-Governor will now drop CPU to lower speeds faster
-Added more apps to lower CPU speed profiles.
v4
-Aroma installer fixes
-BatterySaving profile fine tuning
v3:
-2 new more options
*MaxPerfomance
*BatterySaving
-Tweaked is now called Balanced
v2:
-fixed YouTube 2k+ videos lag
This is example of battery life i get with Balanced profile
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
XDA:DevDB Information
PnP&Thermals tweak, Tool/Utility for the HTC 10
Contributors
ivicask, hamdir
Version Information
Status: Stable
Current Stable Version: v24
Stable Release Date: 2016-06-23
Current Beta Version: v9
Created 2016-07-06
Last Updated 2017-04-24
Performance Profile
I've worked with @ivicask on optimizing gaming performance for the 1.80 base via the performance profile for this mod, in this post i will explain the gaming problem on stock HTC 10 and how this mod/performance profile solves it
by default HTC aggressively cripples the Snapdragon 820, not for the sake of thermals but for the sake of extending battery life, what happens is the following:
Stock CPU behavior on HTC ten (up to 1.80 base):
Starting with 33c battery temp CPU tasks will gradually migrate out of the big cluster, around 38c one of the two big Kryo cores (which enjoy higher clocks and bigger hardware cache) will be completely disabled, HTC smartly hides it in task migration rather than physically shutting down a big core
This means in CPU intensives games like Dead Effect 2 you will notice a sharp drop in performance/smoothness once the fourth core is killed, the game will drop from the 60fps range to 30fps, this behavior is noticeable in many games, if you are on complete stock you can only game at the full s820 speed if you are starting from a cool idle battery temp like 30c but then in about 5 minutes things will go downhill, considering that the HTC 10 idle state in average use is around 35c anyway you can see how most people probably start gaming on the 10 within the crippled state
Previously the only way to fix was to flash EX kernel with CPU migration hacked and already set by default to 60% limit, meaning EX kernel will refuse to let HTC 10 migrate tasks out of the fourth core under 40%, this is a good solution but you are forced to use EX kernel and not the stock kernel plus wait for the kernel source so that EX is updated whenever an OTA is rolled out, this mod will allow you to fix gaming on HTC 10 without touching the kernel plus it's thermally safe as its not a hack and will still gradually slow down the 10 to cool down, but it does so in a sane way
The performance profile in this mod was thoughtfully optimized by profiling the CPU usage in Dead Effect 2 (currently one of the heaviest games on the playstore) from 30c up to 45c, giving you enough time to actually enjoy this game at its full speed up to 30 minutes
The following tests will show you how the HTC 10 behaves in gaming when warm vs the performance profile, profiled using @ivicask tools and game benched in short sessions, the exact same level played from the same starting point to the same end at the same length of time, this level called "return to space gardens" is one of the heaviest sections in Dead Effect 2, at the end of this test you can see how performance drops to the ground because it meets a very dense and tough section in the game.
Stock kernel / PNP / thermals, Dead Effect 2 at 39c
The fourth big core is completely killed, GPU goes to 510mhz, small cluster drops to 1.3ghz, big cluster drops to 1.5ghz
As you can see on pure stock 1.80 base by 39c the games loses one of the big s820 cores and performance drops from 45fps range in this level to 30fps (which happens way too fast) also as seen in the yellow graph how performance stability is terrible, after 40c it will get even worse
here are the results from the same level using the performance profile of this mod
Performance Profile, Dead Effect 2 at 34c to 38c
full tasks are still running on all cores, GPU at 624mhz, small cluster still at 1.5ghz, big cluster drops to 1.5ghz
Performance Profile, Dead Effect 2 at 39c to 41c
both big cores drops to 80% task migration, GPU drops to 560mhz, small cluster still at 1.5ghz, big cluster still at 1.5ghz
Performance Profile, Dead Effect 2 at 42c to 43c
one big core sticks to 80% task migration the other big core drops further to 60%, GPU drops to 510mhz, small cluster still at 1.5ghz, big cluster still at 1.5ghz
Once the device gets warmer after 43c CPU migration will drop to 60% on both big cores with further reduction in GPU speed etc, but at this stage the HTC 10 will no longer heat up as fast and as you can see up to this point it was maintaining almost the same performance in this game; while keeping fairly high GPU clocks too; this is a much more subtle well thought performance degradation than HTC's stock blind brute crippling of the s820 which happens way too fast on low temps
This profile is so good actually HTC should probably copy it and imitate how it deals with default CPU migration, otherwise why are we buying an s820?
ivicask said:
Addon was originally only available on Venom HUB but i decided to release it for everyone to use.Here is copy paste of description and changelogs from the HUB.I will update thread as i update it on HUB.
Also big thanks to @hamdir for testing my performance profile on various games, he will also post later hes review, pictures and comparisons to stock.
Click to expand...
Click to collapse
@ivicask
does it work differently from butterfly v11?
or say does it conflict with butterflyv11 if you have already loaded that profile and flash this zip?
thanks for another tweak made possible for Perfume devices
SacredDeviL666 said:
does it work differently from butterfly v11?
Click to expand...
Click to collapse
Completely different, it uses HTCs native engines to control everything, u can basically flash this on stock un-rooted phone
And doesn't require custom kernel, it should work immediately as new bases come out etc..
ivicask said:
Completely different, it uses HTCs native engines to control everything, u can basically flash this on stock un-rooted phone
And doesn't require custom kernel, it should work immediately as new bases come out etc..
Click to expand...
Click to collapse
aah okay cool...does it conflict if i have already enabled butterflyv11 which disables pnq or its safe to flash while using that script
SacredDeviL666 said:
aah okay cool...does it conflict if i have already enabled butterflyv11 which disables pnq or its safe to flash while using that script
Click to expand...
Click to collapse
Half of this mod runs in PnP, if you disable it, your making this mod almost pointless.
Also, as i stated, this mod runs best standalone, its best not to use any other mods, or apps which change anything CPU /GPU related.
You can still flash EX kernel for example, i just dont recommend messing with any CPU/GPU related settings in it.
ivicask said:
Half of this mod runs in PnP, if you disable it, your making this mod almost pointless.
Also, as i stated, this mod runs best standalone, its best not to use any other mods, or apps which change anything CPU /GPU related.
You can still flash EX kernel for example, i just dont recommend messing with any CPU/GPU related settings in it.
Click to expand...
Click to collapse
cool so this would conflict as butterflyv11 disables the pnp
would try this and see :highfive:
hey
great to see you released this for all on xda!
I have a question. since you wrote on the ex kernel thread that pnp config file is encrypted how come you can edit it?
or can you englighten me how i can just disable all Input and touch boosts from pnpmgr while keeping pnpmgr?
i think that would be the best for my script but i wasn´t able to do so.
i found no other way to stop the touchboost other than disabling pnpmgr completely.
maybe we can integrate my interactive values with your mod? if you are okay with this of course!
thanks
Freak07 said:
hey
great to see you released this for all on xda!
I have a question. since you wrote on the ex kernel thread that pnp config file is encrypted how come you can edit it?
or can you englighten me how i can just disable all Input and touch boosts from pnpmgr while keeping pnpmgr?
i think that would be the best for my script but i wasn´t able to do so.
i found no other way to stop the touchboost other than disabling pnpmgr completely.
maybe we can integrate my interactive values with your mod? if you are okay with this of course!
thanks
Click to expand...
Click to collapse
I cant give you much details on how i edit them, theres reason HTC encrypted them, if we spill it out, HTC would change encryption and everything very soon i suspect, so hope you understand why i wont share that part.
I can disable input boost for you, but im still not sure how your mod works along with PnP, as PnP constantly changes values dynamically, if you chmod values, than PnP constantly tries to change freqs and fails(may cause some problems).
What i can also do, is incorporate your changes directly into my mod, and make "ghostpeper" profile which would work directly in PnP, and people can choose and test which one works better for them and their daily usage.
EDIT:You could simple disable input boost by echoing 0(maybe chmod remove write permission after that so it cant change it) to
/sys/power/pnpmgr/touch_boost
/sys/power/pnpmgr/long_duration_touch_boost
ivicask said:
I cant give you much details on how i edit them, theres reason HTC encrypted them, if we spill it out, HTC would change encryption and everything very soon i suspect, so hope you understand why i wont share that part.
I can disable input boost for you, but im still not sure how your mod works along with PnP, as PnP constantly changes values dynamically, if you chmod values, than PnP constantly tries to change freqs and fails(may cause some problems).
What i can also do, is incorporate your changes directly into my mod, and make "ghostpeper" profile which would work directly in PnP, and people can choose and test which one works better for them and their daily usage.
EDIT:You could simple disable input boost by echoing 0(maybe chmod remove write permission after that so it cant change it) to
/sys/power/pnpmgr/touch_boost
/sys/power/pnpmgr/long_duration_touch_boost
Click to expand...
Click to collapse
yep i totally understand this. it would be however great if you could disable Input boost for me directly in the pnp binary.
i already tried to edit the files you mentioned in sys/power/pnpmgr. when i did this I got heavy lags. really heavy. i think something is conflicting there.
yeah the chmod trick worked before base 1.80. i would simply chmod the min freqs for big and Little Cluster and touchboost from pnpmgr disappeared magically. this trick is no longer working with the new base. that´s why i was forced to disable pnpmgr.
if you want to you can incorporate the Butterfly values for the interactive governor in your mod. I think Butterfly works far better on our 10, that´s why i just updated Butterfly for base 1.80.
does pnpmgr also edit the values for the interactive gov dynamically?
if you could make a pnpmgr config where touch/Input boost, Setting min/max freqs is disabled i´d be quite happy.
---------- Post added at 11:17 AM ---------- Previous post was at 11:10 AM ----------
SacredDeviL666 said:
cool so this would conflict as butterflyv11 disables the pnp
would try this and see :highfive:
Click to expand...
Click to collapse
you may also just edit my script and comment out with a # or delete the line "stop pnpmgr" then the pnpmgr conflicting part will at least be removed.
Noice. Thanks for sharing
Freak07 said:
yep i totally understand this. it would be however great if you could disable Input boost for me directly in the pnp binary.
i already tried to edit the files you mentioned in sys/power/pnpmgr. when i did this I got heavy lags. really heavy. i think something is conflicting there.
yeah the chmod trick worked before base 1.80. i would simply chmod the min freqs for big and Little Cluster and touchboost from pnpmgr disappeared magically. this trick is no longer working with the new base. that´s why i was forced to disable pnpmgr.
if you want to you can incorporate the Butterfly values for the interactive governor in your mod. I think Butterfly works far better on our 10, that´s why i just updated Butterfly for base 1.80.
does pnpmgr also edit the values for the interactive gov dynamically?
if you could make a pnpmgr config where touch/Input boost, Setting min/max freqs is disabled i´d be quite happy.
---------- Post added at 11:17 AM ---------- Previous post was at 11:10 AM ----------
you may also just edit my script and comment out with a # or delete the line "stop pnpmgr" then the pnpmgr conflicting part will at least be removed.
Click to expand...
Click to collapse
PnP controls everything u mentioned, all your butterfly/ghost scripts has, and about 10x times even more
I checked your script, you just echo to disable input boost, try chmod it after you disable it with denial permission so it cant be changed..
Should work, if not i can mode PnP for you, but above would be better solution for you..
Maybe others might ask too, sometimes I'm using it too for a systemless mod: do you plan to add it in as a systemless mod, if it is possible?
tbalden said:
Maybe others might ask too, sometimes I'm using it too for a systemless mod: do you plan to add it in as a systemless mod, if it is possible?
Click to expand...
Click to collapse
There is no need for that, it wont affect android pay or similar, why exactly you ask?
ivicask said:
There is no need for that, it wont affect android pay or similar, why exactly you ask?
Click to expand...
Click to collapse
well, just related to OTAs, but that might be unimportant as you can flash back to original files, or restore no-RW mounted system image backups.
Or am i lagging behind, it's working to have a RW mounted system and do OTA updates? I don't follow that part much, my bad
tbalden said:
well, just related to OTAs, but that might be unimportant as you can flash back to original files, or restore no-RW mounted system image backups.
Or am i lagging behind, it's working to have a RW mounted system and do OTA updates? I don't follow that part much, my bad
Click to expand...
Click to collapse
Its so much easier just to restore original image, i think wont do it systemless, as they are key system parts, dont want some weird things to happen..
ivicask said:
Its so much easier just to restore original image, i think wont do it systemless, as they are key system parts, dont want some weird things to happen..
Click to expand...
Click to collapse
OK.
I'm testing balanced option at the moment.
Also, i know I'm off topic, but in the end what's the recipe: what does and what doesn't affect androidPay. (I'm lagging behind again in this topic, just avoid modifying system partition in my kernel as it seemed to affect it at that time... as i don't use androidPay I didn't follow what exactly makes it unworking).
ivicask said:
PnP controls everything u mentioned, all your butterfly/ghost scripts has, and about 10x times even more
I checked your script, you just echo to disable input boost, try chmod it after you disable it with denial permission so it cant be changed..
Should work, if not i can mode PnP for you, but above would be better solution for you..
Click to expand...
Click to collapse
Thanks I will try this and come back at you
tbalden said:
OK.
I'm testing balanced option at the moment.
Also, i know I'm off topic, but in the end what's the recipe: what does and what doesn't affect androidPay. (I'm lagging behind again in this topic, just avoid modifying system partition in my kernel as it seemed to affect it at that time... as i don't use androidPay I didn't follow what exactly makes it unworking).
Click to expand...
Click to collapse
It checks alot of things, and its constantly updated, its simple must be done for security reasons..
Okay so I tried it with 444 permissions and it still lags. Should I try 000?
Would be great if you could make me a file with touchboost disabled and frequency changing disabled.

what's is smart cpu efficiency explain in details please?

recently miui add a new feature called smart cpu efficiency but I wanna know more about this feature and how it's works and after are the pro and cons in full details please and is it really a good feature please answer as soon as possible....
Guys behind MiUI aren't exactly the "brightest" one's so it's just a fancy name, all do it whose not been to hard to do a better tuning than they did on "8". The CPU is regulated trough three part's; governor, HPM scheduler and hotplug. I won't discuss it there is plenty documentation provided, you just need to search for it and make comparation between vendors (OEM's)...
its just the fancy name
Zola III said:
Guys behind MiUI aren't exactly the "brightest" one's so it's just a fancy name, all do it whose not been to hard to do a better tuning than they did on "8". The CPU is regulated trough three part's; governor, HPM scheduler and hotplug. I won't discuss it there is plenty documentation provided, you just need to search for it and make comparation between vendors (OEM's)...
Click to expand...
Click to collapse
I get your point that it's just a fancy name but I wanna know how actually work and how it effect on cpu and how good it is or bad because as I seen this feature active by security app by miui and it just turn down A-72 1.80ghz core to A-1.40ghz and and doesn't even let the device use this and force the device to use A-53 1.40ghz core which is killing my device and it's performance and multitasking help me out with this is true or wrong
https://ibb.co/dAYP9Q
BG. said:
I get your point that it's just a fancy name but I wanna know how actually work and how it effect on cpu and how good it is or bad because as I seen this feature active by security app by miui and it just turn down A-72 1.80ghz core to A-1.40ghz and and doesn't even let the device use this and force the device to use A-53 1.40ghz core which is killing my device and it's performance and multitasking help me out with this is true or wrong
https://ibb.co/dAYP9Q
Click to expand...
Click to collapse
Basically it's a corectl hotplug which is one of the three parts (the last one in hierarchy) that are used for CPU control others are HPM sched which is highest priority & rather complicated & CPU governor. Hire is a catch HPM sched whose broken in the kernel code we got from Xiaomi & after lots of work it's now patched to work properly (as much as possible). I don't know the state of the code in MiUI nor could I but I am pretty much certain that they didn't do a homework. Nor do I know the parameters they used to configure all tree parts. The 1.4 GHz is biggest long time sustainable frequency for the A72's on S65x SoC's & even that much if only up to two active. That isn't the problem, which leads me to believe that problem is a hotplug configuration as it's lagging behind in activating big cores and naturally HMP sched places the task on the first ready core that meets the demand the best of those available. Actually hotplug needs around 150~200 microseconds to wake up the core so it's ready to be used while HPM sched and governor make a decision in one circle or less which is 20~40 ms usually while migration from one to another core takes between 50 to 90 ms. So you see hotplug can't keep up with them nor it will ever can. That's why you need at all times to have at least one active core per each & every cluster (preferable & optimal by my findings is two & every second one starting with first so that the L2 cache is always active fully [this brings down transition times to 50 Ms]). If you have root feel free to play with it as you will find it im QC power init & you can read about settings hire at XDA (Mi Max) on power performance optimisations thread.
Best regards.
So after all it turns out to be dumb & by all means far north from efficient. Typical MiUI.
Zola III said:
Basically it's a corectl hotplug which is one of the three parts (the last one in hierarchy) that are used for CPU control others are HPM sched which is highest priority & rather complicated & CPU governor. Hire is a catch HPM sched whose broken in the kernel code we got from Xiaomi & after lots of work it's now patched to work properly (as much as possible). I don't know the state of the code in MiUI nor could I but I am pretty much certain that they didn't do a homework. Nor do I know the parameters they used to configure all tree parts. The 1.4 GHz is biggest long time sustainable frequency for the A72's on S65x SoC's & even that much if only up to two active. That isn't the problem, which leads me to believe that problem is a hotplug configuration as it's lagging behind in activating big cores and naturally HMP sched places the task on the first ready core that meets the demand the best of those available. Actually hotplug needs around 150~200 microseconds to wake up the core so it's ready to be used while HPM sched and governor make a decision in one circle or less which is 20~40 ms usually while migration from one to another core takes between 50 to 90 ms. So you see hotplug can't keep up with them nor it will ever can. That's why you need at all times to have at least one active core per each & every cluster (preferable & optimal by my findings is two & every second one starting with first so that the L2 cache is always active fully [this brings down transition times to 50 Ms]). If you have root feel free to play with it as you will find it im QC power init & you can read about settings hire at XDA (Mi Max) on power performance optimisations thread.
Best regards.
Click to expand...
Click to collapse
thanks for helping out
Well I hope you are satisfied with explanation.
See you later alligator.
Zola III said:
So after all it turns out to be dumb & by all means far north from efficient. Typical MiUI.
Click to expand...
Click to collapse
could you please give me few simple examples regarding this issue so I can post and point out on the form
BG. said:
could you please give me few simple examples regarding this issue so I can post and point out on the form
Click to expand...
Click to collapse
Their is no simpler explanation.
The numbers I presented are extrapolated from numerous analysis published as scientific works all available floating around the net.
A) hot plug is relatively slow (not because of it self but) as awakening from deep retention states on all ARM CPU's up to date takes time (to init & test/flush queues and RAM subsystem integrity)
B) HPM scheduler is designed to place the work on first available ready CPU core that best meets the demand (dependant on given idle/packing parameters assigned to HPM)
C) hotplug will never be able to awake any core in deep retention state on time for a HPM decision timing
D) all transitions from one to another core (no matter which one) is costly.
So in short what could & needs to be done;
A) Ensure that at least one CPU is always active per cluster
B) Ensure that HPM is properly configured & running as intended (migration load, packing & idle conditions)
C) Minimise transition times (by providing optimal setup) and minimise their number.
How to achieve this?
Well;
A) properly configure hotplug disabling it to power down control core's that are needed to stay online all the time (this excludes the device sleep), example (of a 2+2 always on configuration on a octa core dual cluster SoC [S652]);
write /sys/devices/system/cpu/cpu0/core_ctl/not_preferred "1 0 1 0"
write /sys/devices/system/cpu/cpu4/core_ctl/not_preferred "1 0 1 0"
write /sys/devices/system/cpu/cpu4/core_ctl/is_big_cluster 1
B) there are two approaches with HPM super packing (Sony) & absolute idle load (Xiaomi on MiUI 8) both tied to min CPU's active and all CPU's active how ever the both approaches are wrong, high enough init with limited packaging & giving idling cores advantage is really the best way to go along with providing ideal conditions of available core's (which is 2+2)
C) this two already implied hire together make the ideal possible setup for a task placement & minimising the up/down migration times plus if set as shown (when possible) ensures the usage of all L2 cache available along with exclusive access, it also provides faster awakening of other core's when they are needed from deep retention state. The power drive cost is the same as the performance gain (5~6%) so for given job the power consumption is exactly the same while other positive effects remain. Additionally it's good to prevent up migration of the tasks that are lower priority & flagged as background tasks.
Notes:
1. If enabling the described hotplug configuration on the A53 cluster make sure that it's enabled only on the V2 revision of the core's & that the tool chain (compiler) is set to the strict ID-ing of the core revision along with no A53 erratums forced.
2. The given 2+2 configuration covers all possible scenarios of the thread migrations including SMP one's & it's considered as optimal one by me.
3. In order for this to work properly (& anything else for that matter) the general scheduler patching is required which is available in nijel8 Github kernel repository (mainline port fixes and mostly from Petr).
4. Alternative setup is all four A53 cores active with one A72 core's active all the time, it provides some power saving (in idle and low load states mostly) compared to 2+2 (with A72 core's which falls close to none with A73 core's) but it doesn't cover SMP up migration case along with minor performance degradation. The rest part remains the same.
Feel free to quote me.
As I believe in good old healthy logic which this is I don't find it particularly "smart" one either.
Best regards.
@Zola III
Another worthy input from you regarding performance/power saving... :good:
I will quote you in the performance thread so this not get lost here along with a question... See you there.
nijel8 said:
@Zola III
Another worthy input from you regarding performance/power saving... :good:
I will quote you in the performance thread so this not get lost here along with a question... See you there.
Click to expand...
Click to collapse
Well it's pretty much not anything new nor something we didn't try already together & most of the stuff you already implemented.
Cheers!
thank you guy thank a lot for all your help

Categories

Resources