[KERNEL][AOSP][AnyKernel][LOS-15.1+EAS] Gamma Kernel for [All Lineage Variants]

Search This thread

Top Liked Posts

  • There are no posts matching your filters.
  • 45

    Hey guys, I have started a custom Kernel based on LineageOS sources with 98% CAF. So I would like to share my own performance and usability improvements with minimal feature and enhancements on top. The intention is to have a minimal light-weight kernel that is very fine tuned for the device.


    • Minimal Kernel with a stripped defconfig base to be more streamlined and have less memory footprint
    • User space display color calibration (KCAL) with screen calibrated against iPhone 8 Plus, also helps reducing screen retention
    • Schedutil governor making use of EAS features with updates from Linux 4.4 and 4.12
    • Up to date with LineageOS sources for maximum compatibility and security bugfixes
    • Memory and cache subsystem optimizations, you will feel it
    • Adaptive LMK enabled by default
    • Transparent Hugepages are enabled
    • ZRAM/Swap partition is disabled by default
    • BFQ IO scheduler set by default to avoid slow-downs on task intensive scenarios
    • No overclocking was chosen to avoid unnecessary heat, optimizations were focused on other different areas
    • Kernel Samepage Sharing enabled with deferred timer by default to gain some memory usage optimizations, the process sleeps on regular basis and I've profiled it so that there's no battery drains due to it
    • Simple temperature controls for msm_thermals exposed
    • Compiled with GCC 6.x optimized toolchain and -O3 plus other hardware specific flags
    • Undervolted the Adreno 530 GPU voltage rail to keep things cooler
    • CAF Rebase on major portions of the Kernel has helped lower the memory footprint a lot
    • ES9218 Quad DAC automatic toggling working inside the kernel for headphone HIFI playback, please read here for details


    AnyKernel: Click Here (Or check top of the post, download tab)

    Extended Screen AnyKernel : Click Here (Maintained by @iDefalt)

    (Recommended) Stock Tasha XML Audio Mixer FIles : Click Here

    (Recommended) Stock Thermal Engine with Tweaked Values Flashable : Click Here

    (Recommended) Vulkan Adreno GPU Drivers with correct SELinux labels and permissions : Click Here



    • Changing CPU governors will greatly impact EAS and give erratic behaivour -- please check here, here and here. This is an EAS only Kernel.

    I would also like to thanks to various people who contribute tremendously such as:

    and many others! :)

    << If you like my work here is my hat, please donate! >>

    XDA:DevDB Information
    Gamma Kernel, Kernel for the LG V20

    Source Code: https://github.com/oxavelar/V20-Kernel-Gamma

    Kernel Special Features:

    Version Information
    Status: Stable
    Current Stable Version: 105.0.0
    Stable Release Date: 2019-09-21

    Created 2018-05-09
    Last Updated 2019-09-21

    • 105.0.0 - Increased responsiveness by adjusting input boost and stune values. Updated the thermal mod values again, revert LA.UM.6.5.r1-11700-8x96.0 to fix green tint crashes and updated to AnyKernel3.
    • 103.0.0 - Merging LA.UM.6.5.r1-11700-8x96.0.
    • 102.0.0 - Update SDCARDFS driver. And updated the thermal mod values to account for GPU undervolt.
    • 101.0.1 - Re-enabled -O3 optimizations and increased little cores boost.
    • 101.0.0 - Compiled with Linaro GCC 8.3.
    • 99.0.0 - Experimental performance values.
    • 90.0.0 - Adding dynamic_stune_boost_ms as part of input boost schedtune.
    • 88.0.0 - Performance increase while phone is used.
    • 87.0.0 - Dynamic schedtune adjustments.
    • 86.0.0 - BFQ enhancements and fixing the last watchdog timer bites.
    • 85.0.0 - Merging LA.UM.6.5.r1-10900-8x96.0 with stability fixes and no green-screen crashes. Tweaking further the input boost frequencies, and enabling IO wait boost on big.LITTLE cores. More BFQ merges from upstream Kernel.
    • 84.0.0 - Back to the performance levels, after being stable for 24 hours without green screening on tag LA.UM.6.5.r1-09800-8x96.0.
    • 83.0.0 - Revert a merge which I believe be the culprit of the kernel panics. Tag is now based on LA.UM.6.5.r1-09800-8x96.0.
    • 82.0.0 - Synced wireless drivers, as I think this was causing kernel panics.
    • 80.0.0 - Merge LA.UM.6.5.r1-10600-8x96.0, fixing infrared and updating AnyKernel.
    • 78.0.0 - Align memlat with gpubw frequency tables to prevent jerking. Backporting a few of BFQ Linux 5.0 mainline changes and enhancements into Linux 3.14.
    • 77.0.0 - Further tweak schedtune values and dynamic boosting.
    • 76.0.0 - Enable schedtune 3.0 boosting, finer Kernel CPU boosting, and disabling user-space perfd.
    • 74.0.0 - Extracting more performance by tweaking BCL and memory bandwidth scaling again.
    • 73.0.0 - Optimized BFQ a tad bit, and some power saving features on the memory bandwidth scaling ramp values on idle.
    • 72.0.0 - Updated BFQ-v8r12 for 3.14 and some UFS clock scaling tweaks for the IO subsystem.
    • 71.0.0 - iowait_boost_enable save and restore working. Keeping this enabled for MSM8996 EAS as well as keep allow_attach just like Wahoo.
    • 70.0.0 - Add debug.gralloc.gfx_ubwc_disable=0, as well as reverting to default OpenGL renderer due to whatsapp camera glithces and other misc glitches depending on GPU driver.
    • 68.0.0 - Adjusting allocstall_threshold.
    • 67.0.0 - Updated AnyKernel files and fixed a regression caused by down_thres that was there for a lot of builds.
    • 66.0.0 - Enabling Skia OpenGL rendering by default. Also please update the "(Recommended) Stock Thermal Engine with Tweaked Values Flashable" file, updated some timer values to keep the smoothness consistency overall with this Kernel version better with these thermal and timer values.
    • 65.0.0 - Relaxing memlat to see how much battery improvements we get from this.
    • 64.0.0 - Updated the EAS timer values and the memory subsystem. Re-increased the freq mitigation freq back again to 1.3 GHz on big cluster for less jank.
    • 63.0.0 - Carved out the memory map back of some ADSP devices and modem back to what LGE is using, let's see if this fixes the sporadic Kernel panics on H990DS.
    • 62.0.0 - Further tweaked our GPU Adreno drivers setprop values on boot.
    • 60.0.0 - Overhauled the charging code by removing a lot of factory junk and taking some pieces from Alice. Tweaked a tad bit the the memlat governor values again.
    • 59.0.0 - Changes in MTP handling that came from LGE to see if it helps the Kernel panics seen with MTP file transfers. (Tired to see if the panel can be bumped to 90 Hz refresh rate but decided to not include as screen seems to not be responding after trying it for a while...).
    • 58.0.0 - Shaved off 4 MiB from unused msm8996pro-*.dtsi files.
    • 57.0.0 - Better charging mitigation. Updated to CONFIG_LGE_PM_CHARGING_SCENARIO_V18.
    • 56.0.0 - Charging detection logic clean-up based on CAF and less of LGE's.
    • 55.0.0 - Merged the charger controller scenarios code with Oreo.
    • 54.0.0 - MDSS display cleanup and memlat tweaks. Should feel snappier. Merged a few USB Type-C code portions from the Oreo source, hopeful fixed h918 static on boot as well with my experiments.
    • 53.0.0 - Charger logic detection was taking longer sometimes, fixed this. And removed some extra dtsi junk that helped shave 300 KiB of Kernel image size.
    • 52.0.0 - Backported a few things from newer schedutil. And fixed h910 static on boot I had introduced due to my own experiments.
    • 51.0.0 - Converged to only two panel files, "dsi-panel-sw49407-dsc-qhd-cmd.dtsi" and "dsi-panel-sw49407-dsc-qhd-cmd-global.dtsi", experimental. Fixed on mem subsystem tweaks not being honored due to me starting perfd earlier than expected by mistake.
    • 50.0.0 - Converged on single "dsi-panel-sw49407-dsc-qhd-cmd.dtsi" file. Added lge,skip-auto-mute in the audio *.dtsi. Increased the panel qcom,switch-freq-khz to 800 based on latest Oreo sources as well.
    • 49.0.0 - LGE's Panel & MDSS extra clean-up.
    • 47.0.0 - Re-adjusted the thermal and tasha files, updated the lpm cpuidle and memory subsystem parameters.
    • 46.0.0 - Updated memory sybsystem parameters, and re-ajdusted thermal and tasha files.
    • 45.0.0 - LA.UM.6.5.r1-09800-8x96.0 merge and ramdisk module debugging disable fixes.
    • 44.0.0 - More MSM ISP CAF merges that keep LGE compatibility intact.
    • 43.0.0 - firmware_class: make firmware caching disabled by default. Since NETLINK wakelocks are disabled in our Kernel keeping this disabled makes the most sense.
    • 42.0.0 - Re-did the BCL freq mitigation to override Elsa variant for now, reverted the anx7688 firmware and updated the screen calibration further.
    • 40.0.0 - Re-did the BCL voltage and freq mitigation changes to make the phone usable when battery levels drop and prevent any potential kernel panics.
    • 39.0.0 - Re-introduced MSM_PERFORMANCE and tamed a tiny bit the memory scaling subsystem to keep a better active power consumption.
    • 38.0.0 - fs: sdfat: Update to version 2.0.8 and more ARM64 related memory optimizations.
    • 37.0.0 - Display color calibration was re-adjusted using iPhone panel as reference again. It got shifted a little bit after *.dtsi merges months ago and just had noticed.
    • 36.0.0 - Major cleanup in the qpnp-smbcharger.c portion. Playing with BCL removal.
    • 35.0.0 - Keeping ULPS and LP11 both in the *.dtsi files for the Panel and tuned further with micro-benchmarks.
    • 34.0.0 - Changing compiler flags a little bit. Adding explicitly the LP64 ARM ABI, and using UPSTREAM: arm64: lib: improve copy_page to deal with 128 bytes at a time. Reverted the arm64 prefetchers during memcpy, and re-introduced the msm_thermal sysfs entries that I had take out during debug.
    • 33.0.0 - Fixed a MSM ISP Bug when taking photos from certain applications was fixed. It would sometimes crash when taking pictures from Whatsapp with the recent merges I have been trying and the bug went unnoticed by me. Fixed USB not charging under certain USB cables as well as qpnp-smbcharger.c code cleanup.
    • 32.0.0 - MSM ISP Upstream changes that improve msm-camera daemon performance. Also noticed this has improved focusing speed with the camera.
    • 31.0.0 - Performance boosts changes to memory scaling and latency had to be adjusted after using CONFIG_SCHED_AUTOGROUP to take into account.
    • 30.1.0 - Rebased now from LA.UM.6.5.r1-09300-8x96.0 CAF and CONFIG_SCHED_AUTOGROUP is being enabled.
    • 29.0.0 - BCL big freq fixes from ls997 Oreo's source as well merge on USB's ANX7688 code.
    • 28.0.0 - Stopping and restarting perfd when doing cpu tweaks to be safer on the state of EAS when changing things up. Fix for Ok google, returned LGE's VTS.
    • 27.0.0 - Removing sched while keeping schedutil, updating the BCL masks, and removing LGE's VTS. Updating GCC's Linaro 6.4 to the 2018 pre-builts.
    • 24.1.0 - Triggering enable-cpu-tweaks on events enable-low-power, property:sys.perf.profile=1 to see if it fixes gaming performance profile switching.
    • 24.0.0 - mmc: move to a SCHED_FIFO thread, power: make sync on suspend optional.
    • 23.0.0 - Disabling BCL hotplugging for voltage based while still keeping the temperature one. Added a commit to prevent writeback dirtying by multiple threads.
    • 22.0.0 - Added updating of the BCL masks during EAS schedutil changes, one suspect on limiting to 1 GHz. Investigating if low-battery power mode also could impact this in the meantime.
    • 21.0.0 - Updated the Kernel scheduler tunables.
    • 20.0.0 - Remove duplicate commit in IRQ subsystem, and letting LineageOS use the default EAS cpusets and DVR values instead. Setting saturation again after boot-complete.
    • 19.0.0 - Re-introducing CONFIG_LGE_PM_LGE_POWER_CLASS_CHARGER_SLEEP in Oreo as well as minor changes in memory subsystem scaling again.
    • 18.0.0 - Removing backlight levels override on boot -- this was a leftover from Nougat time where cache-build might have happened at boot, so I had used this to lower heat generation but it's not needed. Tweaked a little the memory subsystem scaling timer interrupts now that msm_irqbalance is enabled in recent Oreo builds.
    • 17.0.0 - Letting LOS handle msm_irqbalance now as this was enabled recently on LOS 15.1 July 12th 2018 build.
    • 16.0.0 - Started msm_irqbalance by default on boot, disabled lp11 and enabled allow mdss phy powerdown during idle screen.
    • 15.0.0 - Smoother memlat ramp and tuned the schedTune DVR cpusets a bit for better performance overall.
    • 14.0.0 - Fix for touch not working when the phone boots connected to charger, more deep sleep enhancements and addition to H990 and H990DS to the builds.
    • 13.0.0 - Update to Oreo TouchScreen firmware and more MDSS PLL merge fixes that help deep sleep.
    • 12.0.0 - Missing MDSS Oreo merges are now in place.
    • 11.0.0 - Added IPA_WS as a default in the wakelock blocker, as well as enabling CONFIG_PM_SLEEP which if missing would in turn cause some ueventd wakeups.
    • 10.0.0 - Fixed video recording, disabled CONFIG_RMNET_DATA_DEBUG_PKT. Full fix for USB OTG and added missing slimport drivers. Tweaked the random wakeup values, added some extra cpusets based on Marlin's android-cts-8.0_r8/init.common.rc and fixed some BFQ IO possible hang.
    • 8.2.0 - Removed LGE's battery manager alarms.
    • 8.1.0 - Fixed potential wireless packet loss, reverted the potential video recording fix from previous build.
    • 8.0.0 - Further tweaked the wlan_rx_wake wakelock, added a potential video recording fix identified, migrated the audio and thermal workers to power efficient queues, and added an arm64 prefetching optimization for memcpy (the last 3 changes got into LineageOS as well).
    • 7.0.0 - Better deep sleep enhancements with the charger infrastructure borrowed from the V30 Kernel Oreo sources.
    • 6.0.0 - Full fix for 6a00000.ssusb wakelocks while keeping fast charging enabled.
    • 4.1.0 - Tuned further the wakelocks to avoid any wireless packet loss. As well as adding [timerfd] into the block list.
    • 3.0.0 - Added boeffla_wl_blocker to tame NETLINK wakelock, this wakelock is caused by IPC between the wireless driver in the Kernel and Android. This was the reason why when on wireless the battery would drain more compared than radio.
    • 2.0.0 - Rolled back the OTG fixes so that the phone deep sleeps well, and patched the "6a00000.ssusb" wakelock by reverting a few files. Enabled a few more battery savings from EAS that should help battery.
    • 1.0.0 - Synced the NFC driver with Lineage, OTG fixes by @x86cpu. Adjusted the DAC impedance thresholds per LG's Oreo Kernel, as well as disabling store mode and factory cable detection on newer Oreo LG's PM stack.
    • 0.9.99 - Initial version, with KCAL, GPU Undervolting, EAS schedutil, memory subsystem tweaks, and so far working and booting LineageOS 15.1 with better input frequency values due to lack of perfd. Re-introduced the Virtual Thermal Sensor (VTS) for even better thermal management when using the LG's stock thermal flashable.
    Gamma Kernel Second Screen Release

    Finally, the moment you've all been waiting for. Gamma Kernel Second Screen is released! :D This post will serve as the link you can give to people who request second-screen versions of Gamma, to avoid clogging unrelated threads.
    (You should search through the thread for more releases as they happen)
    Link to this post: https://forum.xda-developers.com/showpost.php?p=77606639&postcount=364
    - Second Screen Support
    - Everything that Gamma Kernel has
    - Built from Omar-Avelar's V20-Kernel-Gamma ('gamma-integration' branch) Github source
    - Gamma Kernel by Omar-Avelar
    - Easier-to-use (for someone like me anyway) build system by Phoenix591
    Always tested on these ROMs before a new release:
    - Latest UNOFFICIAL LineageOS 15.1 second-screen version by x86cpu
    - Latest UNOFFICIAL Resurrection Remix second-screen by Blaises
    Flashing process:
    It's the same as any other kernel.
    1. Make sure your TWRP is up-to-date
    2. Do a TWRP backup (I do everything except a full system image because that's like 50GB in my case)
    3. (If flashing a ROM, clean or dirty) Flash your ROM first, then the kernel
    4. (If not flashing a ROM and you just want this over your existing ROMs kernel) Flash the kernel
    5. For good measure, wipe caches/dalvik
    6. Reboot to system from TWRP
    7. Enjoy!
    Need to knows:
    - Second-screen builds are based on the same source as non-SS builds, meaning they come after the release of a single-screen (non-SS) build
    - Built on an Ubuntu Budgie OS virtual machine from my personal PC
    - I am not responsible for any damage done to your device. By flashing my builds, you accept this risk. If in doubt, back it up.
    - I test these builds personally on my H990DS before releasing them. If it doesn't work, it won't be released.
    Personal Thanks & Recommendations:
    @Omar-Avelar (of course!) for Gamma Kernel itself, @Phoenix591 for the easier-to-use build system and for his wealth of help via PMs, @Zacharee1 and other contributors for getting the second screen working for AOSP ROMs (purchase his app BoredSigns from the Play Store for second-screen customisation options and to support him!), @x86cpu and other contributors for the unofficial LineageOS for our devices, @Blaises and other contributors for the unofficial ResurrectionRemix for our devices and his contributions to second-screen, AndroidFileHost for hosting the builds (consider donating to them for the service they provide to us) and finally, to you! :highfive:
    Downloads are here
    Or here: https://androidfilehost.com/?w=files&flid=282339
    That's how it's meant to work.

    ---------- Post added at 08:21 PM ---------- Previous post was at 08:13 PM ----------

    @Omar-Avelar if you don't mind me asking, what's your plans for the second screen builds? I successfully built versions of Gamma v26 with the second screen working fine on x86cpu's second screen LineageOS builds for multiple variants, and I was just wondering because people have been asking in multiple threads for a version where second screen works (the previous ones you had linked didn't work, hence my attempts). If I've got your permission to, I'm happy to build second-screen versions of Gamma for people and their variants to use privately if all you want to focus on is Gamma itself, but if you plan to integrate second-screen builds automatically into your build environment, or even into the one Gamma version somehow, I wouldn't want to intrude so here I am asking. I'm happy to PM you about it if you'd like me to but it's 5am where I am so that'd be later today when I wake :)

    Go on and release the second-screen builds based on Gamma, thanks for helping ;)
    Gamma Kernel Second Screen v30 Downloads Removed

    I've removed the previous builds from download due to the issues people are having with the fingerprint reader and touchscreen. I built the previous set after seeing that Omar had updated his Github source between then and my initial releases, but he also updated today. It's possible the previous builds were missing things, changes or had issues he later fixed.
    From now onwards, after Gamma V30 is up for download, I'll build second-screen Gamma after the version of non-SS Gamma it's based on has been put up for download by Omar, which should ensure they're based on the same version he has finished working on.
    This will mean, for example, single-screen Gamma v30 will be available for download before second-screen Gamma v30, but will also ensure if there's any issues (since they'll be coming from the exact same source) they should happen for everyone. Apologies, I probably should've done it this way from the start.
    I'd tested the v30 build by dirty-flashing over my initial release, and the fingerprint sensor and touchscreen had both worked fine in both instances, but after reports of issues, this wasn't the case with a TWRP backup, and clean flash of both the ROM and v30 kernel. I again updated my source from Omar's changes today, re-built and tried again but the issues were still there.
    You should revert to my initial release builds dated "gamma-kernel-SS-2018-09-13-variant.zip" until Omar releases the next non-SS Gamma version, which will mark the start of the new release schedule I'll follow. From there, things should be smoother. I've also updated my original Gamma second-screen release post to reflect this.