yashsingh1/xdaforums huggingface dataset:
[ONE Android Development] flug32:
Kernel Adiutor won't autoenable hotplug settings (msm_mpdecision) on boot--w/solution

One more thing I've noticed running Argon:

I was using Kernel Adiutor to control the settings, which seems to be a very common choice.

But . . . I noticed that the hotplug settings for Argon were not being reapplied after a reboot. In particular, the msm_mpdecision "enabled" toggle was always toggled off after a reboot. Manually toggle it on, and it would work just fine.

So I experimented a bit. Sometimes it would work OK if I loaded a profile with only the msm_mpdecision settings. But, sometimes not.

If you look at the profile or a backup of the KA settings, they look fine (at least to me). They look something like this:

{
"path": "\/sys\/kernel\/msm_mpdecision\/conf\/enabled",
"command": "echo '1' > \/sys\/kernel\/msm_mpdecision\/conf\/enabled"
},

I'm guessing it is just some kind of strange bug in KA but perhaps it is a bug in Argon?

My solution for now is I tested a bunch of kernel/root managers on the play store and switched from KA to Kernel Manager by SimoneDev, which is the first one I found that seems to work (ie, it sets the hotplug settings properly after reboot).

I did catch it once not re-establishing the hotplug settings, but only once. So, not sure what to make of that.

UPDATE: Kernel Manager crashed a couple of times (though I think the reason was overheating due to thermal settings, see post below), so I went back to Kernel Adiutor.

However, Kernel Adiutor was still not enabling Hotplug.

So what I did was create a Kernel Adiutor profile that does one single thing--enable msm_mpdecision.

Then I use a Tasker on-boot profile to load the KA profile 30 seconds after boot.

It seems to work. Kernel Adiutor profile (.json) attached. You can import it in the KA profiles tab. Also a Tasker project (.xml) is attached that you can import to auto-run the KA profile 30 seconds after boot. Import the project in Tasker by long-pressing the project or "home" tab (bottom of screen).
[ONE Android Development] flug32:
Sorry for dominating the thread with several posts in a row. I'll stop soon. But I wanted to share the results of Argon + some other things I've been doing:

[IMG="Battery stats"]https://xdaforums.com/attachment.php?attachmentid=4817550&stc=1&d=1568094073[/IMG]

[IMG="Battery stats"]https://xdaforums.com/attachment.php?attachmentid=4817551&stc=1&d=1568094073[/IMG]

[IMG="Battery stats"]https://xdaforums.com/attachment.php?attachmentid=4817552&stc=1&d=1568094073[/IMG]

So, I've had this OPO for about 5 years now and it has never run like this.

That 12.9% per hour screen on means I could run it for roughly 7.5 hours straight, screen on (that is probably the upper end of achievable--like if you had an app the kept the screen on all day but used very little CPU. But 6-ish hours of continuous moderate-hard use is realistic and over 5 hours definitely realistic.)

Screen off at less than 2-3% means it would hold battery for a couple of days if left to sit. Many times now I'm getting <1% per when screen is off. Those long "shelfs" at 100% on the graphs above--those aren't when the phone is plugged in. They are after charging the phone to 100% and then unplugging.

If I, say, listen to music or podcasts with screen off I get about 10 hours out of it.

Here is how:

Argon + high freq thermal management settings I mentioned above

Magisk + EdXposed (YAHFA) installed

A have a bunch of modules installed, because I am a dork, but only a few affect performance:

Magisk allows root, which is important for many things, especially Aggressive Doze (see below)

Magisk module Universal GMS Doze

Magisk Module Riru - EdXposed (plus a few modules required to run this one)

EdXposed - Greenify Xposed module

P.S. I tried the other Magisk EdXposed alternative (sandyhook) but it didn't really work. YAHFA worked with all the modules I needed.

Greenify with everything problematic set to hibernate, and Aggressive Doze on plus generally aggressive settings (Doze on the Go enabled, Greenify System apps,etc)

BackgroundRestrictor app - only allow a few apps (that really need it) to run in background)

The secret sauce: I wrote a Tasker project that shuts of wifi & mobile data within 2 minutes of screen off, then turns it on immediately when the screen turns on.

With all those plus the secret sauce installed, suddenly I'm getting Deep Sleep like 50% of the time the screen is off. Not sure why no other combination will do that (I tried Naptime + Servicely extensively--they should be able to do the same thing. But for whatever reason, they don't. I never saw any deep sleep.
[ONE Android Development] flug32:
If anyone is interested in trying the Network Off Battery Saver app I mentioned in the message above, here are the links & info:

