yashsingh1/xdaforums huggingface dataset:
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
Final notice: Since my Z5 died (it's broken into pieces, glass shattered) - development is effectively halted - NO more updates - sorry

This is a

Stock (Sony) ROM Kernel

and WILL NOT work on AOSP, CM, etc.

aka

SunKernel

for Z4/Z3+ & Z4/Z3+ Dual - Stock ROM (for now only stock)

This is an extension of the Xperia Z5/Z5 Dual "sumire" main thread over at: https://xdaforums.com/xperia-z5/dev...und-z5-wip-t3340725/post65936553#post65936553

Finally !

So the kernel is now also available for the (somewhat forgotten) Z4/Z3+ series

Please understand that I can't test whether it works due to lack of that very device - Enjoy !

Keep in mind that building for the Z5 "Stock" ROMs and "Stock" Kernels, you're constantly facing the following tradeoff:

compatibility with pre-built "core" kernel modules (e.g. texfat [proprietary exfat microSD fs driver])

compatibility with pre-built "goodies" kernel modules (e.g. video and other acceleration, hwcodecs, ...)

losing features that can NOT be replaced by similar ones (e.g. ecryptfs, wlan, exfat, etc.)

when going too far the device doesn't boot or simply hangs on bootanimation

this resulted in a couple branches (at least several dozen) that are partially or totally broken :silly:

[snip]

...

[snip]

More info on the Latest Kernel can be usually found at:

AT the end of the thread

( I KNOW - I should have reserved a few posts for better overview :( )

---------------------------------------------------------------------------------

[Download] How to get the

current

("corona", 5.11) Kernel(s) - Step by Step:

Before starting to test/use keep in mind that this is WIP (work in progress),

that means - NO guarantees,

backups before flashing are a MUST (especially your microSD card content !)

stability, speed, improved battery and satisfaction are a great side-effect to have.

You have been WARNED !

Enjoy ! :)

Obligatory Source:

(according to the rules in single commits no giant blobs, authorship kept)

https://github.com/zachariasmaladroit/android_kernel_sony_msm8994_kitakami_r2/branches
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
Features:

(will add more later if I forgot anything)

Notes:

Overclocking:

The following threads are for the Z5 - so naturally the thermal engine needs to be adapted to work on the Z4/Z3+

http://xdaforums.com/xperia-z5/general/tweak-improve-performance-reduce-t3387879

http://xdaforums.com/showpost.php?p=67444047&postcount=150 ( [MENTION=6791680]_LLJY[/MENTION] 's thermal-engine modifications are attached )

Source:

https://github.com/zachariasmaladro...i_r2/commits/Sun-Kernel_32.2.A.0.224_vI.1_2_8

Download: AndroidFileHost :

SunKernel_for_Z4_Z3Plus 224_I.1_2_8

Thanks
[Xperia Z4/Z3+ Android Development] death_note7:
it is coming thx very much
[Xperia Z4/Z3+ Android Development] death_note7:
twrp can not mount mtp
[Xperia Z4/Z3+ Android Development] death_note7:
works great
[Xperia Z4/Z3+ Android Development] Trilliard:
Flashed your Kernel Today, no problems with Systemless Root, flashed Systemless Xposed - no problems here. Everything works fine... Now lets have a look at what we can do ;)
[Xperia Z4/Z3+ Android Development] GryTEcHoG:
If you don't mind a small request to [MENTION=3037651]zacharias.maladroit[/MENTION], I want to use your kernel and features are good, but can you make a kernel build with default clock of CPU and GPU reduced to 50% before boot (it should be same in recovery also) and i want to manually change its default clock through kernel auditor if i want later. Reason is my phone gets heated during boot due to its running at max frequencies.

Thanks for your work and I hope you wont mind giving me this option.

EDIT: Faux sound is not working and it does nothing when i change it from kernel auditor.
[Xperia Z4/Z3+ Android Development] death_note7:
use ex kernel
[Xperia Z4/Z3+ Android Development] GryTEcHoG:
What you mean ? Which kernel you are referring to ? Does that kernel have all the features of Zach's ? If so give me link as I can't find it. I liked Zach's kernel but during boot my phone gets hot due to default max freq and also faux sound is not working (which does nothing when i change sliders from kernel auditor app).
[Xperia Z4/Z3+ Android Development] LMcR92:
Flashed this kernel working well, systemless root, xposed and ex kernel manager. Letting it sit in till I start messing with settings.
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
Kernel Adiutor Sound controls are broken,

please use Faux Sound Control instead, that works;

I'll see what I can find on that CPU + GPU reduction during bootup,

but this will take some time, focusing on several projects (Android + non-Android) at the same time, so need to triage
[Xperia Z4/Z3+ Android Development] death_note7:
cool enjoy your works
[Xperia Z4/Z3+ Android Development] GryTEcHoG:
I've tried that also but seems to me only Headphones are working and speakers does nothing. Can you please try again and let me know ?

For the GPU/CPU, It would be better if you down clock them by 50% default and clock it higher after OS is loaded using init.d or something else.

Thanks
[Xperia Z4/Z3+ Android Development] pauljnar:
same problem here

please do a fix with the broken sound using audio output.. Only headset working flawlessly. thank
[Xperia Z4/Z3+ Android Development] death_note7:
please add a touch boost swich in the next update,and fix twrp mtp mode,can not link with computer.thx
[Xperia Z4/Z3+ Android Development] RenkaHinkaru:
I used kernel Andro v31 and now i flash and use Zachs kernel, but SuperSu automatic updated and now i can't install binary for it. Anyone can help me?
[Xperia Z4/Z3+ Android Development] death_note7:
i use this kernel i want to know how to flash supersu2.76 and how to shut cpu 4..please
[Xperia Z4/Z3+ Android Development] _LLJY:
Dont let it update then...

---------- Post added at 03:27 AM ---------- Previous post was at 03:26 AM ----------

Its hot, its not overheating. Temps should only be considered as overheating when >80
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
Features:

(will add more later if I forgot anything)

Overclocking:

The following threads are for the Z5 - so naturally the thermal engine needs to be adapted to work on the Z4/Z3+

http://xdaforums.com/xperia-z5/general/tweak-improve-performance-reduce-t3387879

http://xdaforums.com/showpost.php?p=67444047&postcount=150 ( [MENTION=6791680]_LLJY[/MENTION] 's thermal-engine modifications (for Z5) are attached )

Source:

https://github.com/zachariasmaladro...i_r2/commits/Sun-Kernel_32.2.A.0.224_vI.1_2_9

Download: AndroidFileHost :

SunKernel_for_Z4_Z3Plus 224_I.1_2_9

Thanks
[Xperia Z4/Z3+ Android Development] sarvar97:
Ok, I was using SunKernel_for_Z4_Z3Plus 253_I_VI.1_2_45_6_15_QC for E6533 model for 2 days and made better battery stats logs for two nights. First night I didn't use sony's stamina mode but second night I used. Everytime I use Greenify, Amplify and Powe Nap apps together working. I use power nap because I don't like sony's stamina mode because it has no any vibration and visualization is bad. But I switched it on only for the second night also. Here are the logs
[Xperia Z4/Z3+ Android Development] RenkaHinkaru:
Same problem here [MENTION=3037651]zacharias.maladroit[/MENTION] :rolleyes:
[Xperia Z4/Z3+ Android Development] LMcR92:
Have you tried backing up data partition and clean flashing or flash tool install of ROM then applying kernel? There is a lot of user variables that can cause this.
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
that is an overclocked kernel, make sure you clock it down to default values and see if it still occurs,

also replace modified thermal engine with stock one,

same applies to init scripts.

Make sure to note when the reboot happened and see whether you can spot a pattern (e.g. during bluetooth audio playback, video playback, music streaming, etc. etc.)
[Xperia Z4/Z3+ Android Development] Alekim91:
It is possible to underclock under 384mhz for a deep sleep?
[Xperia Z4/Z3+ Android Development] _LLJY:
No
[Xperia Z4/Z3+ Android Development] LMcR92:
The device should deep sleep anyway when screen is off and thunderplug turns off cores under the load threshold when on.
[Xperia Z4/Z3+ Android Development] Alekim91:
I didn't know, thanks you lot. But battery of this phone is a disastar
[Xperia Z4/Z3+ Android Development] LMcR92:
Best kernel to date. Smooth,cool and fast :highfive:

Enjoy your time off and hopefully you won't be dreaming code.
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
I'll be posting one more reworked 1_2_12 based kernel,

that is way more slim and doesn't seem to have battery-hungry / Cookie Monster-like behavior while on heavy duty ;)

It still needs tons of additional patches though, but these need to be carefully selected, don't have time for that right now

Thanks
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
Feedback / Comments ?

Please give the following Kernel a test and let me know how it works

it's a reworked 1_2_12 Kernel (SunKernel "reborn")

with some modifications, pretty plain actually

253_II.1 [initial build]

some general improvements

only a few security fixes are included, will be merged later

sound improvements (at an early stage) [make sure to select "Headset High Performance Mode" via e.g. Kernel Adiutor Mod]

backlight lowered close to power-saving mode ("dim") during boot,

additional governors: smartmax, alucard, darkness, elementalx, zzmoove

wakelocks: can be disabled (for wlan, modem, sensors)

FauxSound

BCL: battery percentage can be set when big cores will be shutdown to save battery (once it's e.g. pretty low)

GPU currently idling at 180 MHz

Thermal: if your device tends to get really hot (it shouldn't), enable BOTH Core Control + Temperature Throttle [seems to work fine on the AOSP Kernel]

Core Control (core_ctl): here you can set the minimum and maximum little + big cores active

.

.

253_II.2, 253_II.3 [2nd test build]

ported over zram + zsmalloc changes from Motorola Kenzi repo (thanks to [MENTION=4798704]RyTekk[/MENTION] for the hint)

lz4 compression efficiency and reliably improvements (speedup, etc.)

addressed QuadRooter kernel-side vulnerabilities (CVE-2016-5340 , CVE-2016-2059), still waiting for Sony or Qualcomm driver updates [ROM chefs, please take a look at Nexus 5, 5X, 6, 6P if those updates can be used]

addressed CVE-2016-5696

added frandom, add random32 support (prerequisite for the fix for CVE-2016-5696 to work) + fix frandom

make cpuset handling more reliable around hotplugging

[NOT added - thanks Sony (stock ROM breakage) !] zswap, cleancache, frontswap ["Zswap is a Linux kernel feature providing a compressed write-back cache for swapped pages. Instead of moving memory pages to a swap device when they are to be swapped out, zswap performs their compression and then stores them into a memory pool dynamically allocated inside system's RAM"]

Download, AndroidFileHost :

253 Kernel

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

should work BOTH on .224 based, and .253 ROMs

Notes

Source:

https://github.com/zachariasmaladro...mi_r2/commits/Sun-Kernel_32.2.A.0.253_vII.1_3

Notes

- FM Radio App is broken (with recent security updates)

- so either disable it or Freeze it via Titanium Backup

That's enough changes for one week, August, or some more

Happy testing :)
[Xperia Z4/Z3+ Android Development] LMcR92:
Well one thing I like to be included in thunderplug and darkness governor :angel:

---------- Post added at 05:05 PM ---------- Previous post was at 05:03 PM ----------

PS. Didn't see the post above
[Xperia Z4/Z3+ Android Development] LMcR92:
Just noticed after a while frequency gets locked. Tried putting phone into a fridge to make sure it wasn't thermal but no success. A reboot works but it just reverts.
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
we had that lately on the Z5 thread,

please make sure you DO NOT use a modified thermal engine or init scripts,

the Kernel must obey the command of the userspace :p
[Xperia Z4/Z3+ Android Development] LMcR92:
I am using androidexpert35s thermal I'll revert lto my backup.
[Xperia Z4/Z3+ Android Development] Fauzi alaik:
After a few hour performance is good and smooth ui, less heat than previous version

The camera ok but when record video the result laggy, restart still laggy

Im using e6533 dual
[Xperia Z4/Z3+ Android Development] RenkaHinkaru:
Only one big core turn on?

Can turn on all of them, [MENTION=3037651]zacharias.maladroit[/MENTION]?
[Xperia Z4/Z3+ Android Development] LMcR92:
It will turn on when it is needed. Gaming etc
[Xperia Z4/Z3+ Android Development] LMcR92:
Day one using alucard and Zen I/o. Kernel is running smooth so far and temperature is a lot better than previous.

Day two only setting change is darkness.

Mixture if general and hard use of YouTube and downloading.
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
what ROM ? what thermal engine ? what init scripts ?

what apps that modify system behavior ?

I'm currently always on hardly modified Stock ROM to make sure that everything works as intended™
[Xperia Z4/Z3+ Android Development] Fauzi alaik:
I think underclock cause lag to the video record, i use 1.5 big core and 1.3 little core and elementalx gov

When set it to stock 1.9 big and 1.5 little with interactive gov, video record back to normal

I dont use any init and thermal engine, using xperia x 1.0 rom acoustiX audio and xposed

Using this kernel a day my phone get cooler than before. Thanks
[Xperia Z4/Z3+ Android Development] Fauzi alaik:
Its working here fm radio:good:
[Xperia Z4/Z3+ Android Development] LMcR92:
Elemental x is a laggy Governor I've noticed. I like alucard. Big set at 1.6 and little 1.5 and zen io read head 768.
[Xperia Z4/Z3+ Android Development] Fauzi alaik:
Just like it because the battery friendly, but thanks for the information

Anyone here using audiomod like DIVA? Its for kitakami device but when install it my mic doesn't work and volume rocker like broken always set high after a few minute reboot

I like the sound, but cant use it normally
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
write him and/or send him the audio conf files,

perhaps he can have a look and fix it :)
[Xperia Z4/Z3+ Android Development] fromhungarytolnacounty:
How can i allow big cores?
[Xperia Z4/Z3+ Android Development] LMcR92:
https://en.m.wikipedia.org/wiki/ARM_big.LITTLE

Big core only online when needed. A57 cores are monsters on battery and heat.
[Xperia Z4/Z3+ Android Development] fromhungarytolnacounty:
Ok, thank you.
[Xperia Z4/Z3+ Android Development] Fauzi alaik:
Ok have send it, hope he can fix it
[Xperia Z4/Z3+ Android Development] LMcR92:
Is it possible to make a cm based kernel? To test in conjunction with the new build please?
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
Sorry, can't do that right now,

it would involve analyzing and testing CM13 and seeing if there are any issues,

what patches are involved in the kernel source/stack,

than going through the existing kernel source and partially applying and compile- & boot-testing whether all works.

Currently I need to limit exposure to Android and everything else that is not in relation to the scientific topic I'm working on to a minimum,

(that's just how my mind works)

otherwise I might start dreaming and thinking [with partially thought revolving almost exclusionary] about Android + Kernel things (which I already did in the last 1.5 weeks :eek:),

so - short answer:

sorry, not at the moment

Thanks for understanding
[Xperia Z4/Z3+ Android Development] LMcR92:
No problem, I understand :highfive:

PS. I got a bit confused as I thought you had aosp/cm kernels on the z5 but I just seen it the wrong way.
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
Introducing SunKernel , codename Corona

Download, AndroidFileHost :

253 Kernel

https://www.androidfilehost.com/?w=files&flid=108598 SunKernel_for_Z4_Z3Plus 253_corona_III.1_5_2

Notes

- ALL functions (well, most) have been tested and should work reliably (including FM Radio app, which still acts up from time to time)

- The Kernel is built on the following premise of having a slim Base with which only the relevant (needed & desired) areas are updated, others are deliberately left alone

- [e.g. not ALL Hotplug mechanisms are merged which cannot be used or NOT needed to avoid cluttering the source or even binary from any unwanted effects]

Power efficiency Tests

- Downclock the max GPU frequency to 390 MHz [this should be NO Problem for e.g. MX Player Pro with HW and HW+ acceleration for even 1080p videos (tested)]

- Downclock the max CPU frequencies for BIG to 1.5 GHz, little 1.3 GHz

- Darkness/SmartMax governor for little CPUs, SmartMax for big CPUs

- More aggressive Task packing for HMP Scheduling (this needs in-depth knowledge and LOTS of tests)

- ...

Attention

- This kernel is in

TESTING

state since power efficient WQ, quickwakeup, LPM improvements, NVIDIA relax improvements, KTM/BCL interface, CAF changes and some more got merged

- The goal is to IMPROVE STABILITY and RELIABILITY but it needs more TESTING to confirm this intention

- issues CANNOT be ruled out - caveat emptor !

- This is reason enough to Backup your data, have another Kernel release on your phone's Internal or External storage ready in case of (potential) trouble

Kudos

to [MENTION=5627933]androidexpert35[/MENTION] , [MENTION=6791680]_LLJY[/MENTION] , the BETA Testing team, [MENTION=4798704]RyTekk[/MENTION] , [MENTION=5169444]AndroPlus[/MENTION]

Sauce

https://github.com/zachariasmaladro...-Kernel_Eclipse_32.2.A.0.253_corona_III.1_5_2
[Xperia Z4/Z3+ Android Development] fromhungarytolnacounty:
This kernel with skynet project is INSANE! Btw faux sound control still doesnt working properly. Playing stops on higher volume.
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
So you prefer to have fauxsound disabled for the Z4/Z3+ ? Would it be better ?

Cause I'm currently not in the position to fix it (priorities)
[Xperia Z4/Z3+ Android Development] fromhungarytolnacounty:
What i want is just louder headset. (MDR NC31)
[Xperia Z4/Z3+ Android Development] Fauzi alaik:
use kernel audiutor, working for me, but sometime need set it again after reboot
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
Can I get a consensus please ?

Comments from other users in the following days ?

FauxSound:

YAY (yes, in) or NAY (no, out) ? :confused:

Kernel with FauxSound has been uploaded WITHOUT FauxSound (https://www.androidfilehost.com/?w=files&flid=108598),

I will NOT build BOTH variants in the future,

so I await an answer ;)
[Xperia Z4/Z3+ Android Development] Fauzi alaik:
no problem i'm not using it, satisfied with this phone default volume and mdr-nc31:good:
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
it's the same for me (but using FauxSound), I need to basically set it after every reboot or when changing headsets (disconnecting, and connecting again)

so sound at highest volume works for you ?

I don't clearly understand what the reports mean that either the sound doesn't work on highest volume,

or that the sound changes from headphone -> speakers,

this more sounds like a ROM issue.

Anyone who faces this is using automatic headphone optimization ?

okay :)

