Yes, this thread used to be on just battery life, that was when there was almost no development for the Razr on ICS. Now we have plenty of ROMs, Mods, and How-Tos'. Sorry to all of the GSM users, but since I own a CDMA Razr some things in this guide might only be for CDMA Razr's. If any of you feel up to it, PM me an equivalent Mod or ROM and I'll include it.
NOTE: Most of these tips assume you have root access and a custom recovery!
(Huge Savings!)
Tip 1. Black Themes
It's proven that black themes use less battery. It takes 0 battery to display a black pixel. So make sure your theme is dark. A good ROM for a black theme is Black Widow by andlaw.
(HUGE SAVINGS)
Tip 2. Brightness
Use automatic brightness! If you're using an AOKP/CM9 based ROM, don't be shy to play around with the Automatic backlight settings under Display. To minimize battery drain, it's good to minimize sampling rates and lower brightness.
OR for even bigger battery savings, use Widgetsoid or Tasker to make a Homescreen, battery friendly as there is no syncing, widget to change your brightness when needed.
You can also use Widgetsoid to add customized pull down toggles to any ROM, which is great!
Idea from HSD-Pilot
(HUGE SAVINGS)
Tip 3.The CPU and I/O
The CPU takes up A LOT of battery, to minimize the battery drain, it's good to under clock/under volt(UV when we get Custom Kernels/Mods)
Tips for Under clocking: The lowest the CPU can go and still be able to manage most or all load you put on it is 800Mhz, so keep it there, and if you play a lot of games, you might increase it to 1Ghz.
Use the "hotplug" CPU Governor: "hotplug" as you will see it called is unique in our phone in the aspect that when CPU load is low enough, it tuns off the second core, saving battery. What is also great about this governor is that it's smart enough that when CPU load is high, it turns the second core on quickly. The frequency stepping values on this governor are superb, you'll get the best performance and battery life.
Tips for Screen Off: If you make profiles for screen off DON'T set it 300Mhz minimum and maximum, that uses MORE BATTERY!
Explanation: When you turn the screen off, the CPU probably still has some tasks it still needs to do and when it's at 300Mhz, it can't do those tasks quickly, this keeps the phone out of deep idle. When the phone is at 600Mhz it can do tasks faster and more efficiently therefore the phone hits deep idle faster, saving more battery.
I guess sometimes when you have your min and max frequency as 300 when screen off and you let the screen time out while a program is running your Razr can crash, just another reason to put it on 600.
CPU Sleeper is a great app that turns off the second core of the CPU when the screen is off, saving a lot of battery life.
Instructions for use:
1. Download and install the apk on your phone.
2. Open your app drawer and locate and select CPU Sleeper.
3. Enable auto-start on reboot and click on "Start service" 2x to activate.
(This shuts off 1 core while the phone's screen is off! Both cores resume when the screen is turned back on.)
4. Enjoy!
If you can, install the Kernel Modules by whirleyes found here. I can personally recommend the hotplugx CPU governor and the SIO I/O Scheduler.
Hotplugx is just an enhanced version of hotplug, as I understand it the second core (CPU 1) is turned off and on faster, resulting in a smoother experience. For clarification, when there is less CPU load, instead it taking 1 second to turn off CPU 1 it takes .5 seconds. When CPU 1 is needed it is turned on faster. Hotplugx does not just have different values of up threshold and down threshold, it actually has optimized code to turn the cores off and on faster. Those values are hypothetical, but you get the point.
SIO is an I/O Scheduler based on Deadline, and Noop. The advantages of it are:
It's very simple, which means better battery life and performance.
Minimized starvation of requests(everybody gets their turn).
For more information on CPU Governors and I/O Schedulers go here.
(Medium to High Savings)
Tip 4. Data+Wifi
Undoubtedly, one of the biggest battery suckers is Mobile Data and Wifi, specifically 4G. So what we can do is download the Phone Info app, Located Here to change the LTE/CDMA connection type to CDMA only. This saves battery by looking for less bands to connect to and by not connecting to battery consuming 4G.
Do this by going under the section "Phone Info" and scrolling down to the bottom and where it says "Set preferred network type" select "CDMA Auto(PLR)".
Wifi: It's proven that having the "Wifi on while sleep" setting on improves battery life.
Do this by going into settings and under "Wifi" hit the menu button and go to "Advanced" and make sure "Keep Wifi on during sleep" says "Always".
(Low to High Savings-Depends on use)
Tip 5. build.prop tweaks
To increase battery life efficiency while in deep sleep and while looking for connections, add or change these lines to the bottom of the build.prop using Root File Managers such as Root Explorer or Root Browser.
REALLY IMPORTANT: MAKE A NANDROID BACKUP BEFORE MESSING WITH THIS!
NOTE: The build.prop is located in /system/build.prop
NOTE 2: Don't open the build.prop in a windows based text editor, it messes up the formatting and you will brick. Use Notepad++ It's better this.
A "#" means it's commented and the compiler/system does not read it.
Code:
#Keep at 1 or 0.
ro.ril.disable.power.collapse=0
#Keep at 1
pm.sleep_mode=1
#Could break tethering
ro.mot.eri.losalert.delay=1000
ro.kernel.android.checkjni=0
EDIT EXISTING LINE!
Code:
#Keep value high to minimize battery drain.
wifi.supplicant_scan_interval=120
(Low to High-depends)
Tip 6. Apps,Services,etc.
Sometimes you get an app or service that uses an immense amount of battery, a lot of these apps are built on, which is called bloatware. We are able to "Freeze" apps like this via the App Manager in ICS or via Titanium Backup. Once you freeze an app, be vigilant about Force closes, random reboots, freezes, etc. Don't freeze anything that you know would be system vital, such as "SIM Toolkit or "System UI". Basically, be smart about it.
Bad Apps: Sometimes you download apps from the market that use an immense amount of battery, you'll know when you just downloaded an app and battery life got really bad. In the situation you know what app it is, uninstall it. In the situation that you don't, use an app like Watchdog Task Manager Lite to monitor the apps using memory and CPU.
What I have frozen:
Amazon Kindle 3.6.0.8.7
Apps 3.06.86
Backup Assistant Plus 1.0
Backup Assistant Plus 4.0.4-47
Backup Assistant+ 4.0.4-47
Backup Assistant+ Contacts Client 1.0
Backup Assistant+ Media 1.0
Calendar 4.0.4-47
[Calendar] Calendar Storage 4.0.4-47
com.motorola.huxvmm.setting 4.0.4-47
Device Setup 1.0
Emergency Alerts 4.0.4-47
Facebook 1.9.6
Flash Removal 4.0.4-47
Google Calendar Sync 4.0.4-338691
Google+ 3.0.1.32017166
Guided Tours 1.0
Help Center 1.0
Home screen tips 1.0
Homescreen 7.7.0Q-129 11
Homescreen VZW Config
Magic Smoke Wallpapers 4.0.4-47
ModemStatsService 1.0
MOG Music 1.01
MOTOACTV 1.0.265G
MotoPrint 5.0.0.26
Music Store 1.1.112
Music Visualization Wallpapers 4.0.4-47
MusicFX 1.4
My Gallery 1.1.112
My Music 1.1.112
My Verizon Mobile 10.0.332
net.juniper.junos.pulse.placeholder 1.0
Netflix 1.0.0 build 1161240-trunk
NFL Mobile 5.7
Quickoffice 5.0.109
Rescue Security 7.0.442
Slacker Radio 3.2.2047
Slingbox 1.0
Smart Actions 3.1.5.2.0
Smart Actions FW 1.0.13
Social Location 7.0.28
Social Sharing 4.0.4-47
Sync Service 2.5.1.4.9
Talk 4.0.4-338691
TalkBack 3.0.2
Tasks 3.0
V CAST Tones 4.5.13
Verizon Remote Diagnostics 2.42.166
Verizon Video 6.2.51
Video Calling 1.0
Video Editor Lite 3.2.1.18
VideoSurf 2.3.0
Voicemail 1.1
VZ Navigator 7.5.1.94
Weather 4.0.4-47
World Clock 1.0
If you have any problems, I'll take it off the list.
Known battery media apps:
Facebook
Twitter
Google+
Solution- Try to find an all in one client,like HootSuite or Tweetdeck it will sync less and will take up less RAM and CPU cycles.
Amazon Appstore
Solution- Uninstall it or make sure you kill every time you use it.
Skype
Steam
Solution- Only run Steam and Skype when you need to, I don't know of any all in one for that combination.
Google Drive
Dropbox
Box
Solution- Try to limit your syncing, turn off instant upload.
Flashlight apps:
Brightest Flashlight Free
Flashlight
All benchmark apps if used too much:
Quadrant Standard
Antutu Benchamrk
Smartbench
The solution - It's okay to bench your phone a lot, just limit it if you need your phone to last that day.
Battery sucking games(all of them, even if they're not on this list):
Cut the Rope
Emulators
All of the Angry Birds
Temple Run
GTA III
Amazing Alex
The solution- Play less graphically intensive games, graphically intensive games work the CPU/ GPU really hard.
Music Streaming Apps:
Google Play Music
Pandora
Winamp
Motocast
iHeartRadio
Slacker Radio
TuneIn Radio
Some tips on limiting battery drain while listening to music: Avoid streaming services like Winamp,Motocast , Slacker Radio and TuneIn Radio.
Google Play Music and Pandora are slightly better.
Why Google Play Music is better in terms of battery life
Although Google Music is still capable of streaming music you've stored on Google's cloud,(sucks battery) when you listen to a song the app caches the song temporarily, so if you were addicted to the new song you got and listened to it 2 times in a row, the app wouldn't have to stream the song again. It's the same thing if you were to go back and listen to the same song 2 or 3 songs later, you wouldn't have to stream it again. Another advantage of Google Music is that you can play music from your sdcard as well as songs from your Google Play Library. No streaming, just reading from the sdcard.
Why is better Pandora better?
Yes, it streams music just like all the other ones I told you not to use, but there is one thing that is unique about Pandora, it doesn't stream music exactly, it packs the song into the cache as fast as possible, it's not constantly using your data connection.
So use Google Play Music or Pandora, preferably Google Play Music.
It can go on and on and it will.
(Medium to High Savings)
Tip 7. Custom ROMs
A custom ROM(Read Only Memory) is a custom version of Android, usually with bloatware and manufacturer skin removed, performance enhancements, and a custom theme. I can personally recommend Eclipse for ICS, Artic for ICS and my personal favorite Liquid Smooth for ICS. They are all GREAT ROMs.
(Low to Medium)
Tip 8. Scripts
A script is a series of instructions carried out by a program to do an action. The ones we're interested in are ones that we can set at boot to apply values. Here is a script you can use to improve battery life. If you make any scripts I'll include them here.
Code:
echo "2400" > /proc/sys/vm/dirty_writeback_centisecs
echo "2000" > /proc/sys/vm/dirty_expire_centisecs
echo "256" > /proc/sys/kernel/random/write_wakeup_threshold
echo "256" > /proc/sys/kernel/random/read_wakeup_threshold
rm /dev/log/main
(Low)
Tip 9. Location Services
Location Services are great, so are Google account backups, they improve search results, help in navigation, back up settings, all sorts of things. Unfortunately, they suck up Battery, so lets disable them.
In settings, under "Location Services" make sure everything is unchecked. Under "Backup & reset" make sure "Backup my data" is unchecked.
(Medium to HUGE)
Tip 10. Battery Savers
Yes, Battery Savers, like JuiceDefender, which is the one we're going to talk about. JuiceDefender in the free version, optimizes your battery by controlling when your phone connects to Mobile Data, very simple. There WILL be at least some improvement with JuiceDefender managing your connections. If you're constantly fighting with it, read some of the manuals and make sure you haven't set any settings you didn't mean to.
Remember, if you liked JuiceDefender, consider buying the Plus or Ultimate versions.
(Medium to High)
Tip 11. Launchers
Live Wallpapers are cool and all, but they drain battery. So swap it for something static and preferably black.
Widgets are great too, they display dynamic information in an easy to look at way. Too bad they suck battery by forcing a refresh every time you turn the screen on. So try to minimize how many you use.
(Low)
Tip 12. Haptic Feedback
Haptic feedback is when you press a button, soft key or key on the keyboard, and the phone vibrates. This takes up valuable resources best used else where. To turn this off go under "Sound" in settings and make sure everything from "Dial pad touch tones" to "Vibrate on touch is unchecked.
(Low to Medium)
Tip 13. Sync
An example of sync is when you open the Facebook application and all the latest new is synced. Except the Sync were talking about is done automatically at specified intervals. Taking up valuable juice, so lets disable it!
To do this go into settings and under "Accounts & sync" if it's on in the top right it will be green, if it's off it will be grey. Make sure it's off.
(Low to Medium)
Tip 14. Animations
Animations happen when you transition in homescreens, open an app, etc. This sucks battery life because it causes the CPU/GPU to work harder to do a simple task like opening an app.
To turn this off go under "Developer options" in settings and at the bottom of "User Interface" section make sure that "Window animation scale" and "Transition animation scale" are set to off.
(HUGE SAVINGS)
Tip 15.Disable things when not in use
This is one of the most important rules for great battery life EVER, you can't expect to get great battery life when you constantly have Bluetooth, Wifi and Mobile Data on. So turn things off if you're not using it!!!!!!!!!!!!
If you have any ideas, post them!
Performance
This section is for people who want to increase their performance but don't want to compromise on battery life.
Tip 1. ROMs
Pretty much any ROM and once again:
Eclipse for ICS
Artic for ICS
Liquid Smooth for ICS
Tip 2. Kernel Modules by whirleyes
Again, I can recommend hotplugx and SIO, they're the best that I have tested together.
Whirleyes has made an experimental overclock module to set the max frequency for 1350Mhz, but beware some people have reported random reboots and freezes.
Download link: Overclock Module
For more information on CPU and I/O Schedulers go here.
Tip 3. Scripts/Mods
Most of us know about zeppelinrox's Superchager v6 and there are many other memorable ones.
Like my Speed it UP script.
Like The Universal Adrenaline Shot
Two scripts that improve RAM management,kernel performance, VM tweaks, dirty tweaks, improves sdcard read speed, file system speedups, sets I/O scheduler to noop or SIO and the CPU Governor to hotplug or hotplugx, changes kernel memory swappiness, and tweaks to the hotplug/hotplugx CPU Governor.
Code:
echo "700000" > /proc/sys/kernel/sched_latency_ns
echo "300000" > /proc/sys/kernel/sched_min_granularity_ns
echo "26188" > /proc/sys/kernel/sched_features
#writes more pages to disc, when given oppurtunity
echo "8" > /proc/sys/vm/page-cluster
#drop all cahces when given oppurtunity
echo "3" > /proc/sys/vm/drop_caches
#Keep 4MB in memory
echo "4096" > /proc/sys/vm/min_free_kbytes
#Dump Vfs cache less
echo "20" > /proc/sys/vm/vfs_cache_pressure
echo "80" > /proc/sys/vm/dirty_background_ratio
#How much dirty data there must be to write to disc
echo "90" > /proc/sys/vm/dirty_ratio
#How often writeback daemons wakeup to write data to disc.
echo "1200" > /proc/sys/vm/dirty_writeback_centisecs
#How old 'dirty" data has to be to be written to disc
echo "900" > /proc/sys/vm/dirty_expire_centisecs
#^^^^^^Both expressed in 100th of second^^^^^^
echo "20" > /proc/sys/vm/swappiness
#faster sdcard read speed
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
# file system speedups
mount -o remount,noauto_da_alloc /system /system
mount -o remount,noauto_da_alloc /data /data
mount -o remount,noauto_da_alloc /cache /cache
# disable logcat - performance boost & save memory,comment, reboot for logcat.
rm /dev/log/main
#sets I/O scheduler to SIO, considered best.
echo "noop" > /sys/block/mmcblk0/queue/scheduler
#sets cpu governor to hotplug, is most intelligent
echo "hotplug" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "950" > /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency
#decreases sampling rate, stops lag and saves battery
echo "450000" > /sys/devices/system/cpu/cpufreq/hotplug/sampling_rate
echo "75" > /sys/devices/system/cpu/cpufreq/hotplug/up_threshold
echo "45" > /sys/devices/system/cpu/cpufreq/hotplug/down_threshold
echo "15" > /sys/devices/system/cpu/cpufreq/hotplug/hotplug_out_sampling_periods
echo "5" > /sys/devices/system/cpu/cpufreq/hotplug/hotplug_in_sampling_periods
#better memory mangement
echo "2048,4096,43008,47104,51456,55808" > /sys/module/lowmemorykiller/parameters/minfree
#ADJ fixes , shoould see awesome increase in multitasking
echo "0,3,6,10,12,15" > /sys/module/lowmemorykiller/parameters/adj
Use this script if you have the hotplugx CPU Governor and the SIO I/O scheduler:
Code:
echo "700000" > /proc/sys/kernel/sched_latency_ns
echo "300000" > /proc/sys/kernel/sched_min_granularity_ns
echo "26188" > /proc/sys/kernel/sched_features
#writes more pages to disc, when given oppurtunity
echo "8" > /proc/sys/vm/page-cluster
#drop all cahces when given oppurtunity
echo "3" > /proc/sys/vm/drop_caches
#Keep 4MB in memory
echo "4096" > /proc/sys/vm/min_free_kbytes
#Dump Vfs cache less
echo "20" > /proc/sys/vm/vfs_cache_pressure
echo "80" > /proc/sys/vm/dirty_background_ratio
#How much dirty data there must be to write to disc
echo "90" > /proc/sys/vm/dirty_ratio
#How often writeback daemons wakeup to write data to disc.
echo "900" > /proc/sys/vm/dirty_writeback_centisecs
#How old 'dirty" data has to be to be written to disc
echo "800" > /proc/sys/vm/dirty_expire_centisecs
#^^^^^^Both expressed in 100th of second^^^^^^
echo "20" > /proc/sys/vm/swappiness
#faster sdcard read speed
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
# file system speedups
mount -o remount,noauto_da_alloc /system /system
mount -o remount,noauto_da_alloc /data /data
mount -o remount,noauto_da_alloc /cache /cache
# disable logcat - performance boost & save memory,comment, reboot for logcat.
rm /dev/log/main
#sets I/O scheduler to SIO, considered best.
echo "sio" > /sys/block/mmcblk0/queue/scheduler
#sets cpu governor to hotplug, is most intelligent
echo "hotplugx" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "950" > /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency
#decreases sampling rate, stops lag and saves battery
echo "450000" > /sys/devices/system/cpu/cpufreq/hotplug/sampling_rate
echo "75" > /sys/devices/system/cpu/cpufreq/hotplug/up_threshold
echo "45" > /sys/devices/system/cpu/cpufreq/hotplug/down_threshold
echo "15" > /sys/devices/system/cpu/cpufreq/hotplug/hotplug_out_sampling_periods
echo "5" > /sys/devices/system/cpu/cpufreq/hotplug/hotplug_in_sampling_periods
#better memory mangement
echo "2048,4096,43008,47104,51456,55808" > /sys/module/lowmemorykiller/parameters/minfree
#ADJ fixes , shoould see awesome increase in multitasking
echo "0,3,6,10,12,15" > /sys/module/lowmemorykiller/parameters/adj
Tip 4. Build.prop tweaks
I would say that theses help the most, they can raise a ROMs performance 400 points alone in a benchmark.
Here they are:
Code:
#allows for sound during boot
ro.config.play.bootsound=1
persist.cust.tell.eons=1
#Locks home app in memory.
ro.HOME_APP_ADJ=1
pm.sleep_mode=1
persist.service.swiqi.enable=1
persist.sys.ui.hw=1
#renders UI with GPU
debug.sf.hw=1
debug.performance.tuning=1
#forces hardware acceleration
video.accelerate.hw=1
debug.egl.profiler=1
debug.egl.hw=1
#renders graphics with GPU + CPU
debug.composition.type=gpu
debug.composition.type=cpu
#raises JPEG quality
ro.media.enc.jpeg.quality=100
#raises how much memory can be spent on rendering JPEGs.
ro.media.dec.jpeg.memcap=8000000
ro.media.enc.hprof.vid.bps=8000000
#3g speed tweaks
ro.ril.enable.a52=0
ro.ril.enable.a53=1
ro.ril.enable.sdr=1
ro.ril.enable.dtm=1
ro.ril.enable.gea3=1
ro.ril.disable.fd.plmn.prefix=23402,23410,23411
ro.ril.disable.mcc.filter=1
ro.ril.disable.power.collapse=0
ro.ril.hsdpa.category=14
ro.ril.gprsclass=12
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=268449905
ro.ril.fast.dormancy.rule=0
ro.ril.emc.mode=1
ro.ril.hep=0
ro.ril.hsxpa=2
ro.ril.gprsclass=12
ro.ril.enable.dtm=1
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
#scrolling tweaks
ro.min_pointer_dur=5
ro.max.fling_velocity=12000
ro.min.fling_velocity=8000
#better voice quality in calls
ro.ril.enable.amr.wideband=1
#stops kernel error checking, will speed things up and will fix some application issues.
ro.kernel.android.checkjni=0
ro.kernel.checkjni=0
dalvik.vm.checkjni=false
#uses less RAM but worse performance
dalvik.vm.verify-bytecode=false
#use Dalvik Just In Time Compiler, much faster.
dalvik.vm.execution-mode=int:jit
#dalvik optimizes all classes
dalvik.vm.dexopt-flags=m=v,o=a
dalvik.vm.jmiopts=forcecopy
#increases media performance a lot.
media.stagefright.enable-meta=true
media.stagefright.enable-scan=true
media.stagefright.enable-http=true
media.stagefright.enable-record=false
#higher overall net speeds
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
#ipv4 net tweaks
net.ipv4.tcp_ecn=0
net.ipv4.route.flush=1
net.ipv4.tcp_rfc1337=1
net.ipv4.ip_no_pmtu_disc=0
net.ipv4.tcp_sack=1
net.ipv4.tcp_fack=1
net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_timestamps=1
net.ipv4.tcp_rmem=4096 39000 187000
net.ipv4.tcp_wmem=4096 39000 187000
net.ipv4.tcp_mem=187000 187000 187000
net.ipv4.tcp_no_metrics_save=1
net.ipv4.tcp_moderate_rcvbuf=1
Edit existing lines!
Code:
#instant ring when called
ro.telephony.call_ring.delay=0
#increases FPS to beyond what screen can render, really smooth.
windowsmgr.max_events_per_sec=240
#fixes black screen after call end
mot.proximity.delay=0
Tip 5. Mod your services.jar
The services.jar is where Out Of Memory(OOM) priorities are read. Modding your services.jar is a mandatory part of being fully "Supercharged" in zeppelinrox's Superchager v6 script. Getting the modded services.jar that I will provide gives you the OOM fixes from the script. I recommend that you use the services.jar that I provide, but if you feel like getting your own. Go here if you want to mod your own.
Get the services.jar here.
Note: The services.jar is located in /system/framework
Instructions for replacing your services.jar:
1. Download or get your own services.jar.
2. Navigate to /system/framework using a root file browser.
3. Copy the services.jar into /system/framework.
4. Make sure the permissions are 0644 or rw-r--r--.
5. Reboot and enjoy
And more to come!
If you liked my guide enough, Donate!
Or at least leave me a "Thanks".
<<<<<<<<<<<<<<<<<<<<<<<<
Credit: http://forum.xda-developers.com/showthread.php?t=1599025&highlight=battery+saving+guide
Added Launchers Haptic feedback and Sync.
Sent from my XT912
Instead of Autobrightness I've an toggle from Widgetsoid on my Home Screen. 3 Settings (18 / 25 / 35)
So when I need it, I set in higher but usual I use the 18 %
Isn't that better for battery drain?
Sent from my XT910 using Tapatalk 2
HSD-Pilot said:
Instead of Autobrightness I've an toggle from Widgetsoid on my Home Screen. 3 Settings (18 / 25 / 35)
So when I need it, I set in higher but usual I use the 18 %
Isn't that better for battery drain?
Sent from my XT910 using Tapatalk 2
Click to expand...
Click to collapse
Yes, it would be, no sampling the light every couple of seconds.
Thanks! I'll add this idea to the OP.
Sent from my XT912
All right. It's the same thing with the Data Connection. Especially when I'm @ work, I set it to edge because I didn't need 3G.
Sure, you can let your Razr do almost everything from alone, but everything automated needs CPU / Battery. So toggles are battery's best friends
Sent from my XT910 using Tapatalk 2
HSD-Pilot said:
All right. It's the same thing with the Data Connection. Especially when I'm @ work, I set it to edge because I didn't need 3G.
Sure, you can let your Razr do almost everything from alone, but everything automated needs CPU / Battery. So toggles are battery's best friends
Sent from my XT910 using Tapatalk 2
Click to expand...
Click to collapse
Yeah, I thought about that while making this thread, but since there are only two ROMs that have pull down toggles as of now, Liquid Smooth and Eclipse, for CDMA anyway.
I also thought about 2G, but I don't know a method of of cycling to other than turning off Mobile Data. And you would be surprised, JuiceDefender uses really small amount of battery. It doesn't show up in battery stats, ever.
Sent from my XT912
But with Widgetsoid you can add customized Notification - Toggles in every Rom.
I've used JuiceDefender for an while, but I missed the Email push. So it's gone from my Phone
Sent from my XT910 using Tapatalk 2
HSD-Pilot said:
But with Widgetsoid you can add customized Notification - Toggles in every Rom.
I've used JuiceDefender for an while, but I missed the Email push. So it's gone from my Phone
Sent from my XT910 using Tapatalk 2
Click to expand...
Click to collapse
I'll also add that! You learn new things every day.
Sent from my XT912
If I used all these tips I could nearly bought a low end phone for 1/4 of the price of my razr
maarawoe said:
If I used all these tips I could nearly bought a low end phone for 1/4 of the price of my razr
Click to expand...
Click to collapse
Could you please rephrase that?
Updated with Animations, new script, and Common Sense!
maarawoe said:
If I used all these tips I could nearly bought a low end phone for 1/4 of the price of my razr
Click to expand...
Click to collapse
I disagree. I have used many of these techniques (including turning off data) for a couple of years on various android devices. With the use of notification toggles you can still use it as a smart phone while receiving all the emails you need and maintaining good battery.
Sent from my XT910 using xda premium
Sorry I expressed myself incorrectly (in fact not correctly at all ;-) ) - I wanted to say that its a bit sad that we have to use such workarounds to get a worthy battery juice on the high end and quitew expensive phone..
I didn't wanted to disparage the tips above at all...
maarawoe said:
Sorry I expressed myself incorrectly (in fact not correctly at all ;-) ) - I wanted to say that its a bit sad that we have to use such workarounds to get a worthy battery juice on the high end and quitew expensive phone..
I didn't wanted to disparage the tips above at all...
Click to expand...
Click to collapse
Yes, I would agree, and some of my own tips I don't even use. But they're all there in case somebody needs their phone for some situation to last a little bit longer.
Does anybody know the difference between mot_hotplug and the hotplug governor?
WillKennerley said:
Does anybody know the difference between mot_hotplug and the hotplug governor?
Click to expand...
Click to collapse
Yes, mot_hotplug is just hotplug for Gingerbread. Since I've been on ICS for a while, that's the way I'm speaking. So mot_hotplug and hotplug are the same thing. Just different versions of Android.
Sent from my XT912
OP updated with awesome new tweaks scripts Kernel Modules, freezable apps, and a small performance section.
Excellent tips. I have a couple of questions though. What is the difference between Hotplug and HotplugX? Maybe we could put together a list of apps that are battery thirsty and their more effective alternatives.
Good work!
g_mosh said:
Excellent tips. I have a couple of questions though. What is the difference between Hotplug and HotplugX? Maybe we could put together a list of apps that are battery thirsty and their more effective alternatives.
Good work!
Click to expand...
Click to collapse
Thank you.
For clarification, when there is less CPU load, instead it taking 1 second to turn off CPU 1 it takes .5 seconds. When CPU 1 is needed it is turned on faster. Hotplugx does not just have different values of up threshold and down threshold, it actually has optimized code to turn the cores off and on faster. Those are hypothetical values, but you get the point.
Good idea! I added some that I know of, but I don't exactly go crazy with installing apps, so if anybody can give some help here, it's very welcome.
Updated with new battery sucking apps and links, more build.prop tweaks and clarified hotplugx.
Related
I have a script that i use in the init.d folder to keep some apps in memory i was wondering what the commands are to set the cpu frequency's and governor.
Im just trying to keep it simple i just want a the text for a startup script to set the minimum cpu freq and the gov state
example
Min 450
Max 1000
Gov: Performance
Im assuming this would be a busybox script im using zepplins bulletproof app code and i just wanted to throw some more code in there to play with cpu speeds. In a file with no extension in init.d folder.
Would this work?
Code:
#!/system/bin/sh
#
# By Mike Lierman
# www.mikelierman.com
#
# You may use, reuse, and modify freely.
#
# This script sits in the background and waits for Android to tell it that the phone is sleeping. It
# will then set a gentle 456MHz max cpu frequency, and turn off the second core; which cures insomnia.
FREQENCY_MAX="1000000" # 1GHz
FREQENCY_MIN="250000" # 250MHz
do
echo $FREQENCY_MIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo $FREQENCY_MAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
echo $FREQENCY_MIN > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq;
echo $FREQENCY_MIN > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq;
fi
done
no it wouldnt work because in the 2.3.3 kernel, it ignores what ever you tell it and does what ever it wants. you can try it but then look at the frequencies and see that it went back to 216 and 1ghz. in addition if you are using the performance governor it will run at max 100% of the time. thats just how the governor works
Just wanted to say if u take 03cpufreq from navens init.d hack and put it in init.d folder. Change permission and owners and edit the values to what u want in the script for min/max and go to setcpu u CAN use the slider bars to hold a min/max and change governor from performance/powersave and it WILL hold the value u set. I have been doing this.for over 5 hours now and it hasn't ONCE dropped below the 456 I set it at for min.
ashclepdia said:
Just wanted to say if u take 03cpufreq from navens init.d hack and put it in init.d folder. Change permission and owners and edit the values to what u want in the script for min/max and go to setcpu u CAN use the slider bars to hold a min/max and change governor from performance/powersave and it WILL hold the value u set. I have been doing this.for over 5 hours now and it hasn't ONCE dropped below the 456 I set it at for min.
Click to expand...
Click to collapse
ive been playing around with all those scripts for a day or 2 and i have been using cputuner to track what freq im at. it will stay until the kernel disables the 2nd core then it goes back to normal. i just did what you said and put it at 608 (its just what ever i clicked on) watch it stay up there until # of cores was 1 then i did something and back to 216. use cputuner to check your freq stats. im willing to bet that you have time spent in 216 and 312. i even used both the script to use performance governor and it runs it at what ever freq it wants. who ever set up this kernel was a ****tard
gnuworldorder said:
ive been playing around with all those scripts for a day or 2 and i have been using cputuner to track what freq im at. it will stay until the kernel disables the 2nd core then it goes back to normal. i just did what you said and put it at 608 (its just what ever i clicked on) watch it stay up there until # of cores was 1 then i did something and back to 216. use cputuner to check your freq stats. im willing to bet that you have time spent in 216 and 312. i even used both the script to use performance governor and it runs it at what ever freq it wants. who ever set up this kernel was a ****tard
Click to expand...
Click to collapse
Ill check that out. There gotta be a way to set both cpus. Some type of script or something. Maybe im wrong tho.
I just wanted to share a few tricks i learned to get graphics-intensive games to run much more smoothly. These commands should be run in android terminal emulator as root, in adb shell as root, or ran as a script with any script-running app with root privileges
All of the following is only temporary and will be reset to normal after a reboot
Code:
stop mpdecision
stops the hotplugging binary used to turn on/off extra cpus we want this gone because we want to specify which cpus are online ourselves
Code:
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu2/online
echo 1 > /sys/devices/system/cpu/cpu3/online
turns on the other cpu cores (you probably don't need all 3 extra cores on, just turning cpu1 online makes a big difference)
Code:
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
sets all online cpus to maximum frequency
Code:
echo performance > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/trustzone/governor
sets the gpu to stay at maximum frequency
as a script:
Code:
#!/system/bin/sh
stop mpdecision
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu2/online
echo 1 > /sys/devices/system/cpu/cpu3/online
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo performance > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/trustzone/governor
would this help improve general smoothness across the ui and other apps? Does it reduce the choppiness in the maps app????
It would, but i'm not sure how long the battery would last.
Faux kernel with Faux Clock you can do all this! It is great!
Jeepers. Seems the device gets hot enough without doing this, but what makes the user happy.
rushless said:
Jeepers. Seems the device gets hot enough without doing this, but what makes the user happy.
Click to expand...
Click to collapse
havent noticed mine get that hot at all?
Perhaps subjective to the user. Playing 3d games gets the device hot and OC ing will get it hotter. If the user does not mind, that is what matters.
may add this to the roms/ guides / etc list
bsimpson1 said:
as a script:
Code:
#!/system/bin/sh
stop mpdecision
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu2/online
echo 1 > /sys/devices/system/cpu/cpu3/online
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo performance > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/trustzone/governor
Click to expand...
Click to collapse
You might also want a script for when you're done with gaming. Probably something like:
Code:
#!/system/bin/sh
start mpdecision
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/trustzone/governor
This way once you're done with gaming/whatever, the phone can go back to scaling down CPU speeds and hotplugging cores to save battery. It's not very useful for an idle phone to have all 4 cores active and running at full speed.
What if I just reboot the phone, would that stop the script(s)? Anyone try the S4 with PSP emulator (PPSSPP)?
IamPro said:
What if I just reboot the phone, would that stop the script(s)? Anyone try the S4 with PSP emulator (PPSSPP)?
Click to expand...
Click to collapse
Rebooting would restart mpdecision, and therefore let your hotplugging go back to working order. I'm not certain it would reset your governor, though. So your phone may still be running at full speed 24/7, even after a reboot.
Cilraaz said:
You might also want a script for when you're done with gaming. Probably something like:
Code:
#!/system/bin/sh
start mpdecision
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/trustzone/governor
This way once you're done with gaming/whatever, the phone can go back to scaling down CPU speeds and hotplugging cores to save battery. It's not very useful for an idle phone to have all 4 cores active and running at full speed.
Click to expand...
Click to collapse
I don't think start mpdecision will do what you're intending but according to cat "/proc/`pgrep mpdecision`/cmdline" it was started by "mpdecision --nosleep --avg_comp"
My laptop felt kind of warm when I was using Remix, so I installed CPU-Z and checked the main tab. It said that all of my cores were running at near max performance, about 3.4 GHz, at all times, including when idle. Even stranger, according to the app Remix is supposedly running in "Power Saver" mode. If it was running in that mode core speeds would be much lower most of the time. Is there any way to correct this?
Lol...
Asking for support.. without "any" info about your hardware (laptop)
I've noticed this, too. In my case it's a Microsoft Surface Pro 2, with a Haswell based i5. I was initially investigating that Intel P-States weren't being used, but I have not had an opportunity to follow up on it thoroughly. I know on regular Linux with a 4.7 kernel the CPUs all clock down to .8Ghz when not busy. By default, on Remix the CPUs seem to all be running 1.6-2.2Ghz, even if nothing is going on.
This does make the tablet get hot and consumes the battery very fast, so it's not simply a reporting issue.
When I get a chance I'll boot with 'intel_pstate=force' and see if that does anything.
J M L said:
I've noticed this, too. In my case it's a Microsoft Surface Pro 2, with a Haswell based i5. I was initially investigating that Intel P-States weren't being used, but I have not had an opportunity to follow up on it thoroughly. I know on regular Linux with a 4.7 kernel the CPUs all clock down to .8Ghz when not busy. By default, on Remix the CPUs seem to all be running 1.6-2.2Ghz, even if nothing is going on.
This does make the tablet get hot and consumes the battery very fast, so it's not simply a reporting issue.
When I get a chance I'll boot with 'intel_pstate=force' and see if that does anything.
Click to expand...
Click to collapse
i have a 4200u and power management works fine. idles at .8 GHz , util 1%, temp 37-42C. turbo works 1.6-2.3 GHz temp 55-70C. intel_pstates is enabled by default.
intel_pstates may mess up if you disable turbo.
hwmonitor app gives better readings
Intel P-states might be a problem, but it seems to be going the opposite way. By default Remix is using Intel P-states, but the CPU won't clock lower than 1.6Ghz. Booting with "intel_pstate=disable" lets the CPU go down to .8Ghz. That lets things run a bit cooler, but the CPU and package aren't entering power saving states. Powertop made some suggestions:
Code:
echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs'
echo 'min_power' > '/sys/class/scsi_host/host0/link_power_management_policy'
echo 'min_power' > '/sys/class/scsi_host/host1/link_power_management_policy'
echo 'min_power' > '/sys/class/scsi_host/host2/link_power_management_policy'
echo '1' > '/sys/module/snd_hda_intel/parameters/power_save'
echo '0' > '/proc/sys/kernel/nmi_watchdog'
echo 'auto' > '/sys/bus/i2c/devices/i2c-3/device/power/control'
echo 'auto' > '/sys/bus/usb/devices/2-3/power/control'
echo 'auto' > '/sys/bus/usb/devices/2-4/power/control'
echo 'auto' > '/sys/bus/usb/devices/3-1/power/control'
echo 'auto' > '/sys/bus/i2c/devices/i2c-1/device/power/control'
echo 'auto' > '/sys/bus/i2c/devices/i2c-2/device/power/control'
echo 'auto' > '/sys/bus/i2c/devices/i2c-0/device/power/control'
echo 'auto' > '/sys/bus/i2c/devices/i2c-4/device/power/control'
echo 'auto' > '/sys/bus/i2c/devices/i2c-5/device/power/control'
echo 'auto' > '/sys/bus/i2c/devices/i2c-6/device/power/control'
echo 'auto' > '/sys/bus/i2c/devices/i2c-7/device/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:00.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:03.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:02.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:14.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:1b.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:16.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:1d.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.3/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.2/power/control'
Doing all of that lets the CPU enter better power saving states, but it's still won't enter the best power saving states. Linux with the 4.7 kernel does enter package C10, or whatever the best power saving states are.
The biggest issue for me, is that Linux (Remix and regular) frequently hangs a few seconds after waking from sleep. I don't think that's related to the problem of the CPU running too fast.
J M L said:
Intel P-states might be a problem, but it seems to be going the opposite way. By default Remix is using Intel P-states, but the CPU won't clock lower than 1.6Ghz. Booting with "intel_pstate=disable" lets the CPU go down to .8Ghz. That lets things run a bit cooler, but the CPU and package aren't entering power saving states. Powertop made some suggestions:
Doing all of that lets the CPU enter better power saving states, but it's still won't enter the best power saving states. Linux with the 4.7 kernel does enter package C10, or whatever the best power saving states are.
The biggest issue for me, is that Linux (Remix and regular) frequently hangs a few seconds after waking from sleep. I don't think that's related to the problem of the CPU running too fast.
Click to expand...
Click to collapse
working idle intel_pstates
Same thing over here on HP 820 G1 with i7-4600U.
I'm using 3C CPU Management to lock the speed to 800 MHz (lowest possible). It's cooling down my system from ~82°C (180°F) to ~40°C (104°F).
Still enough power to get a 1080 media file from internal NTFS SDD Drive to display flawlessly scaled down to 1366x768 by VLC App.
As I have <10 Posts I cannot link to the store directly... But c'n'p should work.
Maromi said:
working idle intel_pstates
Click to expand...
Click to collapse
I see the same thing as you. Kernel aduitor and cpu-z show the CPUs at 1600, even when they are otherwise idle.
J M L said:
I see the same thing as you. Kernel aduitor and cpu-z show the CPUs at 1600, even when they are otherwise idle.
Click to expand...
Click to collapse
Hwmonitor is the reliable app on the right side, cpuz is there to show what processor is used, settings shows the kernel, and terminal shows c9 is supported and what cpu microcode im using.
Maromi said:
Hwmonitor is the reliable app on the right side, cpuz is there to show what processor is used, settings shows the kernel, and terminal shows c9 is supported and what cpu microcode im using.
Click to expand...
Click to collapse
I double checked, and hwmonitor shows mine sitting at 1600 on all the CPUs, even with CPU usage at 1-3%. I also see c9 is supported, but without making all the changes I referenced above, powertop shows that none except c2 are used.
Booting to a regular Linux install with the 4.6 or 4.7 kernel shows P-states enabled and the CPU idles at 800. The difference is very obvious, as under Remix the tablet is noticeably warmer to the touch, even when sitting idle.
J M L said:
I double checked, and hwmonitor shows mine sitting at 1600 on all the CPUs, even with CPU usage at 1-3%. I also see c9 is supported, but without making all the changes I referenced above, powertop shows that none except c2 are used.
Booting to a regular Linux install with the 4.6 or 4.7 kernel shows P-states enabled and the CPU idles at 800. The difference is very obvious, as under Remix the tablet is noticeably warmer to the touch, even when sitting idle.
Click to expand...
Click to collapse
what powertop are you using cause for android im stuck on the same page regardless of command. all i see is cpu and bios c-states c1-c7
testing with Fedora 24 kernel 4.6.6 supported core c-states and cpu c-states all work.
achieved package c7(pc7) otherwise it would stay on pc2.
see warning in next post about the following settings
Code:
echo 'min_power' > '/sys/class/scsi_host/host0/link_power_management_policy'
echo 'min_power' > '/sys/class/scsi_host/host1/link_power_management_policy'
echo 'min_power' > '/sys/class/scsi_host/host2/link_power_management_policy'
echo 'min_power' > '/sys/class/scsi_host/host3/link_power_management_policy'
so odds are definitely not currently using c7 on remix os
did some reading i know this sucks but there is a legitimate reason why the default settings are what they are.
Warning: SATA Active Link Power Management can lead to data loss on some devices (e.g. Lenovo T440s is known to suffer this problem. Issue is still verified to occur on Linux kernel version 4.5.1. Do not enable this setting unless you have frequent backups.)
source:
https://wiki.archlinux.org/index.php/Power_management#SATA_Active_Link_Power_Management
i did not have any issues with it enabled and added su.d script. can't verify pc7 with powertop in android but i am getting signifigant lower temps in idle.
Maromi said:
what powertop are you using cause for android im stuck on the same page regardless of command. all i see is cpu and bios c-states c1-c7
Click to expand...
Click to collapse
My device dual boots Debian, so I attach the Debian root as a chroot and am using powertop 2.8 from there. That's also why it's easy for me to compare behavior with Remix's kernel and a generic Linux kernel. If I could get the stability of Linux 4.6/4.7 and Remix's interface, I would be very happy.
boppy.de said:
Same thing over here on HP 820 G1 with i7-4600U.
I'm using 3C CPU Management to lock the speed to 800 MHz (lowest possible). It's cooling down my system from ~82°C (180°F) to ~40°C (104°F).
Still enough power to get a 1080 media file from internal NTFS SDD Drive to display flawlessly scaled down to 1366x768 by VLC App.
As I have <10 Posts I cannot link to the store directly... But c'n'p should work.
Click to expand...
Click to collapse
for you the reason it runs cooler at 800Mhz is c-states runs the cpu with constant high power(battery killer C0). which means the cores are stuck on c3 and the package stuck on c2 or c3.
I believe there is a great deal of confusion or lack of technical explanation available here in the community, when we discuss the how’s, why’s and what’s behind the things we choose to modify in the Android OS in an attempt to squeeze better performance from a very complex operating system. Many of the things I tend to see presented to users are focused on very ineffective and ancient mentalities, pertinent to an older version of the operating system. Much of this is attempted through modifying build properties, and that’s usually about where it stops. My objective here is to describe some of the ins and outs of tuning a mobile operating system such as Android, and looking at it in a different light - not the skin you lay on top of it, but as advanced hardware and software, with many adjustable knobs you can turn for a desired result.
The key players here are, usually, without fail a couple of things alone:
Debloating – which, I suppose, is an effective way to reduce the operating system’s memory footprint. But I would then ask, why not also improve the operating system’s memory management functions? (arguably more important than merely removing unwanted apps)
“Build prop tweaks” – the famous build.prop, which is a property file by which you can apply very effective changes like the ones presented in my post_boot file (the only difference being when they are executed, and how they are written out), but most of the “tuning” done here focuses on principles that were only once true and, thereby, mostly irrelevant in today’s latest versions of Android. There are many things within the build.prop that can (and sometimes should) be altered to directly impact the performance of the DVM/JVM. However, this is almost always untouched.
Every now and then, somebody will throw a kernel together with some added schedulers, or some merged sound drivers, etc., but there is really little to no change that would effect real time performance observed by the user.
So, what about the virtual machine? What about the core operating system? – what Android actually is – Linux.
You’d be surprised how effective some simple modifications to just 1 shell file on your system can be at improving your experience as a user.
So, how do we make our devices feel like they have been reborn with just 1 file and not an entire ROM? That stock ROM you are on will suddenly feel not so stock.
My aim here is to talk about, at a medium to in-depth level, what exactly went into the file I added to the development section that turned a performance corner for your device. For now, let’s just talk about the CPU.
Let’s look at a snippet of some code from the portion of the file where most of the CPU tuning is achieved, we’ll use cluster two’s example. Bear in mind, the methodology here was used for cluster 1 as well – your smaller cores were treated the same, in theory:
Code:
# configure governor settings for big cluster
echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_sched_load
echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_migration_notif
echo "10000 1401600:30000 2073600:60000" > /sys/devices/system/cpu/cpu2/cpufreq/interactive/above_hispeed_delay
echo 20 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/go_hispeed_load
echo 10000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_rate
echo 20000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_slack
echo 806400 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/hispeed_freq
echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/io_is_busy
echo "40 1190400:60 1478400:80 1824000:95" > /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
echo 30000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/min_sample_time
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/max_freq_hysteresis
echo 307200 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/ignore_hispeed_on_notif
So what did I do here? Well, let’s start by explaining the governor, and then its modules.
Interactive: the interactive governor, in short, it works based on timers and load (or tasks). Based on load when the timers are ticked and the CPU is polled, the governor decides how to respond to that load, with consideration taken from its tunables. Because of this, interactive can be extremely exact when handling CPU load. If these tunables are dialed in properly, according to usage and hardware capability, what you achieve is maximum throughput for an operation, at a nominal frequency for that specific task, with an optimal delay. Most of the activity seen in an Android ecosystem is short, bursty usage, with the occasional sustained load intensive operations (gaming, web browsing, HD video playback and recording, etc.). Because of this unique user-interaction with the device, the default settings for interactive are, usually, a little too aggressive for a nominal experience – nominal meaning not “over-performing” (or the opposite) to complete the task and wasting CPU capability or overusing it. The interactive tunables:
use_sched_load: when this value is set to 1, the timer windows (polling intervals) for all cores are synchronized. The default is 0. I set this to 1 because it allows evaluation of current system-wide load, rather than core specific. A small, but very important change for the GTS (global task scheduler).
above_hispeed_delay: when the cpu is at or above hispeed_freq, wait this long before increasing frequency. The values called out here will always take priority, no matter how busy the system is. Notice how I tuned this particular setting to allow an unbiased ramp up until 1.40 GHz, which then calls for .4 seconds delay before allowing an increase. I did this to handle the short bursts quickly and efficiently as needed, without impacting target_load (the module, in this way, allows the governor free range and roam according to load, then, is forced to wait if it wants to utilize the faster but power-costly speeds up top). However, sustained load (like gaming, or loading web pages) would likely tax the CPU at intervals larger than .4 seconds. The default setting here was 20000. You can represent this expression as a single value, followed by a CPU speed and delay for that speed, which is what I did at the 1.40 GHz range. I usually design this around differences in voltage usage per frequency when my objective is more to save power, while sacrificing a slight amount of performance.
go_hispeed_load: when the CPU is polled (at the timer_rate interval) and overall load is determined to be above this value (which represents a percentage) immediately increase CPU speed to the speed set in hispeed_freq. Default value here was 99. I changed it to 20. You’ll understand why in a second.
timer_rate: intervals to check CPU load across the system (keep in mind use_sched_load). Default was 20000. I changed it to 10000 to check more often, and reduce the stack up delay the timer rate causes with other tunables such as above_hispeed_delay, as the timer rate is added on top of that value. Meaning if you set the timer rate to 10000 and the above higspeed delay to 50000, your total delay above hispeed is 60000).
hispeed_freq: counterpart to go_hispeed_load. Immediately jump to this frequency when that load is achieved. Default here, in Linux, is whatever the max frequency is for the core. So, the CPU would be tapped out when load is 99%. I usually set this to a lower speed and compliment it with a smaller go_hispeed_low value, and adjust dynamically all the way to max frequency. The reason I do this is to respond appropriately to tiny bits of usage here and there, which minimizes the probability that the CPU will start overstepping. There are a lot of small tasks constantly running, which can and should be handled by lower frequencies. The trick with this method of approach is to stay slightly ahead of the activity, which increases efficiency, while removing observed latency as much as possible. There is no hit in power by doing this. This principle of approach (on a broad scale) is how to use interactive to your advantage. I remove its subjective behavior by telling it exactly where to be for a set amount of time based on activity alone. There are no other variables. “When CPU load is xxxx, operate at these parameters.” Or, “when CPU speed is xxxx, operate at these parameters.”
io_is_busy: when this value is set to 1, the interactive governor evaluates IO activity, and attempts to calculate it as expected CPU load. The default value is 0. I always set this to 1, to allow the system to get a more accurate representation of anticipated CPU usage. Again, that “staying ahead of the curve” idea is stressed here in this simple but effective change.
target_loads: a general, objective tuneable. Default is 90. This tells the governor to try to keep the CPU load below this value by increasing frequency until <90 is achieved. This can also be represented as a dynamic expression, which is what I did. In short, mine says “do not increase CPU speeds above 1.19 GHz unless CPU load is over 60%... and so on…
min_sample_time: this is an interval which tells the CPU to “wait this long” before scaling back down when you are not at idle. This is to make sure the CPU doesn’t scale down too quickly, only to then have to spin right back up again for the same task. The default here was 80000, which is way too aggressive IMO. Your processor, stock, would hang for nearly a second at each step on its way down. 3/10th of a second is plenty of time for consistent high load, and just right for short, bursty bits of activity. The trick here is balancing response, effectiveness, acceptable drain on power, with consideration to nominal throughput.
max_freq_hysteresis: This one is a ramp down delay only enforced when the core’s max scaling frequency is hit, specified in µs (microseconds, i.e. 20000) which tells the CPU that when the core hits its max frequency, keep it there for this long before ramping back down. This parameter is used as an assumption, really, in the sense that “because CPU core0 was tapped out to max frequency, there is probably more heavy lifting coming, so we’ll remain here to make sure there isn’t more to do”
So, you can see how we are starting to better address the “activity vs. response” computing conundrum a little more precisely. Rather than throw some arbitrary numbers out there, I specifically utilize a frequency windows with a percentage of system-wide usage or activity. This is ideal, but takes careful dialing in, as hardware is always different. Some processors are a little more efficient, so lower speeds are ok for a given load when compared to another processor. The key is understanding the capability of your hardware to handle your usage patterns appropriately, is absolutely critical to get this part right – the objective is not to overwork, or underwork, but to do just the right amount of work. Turn small knobs here and there, watch how much time your CPU spends at a given speed, and comparing that with real time performance characteristics you observe, etc… maybe there is a little more stuttering in that game you play after this last adjustment? OK, make it slightly more aggressive, or let the processor hang out a bit more at those high/moderately high speeds.
One way I like to measure the effects of these adjustments is to use graphical benchmarks that don’t really push the limits of the hardware, but bring it right to the edge. You simply watch framerates, stuttering, and turn knobs as needed.
That’s about it for this, hope this provided a little bit of clarity for some of you! I’ll do another write up on the vm (virtual machine) adjustments another time.
thank you for this topic , Any details on ' build.prop tweaks ' ?
and what's the best app for CPU Config ?
Please, can you maie a GPU tweak tutorial?
H-banGG said:
thank you for this topic , Any details on ' build.prop tweaks ' ?
and what's the best app for CPU Config ?
Click to expand...
Click to collapse
Kernel auditor
And which shell file do i have to edit?
I was tired of badly designed SIP clients eating 100% CPU and keeping the device awake, when trying to re-register on a SIP server. So i changed some settings in Synapse for my Note 4 N910F.
When device is asleep (screen locked), the CPU is on minimum freq (268 Mhz).
when screen is unlocked, maximum frequency is 2000Mhz (vs 2800 by default).
these settings helped me get solid 1 day uptime (with quite a lot of browsing), or sometimes 2 days. No problem with calls, or waking the device. (Note 4 Snapdragon).
even when the sip client is keeping the device awake, it is still manageable (due to minimum cpu freq).
This seems so cool!!! Thank you for this write up!! Has anyone ran any battery life and performance benchmarks to see if these mods makes any difference, good or bad?
Also, which shell file do we modify? Which folder is it in?
Neo3D said:
This seems so cool!!! Thank you for this write up!! Has anyone ran any battery life and performance benchmarks to see if these mods makes any difference, good or bad?
Also, which shell file do we modify? Which folder is it in?
Click to expand...
Click to collapse
@warBeard_actual shared his modified file here: https://forum.xda-developers.com/ax...017-axon-7-msm-8996-cpu-vm-ram-t3557392/page6
Hi there,
My Messaging APP can hardly stay running in background, and this cause me receive those important messages late. After digging in some information, I found that changing the three oom values of the process can make LMK see this process as high priority and won't kill it easily. By the way, I also changed niceness. However, it seems that Android system will change those oom values itself after a particular duration, so my tweak can only take effect in a short time. Is there any way to lock oom values or reach the same result?
My script of changing oom values and niceness:
Code:
#!/system/bin/sh
X=$(pidof jp.naver.line.android)
echo "-17" > /proc/$X/oom_adj
echo "0" > /proc/$X/oom_score
echo "-1000" > /proc/$X/oom_score_adj
renice -n -20 $X