UPDATES: I updated this message with info about version 2.21, just released.
[ONE Android Development] flug32:
One situation low temp/low freq thermal settings don't work - Camera

Running the kernel over a more extended period, I discovered there is definitely one situation where the Argon stock/low temperature/low frequency settings definitely do not work.

That is when you are taking a photo with the camera.

I was using Open Camera but I believe all camera apps will work about the same.

What happened with the low temp/low freq drivers, capped at about 1900mhz, is that I noticed the camera really heavily lagging just when I pushed the camera 'take photo' button, for a few seconds.

So I looked at the CPU frequencies/usage while doing that & it was totally maxed out. Aha!

Also, looking back at the photos I took with Argon stock "low thermal" settings in place, there are a LOT of lines in the middle of the photos. More in the last couple of days than I've seen in several years of running the OPO. So I'm guessing that when the CPU has to copy the photo data from the image sensor, it is quite a lot of data and it only has a very, very short time to do so before glitches start to happen. So with CPU capped at 1900mhz, it's just not fast enough to get it done.

So with all that in mind, I put the "high thermal" settings in place. This allows the CPU to run up to 2880 mhz.

Then I took a few more photos and watched the CPU usage. Sure enough, they spiked right up to 2880 just for a short time, each time I pressed the shutter.

So far, no glitches.

Also, watching the total CPU usage for the day since making that change, I see:

- Deep sleep 35%

- 268MHz 18%

- 1190MHz 14%

- 2880MHz 3%

- a few others 1-5%

In short, a pretty good spread and concentrated towards the middle & low end, with 2880 probably kicking in for a few seconds here & there when really needed.

I improved the thermal settings patch .zip I put together by including a .sh file that is capable of running at device boot to install the thermal settings you want. It can be downloaded upthread; instructions in the included Readme.txt.
[ONE Android Development] flug32:
New, updated, better tested Argon Thermal Settings files

So I found that running at some of the higher thermal settings I uploaded earlier leads to crashes under certain situations--particularly, full CPU load that lasts more than an instant.

So, back to the drawing board.

This time I tested each of the thermal settings with a stress tester.

Now there is an array of available CPU/thermal settings ranging from tame and cool to quite close to the most overclocked you could. (And there is quite a difference in performance, based on the stress-testing.)

Also, I discovered that what I thought were cut-off CPU temperatures in celsius in the thermal settings files, just don't correspond to the temperature as shown by the usual system tools.

I'm not sure if a different temperature is being used, if the numbers represent something different than temp celsius, or there are just other factors in play in setting the CPU performance.

At any rate, it's not just as simple as saying, "Hey I want this frequency to cut off at 63.42 degrees!" and putting it in the setting and having it happen.

Full instructions for installing in the Readme.txt.

Comparison of different settings available in the Readme.txt and also the cpu-stress-test-results.txt.

Those are all the details, but basic installation of the updated thermal settings is quite easy:

Unpack the attached zip file to /sdcard/Argon

In the /sdcard/Argon directory is a file called update_argon_kernel_thermals.sh

Set some program to execute /sdcard/Argon/update_argon_kernel_thermals.sh at boot-up

Init.d scripts support in the Play Store will do it

So will the SmartPack Kernel Manager (mentioned below)

There are settings inside of update_argon_kernel_thermals.sh that you can customize, but it will implement sane settings if you just run it as-is.

UPDATE: I created a Github repository for these thermal settings file here.
[ONE Android Development] flug32:
Better Kernel Manager for Argon - Smartpack Kernel Manager

I mentioned upthread that I was having trouble with Kernel Adiutor - it wouldn't restore hotplug settings after a reboot. I came up with various workarounds for that (Tasker project here, which includes instructions for the KA profile you need to make to go along with it. Ask if you have questions).

However, I came across this much-improved descendant of Kernel Adiutor:

Smartpack Kernel Manager

It is actively being maintained and has many more of the Argon settings--and, generally, modern kernel settings--available than KA does.

Settings easily editable include hotplug (which works, unlike KA), charging levels, and even the thermal settings.

