I'm by no means a pro at kernel building but I've put lots of effort into this kernel so I thought I'd share it with you. After a very long inner conflict period I've decided to post in the android development forum instead of the original android development. I've included features of my own as well as patches and other features of many other top notch kernel developers. I would prefer if you make your way over to my source (link below) and read the commits so you can get to know them and how they have contributed but alas I not that naive enough to think any of you really would actually go and do that so I've included a nice feature list in post 2 with proper credits (at least for the big stuff).
I am a huge fan of giving you options which is why I build my kernel with multiple toolchains for you to test out and decide which option you find works best for you. You'll notice that besides my two favorite toolchains (Linaro 4.10 and SaberMod 4.10.0) I also build a Google 4.8/4.9, SaberMod 4.8/4.9, Linaro 4.9.2 kernel about once a week. Give them all a try and decide which you like best!
I also made a Release Folder that contains kernels that do not contain any CPU or GPU overclock to keep things more stable for you. This kernel is built with SM 4.9.2 since I feel like that give the best battery. Choose this option for stability.
I frequently get asked if this kernel works with the many AOSP projects. The answer is YES! I haven't found an AOSP ROM yet that won't boot with this kernel. The only potential issue is that the ROM you flashed this kernel with has modified the ramdisk from stock. If that's the case use http://goo.im/devs/Cl3Kener/HAMMERHE...MAGE-4.4.3.zip to flash back to stock and then flash my kernel. My kernel uses you ramdisk while flashing for great ROM compatibility but sometimes this backfires.
Do not flash on CM or CM-based ROMs! This kernel is not currently compatible with those "CAF-based" ROMs.
WARNING!!! Even though I don't post anything unless it works (in this case on most if not all AOSP ROMs) I still don't want to be liable for user errors. In other words, if you flash one of these Kernels your warranty is void and I AM NOT RESPONSIBLE for any data loss or bricked devices etc.
If you are unsatisfied with UBER you can uninstall it. Here is the link to the uninstaller http://d-h.st/y1k
* Based upon Google's msm 3.4.y source for Hammerhead
* MultiROM Compatible (has Kexec patch)
* Latest 3.4.103 kernel version from Kernel.org
* Compatible with Stock as well as AOSP projects (CAF-based do not work sorry CM fans, CAF-kernel is just not as stable and battery friendly imao so I'll stay AOSP for now). If it doesn't work on a ROM let me know!!!
* CPU Governors added: Intellidemand, Intelliactive, Adaptive, Lionheart, AbyssplugV2, Ondemandplus, Badass, Wheatley, Hyper, Lazy, PegasusQ, Nightmare, DanceDance, Darkness, Slim, Optimax. and Uberdemand
* GPU Governors: Performance, Ondemand, and Interactive (Franco)
* IO Schedulers: Noop, Deadline, VR, SIO, ROW, CFQ, BFQ, FIOPS, FIFO, ZEN and Tripndroid
* Compiled with Custom Linaro 4.10.0/4.9.1 toolchains (Cl3Kener) (see https://github.com/Cl3Kener/)
* Compiled with Custom SaberMod 4.10.0-4.8.3 (sparksco and Team SaberMod)
* -O3 optimized with neon and graphite enhancements (Cl3Kener)
* Linaro compiler flags for greater optimization build wide (Cl3Kener)
* Snapdragon & CortexA15 optimizations (Tons of Contributors)
* Non-Stock Hotplug and Thermal regulator (from showp1984)
* Touch Boost - Showp1984 (comes with hotplug)
* GPU OverClock up to 650 MHz (27 MHz is still default idle with lowest frequency being underclocked to 100 MHz) (Cl3Kener)
* Allow CPU OverClock up to 3.0 Ghz (Cl3Kener)
* Allow CPU UnderClock to 96Mhz (showp1984 implementation)
* L2 Cache OverClock (flar2)
* Ramdisk Edits on the fly for greater compatibility. (Strongly based on Showp1984 implement)
* Undervolting Control (Franco)
* LZ4 support implemented kernel wide - fastest compression/decompression available (decreases boot time by about 2-3 seconds) (Cl3Kener)
* Google Snappy Compression/Decompression support (just in case you want it)
* XZ Compression to latest 3.17.y (Cl3Kener)
* KSM (Kernel Samepage Merging)
* Frandom Support- Super Fast Random Number Generator to reduce lag (Implemented by default, if you have issues delete 00_frandom init.d file and rest assured kernel default is patched to 3.17.y)
* Faux Sound (Faux123)
* Sweep2Wake, Double Tap 2 Wake (Showp1984 with Faux123 verticle s2w support and flar2 dt2w enhancements)
* Powerkey suspend for S2W/DT2W (Flar2 version)
* Wake timeout for S2W/DT2W (Flar2)
* Dynamic and Asynchronous Fsync (Faux123)
* USB Fast Charge with many voltage options (Faux123)
* Gamma Control (Various Contributers)
* Color Control (savoca)
* Fstrim (reduces lag see more: http://man7.org/linux/man-pages/man8/fstrim.8.html)
* Backlight Dimmer (Flar2)
* ExFat Support (you'll need to load it via this init.d https://www.dropbox.com/s/tfm8k9vmskuhs4v/loadexfat) Updated to latest version (Neobuddy)
* Low Memory Killer - Many patches from Neobuddy
* Zram support upstreamed to 3.17.y branch (Cl3Kener)
* Zram supports lz4 compression now (kernel.org)
* Zcache, and Cleancache support updated to 3.14.y (Cl3Kener)
* BLX - Battery Life Extender (See here http://forum.xda-developers.com/nexus-s/development/mod-battery-life-extender-blx-t1257497) Ported by Ayysir to msm8974 devices
* F2FS file system support from Samsung
* Mount internal storage as CDROM (Frozen Cow)
* Advanced TCP Congestion Options (Veno as default, all 12 from http://kernel.org)
* Stereo Call Recording Support
* Uber.cfg for tuning kernel thanks to @janres155 & @Williamsss
* Many patches to improve various parts of the kernel (see source)
* Full Source including defconfig is available for you use/learn from. (Not a feature but I feel it is important that my source is complete so you can build directly from it if you want to learn and experiment)
1. For best results a install these kernel after a fresh ROM install (although it still should work if you don't do that)
2. Reboot into recovery (needs to be N5 AOSP 4.4.4 compatible)
3. Flash Kernel Zip
4. Reboot and let Settle for ~10 minutes (optional but recommended)
5. Navigate to system/etc/uber_v1.3.cfg using your favorite root file browser and change values based on descriptions to whatever you want.
SPECIAL THANKS TO:
Dennis Rassmann - for all of his kernel work. I'm in love with all of his features and you'll find them all in my kernel.
Ayysir - for his wonderful tutorial on making a bash script to build kernels.
Other great kernel devs - I cherry-pick work of all of the kernel greats!
Google - for kernel base and AOSP!
LG - for manufacturing this awesome phone!
I have RRs with this kernel but not with others, why is that? I have undervolted some other kernel features besides the cpu that you cannot change to save you battery. On some N5s (since not all are created equal) you may actually have to increase voltages on cpu or else you keep getting RRs. Try +25 across CPUs and see if that fixes your RRs. If not keep going down the list.
Having issues with Undervolting? The chief complaint about this kernel is that "I can't uV as much as I can with other kernels." I have undervolted other kernel features (ie cpu regulators) that you cannot change to save you battery. This makes it hard for you to uV the cpu voltages as far but rest assure you'll still be getting better battery for it. Also, be aware that undervolting is a little dangerous in this kernel because of the potential of data loss when dynamic fsync is enabled. If you do decide to undervolt make a backup first so when your phone crashes you can restore. Also be aware that most of the logs ending in wdog_reset are caused by too much uV so before you post a log that ends in wdog_reset please stop undervolting first to see if the RRs persist. Below -25 uV seems to be the point where most users experience issues. Also keep in mind that voltage is important in benchmarking. Many people are benchmarking at incorrect voltages for their devices. I have to add +25 mV to all values so that it doesn't RR during benchmark. Each phone is a little different so some of you may be fine as is and some of you may need to go +50 mV or even potentially more. You'll have to experiment to see where your phone's "sweet spot" is. I again recommend also disabling Dynamic Fsync until you have figured out where that sweet spot is to prevent data loss.
Why am I having issues with ROMs on MultiROM? From my experiences, Custom Kernels and MultiROM have always not played well together. Flashing a custom kernel on Internal ROM has never been an issue you try and flash a custom kernel on ROMs 2-whatever you have weird permission issues which can cause all sorts of problems for you (apps crashing, RRs, loss of root, etc). This is probably why the kernel sharing feature was added which is good but has it's own set of problems when using UBER. (See post directly below) To reiterate, this is not a bug in UBER or MultiROM just a slight incompatibility between the two we have to overcome by hand.
UBER works fine on Internal ROM but has issues on ROMs 2 and beyond when using MultiROM and sharing UBER why is this? UBER is not specifically geared for use in MultiROM, not because I don't like multiROM but simply because of Uber's nature. UBER uses showp1984's custom msm_mpdecision and thermal which conflict with proprietary mpdecision and thermal regulators and cause RRs if these files are present. During normal kernel flash these files are renamed and don't conflict with UBER. When you share this kernel during ROMs 2 and beyond can still be used safely if you know what you're doing. In order to allow ROMs 2, 3, and beyond to share the kernel you must delete N5 proprietary files found at system/bin/mpdecision and system/bin/thermal-engine-hh when running those ROMs. It is a fairly easy process, just install a Root File Browser, locate then, and delete. Normally in kernel flashing process I rename those files to mpdecision_bck and thermanl-engine-hh_bck for you so you never have to see or worry about them. If you use Sharing Feature on MultiROM you'll have to deal with these yourself. I apologize for this inconvenience but there is nothing I can do from my end. Flashing UBER on ROM 2 breaks it and sharing has problems until you remove these two files.
Why are certain apps crashing on me? Most likely it is due to Frandom. I have implemented Frandom by default in this kernel and to my knowledge I'm the only developer that does that by default. Some apps or mods may not be frandom compatible. Most are 100% compatible but not all. If you notice programs stop opening or are having constant reboots try removing 00_frandom from the init.d folder and reboot. I think for stable releases which I plan on posting on XDA this weekend I will not have frandom implemented by default but in nightlies it will always be implemented. Also if you keep having random reboots this is something to try as well.
Not booting? Maybe you have Ramdisk Incompatibility. This kernel uses your ramdisk. Most of the time that works well. Sometimes it does not. Make sure to flash http://goo.im/devs/Cl3Kener/HAMMERHE...MAGE-4.4.3.zip and try again if it doesn't boot. If it still doesn't boot make sure to verify that it is not CAF. Some ROMs fail to mention they are CAF-based but they really are.
My phone crashed once during benchmarking or for no apparent reason and now keeps randomly rebooting. My guess is you have Data Corruption. If you crash your phone out benchmarking or have a frandom related RR and you still keep getting RRs you might have data corruption. This usually happens when you have Dynamic Fsync enabled because Fsync is disabled when screen is on. When testing I crash my phone all of the time and apps and things get messed up. Having a backup is good but if you don't want to waste time backing up all of the time you can salvage things still. Here is what I do when I've crashed the phone and continue to get soft reboots: 1) I install SD Maid from the Google Play store. (I have pro version so I can clean more but free version should work well enough) 2) I use SD Maid to clean all of the app data. (don't worry it is smart enough to not loose your passwords so you won't have to resign into your apps) Then I download ROM Manager by Koush. I don't actually use ROM Manager I just think it has the best permissions fixing feature of any app I've tried (including recoveries). I select the option Fix Permissions toward the bottom of the free version. It then prompts a reboot and then I reboot and life is good again.
I have battery drain when nobody else does.... help!!! Install a wakelock detector and figure out what is keeping your CPU awake. If it's an app. Fix permissions, clear app data, reinstall app, disable app, etc. until is stops having issues.
Still have problems? Search my Google+ community in the questions category. If you don't find anything see below:
I am always open to hearing about your errors although just telling me something went wrong without giving me details does me absolutely no good. So here are my expectations if you do want to complain about something not working:
1. Please list the ROM you are using,
2. The IO scheduler you were using
3. The CPU governor you were using
4. The CPU frequency range
5. What you have done to attempt to fix it.
6. If you were able to simulate it again using the same settings.
7. Anything else you think is applicable to the issue
I would also hope that you would consider trying some of the following things to fix your issue before you ever report it because most of these things will fix the problem without me even having to change a thing.
1) Fix file permissions using a program that does a thorough job. I recommend using the fix file permissions in ROM manager because it is the best I’ve seen. For the record, I don’t actually use ROM manager for anything other than fixing permissions. Please consider trying this first because it tends to fix most of the FC/RR/SOD errors you might have.
2) Make a backup and install a clean version of the ROM you are running and see if you are still experiencing those same errors. You may have corrupted files if you’ve been dirty flashing.
3) If that doesn’t solve it, redownload and reflash, maybe something got corrupted but it still managed to flash. This happens sometimes and I can cause you grief.
4) Pull a logcat. MAKE SURE TO DISABLE DYNAMIC FSYNC BEFORE LOGGING!!! LEAVING IT ENABLED WILL CORRUPT YOUR LOG!I know not everyone knows how to do this but you can learn if you check out this OP or if you aren't comfortable with using terminal commands to pull a log just install Bootlog Uptime and set it up to autocopy log on RR. Opening the program after crash will autocopy your log and you send it to me.
Thanks to the uber.cfg you no longer need to tune manually because you have the following already in the kernel:
1. BOOT SETTINGS
1.1 KERNEL SWITCH
1.2 GRACE TIME
1.3 WAIT TIMERS
1.4 FILE SYSTEM TRIM
2. CPU SETTINGS
2.1 CPU SETTINGS SWITCH
2.2 CPU FREQUENCY SCALING
2.2.1 CPU FREQUENCY SCALING SWITCH
2.2.2 CPU MAX FREQUENCY
2.2.3 CPU MIN FREQUENCY
2.3 CPU GOVERNOR
2.3.1 CPU GOVERNOR SWITCH
2.3.2 CPU GOVERNORS
2.4 CPU MULTICORE POWER SAVING
3. CPU VOLTAGE SETTINGS
4. HOTPLUG SETTINGS
4.1 MPDECISION SWITCH
4.1.1 MPDECISION SCREEN-OFF MAX FREQUENCY
4.1.2 MPDECISION SCREEN-OFF SINGLE CORE
4.1.3 MPDECISION TOUCHBOOST
4.1.4 MPDECISION MIN CPUS
4.1.5 MPDECISION MAX CPUS
4.1.6 MPDECISION HOTPLUG CONTROL
4.1.7 MPDECISION UNPLUG CONTROL
10. WAKE SETTINGS
10.1 WAKE CONTROL SWITCH
10.2 DOUBLE TAP TO WAKE
10.3 SWEEP TO WAKE/SLEEP
10.4 POWERKEY SUSPEND
10.5 WAKE TIMEOUT
11. MISCELLANEOUS SETTINGS
11.1 TCP CONGESTION CONTROL
11.2 DYNAMIC FSYNC
11.3 POWER SUSPEND
11.4 VIBRATION INTENSITY
11.5 USB FAST CHARGE
11.5.1 FAST CHARGE SWITCH
11.5.2 FAST CHARGE LEVEL
11.6 BATTERY LIFE EXTENDER
I still left these commands for people that like to see them anyways:
To enable - echo 1 > /sys/kernel/dyn_fsync/Dyn_fsync_active
To disable - echo 0 > /sys/kernel/dyn_fsync/Dyn_fsync_active
KSM (Kernel Samepage Merging)
To enable - echo "1" > /sys/kernel/mm/ksm/run
To disable - echo "0" > /sys/kernel/mm/ksm/run
USB Fast Charge
To enable - echo 1 > /sys/kernel/fast_charge/force_fast_charge
This makes USB to computer connections transfer current the same as the wall charger. (Classical version)
Faux123 added the a ability to change currents to 500 900 1200 1500 2000. Enable by doing this
To enable custom - echo 2 > /sys/kernel/fast_charge/force_fast_charge
echo 1500 > /sys/kernel/fast_charge/fast_charge_level
change value 1500 to whatever you want (as long as it's one of those 5 values)
To disable - echo 0 > /sys/kernel/fast_charge/force_fast_charge
Set Default IO Scheduler
IO Acceptable values are bfq, cfq, deadline, fifo, fiops, noop, row, sio, vr, zen
echo "bfq" > /sys/block/mmcblk0/queue/scheduler
Set Default CPU Governor
Acceptablevalues are adaptive, badass, intelliactive, dancedance, wheatley, abyssplugv2, ondemandplus, intellidemand, interactive, conservative, userspace, powersave, lionheart, ondemand, performance and others mentioned in kernel features above.
echo "1" > /sys/devices/system/cpu/cpu0/online;
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor;
echo "1" > /sys/devices/system/cpu/cpu1/online;
echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor;
echo "1" > /sys/devices/system/cpu/cpu2/online;
echo "ondemand" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor;
echo "1" > /sys/devices/system/cpu/cpu3/online;
echo "ondemand" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor;
N is disabled, Y is enabled.
echo "N" > /sys/module/lm3630_bl/parameters/backlight_dimmer
Toggle 0 is disabled 1 is enabled.
echo "0" > /sys/kernel/msm_mpdecision/conf/boost_enabled
Double Tap To Wake
There are three options here:
0 is disabled
1 is normal dt2w (bottom half of screen)
2 is full screen dt2w
echo "0" > /sys/android_touch/doubletap2wake
This one is tricky because there are two files to change. If you want both only run
echo "1" > /sys/android_touch/sweep2wake
If you only want sweep2sleep you'll have to run this as well.
echo "1" > /sys/android_touch/s2w_s2sonly
To disabled run both run these commands but with 0s instead.
GPU Governor Toggle
Acceptable values are "performance" "simple" or "ondemand". Ondemand is default so I placed simple here. Performance will freeze system is placed at full OC (at lest for me so be careful!)
echo "ondemand" > /sys/class/kgsl/kgsl-3d0/pwrscale/trustzone/governor
Frequency options (Use values on the left for init.d script)
533333000-> 533 Mhz
487500000-> 487 Mhz
450000000-> 450 Mhz
389000000-> 389 Mhz
320000000-> 320 Mhz
200000000-> 200 Mhz
150000000-> 150 Mhz
Set Max GPU:
echo "320000000" > /sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/max_gpuclk
Set Min GPU:
echo "150000000" > /sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/min_pwrlevel
SET DEFAULT BOTTOM CLOCK SPEEDS
(If you want to set max change crom scaling_min_freq to scaling_max_freq on bottom four) Acceptable values any of the clock speeds.
echo "96000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
echo "96000" > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
echo "96000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo "96000" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo "96000" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
echo "96000" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
Stock Value is 63. Range of acceptable values is 0-100
echo "63" > /sys/class/timed_output/vibrator/amp
# dirty_background_ratio default is 10 (background meaning screen is off usually)
echo "20" > /proc/sys/vm/dirty_background_ratio
# dirty_ratio default is 20.
echo "40" > /proc/sys/vm/dirty_ratio
Set MPDecision Values
Note: Only change these values after you've played with them in your favorite kernel tuning app. I recommend figuring out your settings then finding these files with a root browser then you can fill these init.d lines in with your root browser of choice.
Set Thermal Values
Go to /sys/kernel/msm_thermal/conf/ in a root file browser and change the values
I recommend that you figure out what you like and then create your own init.d script like I did. Here is the link to my example Script. I have 99 appended to the front so that it will run last resetting any previously set settings. https://copy.com/cyApOWNSjPs1
The holidays will be here in no time, so why not start thinking about … more
21 Sep 2014
By Jimmy McGee
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer?