yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Premium Android Development] zacharias.maladroit:
Real quick before I go out - here's an "evaluation" kernel (meaning - I still test it for stability and reliability)

Source is at:

Sun-Kernel_32.1.A.0.xxx_AP-mod-v22_II_1.6_eval

For best measure - combine it with

Wakelock Detector, Greenify, Amplify, AppOpsXposed, BootManager (XPosed; or other that e.g. also allows control of system apps), Disable Service/My Android Tools (by WangQi)

with Wakelock Detector it's rather easy to greenify Google Play Store which is one major culprit of wakelocks,

with AppOpsXposed (or other App Ops via root) you can control what apps or services keep awake (wakelock) the phone and thus occasionally or more often drains the battery

with Disable Service/My Android Tools you get pretty powerful tools that allow you to disable service on a fine-grained basis, and e.g. specifically turn off Google's Analytics; which as a side-effect also might save battery

with Amplify you can disable wakelocks, alarms and services in a general sense and helps quite to some degree to cut down battery consumption

Features:

(will add more later if I forgot anything)

Changelog:

Recommended default settings

(set via e.g. Kernel Adiutor; start from there and change to your liking)

In case you watch 4K HD/HQ videos and the above is not enough

Turn the following off:

Hope this kernel works, couldn't have tested it on the Z5 Premium before ...

anyway - I'm out - enjoy :)
[Xperia Z5 Premium Android Development] Ashray_Vk:
[MENTION=3037651]zacharias.maladroit[/MENTION], You rock man! Will try this out once I'm done testing your old kernel. Haha. That old kernel is really on drugs man. About 25% battery has been drained and I've got nearly two and half hours of screen on time.

Thank you once again boss! :)
[Xperia Z5 Premium Android Development] xElectroKingx:
Flashing first the kernel than the ecryptfs.ko or for what is it? Is the eval kernel out or still in testing?

Gesendet von meinem E6853 mit Tapatalk
[Xperia Z5 Premium Android Development] zacharias.maladroit:
Glad you like it, [MENTION=4919303]Ashray_Vk[/MENTION] :)

Unless CPUQuiet really is worse compared to the other Hotplug mechanisms, the new one should provide even better battery runtime ;)

Could you please post what Hotplug mechanism and settings you are using ?

I want to make sure to follow the base with the best settings

Thanks !

The kernel can be forced to use kernel modules even if it normally disagrees with them,

in the case of ecryptfs (encryption of the phone or microSD) it would be better to go safe and use the compiled ecryptfs of the specific kernel over Sony's one with incompatible symbols.

The ecryptfs.ko is in a zip-file (limitation of XDA uploading files) - it can not be flashed, it's to be copied over manually to /system/lib/modules,

until I find a way to copy them over during the kernel flash (might be a thing of only adding a few lines to the flash script).

It's in "extended evaluation (testing)" what I would name it, so safe to use

it appears to be stable but I did some really bad things to the system - lol (and did dozens of kernel builds with new commits and features for testing) - so I got cautious

so with this newly flashed Firmware it looks fine.

The kernel appears to be stable to use - but since my testing ability is limited (due to time, apps, games, etc.) I can't do all the corner cases.

This one should be more stable than the previous one due to more experience with the phone and its intricacies ...

Tl;dr (in a nutshell):

Status: out

In any case do backups of your pictures, apps data, etc. - as always - BEFORE flashing the kernel

to be on the safe side
[Xperia Z5 Premium Android Development] Ashray_Vk:
Was using Intelliplug with eco conservative profile in kernel auditor. Also had undervolted all clock frequencies by 5 mV

Most of the other settings stayed at stock. The governor (interactive) was tweaked using heimdall's tweaks ( posted in z5 themes and apps section by a user, along with those power tweaks and setprop tweaks)

I felt amplify made most of the magic here. Helped a lot with wakelocks. Searched the net for guide to use amplify and it worked brilliantly. Phone was down to 50% and I had an SOT of 4.5+ hours.