(In fact, if you won't want to mess around setting up the shell-files-at-boot method for installing alternate thermal files, that I described above, you could instead load settings once by copy/pasting the thermal settings files, then Smartpack will pick those settings up, then you can save them & Smartpack will re-apply at each bootup.)

(You could also edit the thermal settings directly in Smartpack but it is a whole lot of clicking and typing of small ticky-tacky text fields. No fun if you're trying to do more than change a value or two.)
[ONE Android Development] xdafanboii:
Does this kernel feature backported namespace patches, so that Magisk Hide works way better?

I'm talking about this article from XDA:

https://www.xda-developers.com/magiskhide-older-android-devices-custom-kernel-patch/
[ONE Android Development] mrhamed:
Because I have to use https://github.com/bol-van/zapret project to

bypass internet censorship DPI

and got error: Kernel module xt_set is not loaded,

Can you add ipset and nfq modules to your kernel please?

Thank you!
[ONE Android Development] Tomoms:
It has got it. Anyway, kernel development for now is stopped.

Hello! I'll take your request into consideration, but unfortunately, for now I have stopped the development of the kernel. Actually, I've started the kernel from scratch and I don't know if I'll keep releasing it separately or provide it bundled into my LineageOS builds only.
[ONE Android Development] mrhamed:
Hello my friend! I'd like to hopeful. We have many restrictions against free Internet. Thank you for your understanding.
[ONE Android Development] Tomoms:
Oh! If it's a matter of freedom, I'll do my best to provide you with a kernel that supports those features as soon as possible. I'll send you a PM soon :)
[ONE Android Development] mrhamed:
Thank you so much for your understanding, I'm sure many people need it. I'm very interesting to test your release. if you need more info about ipset and nfq in target context please read this: https://github.com/bol-van/zapret/blob/master/docs/readme.eng.txt

Also let me know if you prefer faster relation tools such as telegram.

Thank you again!
[ONE Android Development] joeandjoe:
Hi guys,anybody been able to test otgy?
[ONE Android Development] Tomoms:
Thanks for reporting this problem, I'll look into it tomorrow. Do you confirm that on v1 you did not face this issue?
[ONE Android Development] jmax91:
I remember one freeze only with v1, and I'm pretty sure things gone worse with v2.
[ONE Android Development] Ruggerxpunk:
Unfortunately I didn't use v1
[ONE Android Development] valvze:
Could this kernel theoretically be used with P due to the few changes or would changes be needed?
[ONE Android Development] Tomoms:
I've already answered this question here.
[ONE Android Development] MaestroCharan:
[MENTION=5727088]Tomoms[/MENTION]

Which kernel manager to use with this app?

I see no recommendation.

Any guidance?
[ONE Android Development] Tomoms:
I personally use Kernel Adiutor, but they're all (more or less) the same.
[ONE Android Development] __infin1ty:
Just had my first random reboot with v3. I was using Poweramp and suddenly everything stuck. This led to a reboot. My rom is AOSPExtended 5.7
[ONE Android Development] Tomoms:
If you haven't manually rebooted the phone since the random reboot, please provide me the /proc/last_kmsg file. It'd be really helpful. Please note that if you have manually rebooted or shut down your phone after the random reboot, that file isn't useful anymore.
[ONE Android Development] __infin1ty:
My apologies but i didn't know that and i made a couple of reboots. :(
[ONE Android Development] Tomoms:
Ok, next time it happens, grab that file as soon as possible and then upload it here :)
[ONE Android Development] valvze:
Oh ok, my apologies. Thanks for your work btw :)
[ONE Android Development] Tomoms:
Please try this kernel, if possible: https://drive.google.com/open?id=1nLulRIWKzT86bDs6ICY4j2LOpsOuXp3o

Maybe it'll fix the issue.
[ONE Android Development] jmax91:
Flashed and trying it. Thank you.
[ONE Android Development] pippoaacc:
Any chance we can get configurable charging for interface? Can't seem to go past 600mah here...
[ONE Android Development] Tomoms:
Yes, sure. It's on my to-do list. But if you can't go past 600 mAh, I suspect there's an issue with the charger and/or cable you're using...
[ONE Android Development] __infin1ty:
Video capture not working at all..

Argon v3

AOSPExtended 5.7
[ONE Android Development] Tomoms:
It's most likely not my fault. Video recording works on LineageOS 15.1, and no AEX users has ever reported that camcorder is broken. Please check if there's something wrong on your side.
[ONE Android Development] __infin1ty:
Yes ,I tried AOSPExtended with stock kernel and everything works. I also tried Arrow ROM and no problems there. Well this is a small issue,no worries. No other issues so far.
[ONE Android Development] jmax91:
Zero issues at the moment with this version. I believe the problem is solved.
[ONE Android Development] Tomoms:
Thanks for reporting. Keep testing it for a couple more days, please. Then, if the issue is fixed for real, I'll try to reimplement CPU underclocking in a way that doesn't cause problems for certain users.

