yashsingh1/xdaforums huggingface dataset:
[ASUS ROG Phone 5 / 5s] Freak07:
I know, I saw your thread and it's nice that you do this.

But I think it's also important that users learn to do that by themselves if needed. Especially if they choose to modify their phones, they should know how to revert it without too much help from outside. And it's mentioned in my OP :)

My kernel flashes a modified dtbo.img, so the three images I mentioned need to be restored if one wants to go back to stock completely.

So I think people would appreciate if you start adding dtbo.img to your thread too :)
[ASUS ROG Phone 5 / 5s] twistedumbrella:
I don't disagree with people learning to extract the payload, which is why i've explained how in previous iterations (if it was somehow dropped along the way).
[ASUS ROG Phone 5 / 5s] Madbullben:
Hi, I installed this yesterday via twrp and everything seems to be working, but earlier you mentioned that the kernel doesn't flash properly through this method. I haven't bought either of the kernel managers you mentioned in the first post.

Although I swear I had franco installed many many years ago back on my Sony Ericsson 😂
[ASUS ROG Phone 5 / 5s] Freak07:
At the moment it´s not ideal. better to flash the 1.1.2 build from the previous page in that case.

I hope we can eventually fix that small issue in TWRP.
[ASUS ROG Phone 5 / 5s] Anubarak16:
Thank you for your help, I just wanted to revert the kernel back but received the "WAITING FOR FLASHING FULL RAMDUMP" error and it didn't respond for about 10 minutes.

Before reverting the stock kernel does someone want me to do something? This issue seems to be very common and I thought phones would not recover from it.

Not sure if it's worth something but I attached the files suggested from https://www.xda-developers.com/how-to-take-logs-android/ just in case

Edit: after 3 unsuccessful tries to upload the logs here....

Asus Logs - Google Drive

drive.google.com

I'll wait a little bit just in case and revert back to stock later
[ASUS ROG Phone 5 / 5s] Anubarak16:
Just grabbed the files and did

$ fastboot flash boot boot.img
Sending 'boot_b' (98304 KB) OKAY [ 2.161s]
Writing 'boot_b' OKAY [ 0.166s]
Finished. Total time: 4.102s

$ fastboot flash boot dtbo.img
Sending 'boot_b' (98304 KB) OKAY [ 2.343s]
Writing 'boot_b' OKAY [ 0.194s]
Finished. Total time: 3.082s

$ fastboot flash vendor_boot vendor_boot.img
Sending 'vendor_boot' (98304 KB) OKAY [ 2.369s]
Writing 'vendor_boot' OKAY [ 0.145s]
Finished. Total time: 2.560s

I ended up in a bootloop, then I tried it the other way around and did dtbo.img first

$ fastboot flash boot dtbo.img
Sending 'boot_a' (98304 KB) OKAY [ 2.378s]
Writing 'boot_a' OKAY [ 0.185s]
Finished. Total time: 3.069s

$ fastboot flash boot boot.img
Sending 'boot_a' (98304 KB) OKAY [ 2.181s]
Writing 'boot_a' OKAY [ 0.227s]
Finished. Total time: 4.045s

$ fastboot flash vendor_boot vendor_boot.img
Sending 'vendor_boot' (98304 KB) OKAY [ 2.216s]
Writing 'vendor_boot' OKAY [ 0.234s]
Finished. Total time: 2.493s

for whatever reason boot_a was used this time?

I wanted to restore everything via TWRP but it's not able to detect my backup anymore and my storage folder is empty.

Any suggestions?

It always boots into bootloader now and I have no way to boot the system at all
[ASUS ROG Phone 5 / 5s] mohammed510:
Format data in TWRP (not factory reset). Try if you can flash latest ota in TWRP after formatting data. You can also try to switch active partition from a to b or vise versa.. good luck!
[ASUS ROG Phone 5 / 5s] Anubarak16:
Tried that but I'm not able to format data.

The error is

