[KERNEL] Butterfly for daisy

Search This thread

eremitein

Senior Member
May 16, 2017
1,186
1,520
Xiaomi Mi A2 Lite
=BUTTERFLY KERNEL=

Your warranty is now void!

We're not responsible for bricked devices, dead SD cards,
thermonuclear war, or you getting fired because the alarm app failed. Please
do some research if you have any concerns about features included in this ROM
before flashing it! YOU are choosing to make these modifications, and if
you point the finger at us for messing up your device, we will laugh at you



Features:
Pie base: CAF & Prima Tag by LA.UM.7.6.r1-04500-89xx.0
Oreo base: CAF & Prima Tag by LA.UM.6.6.r1-11000-89xx.0
Legacy base: not updated pure sources from MiCode github
(prima tag LA.UM.7.6.r1-05500-89xx / LA.UM.6.6.r1-11300-89xx.0)
• KCAL color control
• Vibration intensity control
• Sound gain control
• Audio codec quality improved
• exFAT Support
• NTFS support
• F2FS support
• SquahFS support
• CIFS/SMB support
• Added CPU Hotplug (default disabled)
• Set lz4 for better zram work
• Boeffla wakelock blocker
• Added defaults rules for Boeffla wakelock blocker
• Disable vendor verify and set no verity
• CRC32: disable by default & enable toogle (average 30% I/O performance profit)
• Few patches from Franco kernel (disabled a lot of debugging stuff)
• Fsync: on/off support
• Battery deep optimisation: undervolting & additional tweaks
• Added Adreno Real Idler (supported turning it on/off)
• Improved interactive governor (patch from Franco kernel)
• Improved CPU boost, default is disabled (patch from Franco kernel)
• Improved conservative governor (patch from Franco kernel)
• I/O schedulers: noop, deadline, bfq, cfq (default), sio, fiops, maple, tripndroid, zen, anxiety, sioplus, fifo, v(r)
• Added CPU governors: darkness, zzmoove, relax, impulse, electron, nonconservative, lionheart, clarity, blu_active, yankactive, intelliactive, conservativex, ondemandx, interactivex, bioshock, darknessv5, alucard, smartmax_eps, pegasusq, lionfish, hyper, despair, barry_allen, xperience, alessa, chill, ondemandplus, ironactive, culvitation, tripndroid
• Added GPU governors: guardian, balanced, msm-adreno-plus
• TCP congestion algorithms: cubic, reno, westwood (default)
• Installer include fix for Wi-Fi SELinux permission
• Kernel installer also support custom ROMs
• GCam focus fix (thanks @teftel1608 and @33bca)
• GPU: clocks table reworked (lags free, performance grew). OC max gpu freq now is 725MHz
• Added WireGuard 0.0.20190601
• Fix for goodix-fp gestures on stock (thanks to @artyom5613 & @Broomber)
• Also in the v4 installer included fix fpc-fp gestures for the customs rom
now gestures for both fingerprints is are:
* swipe2right - paste text
* others like in rom's setting
(if you not like this - change it in the /system/usr/keylayout/uinput-*.kl)
• Memory & battery life optimization due config settings for kernel
• Added a block to wakelock from wifi
• I/O optimization
• Hide unlocked bootloader state (for apps like bank clients etc)
• Patches from Franco "mido" kernel for battery life improvement
• Added gpu Adreno simple algorithm (beast!!)
• Found a reason for which the CPU could for a long time not to raise the frequency to the maximum, it's all in the file /vendor/etc/thermal-engine.conf
See samples how to improve situation
• Compiled with GCC 9.1.0, which gave an increase in performance and speed of the kernel
• Reworked undervolting, battery lives even longer
• Added voltage control
• Maximum CPU frequency is now 2.4GHz
• EUOC version has a maximum GPU frequency of 750MHz
• added support for display status for CPU Hotplug & some schedulers
• all schedulers that have display status support:
alucard, chill, clarity, cultivation, darkness, electron, impulse, intelliactive, ironactive, nightmare, relaxed, anxiety-iosched and maple-iosched
• added drivers for few USB-Ethernet adapters
• added nightmare and dancedance CPU governors
• updated version with 2.2GHz overclocking
• removed the patch for hiding the bootloader state (there are more problems than good with it)
• new settings for a smooth interface in installer (applied for GSI only)
- DT2W fix for fts_ts [default disabled] (thanks @33bca) * tested on customs and GSIs. for latest maybe need to enable "Handwave gesture" in "Phh Treble Settings" > "Doze features" * #TODO
- Installer include Magisk preserve #TODO