If you're still on AEX, could you try v2 and tell me if the issue persists?
[ONE Android Development] __infin1ty:
Yes the problem is still here
[ONE Android Development] Tomoms:
And could you try v1 as well, please?
[ONE Android Development] __infin1ty:
Unfortunately the same issue with v1
[ONE Android Development] pippoaacc:
Hi. Thanks a lot! Just a heads up that I have just tested same cable and charger with Thunder V6S and, if stock, I get 6-700mah idle charge, if I set it to 2000 with Synapse, then I can reach about 1600,which is consistent with previous tests.
[ONE Android Development] Tomoms:
I've released a new update, it brings many improvements under the hood and per-process reclaim (which is enabled by default).

Download here.
[ONE Android Development] __infin1ty:
After flashing the latest kernel this happens.

Also no option to KA to change the battery settings
[ONE Android Development] Tomoms:
Ok, I'll try to implement the feature in the next days.

Maybe you'll benefit from the charging current interface I'll add to the kernel soon.

If you want to help me understand why camcorder is broken on AEX, please provide me a logcat taken after attempting to record a video.

--

[MENTION=3234292]jmax91[/MENTION] If you haven't encountered issues with the last kernel I sent you, please try this one for a couple of days: https://drive.google.com/open?id=1D_jzA0TeHx886DDwOLe6BaJ3f42hyfir