unable to mount storage
unable to mount /data/media/TWRP/.twrps
Error opening: 'data/recovery/.version' (no such file or directory)
E: unable to check merge status
updating partition details
...done
unable to mount storage

edit: however just changing the active boot partition to b via TWRP fixed it...

I'm back on stock and rooted.. even tho I have no idea what happend.

Thank you very much @mohammed510
[ASUS ROG Phone 5 / 5s] Madbullben:
What is the issue with flashing in twrp? Also is it flashing both the kernel and dlkm or just the kernel? Not sure if the dlkm is just for diagnostic stuff which you were doing.
[ASUS ROG Phone 5 / 5s] Freak07:
thanks for the logs.

Right at the beginning of the kernel log I can see your device is being detected as a normal ROG 5. Why that is I have no idea.

Can you grab the same logs but from a rooted stock kernel on your Ultimate?

It seems something triggered your slot to be switched. That usually happens if you try to flash a firmware zip or in some way cause the A/B system to get confused (wiping restoring data in twrp might trigger this too).

When the slot is switched you might end up in an unbootable state and your device crashes to ramdump or bootloader screen.

Glad you got it back up and running.

It´s a bit hard to explain in a simple fashion, but I´ll try anyways.

Usually drivers are built directly into the kernel image. you flash that kernel image and are done.

However there´s the possibility of build the drivers externally as so called dynamically loadable kernel modules (DLKM). That allows those to load those drivers via a command at will.

Due to the "nature" or rather the coding of some of the drivers on the ROG phones and (also due to Google introducing GKI and CAF doing their own thing with QGKI), it´s at the moment not possible to build just everything directly into the kernel image.

So the kernel.zip automatically installs a magisk module that includes two DLKMs, which I load via a script during booting. If kernel is flashed via TWRP this magisk module is broken and those two drivers are missing.

If you want to flash via TWRP and want to end up with the "same" as when flashing via a kernel manager you should flash the kernel.zip and the DLKM magisk module in TWRP.
[ASUS ROG Phone 5 / 5s] Freak07:
updated post #4 with information and a guide on how to pass safetynet at the moment.
[ASUS ROG Phone 5 / 5s] JazonX:
Hey @Freak07 Mate;

I flashed both the zips over TWRP, No errors so far.

Can you check whether I need both these modules?

ak3-Helper is from the previous version. Should I keep both ?

Second, Here's the lsmod output if you didnt get it yet -

This is from ROG 5 Ultimate - on WW latest.
[ASUS ROG Phone 5 / 5s] Freak07:
yes the "bandaid" is working for you. the ak3 helper module is one that is broken when zip is being flashed from TWRP. you can see that it´s broken as there´s no proper description for the module in magisk manager.

If it doesn´t bother you, you can keep the ak3 helper module if flashed from TWRP as it won´t get loaded anyway and will be reinstalled on every flash via TWRP. Just now that the DLKM module replaces the function of the ak3 helper module.

That´s how the "description" of the ak3 helper module should look if it´s flashed correctly.

We´re working on resolving the issue. So hopefully the bandaid will at one point no longer be needed.
[ASUS ROG Phone 5 / 5s] Madbullben:
Hi, just wondering if it's possible now or in the future to change the voltage settings of the cpu+gup?
[ASUS ROG Phone 5 / 5s] Freak07:
CPU is not possible on modern QCOM chips.

GPU is possible, but I'd suggest you don't mess with it. There have been a few fried ROG 3 devices in the past, because people played with it.

It's also something that will never end up in my kernels, because I value stability. And there are always those very few devices that have with even the slightest changes there.

Instead of undervolting I suggest to restrict max GPU (same for CPU) freq a few steps via armoury crate for gaming and see if the game still runs smooth. Excellent tool is game genie where you can check fps in real time.

However if you want to experiment with this kind of stuff:

There's a tool called Konabess or something similar. It's open source and available on GitHub. It will probably do the trick for you. ;)