I'm asking because

without FauxSound

(reducing the max AMP) there's some kind of white noise with almost all music I listen to (with in-ear headphones),

when using bigger headphones (e.g. Sony MDR-1a) it's not there or cannot be heard

so I definitely need FauxSound to not get irritated ;)
[Xperia Z4/Z3+ Android Development] fromhungarytolnacounty:
please watch it.

As you see when I give more volume, the playing suddenly stops and i can not start again, first i have to decrease the volume.
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
Thanks (all thanks used up for today),

does it also happen if you

lower

(e.g. -5)

Digital Output Gain Controls ?

Does this also happen with other players ?

I'm using PowerAmp or Sony's Music app and never observed that,

it's still weird behavior and Kernel Space should never break userspace :confused:
[Xperia Z4/Z3+ Android Development] fromhungarytolnacounty:
Yes it is the same every other players, but is not happening on lower values just when i increase in kernel auditor or fauxsoundcontrol. Maybe becouse the nagasaki rom, I dont know.
[Xperia Z4/Z3+ Android Development] nosiobadx:
There's a bug on latest version Corona, when I try to enable Bluetooth, I get a bootloop.
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
update has been uploaded to the same folder on XDA that should hopefully fix it (one bluetooth "fix" reverted)
[Xperia Z4/Z3+ Android Development] nosiobadx:
Could you post the link I can't find it? Tks
[Xperia Z4/Z3+ Android Development] fromhungarytolnacounty:
Where you downloaded the latest kernel. One page backward.
[Xperia Z4/Z3+ Android Development] fromhungarytolnacounty:
My charging value is lower than was. I have fast charger, i used to get 1500-1600mA but now 1100-1200. I using 1.5.4. Please make it back.
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
you downloaded the latest updated kernel from the AFH folder ?

