Development [Kernel][20.06.2022][Android 12] Kirisakura 2.0.9 for Asus ROG Phone 5 aka "Anakin"

Search This thread

RicoMartins

Member
Jul 10, 2018
31
5
Xiaomi Mi 11
ASUS ROG Phone 5
If you want to return to stock conditions it´s mentioned in the OP and the second post which partitions to restore.
Flash boot.img, dtbo.img and vendor_boot.img of the exact firmware you´re on. If you don´t have those, use payload extractor tool to extract them from your firmware file.


I´m sorry A11 is no longer supported and there´s no way to test for me what exactly happened to you.
If you flash a kernel you need to make sure you´re flashing it to a compatible firmware. If you run one of the "older" A11 firmwares 1.4.1 should work.

If you run one of the more recent A11 versions take a look here:

and try to flash the kernel from here:


If you flash the older kernel to more recent firmware you´ll crash and vice versa as well.
Hello, thank you, I saw this later and maybe for many ways to try I ended up needing to pass some more images and in the end format via recovery (which was also something I managed to return to the device after trying to twrp), but in the end resolved (I was using my son's device and created this account with his email too... I'm using the version that the Asus firmware col puts when returning to 11 , they say that on the A12 it is better optimized, but not for me, now less heating and more battery life. Not to mention the triggers bug that I don't have them anymore. Anyway thanks again, and IF you can invoke which version I can use I'm grateful I'm in WW_18.1220.2201.192.
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
5,644
18,740
Hello, I would like to test your kernel on my brand new ROG Phone 5S but I have a few questions. Rooting will make me lose fingerprint capabilities? I've heard of other phones losing fingerprint calibration after root. Will I lose anything else forever? Does safety net fix still work? Anything that is not working on root or your kernel?
Currently my phone has frame drops on Call of Duty Mobile even on medium settings, overheating is not an issue as it doesn't even pass 40°C so I hope your kernel smoothes everything on the system.
Thanks a lot !
Would this help in lag and performance ? I play Call of Duty Mobile and suddenly there's frame drops even though temp doesn't go above 39 ºC
5S is only compatible with Android 12. Just a reminder :)

I don´t personally own a 5S, but other users confirmed it working so you should have no problems flashing if you follow the instructions.

Rooting doesn´t impact fingerprint scanner. The problem arises when people buy CN devices that have been converted to WW and messed up in the process. If persist partition gets messed up, the calibration might get lost. So first thing I would do if you decide to root is backup the persist partition once you´re being rooted. Google around, you should find guides for that.
Safetynet fix works at the moment, but google can flip a switch and it will stop working on all devices. That´s nothing specific to ROG Phones.
The only thing that does not work on my kernel is connecting a storage device that´s formatted via NTFS. That driver is proprietary and there´s no way to build it from source.

The kernel hasn´t anything to do with how asus regulates thermals. You can change the thermal profile by playing with the temperature slider in armoury crate.
Keep also in mind, thermal throttling is probably the reason why the phone doesn´t cross 39°C. If you allow for more performance and a higher thermal floor via armoury crate it will get hotter.


Hello, thank you, I saw this later and maybe for many ways to try I ended up needing to pass some more images and in the end format via recovery (which was also something I managed to return to the device after trying to twrp), but in the end resolved (I was using my son's device and created this account with his email too... I'm using the version that the Asus firmware col puts when returning to 11 , they say that on the A12 it is better optimized, but not for me, now less heating and more battery life. Not to mention the triggers bug that I don't have them anymore. Anyway thanks again, and IF you can invoke which version I can use I'm grateful I'm in WW_18.1220.2201.192.
If you only flash the kernel, restoring the images I mentioned will be enough.
If something else got messed up, you might need to restore the phone to stock completely. But I´m glad you got it sorted.

My triggers work fine on A12.

If you used the firmware to return from A12 to A11 from the support page you´re on WW-18.0840.2201.226 though. You shouldn´t cross flash something from different firmwares, as that can lead to issues. So if you flashed parts of .226 A11 and parts of .192 A11 that´s not really good.... :)

I think the kernel for .192 A11 firmware was 1.4.0. Keep in mind the A11 kernel is only working correctly on standard ROG 5. If I remember correctly 1.4.1 should have worked too.
 

RicoMartins

Member
Jul 10, 2018
31
5
Xiaomi Mi 11
ASUS ROG Phone 5
5S is only compatible with Android 12. Just a reminder :)

