[Z00L][KERNEL]Enhancements For Increased Battery Backup

Status
Not open for further replies.

pokipokipxorn

Senior Member
Nov 22, 2016
366
194
0
Disclaimer & Notes
I bear no responsibility towards any failure or malfunction of your device, use my kernels at your own risk.
I have no time or resources for support of any kind whatsoever.
The kernels are for my own use, recompiled from original boot images of respective roms, with the objective of prolonging battery backup, not performance.
The kernel features are compiled in only, meaning not optimized at all, you must use Kernel Adiutor to set the right options to achieve desired effect, see post #2
Yes, they work with XPOSED! (marshmallow only), but xposed modules should be enabled & configured ONE-BY-ONE-then-reboot-phone to take effect.
If wireless or sim cards are not detected after enabling some xposed modules, simply restart phone, or turn on-3mins-off airplane mode, or revert your xposed module settings (gravity-smart radio in particular)

Credits & Thank you
abhishekr700 | source
Fabb2303 | source
LuK1337 | source

Z00L & variants only, meaning these kernels are for Asus Zenfone 2 Laser models
- ZE550KL
- ZD550KL
- ZE600KL

Features (added)
- cpu hotplug: autosmp
- tcp-algorithm: westwood
- kernel config.gz at /proc
- filesystem: ntfs
- charging: usb fastcharge
- selinux: set to permissive via kernel
- kernel: samepage merging, frontswap, cleancache

Features (removed)
- cpu: cpu boost
- cpu hotplug: msm performance, including touch boost
- CRC check, in favor of 30% performance boost

Work-in-progress, no ETA
- gpu idler
- more cpu/gpu governor
- i/o scheduler

DOWNLOAD
edit: download link removed, to comply with GPLv3, will reinstate download link once sources are published, no ETA though
before flashing my kernel, read disclaimer at top of this post, make a backup of your phone partitions, imei, running kernel, settings, data etc
unzip & copy to sdcard, flash via fastboot or TWRP

file names & ROMs

ROM BeanStalk-6.25-20160919-Z00L (marshmallow)
kernel boot_m003_BeanStalk-6.25-20160919-Z00L.7z

ROM CM13 snapshot dated 2016-12-21 (marshmallow)
kernel boot_m003_cm13snapshot20161221.7z

ROM Resurrection Remix v5.7.4 dated 2016-09-23 (marshmallow)
kernel boot_m003_RR-M-v5.7.4-20160923-Z00L.7z

ROM Slim-Z00L-6.0.1.b1.7--20161019-1635 (marshmallow)
kernel boot_m003_Slim-Z00L-6.0.1.b1.7--20161019-1635.7z



ROM CM-14.1-20161225-NIGHTLY-Z00L (nougat)
kernel boot_m003_cm-14.1-20161225-NIGHTLY-Z00L.7z

ROM Resurrection Remix v5.8.0 dated 2016-12-22 (nougat)
kernel boot_m003_RR-N-v5.8.0-20161222-Z00L.7z

ROM XOSP-RL7-REV2-UNOFFICIAL-20170109-Z00L
kernel boot_m003_XOSP-RL7-REV2-UNOFFICIAL-20170109-Z00L.7z


New Upload, 2017 Jan 26th, features are the same as previous kernels (nothing new), just a re-compile
ROM aicp_Z00L_n-12.1-UNOFFICIAL-20170122
kernel v05-aicp_Z00L_n-12.1-20170122.7z

ROM aokp_Z00L_nougat_unofficial_2017-01-24_0801
kernel v05-aokp_Z00L_nougat_2017-01-24_0801.7z

ROM XOSP-RL7-REV2-UNOFFICIAL-20170115-Z00L
kernel v05-XOSP-RL7-REV2-20170115-Z00L.7z

ROM RR-N-v5.8.0-20170121-Z00L-OFFICIAL
kernel v05-RR-N-v5.8.0-20170121-Z00L.7z
 
Last edited:

pokipokipxorn

Senior Member
Nov 22, 2016
366
194
0
My settings for reference:

Monitoring tools:

- Settings > Developer options > enable 'Show CPU info' (far bottom) OR
- Trepn Profiler (from Playstore), enable 'CPU Frequency Overlay' OR
- Kernel Adiutor > CPU drawer > CPU Frequency section

Kernel Adiutor Mod | thread | download

Note: After enabling 'Apply on boot', check Start-Up Commands and verify the settings are actually being applied

