[KERNEL][Z017/Z012][TREBLE][P5] Advanced Kernel for Custom ROMs

planet9

Senior Member
Apr 24, 2017
114
500
0
Code:
#include 
/*
 * I am not responsible for bricked devices, dead SD cards, thermonuclear
 * war, or the current economic crisis caused by you following these
 * directions. YOU are choosing to make these modificiations, and
 * if you point your finger at me for messing up your device, I will
 * laugh at you.
 */
This kernel should be compatible to all up to date Pie/Oreo custom ROMs. Its goal is to further improve battery life and to offer as many features as possible while maintaining perfect stability. All battery tweaks are toggleable so you can decide whether you prefer performance or battery life.

Every release will be tested with the latest LineageOS 16.0 build before release.
Compatibility to other custom ROMs is very likely but cannot be guaranteed.

Advanced Kernel for Oreo is now discontinued. The non-treble Pie version should work fine with Oreo ROMs.

Features
  • Built with bleeding edge GCC 10.0.0 toolchain, optimized for Cortex-A53
  • Linux 3.18.140, CAF Tag LA.UM.7.6.r1-05500-89xx.0
  • Treble ROM support.
  • Spectrum
  • WireGuard VPN
  • KCAL v2 color control
  • Sound control
  • Intellithermal v3
  • USB keyboard support
  • Arch power
  • Adreno idler
  • Adreno boost
  • Slimbus OC
  • Fingerprint boost
  • State notifier
  • Boeffla wakelock blocker
  • CPU wake boost
  • Vibration intensity control
  • Force fast charge to enforce maximum charging speed on any charger. (Use at your own risk! Disabled by default.)
  • Qnovo driver for better charging temperatures
  • Powersuspend
  • Toggleable touchboost
  • Powersaving work queue by default
  • Tuned interactive governor
  • Additional lower frequencies: 307MHz and 480MHz
  • Additional overclocking frequencies: 2208MHz and 2150MHz - Only selectable in OC version.
  • Disabled CRC check for up to 30% faster I/O, toggleable
  • Fsync switch
  • Improved zram with lz4 compression
  • Native CIFS and BTRFS filesystem support
  • Support for SMB2 and SMB3
  • SdFat for FAT and exFAT support
  • Support for rtl8812au and rtl8814au usb wifi adapters.
  • CPU governors: relaxed, chill, electron, elementalx, impulse, zzmoove, alucard, darkness, nightmare, yankactive, intelliactive, blu_active, interactive, conservative, ondemand, powersave, performance, userspace
  • Hotplug governors: alucard_hotplug, thunderplug, blu_plug, msm_hotplug, intelli_plug, lazyplug, autosmp, AiO_hotplug (Pie only)
  • I/O schedulers: noop, deadline, cfq, bfq, sio, fiops, zen, maple
  • TCP congestion algorithms: westwood, reno, bic, cubic, highspeed, htcp, vegas, veno, scalable, lp, yeah, illinois
  • Countless additional improvements
Overclocking
With every version of Advanced Kernel two files are released: One with overclocking support and one without. Be aware that overclocking may physically damage your phone! If you still want to use it, download and install the kernel zip from the "Overclocking" subfolder. The default zip from the main folder doesn't allow overclocking and is "safe".

The overclocked kernel will first boot with 2.2GHz, then the maximum frequency is lowered by the active spectrum profile. To enable overclocking after booting you have to use a kernel manager app to select a higher maximum cpu frequency. The tradeoff is that higher frequencies also come with higher CPU-voltages so your battery level will drop faster while OC frequencies are in use.

Force fast charge:
Available on the OC and non-OC kernel. This feature overrides the detected charging current with the maximum possible current for the Zenfone 3 (1910ma) so that every charger is fully utilized. Please be especially careful when using this feature as possible safety measures are disabled! It's disabled by default and can be enabled by enabling "USB fastcharge" at KernelAdiutor's "Battery" section or in EX Kernel Manager under "Miscellaneous".

Installation
Simply flash the provided zip file via TWRP over your custom ROM installation. No need to wipe anything!
Before flashing you may want to backup the "Boot" partition. Restore it to revert any changes.
Flashing a ROM will overwrite this kernel: You'll have to flash the kernel zip again after updating your ROM.

In order to use all of the features you'll need some additional apps and root:
Spectrum profiles
  • Battery: Very battery friendly profile. It sacrifices performance for battery life.
  • Balanced: As close to stock as possible with only minor tweaks.
  • Performance: Tuned for CPU performance.
  • Gaming: Everything always runs as fast as possible. Burns away your battery!