I don´t personally own a 5S, but other users confirmed it working so you should have no problems flashing if you follow the instructions.

Rooting doesn´t impact fingerprint scanner. The problem arises when people buy CN devices that have been converted to WW and messed up in the process. If persist partition gets messed up, the calibration might get lost. So first thing I would do if you decide to root is backup the persist partition once you´re being rooted. Google around, you should find guides for that.
Safetynet fix works at the moment, but google can flip a switch and it will stop working on all devices. That´s nothing specific to ROG Phones.
A única coisa que não funciona no meu kernel é conectar um dispositivo de armazenamento formatado via NTFS. Esse driver é proprietário e não há como construí-lo a partir do código-fonte.

O kernel não tem nada a ver com a forma como a asus regula as térmicas. Você pode alterar o perfil térmico brincando com o controle deslizante de temperatura na caixa do arsenal.
Lembre-se também de que a aceleração térmica é provavelmente a razão pela qual o telefone não ultrapassa os 39°C. Se você permitir mais desempenho e um piso térmico mais alto através da caixa do arsenal, ficará mais quente.



Se você apenas atualizar o kernel, restaurar as imagens que mencionei será suficiente.
Se algo mais deu errado, talvez seja necessário restaurar completamente o estoque do telefone. Mas fico feliz que tenha resolvido.

Meus gatilhos funcionam bem no A12.

Se você usou o firmware para retornar de A12 para A11 da página de suporte, você está no WW-18.0840.2201.226. Você não deve cruzar o flash de diferentes firmwares, pois isso pode levar a problemas. Então, se você exibiu partes de .226 A11 e partes de .192 A11, isso não é muito bom....:)

Acho que o kernel do firmware .192 A11 era 1.4.0. Tenha em mente que o kernel A11 está funcionando corretamente apenas no ROG 5 padrão. Se bem me lembro, o 1.4.1 deveria ter funcionado também.ok, thanks I really feel my 5S much better on the A11, apart from the appearance of the 12 that I didn't like at all... I'll stay like that for now, if a next update convinces me I'll do it.
 

Lossani

Member
Sep 13, 2021
27
1
5S is only compatible with Android 12. Just a reminder :)

I don´t personally own a 5S, but other users confirmed it working so you should have no problems flashing if you follow the instructions.

Rooting doesn´t impact fingerprint scanner. The problem arises when people buy CN devices that have been converted to WW and messed up in the process. If persist partition gets messed up, the calibration might get lost. So first thing I would do if you decide to root is backup the persist partition once you´re being rooted. Google around, you should find guides for that.
Safetynet fix works at the moment, but google can flip a switch and it will stop working on all devices. That´s nothing specific to ROG Phones.
The only thing that does not work on my kernel is connecting a storage device that´s formatted via NTFS. That driver is proprietary and there´s no way to build it from source.

The kernel hasn´t anything to do with how asus regulates thermals. You can change the thermal profile by playing with the temperature slider in armoury crate.
Keep also in mind, thermal throttling is probably the reason why the phone doesn´t cross 39°C. If you allow for more performance and a higher thermal floor via armoury crate it will get hotter.



If you only flash the kernel, restoring the images I mentioned will be enough.
If something else got messed up, you might need to restore the phone to stock completely. But I´m glad you got it sorted.

My triggers work fine on A12.

If you used the firmware to return from A12 to A11 from the support page you´re on WW-18.0840.2201.226 though. You shouldn´t cross flash something from different firmwares, as that can lead to issues. So if you flashed parts of .226 A11 and parts of .192 A11 that´s not really good.... :)

I think the kernel for .192 A11 firmware was 1.4.0. Keep in mind the A11 kernel is only working correctly on standard ROG 5. If I remember correctly 1.4.1 should have worked too.
Thanks I finally decided to root and install your kernel. I come from ASUS ROG Phone 3 with your kernel so I wanted to give it a try on this phone. So far everything seems ok, even more fluid than before apparently. Need to test more. Also 5S actually came with Android 11 so I don't know what you mean by only compatible with Android 12.
About the fingerprint sensor, thanks for reminding to make a backup. I owned a Red Magic phone and fingerprint calibration was lost when rooting but finally recovered it after "calibration tool" succeeded.
Do you know if there's a config option to make FPS fixed? I try to use GLTools for more FPS but system limits it on 60 FPS on some game modes while on others it's 120 FPS as expected. Is it something related to your kernel? Seems like the system limits to 60 FPS whenever it wants.

Thanks for your effort!
 

Rom1995