Just remember that playing with these kind of things can introduce the most mysterious and strange bugs. :)
[ASUS ROG Phone 5 / 5s] mohammed510:
@Freak07 so.. is 165hz possible on Rog 5? 😎
[ASUS ROG Phone 5 / 5s] Madbullben:
Thanks for clear answer! I'll stick with your recommendation and just leave the voltages where they are intended to be if they do indeed introduce bugs or even kill my device, not worth it, our device already seems quite sensitive to changes so doing this will probably just mess things up.

I was trying to reduce the amount of power that the device consumes, but unsure of how to do it, besides lowering the voltages and cpu frequency, even when not gaming as I'm not a huge gamer on phones anyway, its the other specs on the phone which massively drawn me into it.
[ASUS ROG Phone 5 / 5s] JazonX:
This is why I've been with Kirisakura since my HTC U11 ~

Did I thank you enough for coming onboard the ROG 5 ?

Cheers, and keep up the great work!
[ASUS ROG Phone 5 / 5s] Freak07:
No idea. But there´s no "hidden" 160fps mode as on ROG3, so I´m not sure the system would even support it even if the kernel would make the panel run at 160fps, if the panel is capable of that. The panel works different than ROG3 too. FPS handling is different than ROG3. So probably not unfortunately.

What I´d be more interested in is to make the 90fps mode usable, without the quality degradation.

Maybe I´ll give it a try at one point. :)

undervolting probably won´t kill any device (besides random instability that might be introduced, can also be temperature based as to what works fine during summer won´t work during winter etc.). Usually people want to overclock the GPU to show of some Antutu Scores.

Undervolting/underclocking the GPU won´t save you much power anyway if you´re not gaming.

Same as the CPU the GPU goes into idle states if it´s not being used, especially during light usage.

That means even if kernel managers report certain CPU freqs, the CPUs actually go to Idle C-States during that time. The more so, the lighter the usage.

There´s a feature in the kernel I haven´t documented yet that lets you restrict the max CPU freqs on kernel level. So no powerhal can boost "above" those limits. I´ll put some documentation for that into one of the first posts soon.

thank you for the kind words :)
[ASUS ROG Phone 5 / 5s] Freak07:
updated post #3 with some information on how to use the battery saver/cpufreq limiting feature
[ASUS ROG Phone 5 / 5s] Freak07:
soon :)
[ASUS ROG Phone 5 / 5s] Freak07:
Update to 1.2.0

Hey guys and girls,

I hope everyone is having a good day or starting into one. Here´s the next update.

The kernel is updated for the latest firmware:

18.0840.2109.176. Make sure to update to the latest firmware before flashing the kernel to have no compatibility issues.

Some device specific changes, which should fix a touchscreen issue was in the source code.

All other security related updates on the kernel side, were already included by merging CAF-Upstream previously.

Caf-Upstream was also merged, which includes several improvements from QCOM to different subsystems like the scheduler, gpu driver etc. Details on github as usual.

The link to the WW firmware can be found here:

https://dlcdnets.asus.com/pub/ASUS/..._I005_1-ASUS-18.0840.2109.176-1.1.96-user.zip

More changes in the Changelog below:

Changelog:

- Import ASUS_I005_1-18.0840.2109.176 source code

- Linux-Stable Upstream to 5.4.150

- Merge CAF (QCOM) upstream up to tag LA.UM.9.14.r1-18300-LAHAINA.0

- Scheduler improvements from QCOM and Google

- Enable NAP power saving state for GPU

- updates from kernel common for several subsystems

- for details please check github

Important: If flashing the kernel via TWRP, flash the DLKM magisk module found in the download folder that matches the kernel version.

Download:

https://www.androidfilehost.com/?w=files&flid=328305

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
[ASUS ROG Phone 5 / 5s] mohammed510:
Thanks @Freak07. Really appreciate your work. I can also confirm that flashing the new ROM update and the kernel update by TWRP works fine. Just tick the option to reflash TWRP after flashing ROM. Then reboot recovery then flash Kernel -> Magisk alpha -> kernel again then reboot system
[ASUS ROG Phone 5 / 5s] Freak07:
It works, but the magisk helper module is still broken I suppose if flashing from twrp. Need to update the flashable module for that and adjust the instructions.