Will try the new kernel and let you know in a day or two. I am pretty sure the kernel would work better if I gave it a day to settle.

For the previous kernel which I was testing, it was it's first run.
[Xperia Z5 Premium Android Development] Ashray_Vk:
[MENTION=1965532]zacharias.maladroit.[/MENTION], Regarding Wakelock controls in misc of kernel auditor, do you mean to switch off all the toggles or turn on all of them to prevent wakelocks?

Regarding stats for 10% battery usage, the kernel is doing better than the last one. Got like 15 minutes extra SOT compared to the last one.

So, for the complete usage, this kernel would atleast give I think an hour or two of extra SOT.

As far as I've seen, the processors are running at low frequencies itself. Will keep this post updated regarding the battery life. I should also check about deep sleep stats. But all this is just taking too long since the battery and the kernel is that good XD

[MENTION=3037651]zacharias.maladroit[/MENTION], A kernel Wakelock suspend_backoff is taking up some battery. Is that normal or is something wrong?

Edit: I think it's related to something with some apps keeping the phone awake in succession

Maybe chrome is a bad app here. Will Try disabling it and checking
[Xperia Z5 Premium Android Development] :
Is undervolting working now correctly?
[Xperia Z5 Premium Android Development] Ashray_Vk:
[MENTION=3037651]zacharias.maladroit[/MENTION], not sure, but I think I like the older kernel more, since the new kernel has a slightly more battery drain while phone is in deep sleep, compared to the older one.

I'll need to do a few more tests before I confirm though.
[Xperia Z5 Premium Android Development] zacharias.maladroit:
Thanks for the confirmation,

Yes, the new kernel base appears to be more vulnerable to wakeups and wakes up every few seconds or minutes from my observation

sometimes it doesn't hurt but sometimes it drains faster.

To get to the bottom of this I wanted to build a "vanilla", "stripped" kernel to the bare minimum and see how high the actual drainage of Sony's source is but it didn't boot yet (thanks to Sony's stupid Bootloader or other Security Framework on the phone - with a Samsung Galaxy we probably would either have figured it out or optimized the kernel and ROM to have virtually no drain by now :confused:)

I'm currently occupied with AOSP/CM and also got somewhat upset of the dozens of (working and non-working) kernel builds,

however glad that the previous kernel is a good one, I'll mark that one and see where to do only minor changes in the future to it (or simply leave it if it's close to optimum - Sony's Stock Kernel is significantly more

"high maintenance" to tweak and optimize than the AOSP one )
[Xperia Z5 Premium Android Development] :
Ok it seems to be disabled...
[Xperia Z5 Premium Android Development] Ashray_Vk:
Just letting you know about that latest kernel build. I got 10% battery drain in 12 hours. [MENTION=3037651]zacharias.maladroit[/MENTION]
[Xperia Z5 Premium Android Development] zacharias.maladroit:
That's with Phone activated (not Airplane Mode) ?

How good (or bad) is that compared to your previous usage pattern ?

Thanks !
[Xperia Z5 Premium Android Development] Ashray_Vk:
Sorry for the missing info.

That was on idle, not airplane mode. Phone was available for calls and stuff
[Xperia Z5 Premium Android Development] alvarozafra:
hi this kernel have drm fix?
[Xperia Z5 Premium Android Development] Ashray_Vk:
Another observation. Happened twice. The phone falls into something like a sleep of death when kept idle for a long time like more than 3 hours.not always, but happened twice.

The worst part of this is, the phone isn't actually Asleep, but there's a very bad battery drain happening during that time. Lost almost 50% battery in around 9 hours of this " sleep of death"

[MENTION=3037651]zacharias.maladroit[/MENTION]
[Xperia Z5 Premium Android Development] zacharias.maladroit:
alright, so that doesn't look too bad

Hm, bummer,

I wonder what is involved in this,

you use double-tap-to-wake ? or any sort of touchboost ?

And the phone is getting quite hot, I guess ?

Thanks for the information :good:

yeah, there's something included in the initramfs,

but you also need a part in the ROM, if I remember right
[Xperia Z5 Premium Android Development] KbaB.BroS:
Actually, flashing your kernel directly over stock ROM seems to restore the DRM, no need to flash the separate zip or anything like that.
[Xperia Z5 Premium Android Development] arshia.sunboy:
please answer
[Xperia Z5 Premium Android Development] petyasb:
How to make this on DualSIM? Your kernel works on E6883 but without SD card, safetynet IS NOT passing :(

It looks like recovery is not working in all the Dual-SIM KERNELs for Android 7. I flashed the latest KERNEL Z5Prem-DSDS_SK_Enf_vN_2.33_Nova_I.2_12_2_sats_dual and booted with fastboot from PC with kernel 32.3.A.2.33_E6883.img from here to get into recovery and iwt worked!
[Xperia Z5 Premium Android Development] DarkSilentSC:
If you flashed TWRP 3.1.1-0 for Z5P, you no longer be able to use TWRP access when normally booting. What you need to do is power down completely (power + Vol Up button), and then press power + Vol Down button to boot straight to the new TWRP version. You can also try altering the kernel using Rootkernel to point to a new TWRP.
[Xperia Z5 Premium Android Development] the_brad:
No Warranties for this one :) Z5Prem-DSDS_SK_Perm_vN_2.33_Nova_I.2_12_2_sats_dual

I switched my phone to a XZ Premium, so I can't test.

As I wrote here, this recovery works on single SIM and should do it's job on DSDS, too.
[Xperia Z5 Premium Android Development] petyasb:
Thank you for this one, TWRP works fine and safetyNet passed.
[Xperia Z5 Premium Android Development] arshia.sunboy:
Hi .dear dev please share full changelog for this kernel.

this is just rooted kernel or other changes and governors applied into kernel?

thanks
[Xperia Z5 Premium Android Development] _LLJY:
Look at the kernel source for detailed changes,

There are several hundred, don't expect him to list it down for u, look for them yourself.
[Xperia Z5 Premium Android Development] pandan80:
will update kernel to 32.4.A.0.160?
[Xperia Z5 Premium Android Development] luvmdy:
Z5P 32.4.A.0.160 has released
[Xperia Z5 Premium Android Development] zacharias.maladroit:
exactly :D

Yes, probably - as soon as I know that the source is compatible with 160,

I'm still on 2.33 (Nougat 7.0)

Thanks, no new source yet

Thanks mate,

the XZ Premium probably has a much better battery compared to the Z5, I guess ? :)

Good grief !

There's so little development for it :eek:

(https://xdaforums.com/xz-premium/development)

in time it'll probably surpass Z5, Z4/Z3+ - still pretty new ....
[Xperia Z5 Premium Android Development] zacharias.maladroit:
Can you guys point me to new repackaged 2.33 Stock Kernels that work for you ?

single + dual SIM ?

I need to update the ramdisks & afterward can build new kernel (https://xdaforums.com/showpost.php?p=73031673&postcount=2112) for the Z5 Premium

Thanks
[Xperia Z5 Premium Android Development] zacharias.maladroit:
DSDS = dual sim

Perm = SELinux permissive

MM = Marshmallow

5.11 (5.11 Sony ROM release)

Flares (5.11 SunKernel variant)

II.3 (2nd attempt, 3rd bump)

lazy (lazy hotplug)

sats_dual (satsuki dual = Z5 Premium Dual SIM)
[Xperia Z5 Premium Android Development] pandan80:
i cant made it because im in 160 firmware
[Xperia Z5 Premium Android Development] the_brad:
Yes, it's battery lasts so much longer! Sony really did a great job here. The heat-issue is solved completely... finally :)

Yeah, no development atm as there is no DRM-Fix and temp-root available... I really hope, that, once these are out, some devs start with that device.
[Xperia Z5 Premium Android Development] zacharias.maladroit:
In the 2.33 Firmware folder is a new kernel(s) available N_2.33_Nova_I.1_n_1_6_4_3 (2.33 Nougat)

this is the 2nd incarnation of the Nova I.1 kernel

this one should be more stable

folder to 2.33_nougat kernels folder:

https://drive.google.com/open?id=0BykGGWB96CBQNnZGd0NPOWJFcUk

Known issues & problems:
[Xperia Z5 Premium Android Development] Tilman:
It's always pleasing to test new kernels, unfortunately I've moved to 7.1.1 - where 2.33 kernels don't work as you mentioned earlier. Though, any chances to see lazyplug for our GPU, not a request at all!!
[Xperia Z5 Premium Android Development] zacharias.maladroit:
Yes, it's unfortunate, all Kitakami-devs (Z5, Z5 Premium, Z4/Z3+, Z5 compact devs are still waiting for kernel source),

lazyplug isn't really needed,

the current hotplug mechanism (core_ctl & core_ctl_helper) can be configured to behave like lazyplug (that ALL cares are plugged in ALL of the time) and it should be more stable,

since it's the hotplug driver (well, one of the several) that Qualcomm uses in their kernels

Lazyplug is for the CPUs (NOT GPU ;) ) :)