it has fastcharge added back :)
[Xperia Z4/Z3+ Android Development] fromhungarytolnacounty:
Im using this: Z4_Z3Plus-DSDS_Sunkernel_Permissive_v253_corona_III.1_5_4_ivy_dual.zip

Good? Do you know what are the correct values in mA?
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
1500 to 1600 mA should be good, Sony has limited it
[Xperia Z4/Z3+ Android Development] zacharias.maladroit:
Introducing SunKernel , codename Corona

Download, AndroidFileHost :

253 Kernel

https://www.androidfilehost.com/?w=files&flid=109754 SunKernel_for_Z4_Z3Plus 253_corona_III.1_8_2_bcmdhd

Notes

- ALL functions (well, most) have been tested and should work reliably (

including FM Radio app

)

-FM Radio app should work reliably now, the wakelock toggles made it stop working randomly (when activated ?!) + also to Kernel panic once activated

-In-built WiFi Module is

EXPERIMENTAL for suzuran [Z5 Compact] (need feedback)

- The Kernel is built on the following premise of having a slim Base with which only the relevant (needed & desired) areas are updated, others are deliberately left alone

- [e.g. not ALL Hotplug mechanisms are merged which cannot be used or NOT needed to avoid cluttering the source or even binary from any unwanted effects]

Power efficiency Tests

- Downclock the max GPU frequency to 390 MHz [this should be NO Problem for e.g. MX Player Pro with HW and HW+ acceleration for even 1080p videos (tested)]

- Downclock the max CPU frequencies for BIG to 1.5 GHz, little 1.3 GHz

- Darkness/SmartMax governor for little CPUs, SmartMax for big CPUs

- More aggressive Task packing for HMP Scheduling (this needs in-depth knowledge and LOTS of tests)

- In case your phone uses LOTS of Background tasks, try to use conservative governor for BOTH big and little cores, this will make your phone a bit less smooth but battery consumption goes down

- ...

Attention

- This kernel is in

TESTING

state since power efficient WQ, quickwakeup, LPM improvements, NVIDIA relax improvements, KTM/BCL interface, the WiFi driver is built-in, CPUQUIET, CAF changes and some more got merged

- The goal is to IMPROVE STABILITY and RELIABILITY and also

CUT Battery consumption

but it needs more TESTING to confirm this intention

- issues CANNOT be ruled out - caveat emptor !

- This is reason enough to Backup your data, have another Kernel release on your phone's Internal or External storage ready in case of (potential) trouble

Kudos

to [MENTION=5627933]androidexpert35[/MENTION] , [MENTION=6791680]_LLJY[/MENTION] , the BETA Testing team, [MENTION=4798704]RyTekk[/MENTION] , [MENTION=5169444]AndroPlus[/MENTION] , Myself5,

Sauce

https://github.com/zachariasmaladro..._Eclipse_32.2.A.0.253_corona_III.1_8_2_bcmdhd
[Xperia Z4/Z3+ Android Development] _LLJY:
You could add the commit that [MENTION=4798704]RyTekk[/MENTION] added to his kernel to increase the limit, no harm in adding it.
[Xperia Z4/Z3+ Android Development] fromhungarytolnacounty:
Thats would be great, if not harm our battery.