Thanks for the reminder :)
[ASUS ROG Phone 5 / 5s] nexusnerdgeek:
Thank you very much for supplying this community your custom kernel build.

Please pardon my newbie question here.

My phone's running ASUS firmware WW_18.0840.2107.151 & Kirisakura kernel 1.1.0 (which was flashed using EXKM).

Now to successfully install Kirisakura kernel 1.2.0:

1. I need to apply UL-ASUS_I005_1-ASUS-18.0840.2109.176-1.1.96-user.zip (strange that it has Zenfone label in the ASUS URL provided)

2. Skip reboot

3. Apply Magisk to the inactive slot

4. Reboot

5. Using EXKM, apply Kirisukura kernel 1.2.0

6. Reboot

I'm not missing any steps there, right?

Thanks for your help.
[ASUS ROG Phone 5 / 5s] JazonX:
You got it right, Firmware update, then dont reboot,

Open magisk - install to inacive slot.. Then it will request for a reboot.

Afterwards, Flash the kernel via EXKM or TWRP.

@Freak07 - Do we still need to use the DLKM module if flashing over TWRP ?

I already have it installed anyway..
[ASUS ROG Phone 5 / 5s] Freak07:
Yes if flashing via TWRP the DLKM magisk module still needs to be installed. It seems to maybe not be a problem only present on this specific device, but due to virtual A/B and the way the ak3 zip, gets the strings to create the helper module while being flashed in twrp.

For now if flashing via TWRP, flash kernel inside TWRP then DLKM module that matches the kernel. so kernel 1.2.0 and dlkm module 1.2.0.

I uploaded the DLKM module to the download link the in the release post.

I´ll update the instructions until this is fixed.
[ASUS ROG Phone 5 / 5s] Quiexo:
Does your kernel help fix stutter in games? Your first post mentions "tune scheduler for improved jitter and less jank frames"
[ASUS ROG Phone 5 / 5s] Madbullben:
Hey, not sure what the problem is, but rarely, once maybe twice a week, my phone stops responding and restarts with this screen saying waiting for flashing full ram dump, it did this on v1.1 as well. Any idea?
[ASUS ROG Phone 5 / 5s] Freak07:
The problem could be anything really... a ROM issue, an issue from a magisk module or also a kernel panic that I introduced.

I haven't had a single random reboot or ramdump screen with the releases on xda.

Now is the time I would usually ask you for a kernel log. Unfortunately I found no way yet to get ramoops working on the ROG 5. That means there's no way to recover a kernel log after the device crashed.

There's ASDF which Asus uses but usually it produces nothing useful for me.

So if you find something in asdf/ or asdf/ASDF/ that matches the time of the crash please upload it here.

The only thing that might help is if you'd knew how to exactly reproduce the bug and try to take logs exactly in the moment the device crashes and boots to ramdump.

So unfortunately there's not much I can do... :(

If flashed through TWRP did you flash the additional magisk module?

Do you use any other magisk modules, tweaks or mods?

Is there something you always do when this happens?
[ASUS ROG Phone 5 / 5s] twistedumbrella:
https://xdaforums.com/t/asus-proprietary-logs.4303809/

Not ideal, but better than nothing at all (kind of).
[ASUS ROG Phone 5 / 5s] Freak07:
The best thing is to try for yourself. Backup the stuff mentioned in the OP. It's very easy to revert.

I tried ICEY with my kernel and couldn't see the sign stutter that you mentioned in your thread:

https://xdaforums.com/t/frame-skips-in-games-at-60fps.4342359/

Might be something else though who knows. :)
[ASUS ROG Phone 5 / 5s] Freak07:
Yeah I know about ASDF. Unfortunately it's more miss (almost exclusively miss for me, seems it's similar for you :D) than hit for me.