- I/O Scheduler > Internal Storage > noop | External Storage > noop | Enable 'Apply on boot' | read Recommendations & Benchmark for best settings
- Power and Battery > USB Fast Charge > enable | Enable 'Apply on boot'
- CPU Hotplug > AutoSMP > Downrate Limits 55% | Uprate Limits 75% | Cycle Down 2 | Cycle Up 3 | Delay 500ms | Max CPU 4 (if quad-core) | Min CPU 1 | Enable 'Apply on boot'
- CPU > Max Freq 998MHz | Min Freq 200MHz | Governor Interactive | Governor Tunables >>>

Code:
 above_hispeed_delay	20000 100000:60000 200000:150000
 (note: its 20 thousand, 100 thousand:60 thousand, 200 thousand: 150 thousand)
 
 align_windows                    1
 
 boost                            0
 
 boostpulse_duration	80000
 (note: its 80 thousand)
 
 go_hispeed_load		99
 
 
 hispeed_freq			200000
 
 io_is_busy                     0
 
 max_freq_hysteresis	0
 
 min_sample_time		40000
 (note: its 40 thousand)
 
 target_loads			98 100000:40 200000:80 400000:95
 (note: its ninety-eight, 100 thousand:40, 200 thousand:80, 400 thousand:95)
 
 timer_rate				46666
 (note: its 46 thousand, 666)
 
 timer_slack			80000
 (note: its 80 thousand)
 
 use_migration_notif	0
 
 use_sched_load			0
After applying all settings, reboot phone, then wait for Kernel Adiutor Mod to apply settings, then check your monitoring tool

- during idle, 3 out of 4 cpu cores will be offline/shutdown, the remaining active core should hover between 200-400MHz
- when phone is in use, the offline cores will be activated, scale up the frequency, then slide towards idle state

if using marshmallow, enable xposed, install amplify, greenify to optimize wakelock & hibernate settings
if using nougat, try to edit doze settings

wakelock, hibernate, doze apps & settings, checkout
http://lifehacker.com/how-android-doze-works-and-how-to-tweak-it-to-save-you-1785921957
https://www.reddit.com/r/Android/co...doze_features_in_nougat_have/#bottom-comments
https://forum.xda-developers.com/an...doze-settings-editor-android-t3235130/page136

EDIT: the settings above is not 100% tuned, but it works, there's no stutter either (during idle, 1 core should be 200-400MHz, by right, it should stay 200MHz all the time during idle, this is affected by timer_rate 46666, which does NOT stick at all, may need to set manually each time at boot). To get the proper value of timer rate, increase or decrease by 5000, it's base value is 30000, u can start from there. I simply chose 46666 coz it hovers less.

Follow these guides to tweak further the cpu governor INTERACTIVE
https://forum.xda-developers.com/nexus-5x/general/guide-advanced-interactive-governor-t3269557
https://forum.xda-developers.com/showthread.php?t=2769899 (OLD GUIDE)
 
Last edited:

kunalchitara

Senior Member
Aug 24, 2014
308
166
0
Thanks for this amazing work. Will flash the kernel right now on cm13. I tried optimising cpu governers with one of the guides in nexus thread, but they all proved vague as a simple touch is boosting all cpu cores to their max. Also 'stop perfd' command in terminal did helped a bit to limit it but then, the performance was stuttering. A big thanks for this kernel. Will flash and post the results.. ??
 

pokipokipxorn

Senior Member
Nov 22, 2016
366
194
0
Any chance of a CM14 25/12/2016 version for Z00L?
probably next week, no guarantees though.
I need to work on getting gpu idler functional. the idler works at all screens but not at screen off.

gpu frequencies
200Mhz, 310Mhz, 400Mhz

current gpu idler implementation which I tried:
during idle, the gpu should rest at 200Mhz, yes this works but the moment the screen goes off, it shoots back to 310Mhz and stays there.

try it on your current rom, at adb shell
Code:
cd "/sys/devices/soc.0/1c00000.qcom,kgsl-3d0/devfreq/1c00000.qcom,kgsl-3d0" ; while true; do cat trans_stat ; busybox sleep 0.1 ; done ;
observe the asterisk *, that's the current gpu speed,
then try using the phone, touch menus, launch apps etc, see the * switch to different speeds, then check idle speed
Code:
   From  :   To
         :400000000310000000200000000   time(ms)
 400000000:       0      61       0     70233
*310000000:      60       0      26    755266
 200000000:       1      25       0     43133
Total transition : 173
 