<< download Pie v5.5 || download Pie v4.4 >>
<< download Oreo v5.5 || download Oreo v4.4 >>

undervolted (U) lower voltage for decrease overheat. also incredible battery saving
overclocked (OC) CPU max frequency is 2.4GHz, GPU max frequency is 725MHz
extra-overclocked (E) GPU max frequency is 750MHz (if you will face with graphical glitches - don't use it!)

Installations:
Backup boot.img, /system/lib/modules, /system/usr/keylayout and /vendor/lib/modules folders, /vendor/bin/init.qcom.post_boot.sh file if you want to go back
Flash Zip file with any TWRP recovery, wipe Dalvik cache, reboot and enjoy ^_^
Notice: if you have Magisk with modules installed maybe you'll get bootloop.
If you have Magisk don't need reinstall it after kernel because installer will save Magisk #TODO
Right way: if you have Magisk and modules - deinstall all. Then flash stock boot.img, then custom kernel, then other stuff like TWRP and Magisk.
Enough just dirty flashing kernel and then Magisk if you need it. All yours Magisk modules will preserved.

Issues:
- DT2W not work for fts_ts touchscreen
- tell me if find :)




XDA:DevDB Information
Butterfly kernel for Xiaomi Mi A2 Lite "daisy"

Contributors:
eremitein
Source Code:
https://github.com/eremitein/xiaomi_kernel_msm8953_daisy_butterfly

CREDITS:
All people, who made good code for this platform


Version Information
Status: Stable/Experimental
Release Date: 2019-04-15 (UTC +0)

Created: 2019-04-07
Last Updated: 2019-08-08


.
 
Last edited:

eremitein

Senior Member
May 16, 2017
1,186
1,520
Xiaomi Mi A2 Lite
=VARIOUS POWER PROFILES=

[BATTERY DEEP BACKUP]
CPU governor: conservative
CPU max freq: 1804 MHz
GPU governor: msm-adreno-tz or guardian
Adreno idler: on
Tune Boeffla Wakelock Blocker: read this manual
CPU Hotplug: see attached screenshot
# Give ~10 minutes SOT per 1% battery while web browsing #

[NORMAL MODE]
CPU governor: ondemand / interactive
CPU max freq: set highest
GPU governor: msm-adreno-tz or balanced if lagzzs)
Adreno idler: on
CPU Hotplug: off
# Give ~8 minutes SOT per 1% battery while web browsing #

[PERFORMANCE MODE]
CPU governor: intelliactive, blue_active or nonconservative
CPU max freq: set highest
GPU governor: performance or msm-adreno-plus
Adreno idler: on
CPU boost: on
CPU boost freq: set to 1.84, 2.0 or 2.2GHz
CPU Hotplug: off
# Give ~5 minutes SOT per 1% battery while web browsing #


.
 

Attachments

  • Screenshot_20190409-161624.png
    Screenshot_20190409-161624.png
    135.5 KB · Views: 7,204
Last edited:

eremitein

Senior Member
May 16, 2017
1,186
1,520
Xiaomi Mi A2 Lite
I will not help users if they are:

- using Magisk and moreover they installed modules;
- made any kernel settings (selected exotic governors, turned on hotplug and etc.);
- using option "Disable HW overlays";
- not sure that the same problems were not on the standard kernel
- not follow installation guide

All OC versions is always have CPU 2.2GHz

if not for you, then this is maybe if:

- you SoC/voltageregulator/phone doesn't support overclocking
- your device overheated due high outside temp or high load
- you system set restrictions to overclocking


.
 
Last edited:

hendri88

Member
Feb 11, 2019
10
0
Now im using CAF kernel with stock rom i want to flash butterfly what should i do delete CAF then install it??and for magisk delete all modul ?
 

eremitein

Senior Member
May 16, 2017
1,186
1,520
Xiaomi Mi A2 Lite
Now im using CAF kernel with stock rom i want to flash butterfly what should i do delete CAF then install it??and for magisk delete all modul ?

yes, thats right

you may try dirty install but this is not a guarantee what system boot due to magisk specific

best way is remove all modules from magisk, remove magisk via flashing stock kernel and then boot to twrp and install butterfly
 

Zewyni

New member
Jul 20, 2018
1
0
May I ask if this kernel could be modified so we can overclock? How exactly do we need to go about and do the modifications to the PLL tables? It'd be great if you could help out and make a tutorial or something.
 