Reporting issues
  1. Before reporting an issue please check that it only occurs when having this kernel installed. Otherwise it may be an issue with the ROM.
  2. The above also applies the other way around: Don't report issues to the maintainer of a ROM unless they also occur without this kernel.
  3. Be aware that performance issues are very likey related to your personal settings. Don't blame me for your decision to run only one core at 307 MHz :p
  4. Always use the latest Advanced Kernel release with the latest build of you ROM of choice. If the kernel is much newer than the ROM or the other way around weird issues may arise.
Download
All zip files support both the ZE520KL and the ZE552KL.
The treble version is only compatible to treble ROMs using APD as the vendor partition.
The non-treble version is compatible to non-treble Pie ROMs and SHOULD be compatible to Oreo ROMs too.
Flashing the wrong version won't harm your device but will prevent your ROM from booting! This can be easily fixed by flashing the right version or re-flashing your ROM.
Download: https://drive.google.com/drive/folders/1cel2AB59-6kOaLkk7dK6uBPwejdw6s4C

Additional credits
Due to the sheer amount of features it's not possible to list all of the contributors here. Please check the commit history for a comprehensive list.

XDA:DevDB Information
Advanced Kernel for Custom ROMs, Kernel for all devices (see above for details)

Contributors
planet9
Source Code: https://github.com/Planet-X/android-kernel-zenfone3_advanced

Kernel Special Features: Overclocking, Force Fast Charge

Version Information
Status: Stable

Created 2019-07-19
Last Updated 2019-07-19
 
Last edited:

planet9

Senior Member
Apr 24, 2017
114
500
0
Changelog

P5 - 2019-07-19:
  • Updated Toolchain to GCC 10.0.0 (experimental).
  • Updated AnyKernel2 to AnyKernel3.
  • Updated rtl88XXau kernel module.
  • Updated kernel to Linux 3.18.140, CAF Tag LA.UM.7.6.r1-05500-89xx.0.
P4 - 2019-04-19:
P3 - 2019-02-20:
  • Added adreno boost.
  • Updated rtl88XXau kernel module.
  • Updated toolchain to GCC 9.0.1 (experimental).
  • Updated kernel to Linux 3.18.135, CAF Tag LA.UM.7.6.r1-04100-89xx.0.
P2 - 2018-12-01:
  • New rtl88XXau kernel module for usb wifi adapters.
    Check the post below for more information.
  • Updated AnyKernel installation scripts.
  • Updated spectrum balanced profile to use elementalx with maple.
  • Added AiO_hotplug.
  • Updated kernel to Linux 3.18.127, CAF Tag LA.UM.7.6.r1-03600-89xx.0.
P1 - 2018-11-02:
  • Initial release of Advanced Kernel for Pie :D
  • Kernel source has been fully rebased.
  • New version labels: Releases for Pie ROMs start with a P followed by the release number.
  • Updated kernel to Linux 3.18.124, CAF Tag LA.UM.7.6.r1-03100-89xx.0.
V 1.1 - 2018-10-11:
  • Added USB keyboard support.
  • Added support for SMB2 and SMB3.
  • Updated kernel to Linux 3.18.123, CAF Tag LA.UM.6.6.r1-09900-89xx.0.
V 1.0 - 2018-08-11:
  • The zip file is now signed with my release-key.
  • Added CPU wake boost driver.
  • Removed asusdebug for a lighter kernel.
  • Updated BFQ I/O scheduler.
  • Updated F2FS driver.
  • Added SdFat for FAT and exFAT support.
  • Imported many more misc fixes and improvements.
  • Updated Toolchain to GCC 8.2.1.
  • Updated kernel to Linux 3.18.118, CAF Tag LA.UM.6.6.r1-09500-89xx.0.
    Thanks to @makorn645:
  • Modifications for "Swipe up to wake".
  • Misc improvements of the defconfig for more performance.
V 0.9 - 2018-06-11:
  • Added elementalx cpufreq governor.
  • Updated Toolchain to GCC 8.1.1.
  • Updated kernel to Linux 3.18.112, CAF Tag LA.UM.6.6.r1-08600-89xx.0.
V 0.8 - 2018-05-21:
V 0.7 - 2018-05-10:
  • Updated blu_plug defaults.
  • Fixed lazyplug display state detection.
  • Rebased and cleaned up the kernel.
  • Updated kernel to Linux 3.18.108, CAF Tag LA.UM.6.6.r1-08300-89xx.0.
V 0.6 - 2018-04-25:
  • Added AutoSMP hotplug. (May be unstable, please report any crashes when using it.)
  • Added force fast charge feature - Thanks to @Saktis_STi for helping!
    Important: Check the main post for more information before using force fast charge. This is NOT QC.
  • Updated kernel to Linux 3.18.106, CAF Tag LA.UM.6.6.r1-07400-89xx.0.
