[KERNEL][E5823/E5803] Zach's Kernel Playground for Z5C, WIP (work in progress)

Search This thread


Aug 6, 2016
Logos_I.1_5_3 is up !

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


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


Flashed this kernel, after enter settings>Wifi... phone restart....
Rom:M-Rom 2.6


Senior Member
Logos_I.1_5_3 is up !

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


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


Does it have Undervolting?


Senior Member
May 15, 2012
In one of his last posts he said, it works for some other rom's, and I thought "try it" and I tried it and now we all know, it's not working.
That's all... ;)
That's okay. He was talking about MROM and stock-based ROMs - the differences between stock and AOSP-based ROMs, however, is too big, this is why we don't often have let's say the Sony Camera on LOS. :)


Recognized Developer
Since I've been getting requests lately due to Google's updated Google Drive policy - here's the updated share link for the Z5 Compact kernels

Z5 compact (suzuran) [+/- single SIM | DSDS - specific versions mentioned]:

Kernels ONLY available:

Z5C various kernels (stock ROM ? | different Android versions)

so for whatever reason there are only kernels available for the Z5 compact what I could reconstruct from the google drive so far (I don't have any built kernels or ROMs available locally anymore due to hard disk data loss)
  • Like
Reactions: trax7

Top Liked Posts

  • There are no posts matching your filters.
  • 18
    September 2021 update:

    Since I've been getting requests lately due to Google's updated Google Drive policy - here's the updated share link for the Z5 Compact kernels

    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 Z5 Compact - Stock ROM (for now only stock)

    This is an extension of the Xperia Z5/Z5 Dual "sumire" main thread over at: https://forum.xda-developers.com/xp...und-z5-wip-t3340725/post65936553#post65936553


    so the kernel is also available for the Z5 compact series

    I can't test if 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:


    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:

    Choose your device from one of the 4 folders

    Z5 + Z5 Dual: https://drive.google.com/open?id=0BykGGWB96CBQQy05VURLbzJTZlU
    Z5 Compact: https://drive.google.com/open?id=0BykGGWB96CBQVE0tb2dieTZMXzg
    Z5 Prem + Z5 Prem Dual: https://drive.google.com/open?id=0BykGGWB96CBQaVZTdnF5QnVTMU0
    Z4/Z3+ + Z4/Z3+ Dual: https://drive.google.com/open?id=0BykGGWB96CBQa2xBdHR5TzlrNUE

    At the upper right, click on "List View"

    At the top of the table, there are 3 labels (name, owner, [last] modified, File size)

    click on "Last modified", the newest Kernels should be shown either at the top, or at the bottom

    Download the latest Kernel


    Profit !

    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)

    New Nougat Kernel 2.33 [Z5 compact in-built WiFi preview]

    [New "clean", "untainted" Kernel base solely based on Sony's source]

    https://drive.google.com/open?id=0BykGGWB96CBQaVNmbzRjaktMZTQ Z5Comp_SK_Enf_vN_2.33_Nova_I.1_5_2_suzuran_pre.zip


    • NO compromises - thus some things might NOT be added, some things might be broken (!)
    • booting into TWRP via button combo is currently BROKEN (TWRP crashes / kernel panics)
    • use an older kernel, keep the USB-cable attached,
      fastboot boot boot.img
      , push VOL UP once the LED changes color, do stuff in TWRP, then reboot
    • *
    • NO - MHL is NOT built into the kernel - NOT possible with Sony's Stock ROM (works fine on Lineage, RR, etc. though)
    • NO - RCU-boosting [memory leak, priority inversion fix] is NOT possible due to kernel NOT booting (detto on Lineage, RR)
    • NO FauxSound [caused way too much trouble with sound so far]
    • NO KCAL [base stability testing]
    • NO powerefficient workqueues [yet, base stability & functionality testing]
    • NO relaxed power consumption changes [is there even improvement with it ? - later]
    • *
    • Uses 6.2 Linaro toolchain
    • conservative & code correctness related optimizations
    • WiFi is built INTO the kernel for sumire (and will be for: satsuki, ivy), suzuran [Z5 compact needs a different driver]
    • 2.33 uses an improved WiFi driver
    • ion fixes
    • toned down logging (for dmesg) significantly
    • disabled quite a few logging sources - should be faster & less cluttering
    • pushed down idle load, less power consumption compared to "stock"
    • TONS of sound-related improvements (add ALAC/APE/VORBIS support, cut latency, fixed 24bit playback [may need a few more additional changes], ...) - quality should be MUCH better as well
    • lz4 compression fixes
    • enabled lz4 compression for zram
    • Fixed issue with "Unhandled level 2 translation fault"
    • writeback optimizations
    • TONS of mmc related fixes and speed improvements (when disabling CRC/checksumming - up to 70+% performance improvement, base should be around 40+% compared to "stock")
    • wakelock blocker
    • ZZMoove, elementalX v2, alucard governors
    • GPU underclocked to 27 MHz in idle, ~ 180-190MHz in most cases - cooler & less power consumption [downclock to ~ 300 or 390 MHz for more savings under load if needed]
    • several GPU governor related fixes
    • MAIN GPU governor is (msm_)adreno_tz - so if you change it - YOU ARE ON YOUR OWN
    • WiFi driver: attempts to cut down power consumption [evaluation]
    • camera: QUICKER , should be faster ready & more pictures can be taken in the same time compared to "stock"
    • quicker resume time (rushed wakeup from sleep of the device)
    • KSM is OFF by default, enable it if needed - this will save ~ 10-50 MB of RAM (or more) and cut down fragmentation a bit at the cost of battery
    • NOP / NULL cpuidle driver - use lpm cpuidle provided functionality
    • CPUIDLE: a few fixes
    • ANT/BT/FM: built INTO the kernel
    • other stuff I forgot

    Due to Sony's Stock ROM's nature - NOT ALL and the latest security changes are possible,


    • breaks sound quality
    • breaks Stock Music app [reboots]
    • breaks stability in general
    • breaks other functionality
    • breaks booting in general


    • booting into TWRP via button combo is currently BROKEN (TWRP crashes / kernel panics)
    • use an older kernel, keep the USB-cable attached,
      fastboot boot boot.img
      , push VOL UP once the LED changes color, do stuff in TWRP, then reboot


    • NO ETAs
    • NO comparisons with other stuff disguised under the theme of "feedback", etc. [aka "fanboy-ism" and similar]
    • NO wishing for exotic governors, schedulers, etc. - been there - done that, it doesn't work well
    • NO compromises
    • NO repeated requests, questions, etc. TO ME
    • NO direct PMs related to things that you could find via Google Searches, Forum searches or questions posted HERE or in the Q&A Subforum
    • *
    • NO other weird stuff - this will prolong release, changes, etc. by +1-2 weeks for each demand

    You have been warned !

    Feedback needed : [for Z5 compact]

    • does it boot ?
    • does WiFi work ?
    • how is the WiFi idle drain/power consumption during idle or usage - compared to Stock Kernel ?
    Please test:

    Source is at:


    For best measure - combine it with
    Wakelock Detector, Greenify, (+/- Amplify), AppOpsXposed (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 (Wifi Scan, "Location" is one possible drainer; note that there are 2 Location options)

    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 (but you CAN NOT greenify Google Play Store, otherwise you'll miss out on features, which kind of defeats the purpose; luckily you can disable the "Keep Awake" functionality via App Ops Xposed :D )

    Power Nap for XPosed is similar to Greenify, but can serve as an additional safety net to catch wakelocks that you forgot (add Greenify and Amplify to the apps, that are allowed; otherwise you'll miss out on their function)

    (will add more later if I forgot anything)

    Features said:
    • @AndroPlus for build-scripts, kernel patches
    • @Tommy-Geenexus for kernel patches, fixes
    • pstore
    • LPM (low power mode, battery efficiency)
    • fix high load average (lower battery consumption)
    • microSD, internal SD reliability improvements
    • cpuidle improvements (battery efficiency)
    • fix page thrashing in case of low memory situation (when you disable zram)
    • vmalloc improvements (less memory fragmentation, better reliability of camera, wifi, etc. drivers with long runtime)
    • FauxSound
    • KCAL
    • WLAN: disable memdesc and ramdumps (thanks to @Tommy-Geenexus )
    • notification LED changes to green+blue (cyan), when battery is really full (thanks to @Tommy-Geenexus )
    • Powersuspend, QuickWakeup, Power Efficient Workqueues,
    • improved vibrator, faster/more reliable interactivity
    • bluetooth hidp, fix disconnect on idle timeout
    • a few general stability fixes & reliability improvements
    • added wakelock switches (only use, if you observe high drain with specific functions; might cause instabilities or higher battery drain !)
    • big.LITTLE optimization flags; aggressive compiler optimization flags
    • disabled KSM, it's a battery drainer and magically gets enabled by Sony's ROM so remove it
    • added BFQ i/o scheduler (now YOU show me where it's smoother ! :) )
    • improved noop i/o scheduler - now it's more bare, previously it was similar to simple i/o scheduler - now it should be optimum for bare metal SSD/microSD access
    • GPU default set to 180 MHz
    • cpu governors: added ZZMoove, elementalX
    • added vibrator intensity switch support
    • added a bunch touchpad (screen) and fingerprint scanner fixes & improvements
    • support for Sumire DSDS (dual sim) (testing, used single SIM ramdisk)
    • kudos to all devs working on android, whether at Linux Foundation (Linux Kernel), Android (Google), Codeaurora, XDA or elsewhere - YOU ROCK !
    • this one looks to be more battery friendly
    • WIP branch


    Changelog said:
    185_I.1_2_4 has an totally new kernel base.
    This is an entirely new base an compatible to 32.1.A.1.185+ only,
    lots of experience with AOSP and CM-based kernels meanwhile has been collected and was applied to the creation of this release.
    For this kernel the mottos are:
    • less is more
    • never change a running system
    • fixing bugs causes new bugs

    So you'll get an idea where the direction is going ...



    or attached here in the thread

    Enjoy :)
    Introducing SunKernel , codename Corona

    Download, AndroidFileHost :

    253 Kernel

    SunKernel_for_Z5Compact 253_corona_III.1_9_4_6

    [leads to Nirvana, AFH is currently too slow]

    Changes: said:
    - new upstream (Sony) kernel base, should be more reliable and less error-prone
    - slim Kernel base (thanks to @AndroPlus for letting us know that it's possible :) )
    - frandom + frandom fixes + DoS TCP protection
    - graphics page allocator (kgsl: page cache allocator) for more smoother UI experience and more FPS
    - CAF merge of latest updates (beginning of August)
    - tons of sound improvements (make sure to enable Headset High Performance mode in Kernel Adiutor Mod)
    - LPM (low power mode improvements),
    - nvidia power efficiency ("blob") commit
    - microSD improvements
    - reduced load average (less battery consumption)
    - LED (backlight) value close to powersave during booting (less heat, less battery consumption, NO blinding in darkness);
    - KCAL support
    - cpufreq governors: zzmoove, elementalX, darkness, smartmax, alucard (and all the other "default" ones: conservative, ondemand, interactive, performance, etc.)
    - wakelock toggles, less power consumption for modem usage
    - reduced RAM power usage
    - powerefficient workqueues (up to 25% less battery consumption for the SoC)
    - GPU clocks down to 27 MHz when idle
    - some more workqueue improvements, kthread improvements
    - faux sound control
    - BCL <-- --> KTM (thermal) interface [less issues with throttling and less stability issues with hotplug; port from AOSP/1.3.3 kernel]
    - powersuspend driver (smartmax has support for it, so needed to be added to make it work efficiently),
    - 2 bluetooth fixes
    - touchpad + fingerprint stability fixes & improvements
    - 2 additional audio commits I missed out during first collection (probably even better quality during calling or with headphones that have a mic),
    - quickwakeup driver
    - some other stuff I forgot
    - ...
    - Changes since 253_corona_III.1_9_4_6
    - optional input boosting reverted (didn't restore the control to enable/disable input boost frequency control) :confused:
    - reverted IPA wakelock "fix", this might improve the occasional battery drain and stability problems
    - compiled in FM Radio driver - causes mute (silent) FM Radio driver, under investigation [goal was to improve reliability for FM]
    - restored Sony's prebuilt MHL driver (using the kernel module of the ROM), causes kernel to panic during bootup, under investigation
    - improved LZ4 algorithm
    - GPU governor fixes (thanks to @AndroPlus and the upstream authors)
    - added State_Notifier driver + Adreno Idler (thanks for the changes (?) to @RyTekk )
    - removed Sony RIC for good (doesn't play well with custom kernels)
    - Overclock by default 1.7 GHz for Little cores, 2.0 GHz for Big cores
    - potentially improved sound quality of the DAC (disabled Dolby DAP [HeadphoneX], DTS Eagle, Dolby DS2), there's no ROM and/or userspace support thus the effect might be better and/or worse [feedback needed]


    • - 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 (GUI) might be laggy, under investigation how to mitigate this, please consider that this might save A LOT of battery (lower clocked GPU)
    • - YOU HAVE THE CONTROL: if the GUI is too laggy, disable Adreno-Idler, State_Notifier (Adreno_Idler is the only user) and disable GENTLE_FAIR_SLEEPERS, this should improve it A LOT
    • - 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)]
    • - default idle frequency for the GPU is at 27 MHz which might cause trouble with STAMINA MODE, might cause lagginess (currently under investigation), this might be a bit mitigated by using Adreno Idler (currently included)
    • - testing Downclock the max CPU frequencies for BIG to 1.5 GHz, little 1.3 GHz (depending on your usage case it might improve battery time or make it worse and take longer for things to complete)
    • - More aggressive Task packing for HMP Scheduling (this needs in-depth knowledge and LOTS of tests)
    • - ...


    • - 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


    to all devs who are working on Xperia devices and of course all of the other devs on XDA, 4pda, etc. etc.


    "Facula" (Sun-)kernel Release [2_11]

    Explanation of the name:


    (lol - everytime I read the name I think "Dracula" :silly: )


    Facula Kernel for LineageOS 14.1 for Suzuran (Xperia Z5 Compact):

    https://drive.google.com/open?id=0BykGGWB96CBQYnc1UkQ1Q29mMGs Z5Comp_SK_ENF_vN_RR_Facula_I.2_11_suzuran.zip

    changes include

    • based on the new patched up LineageOS Kernel base ( kudos to @Olivier )
    • bleeding edge Linaro 7.2.1 Toolchain
    • enhanced optimizations
    • bleeding edge binder 4.9
    • bleeding edge F2FS (currently NOT built into the kernel, WIP - so do NOT attempt to convert any partitions to it :p )
    • vibration enhancements to make it work more reliably
    • BCL (battery current limit) rework
    • msm-core fixes & improvements
    • several charger fixes,
    • fix for overflow during charging fully
    • ARP spoofing protection (thanks to @jollaman999 )
    • zram fixes & improvements
    • lz4 fixes
    • camera speedups & enhancements
    • ASoC: CPE enhancements & reliability improvements, stability improvements
    • stability & reliability improvements
    • writeback: speedups
    • Fauxsound
    • exfat in-built kernel driver + fixes & speed-ups
    • load average reductions to keep CPU load low
    • a few scheduler power consumption reductions
    • fixed/improved battery state calculation (the old one could overflow once the battery was full)
    • other things I forgot to mention

    Additional changes (for 1_2_4)
    • F2FS enabled
    • mm: per-thread vma caching added (reduction of the needed cycles for expensive rbtree walk of find_vma() by up to 250%, hit-rate improvement of 25-9431% [ebizzy] [cached] )
    • re-enabled msm-core polling, decreased the polling rate

    More changes (for 1_2_16)
    • added dynamic wakelock blocker from @PDesire (kudos !)
    • added a few serial fixes
    • do hotplug with SCHED_FIFO priority to make hotplugging more reliable under heavy load (re-added, seemed to have worked well in NovaCore)
    • revamped alarm driver to make setting an alarm time (even when the device is OFF (?) (sic!)) work as expected, so that it boots up 2 minutes before [needs testing]
    • add several timer fixes
    • several WiFi driver tweaks to (potentially) reduce power consumption
    • stability fixes against WiFi driver to avoid crashes / panics
    • add state_notifier
    • add PowerSuspend [seemed to be "at fault" for better power savings (?!) :cowboy: ]
    • add Adreno Idler to cut down power consumption of GPU
    • a few fixes to the adreno_tz driver
    • rework of the net/bluetooth subsystem with several reliability and stability fixes
    • rework of the drivers/bluetooth subsystem with latest bluetooth driver, power savings and stability fixes [FM/GPS/BT/ANT]
    • rework of the dwc3 ( "SuperSpeed (SS) USB 3.0 Dual-Role-Device (DRD) from Synopsys" ), to increase stability, reliability and cut down CPU load during e.g. charging, potentially also increasing performance
    • fingerprint driver stability / reliability improvement
    • touchscreen stability / reliability improvement
    • clk: add fixes to allow devices with broken cluster to boot (similar to Nexus 5X, Nexus 6P)
    • raise performance of mmc a bit
    • power button: increase the debounce delay a bit to make sure that Power Button work reliably (potentially fixed an screen stay black issue on Z5 compact)
    • raised mitigation frequency to 960 MHz, disabling hotplugging of BIG cluster upon BCL event [would lead to massive lagging] [eval]
    • enhanced optimized compiler flags
    • revert to 6.3.1 Linaro Toolchain (7.2.1 would throw internal compiler error), yep, I tend to stress things to the max and track down errors :D
    • other changes I forgot

    More changes (for 2_11)
    • back to 7.2.1 toolchain with flags to proved to work fine on M4 Aqua
    • vidc fixes & improvements
    • more fixes against power button ghost presses / not reacting
    • mm (memory management) subsystem rework, raise alloc (vmalloc) success rate,
    • mm: slub tweaks, never let shrink fail
    • mm: tmpfs fixes
    • mm: migration: improve heuristic
    • mm: other improvements & changes
    • readahead: tweaks
    • zpool, zbug fixes & improvements (important deadlock fix) [currently not used since the kernels utilizes z3fold]
    • cpuidle / lpm: rework & overhaul
    • fix & add "freeze" state
    • cpuidle: enable it in suspend to allow lowest power saving mode
    • cpuboost: rework and enhancement, run it with SCHED_FIFO priority to reduce lags
    • kgsl, mdss: use kthreads, run at higher priority to ensure smoothness of UI
    • msm_serial: rework and overhaul of the serial driver to fix (potential) suspend issues, etc. [lots of ports]
    • tty: fixes & improvements
    • CFS/HMP: scheduler: switched from Sony's "custom" solution to full-blown angler (Nexus 6P) with cluster scheduling, deadline scheduling, topology support and tons of improvements [impossible on Sony Stock ROMs]
    • KCAL: add support
    • arm64: toolchain: ensure sanity while compiling the kernel in several corner cases
    • sqrt: enhanced variant for 3x faster operation
    • qpnp-charger: raise final charging duration from 30s to 100s towards 100%
    • relax call: raise power efficiency [eval]
    • ptrace: rework, several improvements & fixes
    • lib: vsprintf: fixes & improvements
    • lib: idr: fixes & improvements
    • lib: bitmap: fixes & improvements
    • lib/string, lib/memcopy: use glibc (faster) variants
    • lib/sort: tweak a bit to use 64bit variant
    • rtmutex: several fixes & improvements [impossible on Sony Stock ROMs]
    • add zen-tune & super-charge it [extreme low latency scheduling with much smaller granular period]
    • fix frequency mitigation to avoid hotness on cores & other additional changes
    • core_ctl: use an improved hotplug driver to allow for a bit more conservative un-plugging to keep the device cooler and make more sense
    • mdss: enable powercollapse on idle [might interfere with KCAL, saves lots of energy though, videoplayback is fine]
    • wcd9330: fix audio mute after several use of SSR
    • disabled various audio subsystem drivers & automatic headset detection [NOT used in non-stock ROMs]
    • added support for various HID (input) devices [mice, keyboard, etc.]
    • disable panic on watchdog bark
    • prefer to panic upon detection of data corruption
    • disable Mirrorlink [NOT useable on non-Stock ROMs]
    • remove caching on big clusters [fixes random high frequency stay on big clusters] [fixme: also for small clusters needed without breaking hotplug, booting, etc.]
    • introduce CPU voltage control
    • add overclocking support, booting up is done in stock frequencies
    • genirq, irq_work: lots of fixes & improvements [stability, reliability]
    • softirq: reduce latencies for network (+ general ?) & other cases
    • raise HZ to 1000
    • lots of fixes to drivers, kernel to make operation with 1000 Hz reliable
    • rcu: rework, fixes, improvements [fixme: add more !]
    • BFQ: add BFQ i/o scheduler
    • CFQ: add several fixes & improvements
    • ROW i/o scheduler: is default, we favor read over write in most situations
    • msm-core / thermal-core: rework and fix the un-interruptible wait issue
    • msm-core / thermal-core: reduce polling & raise hysteresis to reduce number of wakeups
    • initial support for suzuran (Z5 Compact)
    • other changes I forgot