Thank you.
[ONE Android Development] jmax91:
I have had two freezes since Saturday with the test version and with v4 too. Here are the logs (I don't know it they were grabbed correctly).
[ONE Android Development] __infin1ty:
Here you go

View attachment last_kmsg.zip
[ONE Android Development] Tomoms:
This is a last_kmsg, it's not what I need. I need a logcat, and probably, the output of dmesg would be useful too. You mustn't reboot before taking the logs.

Let me take this opportunity to remind you that you can save a logcat using an app such as MatLog, and you can save the output of dmesg by opening a terminal and running

dmesg > /sdcard/kernel.log

(the log will be saved in kernel.log).

I don't know how you grabbed them, anyway, there are several files I don't need, and the only file I need is full of corrupted characters.

Have you got a file explorer that can access /on your phone? If you haven't, please install one, and after the next freeze, open it up and manually copy /proc/last_kmsg somewhere, then send it to me. Thanks.
[ONE Android Development] __infin1ty:
Better now?

View attachment saved_logs.zip
[ONE Android Development] jmax91:
[MENTION=5727088]Tomoms[/MENTION] I used SysLog to grab them. Next time I will follow your steps. Thank you.
[ONE Android Development] jmax91:
Another freeze while using Telegram on idrophecy's LOS 15.1 with the test version kernel. Here is the log.

Edit: now I will try argon_v5_noUC as suggested.
[ONE Android Development] Tomoms:
Yes, indeed.

Did you flash any other mod on AEX, apart from my kernel? Before flashing my kernel, were you using another custom kernel or AEX's stock one?
[ONE Android Development] __infin1ty:
Completely fresh install and using Argon kernel from day one :)
[ONE Android Development] Tomoms:
The log is full of broken characters, which I guess is caused by something in the kernel not working properly (I think I've already seen this behavior on another device). Anyway, the log is spammed by Core control messages, could you check in Kernel Adiutor whether you have disabled Core control (the option is located in the Thermal tab)? By default, it should be on and it shouldn't print all those messages in the kernel log...

Did you modify anything else? Something that might be related to Core control/thermal management?
[ONE Android Development] jmax91:
[MENTION=5727088]Tomoms[/MENTION] I didn't modify anything but I will check.

Edit: Core Control is on.
[ONE Android Development] Tomoms:
Try to disable it and, instead, enable "SoC temperature limit toggle".
[ONE Android Development] Tomoms:
A new release is available!

v5 brings zram support (it's disabled by default) and many async I/O (AIO) optimizations (they might improve filesystem speed). There are a couple of tweaks and fixes as well.

You can download it here.
[ONE Android Development] jmax91:
I just noticed the Core Control switcher in Kernel Adiutor doesn't work properly: if I disable it, next time I open the app it's enabled again. BTW, I haven't had any issues since I enabled SoC temperature limit toggle.

Edit: Another freeze while I was using Telegram again. Log attached with a lot of corrupted characters.
[ONE Android Development] Tomoms:
The logs you sent me show that the video encoder the phone's attempting to use when recording a video can't instantiate itself properly. I honestly can't understand how this could be caused by my kernel, anyway, I suggest you to try using an app that uses software encoding for video encoding, if I'm not mistaken, Footej Camera is one of such apps.

[MENTION=3234292]jmax91[/MENTION] Please try this kernel: https://drive.google.com/open?id=1hRGwAoJAtboWrny2BRPyqIcCiHVe4s5-

Use the default settings, don't change anything.
[ONE Android Development] jmax91:
[MENTION=5727088]Tomoms[/MENTION] Another freeze while I was using Telegram.
[ONE Android Development] JJohnson1988:
I seem to be having an issue with the Magisk directory not being writable (therefore modules and scripts don't seem to install) with v5.

I rolled back to v4 and everything was working again.
[ONE Android Development] Tomoms:
In v5 I implemented some updates that broke Magisk modules installation for many users some time ago, when I implemented the same updates in my old Neon kernel. If I recall correctly, you were one of the first users to report the issue, back then. I have tested the kernel on my device before releasing it, and I was able to install and update several Magisk modules without a single problem; are you using f2fs or ext4 as the /data filesystem?
[ONE Android Development] JJohnson1988:
Ext4.
[ONE Android Development] Tomoms:
I'm using f2fs, instead. This means that I'm missing some ext4 patches; I'll try to fix the bug, and I'll send you a test kernel.

EDIT: all ext4 users should flash this kernel, to avoid facing filesystem problems: https://drive.google.com/file/d/1MHNUv8Lb7G7qWvRHQW1UivNzv-hl5Ux9/view?usp=drivesdk

[MENTION=5599724]JJohnson1988[/MENTION] let me know if it fixes the issue.
[ONE Android Development] JJohnson1988:
v5.1 seems to do the trick. Working flawlessly so far. Thanks :D
[ONE Android Development] __infin1ty:
2 freezes-reboots in one day . I'm using 5.1 View attachment saved_logs.zip
[ONE Android Development] 1plus:
Hello, thanks for the kernel, just a few of them being still updated for OnePlus 1 :)

Funny enough I'm on LineageOS and use ext4 for all partitions, and yet the kernel is very stable, and no freeze or reboots. I'm currently using 17.2 magisk beta and still with v5, not v5.1 of the kernel.

Also worth mentioning -- stand-by drain (on wifi, not 4g) is excellent, I can get like just over 1% of drain per hour. While on N roms that was pretty normal, on Oreo it used to be more (like 2-2.5% per hour).
[ONE Android Development] Tomoms:
Hmm... weird. Unfortunately, since you faced a reboot, I don't need a logcat and the output of dmesg, but I need the last_kmsg file. So next time a reboot occurs, grab that file and upload it here. Thanks.

I'm glad to know that Magisk + v5 works fine, in fact, there's no reason why it shouldn't. Anyway, I reverted the updates that caused problems, however when I have some free time I'll try to look deeper into the issues and maybe attempt to solve them.

I've added the charging current interface to my kernel, it'll be available in the next release (which I'll probably publish within a few days) :)

EDIT: a small note for all those who faced freezes and other problems (camcorder not working, etc.): unfortunately, I have no idea how to fix your issues. The broken camcorder on AEX might be caused by the fact that my kernel and AEX simply aren't meant to work together (Argon is based on LineageOS, while the whole device trees used in AEX are based on AgentFabulous's/AOSP sources), however it'd be nice if some other users of AEX or any other AOSP-based ROMs could confirm that the issue exists for everyone.
[ONE Android Development] rolarocka:
Will you update your rom with this new kernel version too? Ty
[ONE Android Development] Tomoms:
Of course, but in the mean time you can simply flash the new kernel on top of the ROM.
[ONE Android Development] __infin1ty:
About 10 freezes that led to a reboot so far

View attachment 4605184
[ONE Android Development] Tomoms:
Thanks for the logs. I can't promise it, but there's a high chance that the upcoming v6 will fix all the freezes/reboots some users like you have faced. I'll release the new kernel tonight.

EDIT: you don't even have to wait till tonight. Open this file: /sys/modules/process_reclaim/parameters/enable_process_reclaim and change the 1 to a 0, then save the file. Reboots shouldn't happen anymore, hopefully. [MENTION=5880617]__infin1ty[/MENTION] [MENTION=3234292]jmax91[/MENTION]
[ONE Android Development] jmax91:
Another freeze right now while browsing with 5.1 after changing sys/modules/process_reclaim/parameters/enable_process_reclaim from 1 to 0. Here is the log (this time without any corrupted characters).

Edit: my bad, I just noticed there are corrupted characters again...