Last edited:

kunalchitara

Senior Member
Aug 24, 2014
308
166
0
hotplug autosmp totally disables touch boost by its very nature
Awesome kernel man. Thanks. Been using it on cm13 since yesterday and I must say the battery savings were significantly improved without compromising performance at all. No stuttering at all.
Will try it on RR N today.

BTW, I have a doubt, in above_highspeed_delay and target_loads, the first frequency written in OP is 100Mhz but cpu frequencies in Z00L starts from 200Mhz. So what's the significance of putting these values of 100MHz?

I know little about CPU Gov tuning and I/O scheduling but whatever I found on searching over XDA for I/O schedulers is, Deadline to be better I/O Scheduler with following tunings-
fifo_batch 4
front_merges 1
read_expire 500
write_expire 3000
writes_starved 3
 

pokipokipxorn

Senior Member
Nov 22, 2016
366
194
0
Does this kernel works on Resurrection Remix (nougat) and XOSP ROMs ?
How is the battery performance ? is the kernel is specific batch builds like 22 Dec RR or can we use in any other batch builds too ?
RR Nougat - yes, check 1st post under section file names & roms
The truth about kernels and battery life

Not sure about other roms, you could test the kernel via fastboot
Code:
fastboot boot testkernel.img
This will boot the test kernel one time, your original kernel remains intact, you could check the features & whether it works for you.
 

pokipokipxorn

Senior Member
Nov 22, 2016
366
194
0
Awesome kernel man. Thanks. Been using it on cm13 since yesterday and I must say the battery savings were significantly improved without compromising performance at all. No stuttering at all.
Will try it on RR N today.

BTW, I have a doubt, in above_highspeed_delay and target_loads, the first frequency written in OP is 100Mhz but cpu frequencies in Z00L starts from 200Mhz. So what's the significance of putting these values of 100MHz?

I know little about CPU Gov tuning and I/O scheduling but whatever I found on searching over XDA for I/O schedulers is, Deadline to be better I/O Scheduler with following tunings-
fifo_batch 4
front_merges 1
read_expire 500
write_expire 3000
writes_starved 3
I didn't test for optimized settings but just went through these 2 guides below
Follow these guides to tweak further the cpu governor INTERACTIVE
[GUIDE] Advanced Interactive Governor Tweaks; Buttery smooth and insane battery life!
[GUIDE] Advanced Interactive Governor Tweaks; Buttery smooth and insane battery life! (Old Guide)

What I remember: 100MHz is for the transition of sustained cpu loads of at least 60ms before crossing into the next frequency, while 200MHz is the cpu frequency stepping. Honestly speaking, if you go through the 2 guides above, you'll notice our cpu speed range is too small (200MHz > 400MHz > 533MHz > 800MHz > 998MHz).

You could replace it with the standard speed steppings ie 200 > 400 > 533MHz.

If you find better performance of any sort, pls post the settings.

Z00L battery may not be enough for my usage, no matter what I do, and I prefer not to carry a powerbank daily. I might get a Xiaomi Mi Max 4850 mAh and use Z00L as a backup. the Mi Max is just $70 extra, heck a 10,000 powerbank already costs $20, and the Mi Max gives 6.4" IPS, 3GB ram, 2 more power cores, plus the big battery. I could use at least 2 days w/o charging.
 
Last edited:

zackwire

Senior Member
Mar 9, 2011
413
141
73
Barueri - SP
Been using the kernel and suggested settings since yesterday on CM13 Snapshot and the battery life and performance of this is a beast! great work mate...got roughly 3:30hs SOT and lost only 47% of juice.
 

heerarana

Senior Member
Oct 18, 2013
568
71
0
Kathmandu
RR Nougat - yes, check 1st post under section file names & roms
The truth about kernels and battery life

Not sure about other roms, you could test the kernel via fastboot
Code:
fastboot boot testkernel.img
This will boot the test kernel one time, your original kernel remains intact, you could check the features & whether it works for you.
I tested in for XOSP ROM and got "Okay" message at the end. I tried to flash with TWRP Recovery but its not finding Winzip file in directory. I tried to convert into .zip file which came as "boot_m003_RR-N-v5.8.0-20161222-Z00L.7z.zip" and failed while flashing.
Also i tried with this command in fast boot mode: fastboot flash boot_m003_RR-N-v5.8.0-20161222-Z00L.img but it's not working.

can you plz make .zip file ?
 

Attachments

Status
Not open for further replies.