V 0.5 - 2018-04-06:
  • Added vibration intensity control.
  • Added fsync switch.
  • Imported many other improvements.
  • Updated compiler to Linaro GCC 7.3.1.
  • Updated kernel to CAF Tag LA.UM.6.6.r1-07200-89xx.0.
V 0.4 - 2018-03-25:
  • Updated kernel to Linux 3.18.102.
V 0.3 - 2018-03-23:
  • Added (optional) overclocking support for up to 2.2GHz.
  • Advanced Kernel version now visible in settings, with OC indicator.
  • Updated kernel to Linux 3.18.101, CAF Tag LA.UM.6.6.r1-06700-89xx.0.
V 0.2 - 2018-03-11:
  • Updated spectrum profiles: See main post for more detailed descriptions.
  • Updated kernel to Linux 3.18.99.
V 0.1 - 2018-03-07:
  • Initial release.
 
Last edited:

planet9

Senior Member
Apr 24, 2017
114
500
0
Kernel Modules

Here you'll find a description of every currently available kernel module for Advanced Kernel for Pie. (The oreo version is not currently supported.)

Kernel modules are drivers that can be loaded into the kernel in order to use hardware that would otherwise not work. A kernel module comes as a .ko-file and is only fully compatible to the kernel version it was released for. Modules can be loaded by executing "insmod [module].ko" within a terminal as root on the phone.
Every new Advanced Kernel release will come with a new version of all available modules.
The modules can be downloaded from the "Kernel Modules" subfolder (here).

Available modules:
 
Last edited:

planet9

Senior Member
Apr 24, 2017
114
500
0
I feel like my device is lagging. Even when I set everything to Performance.
It's all about finding the right settings ;)
Just take your time to find them - I do admit that default settings are very conservative/battery friendly...
However I can assure you that this kernel can be just as fast or even faster than stock kernel. It's actually based on it so with exact stock settings you should get at least stock performance. The real problem is just tuning all these features which is why my spectrum profiles are still very basic ... too many variables take time for testing.
The next kernel version will move the current "Balance" profile to "Battery" and change "Balance" to be very stock-like. The current "Balance" and especially "Battery" profiles may be a little too extreme... :silly:
 
Last edited:
Nov 7, 2016
42
6
8
The system wide mic gain is working perfectly for whatsapp voice messages,but unfortunately it is not applied to video recording it seems... I tested it with Lineage Camera App and Whatsapp camera

Great, that I dont have to fiddle around with mixer_paths.xml, but can you adjust the kernel to let the mic gaion also apply to the video recordings? Many thanks!
 

planet9

Senior Member
Apr 24, 2017
114
500
0
The system wide mic gain is working perfectly for whatsapp voice messages,but unfortunately it is not applied to video recording it seems... I tested it with Lineage Camera App and Whatsapp camera

Great, that I dont have to fiddle around with mixer_paths.xml, but can you adjust the kernel to let the mic gaion also apply to the video recordings? Many thanks!
Mic gain worked for me with Lineage and stock asus camera videos :confused:
 
  • Like
Reactions: akaSk8krew
Nov 7, 2016
42
6
8
Mic gain worked for me with Lineage and stock asus camera videos :confused:
Well, i guess i Flash your new Rom Update and kernel and test it again :)

Maybe the videos are Sounding low volume to me, because they need more Gain Boost than pure sound records?
The slider for the kernel is raising the gain equally for all inputs in general, but maybe the video recording gain is less sensitive then pure volume.
 

planet9

Senior Member
Apr 24, 2017
114
500
0
It is compatible with XenonHD Rom? (because it's based on lineage 15.1)
It somehow is and isn't: Currently there should be no problems and it should work fine.
I can't guarantee, however, that it'll stay this way in the future. Just be aware that issues may arise due to kernel incompatibility.
I can only assure that my kernel is fully compatible to LOS 15.1. With every LineageOS update a new advanced kernel version will be released. As Xenon kernel improvements get merged into LOS and vice versa it should stay compatible but, again, I can't guarantee it...
 
Aug 26, 2016
11
0
1
It somehow is and isn't: Currently there should be no problems and it should work fine.
I can't guarantee, however, that it'll stay this way in the future. Just be aware that issues may arise due to kernel incompatibility.
I can only assure that my kernel is fully compatible to LOS 15.1. With every LineageOS update a new advanced kernel version will be released. As Xenon kernel improvements get merged into LOS and vice versa it should stay compatible but, again, I can't guarantee it...
Thanks, I'll try it