MOD FIX MaxOpt, battery saver/multitasking fix
MOD FIX MaxOpt, battery saver/multitasking fix
I finally made an installer (however it is a command line program, need terminal emulator) to package the necessary executables, init scripts, and default property settings into a boot image and flash it.
This software package was originally just made for my personal use to rectify the issue of my phone not entering deep sleep when idle and me not having access to a charger for the majority of the day while also improving multitasking because being my phone is also my build environment/office environment, I am frequently jumping around various apps that I'd prefer to keep open.
Things this package accomplishes on your phone (very simple and brief summary):
*Forces entry into deep sleep as soon as the screen is off (if enabled, on by default). It also has audio detection so you can listen to music with the screen off without unwanted deep sleep entry.
*Improves multitasking, no more apps having to reload when you switch back to them.
*Automatic odexing of all apps, including new installs (if enabled, pre-lollipop ROM's).
*Easy management of swap.
*CPU management. You can set your own values to be locked (no other app can change them) or let its device manager automatically set CPU frequencies and the governor you specify.
*Dynamic Max CPU Freq: When enabled (on by default) it will automatically scale the max CPU frequency value depending on the CPU load. This can help with governors that favor the high end of the frequency table too much by allowing you to save battery but have the CPU power available when needed, without having to adjust anything manually whenever you go from doing something processor demanding to having your phone sit idle.
*Fixes issues with several kernels where the touch screen is unresponsive after waking the device. No more inconvenient force reboots.
*Enables all idle and suspend states available (they are disabled by default quite often) and can help get your device into the lower C-States.
*Fixes broken links to firmware files caused by buggy init scripts on some ROM's.
New/Other features:
*Fixes Dt2w and Sw2w lock screen freeze bug.
*Now compatible with KSM.
*Faster app loading and responsiveness. Key android services are given priority status for I/O and CPU resources.
*Multitask over 20+ apps simultaneously without any redraws and low-latency app switching (provided you have the swap space)
Tip: I use the large amount of unused space on /system to increase the size of that MaxOpt managed swapfile.
*Fixed the crash on boot issue between MaxOpt and some kernels.
Default MaxOpt config:
•Swap on, default MaxOpt generated swapfile size is 64 MB, with one made on /data, one on /cache, and one on /system if mounted rw.
•Auto-odexing on unless installed with nodexy flag set.
•Hotplugging compatibility on.
•User CPU settings off, auto-device manager on.
•Deep Sleep immediately on screen off enabled.
•KSM off (you must have a kernel that supports it to enable this option and have it work).
•Kernel settings on.
All of the above listed features are user optional/tuneable.
For those who wish to only use MaxOpt for fixing the lock screen freeze bug associated with some kernels/DT2W/S2W use the following link: http://forum.xda-developers.com/show...=3061589<br />
To use the installer, pick any working directory on /data or /cache, place the contents of the attached zip (maxopt and imageutils.zip) together in the directory with 755 permissions along with a copy of your kernel image. Then (as root) run any of the following:
"./maxopt yourbootimage.img" -- You will be returned a rebuilt file in a couple seconds and it will exit. Flash that to your boot partition and enjoy. If you just want to look at what is in the package, extract MaxOpt.zip out of imageutils.zip.
Alternate install methods:
"./maxopt paf yourbootimage.img" -- (Patch and Flash) Install MaxOpt into said boot image and immediately flash it to boot.
"./maxopt nodexy yourbootimage.img" -- Automatic APK odexing is disabled in the image it generates. It is possible to re-enable it post-installation.
"./maxopt --init" -- Sets the binaries up on the system partition with file in init.d to launch on boot
"./maxopt --tools" -- Sets up the binaries on the system partition with no init.d file, executables won't do anything unless you invoke them through a script or on the command line.
"./maxopt flash yourbootimage.img" -- Flash the specified boot image, whether it was made by the MaxOpt installer or not.
"./maxopt mini yourbootimage.img" -- Patch MaxOpt into said file and try to minimize size
"./maxopt maf yourbootimage.img" -- (Mini and Flash) Install MaxOpt using the mini flag and immediately flash it to boot.
If you would like to just use individual components or adjust program settings from a terminal app, here is an example usage and description of their individual functions as well as other useful documentation:https://docs.google.com/file/d/0B_hg...p=docslist_api
Terminal Emulator is what I would recommend for use with managing MaxOpts' settings.
System Requirements (not entirely sure due to lack of public testing):
Busybox
A terminal app
A kernel that can best be utilized by these programs.
I would highly recommend:
***APK Signature checking disabled on first run, and on later boots when you installed new apps or upgraded them prior to reboot, otherwise you will get force closes and vanishing apps. Signature checking can be reactivated on subsequent boots where there are not new apks without consequence. BUT ABSOLUTELY NECESSARY TO DISABLE ON FIRST BOOT AFTER INSTALLATION OR DEXY USE, THERE IS A XPOSED MODULE FOR THIS OR LUCKY PATCHER***
If you'd prefer to keep your ROM de-odexed or don't wish to mess with signature checks please run the installer with nodexy.
More info: This package was actually written and compiled on a Moto G running AOSP KitKat 4.4.4 with the XPerience 3.4.104 17+ kernel. I tried making the code as general as possible, reading the device configuration and working with what it can find out. So hopefully it can run on a wide range of devices, android versions, kernels, and ROMS. Please make a nandroid backup before using.
Thanks to osm0sis for Android Image Kitchen http://forum.xda-developers.com/show....php?t=2073775, which is what my installer is a wrapper around.
*
And here is the MaxOpt installer ( 1.3.7b6 ):
*https://drive.google.com/file/d/0B_h...p=docslist_api
Changelog:
https://docs.google.com/file/d/0B_hg...p=docslist_api
Main changes this release:
Deepsleep has been modified to reduce CPU usage and make the enhanced multitasking more fluid. The init script for MaxOpt has a new function for flushing the modem cache. This isn't directly related to MaxOpt functionality but can help people with GPS and signal issues (which I had and this helped immensely)
For those still getting crashes:
The issue still appears to be related to the device radio when it happens, so, after a crash could you please force reboot your device and try to disable mobile data when it boots before it crashes again and please post a copy of /proc/last_kmesg. Thank you.
Screenshots of battery screen showing time spent in sleep:
https://docs.google.com/file/d/0B_hg...p=docslist_api
https://docs.google.com/file/d/0B_hg...p=docslist_api
https://docs.google.com/file/d/0B_hg...p=docslist_api
Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
This software package was originally just made for my personal use to rectify the issue of my phone not entering deep sleep when idle and me not having access to a charger for the majority of the day while also improving multitasking because being my phone is also my build environment/office environment, I am frequently jumping around various apps that I'd prefer to keep open.
Things this package accomplishes on your phone (very simple and brief summary):
*Forces entry into deep sleep as soon as the screen is off (if enabled, on by default). It also has audio detection so you can listen to music with the screen off without unwanted deep sleep entry.
*Improves multitasking, no more apps having to reload when you switch back to them.
*Automatic odexing of all apps, including new installs (if enabled, pre-lollipop ROM's).
*Easy management of swap.
*CPU management. You can set your own values to be locked (no other app can change them) or let its device manager automatically set CPU frequencies and the governor you specify.
*Dynamic Max CPU Freq: When enabled (on by default) it will automatically scale the max CPU frequency value depending on the CPU load. This can help with governors that favor the high end of the frequency table too much by allowing you to save battery but have the CPU power available when needed, without having to adjust anything manually whenever you go from doing something processor demanding to having your phone sit idle.
*Fixes issues with several kernels where the touch screen is unresponsive after waking the device. No more inconvenient force reboots.
*Enables all idle and suspend states available (they are disabled by default quite often) and can help get your device into the lower C-States.
*Fixes broken links to firmware files caused by buggy init scripts on some ROM's.
New/Other features:
*Fixes Dt2w and Sw2w lock screen freeze bug.
*Now compatible with KSM.
*Faster app loading and responsiveness. Key android services are given priority status for I/O and CPU resources.
*Multitask over 20+ apps simultaneously without any redraws and low-latency app switching (provided you have the swap space)
Tip: I use the large amount of unused space on /system to increase the size of that MaxOpt managed swapfile.
*Fixed the crash on boot issue between MaxOpt and some kernels.
Default MaxOpt config:
•Swap on, default MaxOpt generated swapfile size is 64 MB, with one made on /data, one on /cache, and one on /system if mounted rw.
•Auto-odexing on unless installed with nodexy flag set.
•Hotplugging compatibility on.
•User CPU settings off, auto-device manager on.
•Deep Sleep immediately on screen off enabled.
•KSM off (you must have a kernel that supports it to enable this option and have it work).
•Kernel settings on.
All of the above listed features are user optional/tuneable.
For those who wish to only use MaxOpt for fixing the lock screen freeze bug associated with some kernels/DT2W/S2W use the following link: http://forum.xda-developers.com/show...=3061589<br />
To use the installer, pick any working directory on /data or /cache, place the contents of the attached zip (maxopt and imageutils.zip) together in the directory with 755 permissions along with a copy of your kernel image. Then (as root) run any of the following:
"./maxopt yourbootimage.img" -- You will be returned a rebuilt file in a couple seconds and it will exit. Flash that to your boot partition and enjoy. If you just want to look at what is in the package, extract MaxOpt.zip out of imageutils.zip.
Alternate install methods:
"./maxopt paf yourbootimage.img" -- (Patch and Flash) Install MaxOpt into said boot image and immediately flash it to boot.
"./maxopt nodexy yourbootimage.img" -- Automatic APK odexing is disabled in the image it generates. It is possible to re-enable it post-installation.
"./maxopt --init" -- Sets the binaries up on the system partition with file in init.d to launch on boot
"./maxopt --tools" -- Sets up the binaries on the system partition with no init.d file, executables won't do anything unless you invoke them through a script or on the command line.
"./maxopt flash yourbootimage.img" -- Flash the specified boot image, whether it was made by the MaxOpt installer or not.
"./maxopt mini yourbootimage.img" -- Patch MaxOpt into said file and try to minimize size
"./maxopt maf yourbootimage.img" -- (Mini and Flash) Install MaxOpt using the mini flag and immediately flash it to boot.
If you would like to just use individual components or adjust program settings from a terminal app, here is an example usage and description of their individual functions as well as other useful documentation:https://docs.google.com/file/d/0B_hg...p=docslist_api
Terminal Emulator is what I would recommend for use with managing MaxOpts' settings.
System Requirements (not entirely sure due to lack of public testing):
Busybox
A terminal app
A kernel that can best be utilized by these programs.
I would highly recommend:
***APK Signature checking disabled on first run, and on later boots when you installed new apps or upgraded them prior to reboot, otherwise you will get force closes and vanishing apps. Signature checking can be reactivated on subsequent boots where there are not new apks without consequence. BUT ABSOLUTELY NECESSARY TO DISABLE ON FIRST BOOT AFTER INSTALLATION OR DEXY USE, THERE IS A XPOSED MODULE FOR THIS OR LUCKY PATCHER***
If you'd prefer to keep your ROM de-odexed or don't wish to mess with signature checks please run the installer with nodexy.
More info: This package was actually written and compiled on a Moto G running AOSP KitKat 4.4.4 with the XPerience 3.4.104 17+ kernel. I tried making the code as general as possible, reading the device configuration and working with what it can find out. So hopefully it can run on a wide range of devices, android versions, kernels, and ROMS. Please make a nandroid backup before using.
Thanks to osm0sis for Android Image Kitchen http://forum.xda-developers.com/show....php?t=2073775, which is what my installer is a wrapper around.
*
And here is the MaxOpt installer ( 1.3.7b6 ):
*https://drive.google.com/file/d/0B_h...p=docslist_api
Changelog:
https://docs.google.com/file/d/0B_hg...p=docslist_api
Main changes this release:
Deepsleep has been modified to reduce CPU usage and make the enhanced multitasking more fluid. The init script for MaxOpt has a new function for flushing the modem cache. This isn't directly related to MaxOpt functionality but can help people with GPS and signal issues (which I had and this helped immensely)
For those still getting crashes:
The issue still appears to be related to the device radio when it happens, so, after a crash could you please force reboot your device and try to disable mobile data when it boots before it crashes again and please post a copy of /proc/last_kmesg. Thank you.
Screenshots of battery screen showing time spent in sleep:
https://docs.google.com/file/d/0B_hg...p=docslist_api
https://docs.google.com/file/d/0B_hg...p=docslist_api
https://docs.google.com/file/d/0B_hg...p=docslist_api
Please thank if my software has helped you and please leave logs and descriptions of problems if my software did not work for you.
Note this is not my work im just sharing it
Leave a Comment