Member
Jul 5, 2012
32
5
Samsung Galaxy Tab S3
Does the kernel support overlayfs? Only using it cause i want to upgrade the stock graphics driver. Was working fine with zenfone 6 using your kernel just not working with ROG 5.
Screenshot_20220706-083736265~(1).png
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
5,644
18,740
It doesnt work on stock kernel either but works on zenfone 6 stock kernel.
Unfortunately that doesn't help me much. If i find time I'll look into it. Maybe that module needs to be updated for a12 or 5.4 based devices/kernels. I'll see if I find anything
 

DjalilovSunnat

New member
Dec 29, 2014
1
0
ASUS ROG Phone 5
ROG 5 A12 last version. I tried change the sound parameters but not working. After reboot it returns to standard parameters. May be my system not support rw/rw? Sorry for my bad English.
Screenshot_20220706-231038290.jpg




Screenshot_20220706-234631927.jpg
 
Last edited:

Lossani

Member
Sep 13, 2021
27
1
Unfortunately that doesn't help me much. If i find time I'll look into it. Maybe that module needs to be updated for a12 or 5.4 based devices/kernels. I'll see if I find anything
Is there a config in your kernel to make FPS at a fixed number? Or is it already always at 120 FPS and not variable?
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
5,644
18,740
ROG 5 A12 last version. I tried change the sound parameters but not working. After reboot it returns to standard parameters. May be my system not support rw/rw? Sorry for my bad English.
I just tried the feature and it works as expected for me.

The kernel has nothing to do with the values getting set on boot, what kernel manager app you´re using is responsible for this. You might need to set a longer timer for the values to get applied after boot. I tried with EXKM and the values stick after a reboot.

Is there a config in your kernel to make FPS at a fixed number? Or is it already always at 120 FPS and not variable?
Thanks I finally decided to root and install your kernel. I come from ASUS ROG Phone 3 with your kernel so I wanted to give it a try on this phone. So far everything seems ok, even more fluid than before apparently. Need to test more. Also 5S actually came with Android 11 so I don't know what you mean by only compatible with Android 12.
About the fingerprint sensor, thanks for reminding to make a backup. I owned a Red Magic phone and fingerprint calibration was lost when rooting but finally recovered it after "calibration tool" succeeded.
Do you know if there's a config option to make FPS fixed? I try to use GLTools for more FPS but system limits it on 60 FPS on some game modes while on others it's 120 FPS as expected. Is it something related to your kernel? Seems like the system limits to 60 FPS whenever it wants.

Thanks for your effort!
The kernel can´t change the FPS a game runs on. If a game falls back to 30fps or 60fps, it´s other parts of the system handling that. Some games are also hardcoded to run at 30 or 60fps.

The only thing I can change via kernel is providing an option so it´s possible to force the panel itself to refresh at 120FPS or 144FPS, but the game will still render at 60FPS or whatever the game decides to. So you gain nothing except waster power.
 

Lossani

Member
Sep 13, 2021
27
1
I just tried the feature and it works as expected for me.

The kernel has nothing to do with the values getting set on boot, what kernel manager app you´re using is responsible for this. You might need to set a longer timer for the values to get applied after boot. I tried with EXKM and the values stick after a reboot.



The kernel can´t change the FPS a game runs on. If a game falls back to 30fps or 60fps, it´s other parts of the system handling that. Some games are also hardcoded to run at 30 or 60fps.

The only thing I can change via kernel is providing an option so it´s possible to force the panel itself to refresh at 120FPS or 144FPS, but the game will still render at 60FPS or whatever the game decides to. So you gain nothing except waster power.
Yes how can I force panel to refresh at always 120/144 FPS? Gltools is supposed to break the FPS limiter on game and it worked on Red Magic but now I think the panel is stopping it. Where can I force panel to fixed 120/144?
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
5,644
18,740
Yes how can I force panel to refresh at always 120/144 FPS? Gltools is supposed to break the FPS limiter on game and it worked on Red Magic but now I think the panel is stopping it. Where can I force panel to fixed 120/144?
You can´t on your own. If game genie doesn´t work to set the refresh rate, I will need to implement an option to the kernel.
But why would you want that? It won´t make a difference if the game still renders at 60fps, just the panel refreshes higher. You won´t get more FPS in the game.
 

Lossani