and the current governor for the GPU should be the best available (adreno_tz), with the recent tweaks the battery consumption shouldn't be that high

hope that helps.
[Xperia Z5 Premium Android Development] Tilman:
Stupid sleepy me confused everything up. What I wanted to say was if we can see adreno_idler for gpu, lord knows where lazy plug came out (sorry for the confusion).

Currently I've disabled msm thermal & core_ctl, just running on qualcomm's msm performance to see what it feels like. Also I've disabled KSM for while being. Its still smooth, everything runs just as fine. I think the battery is a little improved. I'm also testing some interactive values limiting the lower cores @ 1.2 for most tasks, & only ramps higher whilst opening apps. Though the Facebook app is a resource hungry one, & simply scrolling through makes the device run at speeds of 1.2ghz or higher.
[Xperia Z5 Premium Android Development] zacharias.maladroit:
Adreno_idler caused lagginess under certain circumstances (especially when clocking down the max frequency of the GPU),

[MENTION=5627933]androidexpert35[/MENTION] did some extensive tests with that

NO NO NO !

Do NOT disable msm_thermal and core_ctl - unless you have vdd restriction activated !

These are thermal / throttling mechanisms - and AT LEAST ONE needs to be enabled - otherwise you can kill your hardware ! :eek:

core_ctl (thermal) and core_ctl (hotplug) are NOT the same [at least it looks that way]

the one appears to be the hotplug driver, the other is used for thermal and keeping the device cool.

Yes, KSM got disabled by default, the memory savings (8-50 MB) aren't really that great and shouldn't be needed,

I've reworked the memory subsystem and in combination with the z3fold allocator/compressor the memory fragmentation should stay pretty low and allocations should keep on succeeding ...

Limit the cores to 1.3, oftentimes it's needed for tasks that need somewhat more juice, 1.2 GHz is enough for scrolling most of the time but can still be janky from time to time.
[Xperia Z5 Premium Android Development] Tilman:
I might not have as much knowledge as you, but I'm not stupid enough to let my device run without a thermal management :p. I do have VDD Restriction enabled. And this is all just for time being, I'm just experimenting, trying maybe to find out what caused this battery issues with Nougat when on Marshmallow it was so better.
[Xperia Z5 Premium Android Development] 64801965:
Which kernel should I choose with my Z5 premium Android 7.1.1 HongKong location?
[Xperia Z5 Premium Android Development] Shade20041987:
Hi everyone!

zacharias.maladroit , I want to thank you for you great work, you kernels are really the best i used on every marshmallow rom, so i really appreciate your hard work!

I have a question, since i moved to nougat, (as we all know) , the battery life got much much worse and i jumped strait to 32.4.A.0.160 so i couldn't even try you kernel it on my device :(