But thanks for reminding me, I'll edit the post above. Who knows maybe we get something and if we get something it's not corrupted :D
[ASUS ROG Phone 5 / 5s] Devaanp:
Finally
[ASUS ROG Phone 5 / 5s] twistedumbrella:
I believe when it happened for me mine was in the middle of benchmarking 'import-instr-limit' (You call it LTO inlining). It hasn't happened again since keeping that below 40, but that may also be pure coincidence. I was never able to trace it back to a specific cause before it stopped.
[ASUS ROG Phone 5 / 5s] Freak07:
Never had a crash to ramdump screen or other crash on the releases here on xda and on the next kernel(s) that will be released shortly.

So I doubt it's that.

Without a way to reproduce those crashes and a way to reliably get logs it's basically impossible to say what the issue is or debug a kernel issue. It could be just a combination of magisk modules or something else entirely.
[ASUS ROG Phone 5 / 5s] JazonX:
Cant wait !!

Cheers !
[ASUS ROG Phone 5 / 5s] twistedumbrella:
A little too coincidental to be magisk modules. More likely it was something in the .176 changes. The timing lines up almost perfectly.
[ASUS ROG Phone 5 / 5s] Freak07:
Here a user reported ramdump happens rarely once a week, also on v 1.1 which was prior to .176 release.

For all we know there could be multiple reasons for a ramdump to be happening.

On previous Asus devices the phones never rebooted to ramdump but instead just crashed/looped. So I think it's quite new to some parts of the community and occurrences might not be reported.

Unfortunately it could be caused by anything. There's no lead or clue for me to follow on.

I had to debug several kernel panics during the bringup of the kernel, that crashed the device to ramoops caused by caf-upstream or Linux-stable. Might just be one of those again that never happened to me.

Might be something in the .176 firmware, some special usecase, a certain router firmware combo, not necessarily a kernel issue, a combination of apps, etc....

Without a way to reproduce I can't do anything. :(

Tried to get ramoops working a few times now to no avail.

Not a single crash to ramdump for me the last month since the kernel was released either.
[ASUS ROG Phone 5 / 5s] twistedumbrella:
unguard (and restore) printk_buffer_rebase and write_to_asus_log_buffer()

It won't fix the root cause, but should turn the ramdump back into a reboot and possibly even fill in the logs.
[ASUS ROG Phone 5 / 5s] C.T.Richter:
What are the chances this kernel would work on a ROG Phone 5S?
[ASUS ROG Phone 5 / 5s] L10nzD3n:
Does any know if this will work on ROG Phone 5S?
[ASUS ROG Phone 5 / 5s] Freak07:
I don´t have a rog 5s to test.

backup stock boot.img (magisk_patched if you want to stay rooted), dtbo.img and vendor_boot.img of your 5s firmware. If flashing the kernel causes the device to bootloop you can restore those via fastboot.

The 5s kernel uses a more recent CAF-Snapshot. so if parts of firmware/kernel combinations are not compatible you might run into issues or a bootloop.
[ASUS ROG Phone 5 / 5s] chrisaw:
It would be awesome if this change was made and a new version released. The kernel has crashed a couple of times now without me noticing - meaning no calls during this time while it's in my pocket. An auto-reboot failsafe would avoid this issue.
[ASUS ROG Phone 5 / 5s] JazonX:
Hey @Freak07

New firmware out for ZS673KS

EDIT : Current 1.2.0 Version of the kernel works!
[ASUS ROG Phone 5 / 5s] thieftime1980:
Hello, I do not know about you, but for me the original karnel the phone keeps the battery about 20% longer
[ASUS ROG Phone 5 / 5s] Freak07:
Big update for .196 firmware dropping soon.

About stability for the previous versions here's a screenshot. Over 30 days without rebooting the phone and a single crash.

Those that suffered from them, remove all magisk modules, don't disable any system apps, don't remove them or do other mods. Pretty sure problems are caused by this.