Member
Sep 13, 2021
27
1
You can´t on your own. If game genie doesn´t work to set the refresh rate, I will need to implement an option to the kernel.
But why would you want that? It won´t make a difference if the game still renders at 60fps, just the panel refreshes higher. You won´t get more FPS in the game.
I mean it works. Game is supposed to run at 90 FPS max on ROG Phone but with GLTools Root App it makes the game work on 120 FPS but thats somehow thats the new cap it is supposed to let it run on 144 but panel for some reason is stuck. On Nubia phone I was able to bypass game engine FPS limit and play at 165 Hz max (showed in FPS meter) but cant on ROG I thought it was something related to Kernel or Game Genie automatically limiting FPS even after GLTools disabled that limit in game.
I suspect that is the case because when I start a match of specific mode the game starts at 60 FPS and after a few seconds it suddenly jumps to 120 FPS but only at some game modes. On Battle Royale it would lock it back. Even on game lobby. Normally it would run only at 30 FPS on any phone in game lobby but with GLTools limit is removed but phone would still limit to 60 FPS somehow.
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
5,644
18,740
I mean it works. Game is supposed to run at 90 FPS max on ROG Phone but with GLTools Root App it makes the game work on 120 FPS but thats somehow thats the new cap it is supposed to let it run on 144 but panel for some reason stuck. On Nubia phone I was able to bypass game engine FPS limit and play at 165 Hz max (showed in FPS meter) but cant on ROG I thought it was something related to Kernel or Game Genie automatically limiting FPS even after GLTools disabled that limit in game.
I suspect that is the case because when I start a match the game starts at 60 FPS and after a fer seconds it suddenly jumps to 120 FPS but only at some game modes. On Battle Royale it would lock it back. Even on game lobby. Normally it would run only at 30 FPS on any phone in game lobby but with GLTools limit is removed but phone would still limit to 60 FPS somehow.
I´ll see if I can implement an option to override the panel FPS. :) then you can try.
 

Lossani

Member
Sep 13, 2021
27
1
I´ll see if I can implement an option to override the panel FPS. :) then you can try.
Besides a switch to override panel FPS is there any line code to force it permanently? I would like to test around and compile your kernel but I don't know where I can change to force it at least for now.
Thanks!
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
5,644
18,740
Besides a switch to override panel FPS is there any line code to force it permanently? I would like to test around and compile your kernel but I don't know where I can change to force it at least for now.
Thanks!
so I removed 60fps from the panel.

Flash this zip.
Afterwards the option for 60fps should disappear from settings. See if that makes a difference for what you´re trying to achieve.
 

Attachments

  • Kirisakura_Anakin_S_2.1.0_no60fps.zip
    26.1 MB · Views: 22

Lossani

Member
Sep 13, 2021
27
1
so I removed 60fps from the panel.

Flash this zip.
Afterwards the option for 60fps should disappear from settings. See if that makes a difference for what you´re trying to achieve.
Yes so that seems to be the problem:
Screenshot_20220708-024925320_1.jpg


The panel or software was limiting to 60 FPS, now it's limited to 120 FPS. Even though I override the limit up to 144 Hz should be allowed.
Is there any way to add a custom switch?