Now i'm on Lineage OS 14.1 for Z5 premium, which is 7.1.2, everything works great and this is really the fastest rom I have ever experienced! reboots take under 20 secs, and everything really flies, but there's this one little problem again- battery life.... :(

it's just horrible, phone drains 2%- 3% per hour on deep sleep!!! i tried to disable every app and service, and "better battery stats" shows its in deep sleep, and greenify also shows its dozing , and i even tried to freeze google services ,phone services ,nfc and bluetooth just to make sure its not something in the system, so i have come to a conclusion that this could be only the kernel that drains that battery so much...

I tried to flash EAS kernel by PDesire, and a couple of you kernels but every time i get stuck at Lineage OS infinite animation that just does't continue to the system...

I wanted to ask if there is some advice you could give me?

cause I really think this could be the best user experience for Z5p...

I thank you again very much!
[Xperia Z5 Premium Android Development] zacharias.maladroit:
unmodified Stock Kernels unfortunately do NOT work on CarbonRom, LineageOS, CrDroid, etc. - they need a few kernel-side changes + a different ramdisk

that's probably not so far from the core of truth, but not what you might think (Magisk-patched kernel, tap2wake, fingerprint scanner always active, adaptive brightness, etc.) ;)

Are you using Magisk v13.x ?

There's unproportionally high battery drain with it - both when trying to use it on my Note 3 or Z5 [only when having the Android Logging disabled , it's a "bug" - Magisk is lacking handling when the logger is disabled]

thus I'm using Magisk v12 on the Z5 for now (luckily it works, on the Note 3 I didn't get so lucky and root doesn't work - so I have to use v13.x)

when forced to use Magisk to have root access (e.g. like on my Note 3 when root only works that way - ymmv) - you can resort to create a script via Script-Manager

and call it to kill off the magiskdaemon (currently don't have the exact name of the apps to be shut down since the Note 3 is charging) and another google play services component,

that should allow the phone to mostly go to sleep in a quick way.

I'm not sure if [MENTION=6362823]kv123[/MENTION] is using any modified kernel source for his LineageOS builds,

so if it's "upstream" lineageOS "stock" (we are using the CAF / Stock kernel after all on LineageOS and CarbonRom since quite a while),

I currently can't think of any major battery drainers - except perhaps:

doubletaptowakeup [tap2wake] and/or adaptive brightness

these are more system-side but since it involves the kernel, I'm mentioning it here,

tap2wake has been confirmed to growingly cause battery drain [tested here on Z5 + also on Z5 compact & confirmed]

Another factor could be the always active fingerprint scanner which might cause battery drainage [default Android 7.x behavior afaik],

there are possible changes available to only acquire a wakelock when it is pushed/triggered - but that requires kernel- and ROM-side changes (probably NOT implemented in any Z5/Z4/Z3+ device at the moment)

Hope that helps

edit:

explained the higher drain with Magisk - when the Android Logger is disabled,

otherwise it's fine :)
[Xperia Z5 Premium Android Development] kv123:
Yes i'm using "upstream" lineageOS "stock" kernel.

I have 3 phones at one time, with same operator it's locked stock, unlocked stock and LOS. So with 7.1x battery consumption is almost the same on all phones in standby. Difference with stock and LOS may in SOT because LOS have a little bit brightest screen setting. I decreased screen brightnest in low light condition in my build.
[Xperia Z5 Premium Android Development] luvmdy:
removed
[Xperia Z5 Premium Android Development] jimmkhn:
[MENTION=3037651]zacharias.maladroit[/MENTION]

Sony released last kernel sources plz modify this

Open source archive for 32.4.A.0.160

https://developer.sonymobile.com/do...chives/open-source-download-for-32-4-a-0-160/
[Xperia Z5 Premium Android Development] luvmdy:
for Z5 Series, Open source archive for 32.4.A.1.54
[MENTION=3037651]zacharias.maladroit[/MENTION]

thx for your great work

link:https://developer.sonymobile.com/downloads/xperia-open-source-archives/open-source-archive-for-32-4-a-1-54/
[Xperia Z5 Premium Android Development] Raven84:
Hello i am triying your mod just now, i have to say is good in this hours, but i thinkg there is a bug with facebook application, because when i get notified from this, my app continue to mark there.

I like here a screenshot for understand what i say.

https://ibb.co/m2QXYG

U have some trick for resolve this bug? Thanks!
[Xperia Z5 Premium Android Development] zacharias.maladroit:
Hi [MENTION=1558634]Raven84[/MENTION] , thanks for your interest,

not really sure if the kernel can cause these kind of notification "artifacts"

A custom kernel for 32.4.A.1.54 is available :)