On zf8 (which shares a lot of the codebase) there were a few users that also crashed to ramdump or otherwise and all of those were caused by using either mods or what I described above while running my kernel.
[ASUS ROG Phone 5 / 5s] Freak07:
Update to 1.4.0

Hey guys and girls,

I hope everyone is having a good day or starting into one. Here´s the next update. It´s a rather big one.

I´m a bit short on time, so I don´t have time for a bigger writeup, but the changelog is below. All of that adds up to quite a lot.

The kernel is updated for the latest firmware:

18.0840.2111.196. Make sure to update to the latest firmware before flashing the kernel to have no compatibility issues.

Flashing the zip should now work fine from everywhere as the ak3 zip has been updated.

The link to the WW firmware can be found here:

https://dlcdnets.asus.com/pub/ASUS/...I005_1-ASUS-18.0840.2111.196-1.1.101-user.zip

More changes in the Changelog below:

Changelog:

- Import ASUS_I005_1-18.0840.2111.196 source code

- Linux-Stable Upstream to 5.4.161

- Merge CAF (QCOM) upstream

- remove logging while device is suspended

- improvements to deep sleep power consumption (ufs driver, auto hibernate)

- reduce auto suspend delay in various other drivers

- improvements on various subsystem like memory management, bluetooth, display, gpu etc

- implement LRNG (thanks @arter97, see arter kernel OP for more info )

- updates from kernel common for several subsystems

- updated ak3 zip, thanks to @osm0sis

Download:

https://www.androidfilehost.com/?w=files&flid=328305

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
[ASUS ROG Phone 5 / 5s] Freak07:
no changes for this kernel in the .200 (18.0840.2111.200) source release.
[ASUS ROG Phone 5 / 5s] JazonX:
Thanks for the confirmation, Flashed and using it on the 200 firmware.

All good over here.
[ASUS ROG Phone 5 / 5s] thieftime1980:
after changing to this kernel, the battery keeps about 30% less of the original
[ASUS ROG Phone 5 / 5s] JazonX:
Give it one or two days. It takes a while to get stable.
[ASUS ROG Phone 5 / 5s] JazonX:
New Firmware Out;

Version WW-18.0840.2112.210

2021/12/27
[ASUS ROG Phone 5 / 5s] LeonardoVNN:
Can someone guide me to update FIRMWARE and kernel?
[ASUS ROG Phone 5 / 5s] WiselyXIV:
For those wondering, I tried installing the kernel (1.4.0) with the latest Rog 5s firmware WW-18.1220.2112.175 and it got me stuck in a bootloop, I would wait for an official 5s version before trying if you were still hesitating on testing it.
[ASUS ROG Phone 5 / 5s] JazonX:
175 will bootloop. You need to be on 196 to try 1.4.0.
[ASUS ROG Phone 5 / 5s] Freak07:
Update to 1.4.1

Hey guys and girls,

I wish everybody a happy new year. :)🎉

The kernel is updated for the latest firmware:

18.0840.2112.210. Make sure to update to the latest firmware before flashing the kernel to have no compatibility issues.

The link to the WW firmware can be found here:

https://dlcdnets.asus.com/pub/ASUS/...I005_1-ASUS-18.0840.2112.210-1.1.101-user.zip

More changes in the Changelog below:

Changelog:

- Import ASUS_I005_1-18.0840.2112.210 source code

- Linux-Stable Upstream to 5.4.166

Download:

https://www.androidfilehost.com/?w=files&flid=328305

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
[ASUS ROG Phone 5 / 5s] rhendywp:
works flawlessly
[ASUS ROG Phone 5 / 5s] Quiexo:
Is it possible to disable wq_power_saving? I tried doing so in EXKM but it still says Enabled.
[ASUS ROG Phone 5 / 5s] Freak07:
No, this setting is read-only by design as it's set at compile time.
[ASUS ROG Phone 5 / 5s] ModernLobby:
Hey, i followed your instructions for the safetynet so i pass the test and everything my google play store is still not certified :/

Any ideas if possible ?

THanks in advance