Thank you
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    Kirisakura-Kernel for the ROG Phone 5

    Hello everyone,

    To keep it short: Here is Kirisakura - Kernel for the Asus ROG Phone 5 aka Anakin. The ROG Phone line-up internal codenames are traditionally derived from Yedi-Characters of the Star Wars universe. Three years ago the 1st gen ROG Phone bore the generic title "Yedi", the ROG Phone 2 was codenamed "Yoda" and the Rog Phone 3 bore the title "Obiwan".
    I would appreciate if everybody that flashes the kernel, reads at least once through this opening post and the following ones.

    Kirisakura - Kernel is designed to bring a handful of beneficial features to the device, while ensuring excellent performance and smoothness to get you safely through the day!
    If you expect a custom kernel to magically improve your devices battery life manifold and this is your only priority then this might not be the right place for you.
    However the kernel is built to keep battery life close to the same as you would experience the on stock kernel while being tuned to perform better in various UI related benchmarks. The same benches are used by google to verify and ensure UI smoothness on the Pixel devices. The scheduler is tuned to yield lower jitter and reduce jank frames.
    There´s also a cpu-battery saver mode that cuts back the CPU max- freqs, but without the disadvantages like delayed notifications from built into the system user-space power-saving modes.
    If that got your curious, I welcome you to continue reading if you´re still interested!


    This project aims to keep most of the subsystems updated, way ahead of the stock kernel, thereby improving security and performance, while keeping stability as the foucs during testing! This includes Linux-Stable, CAF-Upstream and kernel/common.


    A very positive development. Google pushed for CFI and SCS to be enabled by default in the android-common kernel. In this years generation ( 5.4 linux kernel base/ SD 888 ) CFI and SCS are enabled by default. It was a lot of work to get these features working nicely on the kernels I did develop on for the past few year. So it´s nice to see this is now there by default in everybody can profit from it.
    I put the explanations and links in hide tags here.

    Kernel Control Flow Integrity (Kernel-CFI), which is achieved by linking the kernel with LLD and Link Time Optimization (LTO), more precisely ThinLTO, are quite unique security features.
    The recently released Kirisakura-Kernel for the OnePlus 8 Pro was featured on the XDA-Portal due to the inclusion of CFI. The featured article explains CFI in great details, is easy to understand and definitely worth to read.
    If possible the latest Kirisakura-Kernel releases for various devices aim to include CFI in enforcing mode so users can benefit from this security features.

    Another security feature is Shadow Call Stack (SCS).
    SCS is another security patchset that is aimed at preventing attacks via return oriented programming (ROP).
    ROP is a technique where the attacker gains control of the kernel stack to overwrite function return addresses and redirect execution to carefully selected parts of existing kernel code.
    If you´re interested here are a few good links:
    Google Security Blog explaining SCS.
    LLVM doc about SCS
    Android DOCs documenting SCS

    If reading about linux or caf/qcom upstream in the paragraph above got you curious, have a read about Linux-Stable and why it is important here. The stable-process is not the same for every subsystem, but the general idea, rule of thumb and benefits are applicable for other subsystems as well.
    Read more about the Release-Model following this link.
    This conversation on the LKML mailing list also shows the power of Linux-Stable and why it´s very beneficial to not just say it´s not worth and a potentiol source for bugs:
    Starting with the Initial Message , the following reply and a good summarizing statement.


    Quick explanation of CAF-Upstream. CAF is short for Codeaurora-Forums. This is the place where development from Qualcomm for their SoCs happens. This includes the Snapdragon 888 that´s built into the different SKUs of the ROG Phone 5.
    The kernel-bases available on the Codeaurora-Forums, are basically the foundations OEMs use, to build their own kernel additions on top for devices featuring Qualcomm SoCs.
    The Qualcomm developers push regular updates to the bases of the different SoCs, a bit similar to how Linux-Upstream works. OEMs usually stop updating the initial base after the phone is released.
    This kernel focuses amongst the other features to provide the latest CAF-Updates merged in a regular manner, to provide updates, improvements and enhancements for SoC specific drivers and subsystems! This might take a while, because a lot of device specific testing is done on my end to ensure stability.

    The kernel includes a lot of improvements and contributions from other developers as well. Without this kernel would not exist.
    A big part of improvements originate from @arter97´s, @kdrag0n´s and @Sultanxda´s work. Many others contributed in some way or another to this kernel.
    A big thanks to all of them at this place!

    Now lets continue with a list of features in the next paragraph!


    Main Features:
    - Based on latest kernel sources from Asus for Android 12 and intended to be used on the latest Asus Stock-Firmware (currently 31.0810.1226.91)
    - compiled with Clang 14.0.7 and built with -O3 speed optimizations
    - Linux-Stable-Upstream included to 5.4.199
    - upstreamed CAF base for the Snapdragon 888 (qcoms internal codename "lahaina")
    - on max fan setting, use max rpm allowed by the driver
    - improve powerhal to reduce stutters during animations and scrolling (e.g. scrolling main feed in twitter)
    - include important fixes/improvements from kernel/common
    - tune scheduler for improved jitter and less jank frames
    - reduce power consumption during deep sleep
    - remove logging while device is suspended
    - remove sleep debugging from Asus for release build
    - disable various debugging mechanisms for drivers which are not needed on a perf build (for example touchscreen, fingerprint reader, display, binder)
    - disable various debugging configs, that are not needed in a perf kernel build according to google.
    - disable selinux auditing (we don´t have to adress selinux denials running a stock rom)
    - display tweaks to reduce power consumption on statically rendered images
    - disable unnecessary CPU errata for our specific SoC
    - disable per cgroup pressure tracking to reduce overhead
    - free up RAM by removing reserved mem regions used only for debugging
    - implement LRNG (thanks @arter97, see arter kernel OP for more info )
    - Flashing the kernel will keep root!
    - Flashable via EXKM, FKM or TWRP (if available) on a rooted system!
    - Anykernel zip is based on the Anykernel3 release from @osm0sis


    EAS related features:
    - Implement dynamic WALT-Window size depending on current FPS, collecting information about CPU-Load to provide more precise information for the scheduler
    - EAS implementation patched up to latest CAF state
    - updates from kernel/common
    - scheduler updates from sd888/ 5.4 kernel
    - scheduler updates from sony xperia 1 III kernel aiming to improve WALT

    CPU related features:
    - Power saving workingqueues enabled by default (toggleable in EXKM)
    - Change various drivers (WLAN, MM, audio, charger, power, thermal, glink etc) to use power efficient workingqueues. This compliments EAS in general
    - improvements to cpufreq/times/stats
    - vdso32 patches as found on Google Pixel devices (brief documentation here) (CAF 5.4 default, keep for documentation)
    - remove event debug logging
    - disable broken irq detection, disable debugmon
    - improve suspend/resume from audio driver (caf-upstream for audio-kernel)
    - cpuidle: wake only cpus for which qos has changed (this allows cores to keep idle states better)
    - disable debugging during sleep states as per qcom recommendation
    - remove RTB logging to reduce overhead
    - disable trace_printk as it shouldn´t be used on production/perf kernel builds
    - disable edac and coresight (following google on the pixel kernels)
    - disable jtagv8 debugging as recommended by qcom for perf builds to avoid potential power, performance and memory penalty
    - disable s2idle in favor of deep idle state -> improves deep sleep drain (google initially used 2idle for improved suspend/resume latency on pixel 3 and pixel 4, but disabled it on pixel 5. qcom followed suit for sd 888, but apparently didn´t see google reverting it on pixel 5. Other OEMs such as Xiaomi or OnePlus already disabled s2idle on their SD888 devices in favor of deep- read more about s2idle vs deep here)
    - raise LTO-inlining -> more info

    GPU related features:
    - GPU driver updated to latest CAF-State
    - gpu/kgsl improvements from pixel 4/pixel 5 kernel
    - add low_prio_worker thread for gpu driver (Improves performance when tearing down processes (eg, via LMK) and not blocking currently running UI from submitting work to the GPU
    - remove POPP functionality from GPU driver to avoid constant fight about downscaling with msm-adreno-tz
    - increase gpu worker thread priority
    - don´t wait for fenced GMU writes

    File System related features:
    - upstream BFQ-MQ to latest state in linux-mainline and default to 128KB readahead
    - improve memory allocations in kernfs
    - ufs improvements from pixel 4/ pixel 5 kernel
    - improve GC as to not interfere while user interaction is happening and prevent possible jitter or latency spikes
    - improvements to deep sleep power consumption (ufs driver, auto hibernate)

    Audio related features:
    - provide option to override audio profile based on impedance measurement (run 16ohm headphones in 64ohm mode, dangerous use with caution!)
    ----> more information/explanation how to control the feature linked here

    Display related features:
    - Backlight Dimmer (reduce minimal brightness below stock limit)

    Network related features:
    - Wireguard Support (Details)
    - advanced TCP algorithms enabled
    - use bbr as default TCP congestion algorithm (fasted algo according to this excellent research from @kdrag0n found here )
    - improved networking drivers from caf-upstream (especially wifi)
    - remove unnecessary wakelock from WLAN driver to reduce thousands of very short wakeups during a 7 hour deep sleep period
    - improved bluetooth performance (¹, ²)
    - Enable support for TTL spoofing

    Memory related features:
    - Speculative Page Faults left enabled (1. 2) (CAF 5.4 default, keep for documentation)
    - Fix various memory leaks in different subsystems
    - improved mm with patches from mainline
    - patches from kernel/common
    - improve memory allocations in various subsystems, video encode/decode, kernfs, cgroup
    - Backport to enable CONFIG_HAVE_MOVE_PMD (see here) , thanks @arter97
    - Backport to enable CONFIG_HAVE_MOVE_PUD (commit here) , thanks @arter97
    - free more RAM by removing unused reserved memory regions
    - mm: Micro-optimize PID map reads for arm64 (improves game performance, especially unity based games such as genshin impact)

    Security related features:
    - Control-Flow-Integration (CFI) and Link-Time-Optimization (LTO) (CAF 5.4 default, keep for documentation)
    - Use ThinLTO which was first used in the Pixel 4 XL Android R-Kernel instead of full LTO (CAF 5.4 default, keep for documentation)
    - Shadow Call Stack (SCS) Security-Feature ( 5.4 default, keep for documentation)
    - enable init_on_alloc for even more security, more information can be found in the commit message (CAF 5.4 default, keep for documentation)


    Misc Features:

    Wakelock Blocker:
    - advanced wakelock blocker with the ability to block any wakelocks (dangerous, use with caution)
    - please read [URL="https://arstechnica.com/gadgets/2018/08/p-is-for-power-how-google-tests-tracks-and-improves-android-battery-life/"]this for further info
    - blocking a kernel wakelock should only be done in case of firmware incompatabilities (WiFi network at work (can´t be changed) causes deep sleep to not work on the phone.) That´s the only use case I see for this feature. The kernel does not features this to improve battery life!

    Other features:
    - clean up asus drivers and fix a few warnings in kernel log
    - disable logging and debugging to make the kernel more lightweight in various places (includes binder, mm, vma, gpu, ipa etc)
    - fix several coding issues detected by newer Clang-Toolchains
    - enlarge dmesg size to ease debugging


    Flashing Guide, Download and Changelog

    Requirements:
    - unlocked Bootloader (this will void warranty and kill future OTA updates on all asus phones at the moment)
    - USB-Debugging in developer options enabled
    - latest adb and fastboot binaries
    - working adb and fastboot environment
    - magisk root
    - a backup of stock boot.img, vendor_boot.img and dtbo.img so you can go back to stock conditions (simplest way is TWRP or to extract from stock firmware)

    How to flash the Kernel:
    1. Download the latest kernel.zip and make sure you have properly updated to the latest matching Asus Stock-Firmware (check the feature list for the current firmware the source is based on). When the ROG Phone 5 receives an OTA update it takes Asus a while to release the source code for the new OS and me a while to build a new kernel. If you don´t want to face any issues, wait until I either release an updated kernel or give green light because there were no kernel changes.
    Always make sure to run the firmware the kernel is built for!
    If you feel adventurous and try in advance, make sure you have a backup ready!

    2. Flash the kernel.zip via latest TWRP (if available), EXKM or FKM app and do a full reboot.
    2a. Important: If flashing the kernel via TWRP, flash the DLKM magisk module found in the download folder that matches the kernel version.

    3. Reboot and profit.


    DOWNLOAD:
    Download is located always in this folder:

    Important: Read after Download
    Please take a look at the second post after flashing the kernel!

    Changelog:
    Android 11

    1.0.0 Initial Release
    1.1.0 https://forum.xda-developers.com/t/...-rog-phone-5-aka-anakin.4333363/post-85637825
    1.2.0 https://forum.xda-developers.com/t/...-rog-phone-5-aka-anakin.4333363/post-85709075
    1.4.0 https://forum.xda-developers.com/t/...-rog-phone-5-aka-anakin.4333363/post-85998687
    1.4.1 https://forum.xda-developers.com/t/...-rog-phone-5-aka-anakin.4333363/post-86184801

    Android 12
    2.0.0 https://forum.xda-developers.com/t/...-rog-phone-5-aka-anakin.4333363/post-86856155
    2.0.9 https://forum.xda-developers.com/t/...-rog-phone-5-aka-anakin.4333363/post-87049319

    Donations:
    Donations are not mandatory but very welcome if you want to support development or just buy me a coffee/tea :)
    If you like my work: http://paypal.me/freak07

    Credits:
    Asus for the development device, giving me the opportunity to create this project!
    @osm0sis for all his work, including the ak3 installer!
    @tbalden for being the best HTC, Pixel, OnePlus and now Asus wingman!
    @LeeDroid and @mwilky for their awesome roms and work I used on multiple devices!
    @Captain_Throwback for all the mentoring and guidance!
    @Eliminater74 for bringing me into the game and the Inspiration
    @nathanchance for his upstream guidance and assistance
    @RenderBroken for helping me out
    @flar2 for all his work
    @joshuous for all the help he provided to me in the past!
    @arter97 for giving me advice
    @kdrag0n for his help and advices!
    @topjohnwu for magisk!


    Source Code: https://github.com/freak07/Kirisakura_ANAKIN_ROG5
    4
    F.A.Q:

    Question:
    Is root preserved when flashing this kernel?
    Answer: Yes, the AnyKernel.zip will detect root and keep it.

    Question: Safetynet does not pass on my phone since I unlocked the phone, why is this so?
    Answer: Google introduced hardware backed attestation recently. Unfortunately the old kernel tricks to still get safetynet passing won´t work. Instead you will have to rely on some magisk modules. Short guide in post #4 below.

    Question: How do I return back to stock or another kernel.
    Answer: Extract boot.img, vendor_boot.img as well as dtbo.img from matching firmware you are on (you can do so by using this tool or similar ones found on XDA and when googling around) and flash them via fastboot. If you want to keep root flash back the magisk_patched_boot.img. Or dirty flash your rom and re-root.

    Question: Why is having Magisk installed mandatory for this kernel?
    Answer: The kernel uses a ramdisk overlay to apply some settings after boot. If you are not rooted these settings will not get applied and you miss some of the optimizations.

    Question: How to report bugs properly?
    Answer: Have a look at post #3 in the linked thread. The linked guide is a pretty good starting point.
    Before reporting any bug make sure you´re running on a stock configuration. That´s means you´re not using any mods, tweaks in kernel managers or other root tweaks , magisk modules, scripts or other modifications that alter various functions like sound mods, data traffic, sleeping behaviour, scheduler, magical battery tweaks etc.
    Try to describe the issue as detailed as possible! Give your exact setup, like rom, magisk version, kernel version.
    Is the issue reproducible? Does it happen frequently?
    Provide logs, otherwise debugging is a lot harder. If you can already reproduce the issue and provide logs it greatly limits the amount of time I have to spent until I figure out how to reproduce it.

    If the device force reboots/randomly reboots (that means you see the bootloader unlocked screen!) provide a .zip of /asdf.
    Easiest way is immediately after booting up, with a root explorer navigate to /asdf. Copy the contents to your internal storage, zip it up and send it to me.

    If the issue happens while the device is running provide a dmesg plus a logcat that you take while/shortly after the issue happens. This will log what´s running in the current session. Try to be as detailed as possible what´s happening when the issue appears. It will also help me in reading the log!
    4
    Update to 1.1.0

    Hey guys and girls,


    I hope everyone is having a good day or starting into one. Here´s the next update.
    I forgot to include wireguard in the release. That´s now added.

    Since we´re not building a QGKI kernel, but rather a standalone kernel an important config that feeds information to the powerhal daemon didn´t get fully built, since the QGKI dependency wasn´t met. This resulted in lags in games like NieR.

    Also fix certain games like 7DS (com.netmarble.nanagb) crashing frequently on startup.

    thanks to @twistedumbrella for reporting the bugs and noticing wireguard missing.


    More changes in the Changelog below:


    Changelog:
    - add wireguard
    - enable qgki part of msm_performance to fix lags in certain games
    - fix some games ( for example 7DS (com.netmarble.nanagb)) frequently crashing during startup




    Download:



    Instructions can be found in the OP!
    But look at this post too :)

    Have fun, enjoy the kernel and your phone.

    Donations are not mandatory but very welcome.
    If you like my work and want to buy me a coffee/green tea to keep development going: http://paypal.me/freak07
    3
    How to pass Safetynet after unlocking the bootloader

    With the introduction of hardware backed safetynet attestation, passing safetynet has become a lot more complicated.
    Some probably remember a while ago, flashing a kernel that forced some flags was enough to pass it. However these days are gone.
    Below is a short guide how to pass safetynet on phones that are flagged to use HW attestation (such as the ROG 5).

    1. Make sure you´re running latest magisk canary.
    2. In Magisk Manager enable both zygisk and deny list.
    4. Download the latest Universal Safety Net Fix from @kdrag0n ´s github for zygisk cand flash it in Magisk Manager. Reboot.
    5. Profit
    3
    I was trying to give you a pass, but I can take it back if you didn't want it lol. Pretty sure I know which config you are talking about. I had wondered why it wasn't enabled, so that explains it.

    The ROG Phone 5 is super finicky. It doesn't help that they released two (or three, depending where you're from) models and then immediately pushed out a second series with two more. All of them have slightly different hardware that Asus is trying to keep on a single code base.



    has a bunch of tactile (effect) UI components that make it easy to pick out the lag.

    I pushed my source :) I took the pass don´t worry. :)

    CONFIG_MSM_PERFORMANCE_QGKI needs to be explicitly enabled.
    For some reason when extracting the defconfig from boot.img or from /proc/config.gz and using that to build the kernel it doesn´t get enabled.
    It seems there´s a lot for me to be learned about CAFs QGKI build "system". There might be more surprises.

    Yes, the ROGs are super finicky I completely agree.


    I´ll check the game and bluetooth on my end. thanks :)