eremitein

Senior Member
May 16, 2017
1,186
1,520
Xiaomi Mi A2 Lite
Kernel updated (download v2)

Changelog v2:
Pie CAF & Prima updated to LA.UM.7.6.r1-04500-89xx.0

Improved interactive CPU governor (patch from Franco kernel)
Improved CPU boost and enable it (patch from Franco kernel)
Reworked conservative and nonconservative CPU governors
Reworked guardian, balanced and msm-adreno-plus GPU governors
Kernel installer now also support custom ROMs

Also have some changes in Power profiles
 
Last edited:

Eddie_53

Senior Member
Nov 16, 2013
103
19
Governador Valadares
The touch sensetivity is somehow better with this kernel but I really miss dt2w... I'll be testing it for the week, hope you can fix dt2w! Thanks for your work on our device!
 

eremitein

Senior Member
May 16, 2017
1,186
1,520
Xiaomi Mi A2 Lite

BJumperBR

Senior Member
Mar 28, 2016
98
31
I can confirm that touch sensitivity is better on this Kernel. Gcam also runs smoother!

ExFAT support doesn't seem to be working though. I've tried to read an SD Card ExFAT formatted and it didn't work (corrupt error message).
 
Last edited:

Kr47os

Senior Member
May 14, 2016
100
3
=VARIOUS POWER PROFILES=

[BATTERY DEEP BACKUP]
CPU governor: conservative
CPU max freq: 1689 MHz
GPU governor: guardian or msm-adreno-tz
Adreno idler: on
Tune Boeffla Wakelock Blocker:read this manual
CPU Hotplug: see attached screenshot
# Give 10-12 minutes SOT per 1% battery while web browsing #

[NORMAL MODE]
CPU governor: ondemand / interactive
CPU max freq: 2016 MHz
GPU governor: msm-adreno-tz or balanced if lagzzs)
Adreno idler: on
CPU Hotplug: off
# Give ~6 minutes SOT per 1% battery while web browsing #

[PERFORMANCE MODE]
CPU governor: nonconservative
CPU max freq: 2016 MHz
GPU governor: performance or msm-adreno-plus
Adreno idler: off
CPU Hotplug: off
# Give 4-5 minutes SOT per 1% battery while web browsing #


.
How to switch from one profile to another? I have kernel adiutor installed but there is no profile I the kernel section to select. Thanks to everyone answer and to the Dev for his work. Sorry for my English
 

eremitein

Senior Member
May 16, 2017
1,186
1,520
Xiaomi Mi A2 Lite
Kernel updates (see topic)

Changelog v2.99:
Added new builds:
- Oreo base CAF & Prima Tag by LA.UM.6.6.r1-11000-89xx.0
- Legacy base (not updated pure sources from MiCode github)
- Installer totally fixed for support wifi on custom roms

Oreo base is only for oreo vendors (9.6.x.0 versions)!!!

Why i built this and legacy variants?)
For compatibility. Because some people still using oreo stock or 8.1 vendor with GSI
 

eremitein

Senior Member
May 16, 2017
1,186
1,520
Xiaomi Mi A2 Lite
I can confirm that touch sensitivity is better on this Kernel. Gcam also runs smoother!

ExFAT support doesn't seem to be working though. I've tried to read an SD Card ExFAT formatted and it didn't work (corrupt error message).

for clean testing exFAT you need should be sure what ROM have support this FS

if with other kernel on your rom exfat work then, yeahh, something wrong with my kernel exfat


thanks for feedback)
 
  • Like
Reactions: hacker812c

Henki98