https://drive.google.com/open?id=12lk5v19SEPUE6BVbYgaWz0dmhJWEEf15

it's a GreenKernel 0.9.9 (DEV) branch MOD, essentially a collaborative kernel by [MENTION=8041676]GreyLeshy[/MENTION] and [MENTION=3037651]zacharias.maladroit[/MENTION] (that's "me" ;) )

You can reach that folder also via the link mentioned in OP (the first post) in this thread

ramdisk thanks to [MENTION=5813612]sceryavuz[/MENTION]

These kernels weren't tested before on Z5 Premium , only compiled fine,

they were however tested successfully on Z5

Enjoy :)
[Xperia Z5 Premium Android Development] DarkSilentSC:
Installed to 1.54 on E6883. It boots. It passes SafetyNet with Magisk. Works ok. But really unstable when you start pushing your CPU with some tasks. Sometimes boot fails the first time, but boots fine the second time.

Update-- video playback goes artifacting when viewed in landscape mode.
[Xperia Z5 Premium Android Development] zacharias.maladroit:
Thanks for the feedback & testing !

I hope the following one is more stable:

New "beta" / work-in-progress release of a 32.4.A.1.54 kernel

https://drive.google.com/open?id=12lk5v19SEPUE6BVbYgaWz0dmhJWEEf15

that one has overclocking removed and tons of additional changes since the last build (mostly GreyLeshy pushing commits right now - I'm very busy so not much changes)

not sure about the artifacting (can't reproduce it) but it might be still there, ymmv (your mileage may vary)
[Xperia Z5 Premium Android Development] DarkSilentSC:
Thank you Zacharias!

GUI animation may be a slightly tad bit laggy, but nothing bothersome at all! Artifacting has disappeared! Very very stable! I'm not using any kernel management app, so I can't comment any further than this. Battery life hasn't been changed much though during normal use. But definitely some improvement while in sleep mode.
[Xperia Z5 Premium Android Development] davidd.r:
HI

First of all srry for week English

tnx for this great work much much better then stock but I have issu, I use fast charge but the rate of charging is very low (about 300 MA)

Im using nougt B 1.54

Is there way some how I fix that problem?:confused:

If any more details u need to know just tell me
[Xperia Z5 Premium Android Development] zacharias.maladroit:
ugh - let's hope this one is working fine

...

Kernel for 32.4.A.1.54 (Android Nougat 7.1.1) ROMs

Sauce:

https://github.com/zachariasmaladro...i_r2/commits/32.4.A.1.54_Sun-Kernel_Logos_I.1

Battery life under investigation to match stock kernel,

There should be a detailed instruction on how to build a binary matching kernel to Sony's stock kernel so that we get at least similar battery runtime & smoothness

and get to know how to achieve a most stable kernel, also that's usually the assumed way to comply with GPL :rolleyes:

works fine with M-ROM and similar ROMs on Z5 (no UI crashes) :)

LOL - zip size is just barely below 20 MB :p

NOT boot-tested on Z5 Premium ... yet

Features
[Xperia Z5 Premium Android Development] YasuHamed:
sir

how about

- drm fix

- do i need to flash magisk via twrp

- twrp included? or do i need to flash saperately ?

i have z5p dsds