Senior Member
Nov 13, 2016
105
19
Realme GT 2 Pro
I am undecided whether to stay in oreo with this kernel or pie always switch to this kernel.
It is wrong to ask, instead of trying, but I don't have much time to test
No one with any feedback on the battery and stability?
(Noob question, what is it the difference of legacy kernel? )
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 34
    =BUTTERFLY KERNEL=

    Your warranty is now void!

    We're not responsible for bricked devices, dead SD cards,
    thermonuclear war, or you getting fired because the alarm app failed. Please
    do some research if you have any concerns about features included in this ROM
    before flashing it! YOU are choosing to make these modifications, and if
    you point the finger at us for messing up your device, we will laugh at you



    Features:
    Pie base: CAF & Prima Tag by LA.UM.7.6.r1-04500-89xx.0
    Oreo base: CAF & Prima Tag by LA.UM.6.6.r1-11000-89xx.0
    Legacy base: not updated pure sources from MiCode github
    (prima tag LA.UM.7.6.r1-05500-89xx / LA.UM.6.6.r1-11300-89xx.0)
    • KCAL color control
    • Vibration intensity control
    • Sound gain control
    • Audio codec quality improved
    • exFAT Support
    • NTFS support
    • F2FS support
    • SquahFS support
    • CIFS/SMB support
    • Added CPU Hotplug (default disabled)
    • Set lz4 for better zram work
    • Boeffla wakelock blocker
    • Added defaults rules for Boeffla wakelock blocker
    • Disable vendor verify and set no verity
    • CRC32: disable by default & enable toogle (average 30% I/O performance profit)
    • Few patches from Franco kernel (disabled a lot of debugging stuff)
    • Fsync: on/off support
    • Battery deep optimisation: undervolting & additional tweaks
    • Added Adreno Real Idler (supported turning it on/off)
    • Improved interactive governor (patch from Franco kernel)
    • Improved CPU boost, default is disabled (patch from Franco kernel)
    • Improved conservative governor (patch from Franco kernel)
    • I/O schedulers: noop, deadline, bfq, cfq (default), sio, fiops, maple, tripndroid, zen, anxiety, sioplus, fifo, v(r)
    • Added CPU governors: darkness, zzmoove, relax, impulse, electron, nonconservative, lionheart, clarity, blu_active, yankactive, intelliactive, conservativex, ondemandx, interactivex, bioshock, darknessv5, alucard, smartmax_eps, pegasusq, lionfish, hyper, despair, barry_allen, xperience, alessa, chill, ondemandplus, ironactive, culvitation, tripndroid
    • Added GPU governors: guardian, balanced, msm-adreno-plus
    • TCP congestion algorithms: cubic, reno, westwood (default)
    • Installer include fix for Wi-Fi SELinux permission
    • Kernel installer also support custom ROMs
    • GCam focus fix (thanks @teftel1608 and @33bca)
    • GPU: clocks table reworked (lags free, performance grew). OC max gpu freq now is 725MHz
    • Added WireGuard 0.0.20190601
    • Fix for goodix-fp gestures on stock (thanks to @artyom5613 & @Broomber)
    • Also in the v4 installer included fix fpc-fp gestures for the customs rom
    now gestures for both fingerprints is are:
    * swipe2right - paste text
    * others like in rom's setting
    (if you not like this - change it in the /system/usr/keylayout/uinput-*.kl)
    • Memory & battery life optimization due config settings for kernel
    • Added a block to wakelock from wifi
    • I/O optimization
    • Hide unlocked bootloader state (for apps like bank clients etc)
    • Patches from Franco "mido" kernel for battery life improvement
    • Added gpu Adreno simple algorithm (beast!!)
    • Found a reason for which the CPU could for a long time not to raise the frequency to the maximum, it's all in the file /vendor/etc/thermal-engine.conf
    See samples how to improve situation
    • Compiled with GCC 9.1.0, which gave an increase in performance and speed of the kernel
    • Reworked undervolting, battery lives even longer
    • Added voltage control
    • Maximum CPU frequency is now 2.4GHz
    • EUOC version has a maximum GPU frequency of 750MHz
    • added support for display status for CPU Hotplug & some schedulers
    • all schedulers that have display status support:
    alucard, chill, clarity, cultivation, darkness, electron, impulse, intelliactive, ironactive, nightmare, relaxed, anxiety-iosched and maple-iosched
    • added drivers for few USB-Ethernet adapters
    • added nightmare and dancedance CPU governors
    • updated version with 2.2GHz overclocking
    • removed the patch for hiding the bootloader state (there are more problems than good with it)
    • new settings for a smooth interface in installer (applied for GSI only)
    - DT2W fix for fts_ts [default disabled] (thanks @33bca) * tested on customs and GSIs. for latest maybe need to enable "Handwave gesture" in "Phh Treble Settings" > "Doze features" * #TODO
    - Installer include Magisk preserve #TODO

    << download Pie v5.5 || download Pie v4.4 >>
    << download Oreo v5.5 || download Oreo v4.4 >>

    undervolted (U) lower voltage for decrease overheat. also incredible battery saving
    overclocked (OC) CPU max frequency is 2.4GHz, GPU max frequency is 725MHz
    extra-overclocked (E) GPU max frequency is 750MHz (if you will face with graphical glitches - don't use it!)

    Installations:
    Backup boot.img, /system/lib/modules, /system/usr/keylayout and /vendor/lib/modules folders, /vendor/bin/init.qcom.post_boot.sh file if you want to go back
    Flash Zip file with any TWRP recovery, wipe Dalvik cache, reboot and enjoy ^_^
    Notice: if you have Magisk with modules installed maybe you'll get bootloop.
    If you have Magisk don't need reinstall it after kernel because installer will save Magisk #TODO
    Right way: if you have Magisk and modules - deinstall all. Then flash stock boot.img, then custom kernel, then other stuff like TWRP and Magisk.
    Enough just dirty flashing kernel and then Magisk if you need it. All yours Magisk modules will preserved.

    Issues:
    - DT2W not work for fts_ts touchscreen
    - tell me if find :)




    XDA:DevDB Information
    Butterfly kernel for Xiaomi Mi A2 Lite "daisy"

    Contributors:
    eremitein
    Source Code:
    https://github.com/eremitein/xiaomi_kernel_msm8953_daisy_butterfly

    CREDITS:
    All people, who made good code for this platform


    Version Information
    Status: Stable/Experimental
    Release Date: 2019-04-15 (UTC +0)

    Created: 2019-04-07
    Last Updated: 2019-08-08


    .
    11
    =VARIOUS POWER PROFILES=

    [BATTERY DEEP BACKUP]
    CPU governor: conservative
    CPU max freq: 1804 MHz
    GPU governor: msm-adreno-tz or guardian
    Adreno idler: on
    Tune Boeffla Wakelock Blocker: read this manual
    CPU Hotplug: see attached screenshot
    # Give ~10 minutes SOT per 1% battery while web browsing #

    [NORMAL MODE]
    CPU governor: ondemand / interactive
    CPU max freq: set highest
    GPU governor: msm-adreno-tz or balanced if lagzzs)
    Adreno idler: on
    CPU Hotplug: off
    # Give ~8 minutes SOT per 1% battery while web browsing #

    [PERFORMANCE MODE]
    CPU governor: intelliactive, blue_active or nonconservative
    CPU max freq: set highest
    GPU governor: performance or msm-adreno-plus
    Adreno idler: on
    CPU boost: on
    CPU boost freq: set to 1.84, 2.0 or 2.2GHz
    CPU Hotplug: off
    # Give ~5 minutes SOT per 1% battery while web browsing #


    .
    8
    Kernel updated to v4

    Normal || Normal Undervolted
    OverClocked || OverClocked & Undervolted

    Changelog for Pie legacy v4:

    • WireGuard 0.0.20190601
    • prima WiFi updated to LA.UM.7.6.r1-04800-89xx
    • fix for goodix-fp gestures on stock (thanks to @artyom5613 & [email protected])
    • also in the installer included fix fpc-fp gestures for the customs rom
    now gestures for both fingerprints is are:
    * swipe2right - paste text
    * others like in rom's settings
    (if you not like this - change it in the /system/usr/keylayout/uinput-*.kl)
    • DT2W [off by default] (now it's /proc/touchpanel/wakeup_gesture for both panels) and fixed gcam focus as in the latest commits of Offain;
    • memory optimization;
    • added a couple of governors - xperience & alessa;
    • I/O optimization;
    • battery life optimization;
    • added a block to wakelock from wifi;
    • I returned all frequencies to stock (all even builds without serious experiments, if everything is normal, I'll upload the legacy normal code to the github)

    Overclocking and undervolting changes:
    • GPU max freq now is 725MHz
    • voltage reworked for more stability for all users - slightly increased

    Bugfix: installer reworked to saving SELinux context for init file (2019.06.12)


    BEFORE INSTALL YOU MUST READ THIS and THIS


    .
    8
    Kernel updated (download v2)

    Changelog v2:
    Pie CAF & Prima updated to LA.UM.7.6.r1-04500-89xx.0

    Improved interactive CPU governor (patch from Franco kernel)
    Improved CPU boost and enable it (patch from Franco kernel)
    Reworked conservative and nonconservative CPU governors
    Reworked guardian, balanced and msm-adreno-plus GPU governors
    Kernel installer now also support custom ROMs

    Also have some changes in Power profiles
    6
    @eremitein: pie-legacy breaks fp recognition for new fingers on stock 10.0.7.0. Existing fingers work. From the moment fp recognition broke, I can not use fp for any other rom anymore.

    problems with fp in the 10.0.7.0 base

    i specially using original code from xiaomi for legacy build

    with stock kernel people reported about similar problem too

    try fix from attachment

    .