Kernel for Nexus 5
Q. Does doubletap2wake/sweep2wake drain battery?
A. Yes, on this device it does. If you choose to enable the wake functions, you can set a timeout or use the power key toggle option to quickly disable dt2w if you won't be using the phone for a while.
Q. My min frequency is stuck at 1267MHz.
A. No, it's not. When you touch the screen, the frequency is temporarily boosted to 1267MHz. The min frequency will go back to 300MHz when you're not looking. But there is a way for it to get stuck at 1267 if you have certain apps set to automatically save and apply settings. My recommendation: DON'T MESS WITH THE FREQUENCIES!!! Set them in the installer and leave it alone.
Q: What is the difference between standard and express versions?
A: Standard uses the Aroma installer to customize kernel settings. Express is a standard .zip flashed in recovery with default kernel/aroma settings. Any previous aroma install settings will be kept when flashing express. It is recommended to install the aroma version the first time, and the express version for subsequent installs (unless you want to change some settings).
Q. Does this kernel have good battery life?
A. Yes. The best, and it doesn't compromise performance.
Q. What app should I use to control the kernel?
A. You don't need an app, choose your settings in the installer. If you want to tinker you can use Faux Clock, Franco Kernel Updater, TricksterMod and probably other apps.
Q. Should I disable mpdecision?
Q. I have really bad battery drain, any ideas?
A. You might have sweep2wake or doubletap2wake enabled. Otherwise, there is something wrong with your phone.
Q. I have [some random problem], any ideas?
A. There is something wrong with your phone. Wipe and reinstall. The major releases of this kernel are 100% stable and everything works.
1. If you've been using another custom kernel, reflash your ROM without wiping data
2. Install zip from recovery
3. Follow the instructions, if you don't know what to do, use the preselected options
Please consider a donation to support ongoing development
Many thanks to those who have donated!
Special thanks to @jonas2295 for the ElementalX logo
Android M preview:
Android 5.1/5.1.1 (Lollipop):
Note: Version 4.00 and later do not have the "chrome freeze" that some people experienced on 2.x versions
If you need permissive on boot (required for AOSIP and some other ROMs), flash this:
Android 5.0.1/5.0.2 (Lollipop):
An app to customize Wake Gestures:
Stock/AOSP (Android 4.4.3/4.4.4):
Cyanogenmod/CAF (Android 4.4.3/4.4.4):
Stock/AOSP (Android 4.4.2):
Wake Gestures Xposed Module (requires version 0.40 or higher)
Thanks @C3C076 for the Wake Gestures Xposed Module
ElementalX Google+ Community:
ElementalX Configuration File
Your choices in the Aroma installer are used to build a configuration file. The config file is located at /etc/elementalx.conf. You can edit this file to change kernel settings. Whatever is set in this file will take effect when the device is booted (unless other scripts or apps interfere!)
If settings are not sticking:[*]Make sure you have busybox installed correctly and updated to the latest version[*]Make sure the file permissions for /etc/init.d/99elementalx are set to execute.[*]Check to see if any /etc/init.d scripts or apps (such as Kernel Tuner or TricksterMod) are interfering with your settings.
ElementalX Log File
Every boot, a log file is created at /data/local/tmp/elementalx-kernel.log. This file shows the date and time and all settings that have been applied. Use this to verify and troubleshoot configuration options.
The ElementalX CPU governor has been specifically designed and tuned to get the best balance between battery life and performance. By default, it is more conservative than Ondemand. During routine usage, the CPU frequency does not ramp up very often. If gboost is enabled, during gaming or any other graphics intensive situation, the CPU frequencies boost much easier in order to maintain maximum performance. There is also a built in input boost. There are several tunables specific to the governor:
input_event_min_freq: takes four values separated by comma. These are the input boost frequencies for cores 0, 1, 2, and 3 (default 1728000, 1267200, 1267200, 1267200)
input_event_timeout: this is the length of time in milliseconds that the input boost will be active (default 500). Setting this to 0 disables input boosting.
ui_sampling_rate: when you touch the screen, the sampling rate changes temporarily to whatever you set here (default 15000)
two_phase_frequency: this sets the max frequency for moderate loads. Accepts four frequency values separated by comma, for cores 0, 1, 2, and 3. (default 1728000, 1728000, 1728000, 1728000)
How does it work? It's basically a multiphase ondemand governor.
The basic governor is very conservative for most phone activities, spending most of its time at 1267MHz. If there is graphics load, we switch to a two phase ondemand. The first phase runs with a max freq of 1728MHz (default). If the load increases, it goes to max frequency (default is 2265MHz) and the minimum frequency changes to 1267200 (I will probably make this tunable)
The input boost does a couple things. First, it lowers the sampling rate for the timeout duration to make the governor more responsive. Second, it boosts the frequency of any online cores. You can disable this by setting input_event_timeout to 0.
If you want to experiment, delete /system/lib/hw/power.msm8974.so and set the input_event_timeout to about 1000. But I recommend leaving it alone for optimal smoothness.
Faux Clock/TricksterMod/Kernel Tuner/etc
You don't need these apps because the ElementalX installer sets everything up automatically, but if you want to check or change settings, you can use these apps. Just be aware that some of them (e.g. Kernel Tuner) are set by default to apply settings on boot, which can interfere with the settings you chose in the ElementalX installer.
Overclocking (or underclocking) is optional. The installer lets you choose the maximum frequency. You can set the maximum frequency individually for each CPU core in the installer. Whatever frequencies you chose in the installer will be set at boot for each CPU. Not all devices can handle overclocking. I don't recommend overclocking, this device is fast enough. If you overclock, the CPU frequency will likely be throttled due to heat. I recommend the stock frequencies, as this device is plenty fast.
The installer allows you to choose from several undervolting options. These automatically undervolt the lowest frequency (300MHz) where the CPU spends most of its time. The voltages for other frequencies are assigned based on the PVS bin of your phone. CPU voltages are fully customisable with apps such Kernel Tuner or Trickster Mod, but I recommend leaving these other voltages as-is unless you are prepared to do a lot of testing. Be careful, lowering voltages can cause instability. Generally, having reboots while the phone is asleep or other weird problems is a sign that your minimum voltage is too low.
The default GPU govenror is ondemand. It works well and is recommended for best balance between performance and batter life. The simple governor is also available, but ramps up the GPU frequency much quicker than ondemand, so may impact battery life. The governor can be set in /etc/elementalx.conf
fsync can be disabled if you're looking for the last ounce of performance. I recommend leaving it enabled as there is a slight risk of data loss if your phone shuts off unexpectedly before filesystems are synced.
Max screen off frequency
The default max screen off frequency is 1190MHz, which is a good balance between limiting the voltage/frequency and the time required to complete tasks while the screen is off. This can be changed manually at /sys/devices/system/cpu/cpu0/cpufreq/screen_off_max_freq
Installing a new ROM
If you install a new ROM, it will probably replace this with the stock kernel and will definitely overwrite /etc/init.d/99elementalx and /etc/elementalx.conf so you will lose your settings and certain features. So always reinstall the kernel after installing a ROM.
NTFS and exFAT support
This is for anyone who wants to use OTG to connect a USB stick or portable harddrive formatted with Microsoft's NTFS or exFAT filesystems. You will need Stickmount or a similar app.
F2FS support is built into the kernel, however, you will need to have an F2FS compatible kernel installed before you install ElementalX to get all the proper ramdisk stuff.
This is a new feature similar to the Motion Launch Gestures on the HTC One m8. Requires this Xposed module: http://forum.xda-developers.com/xposed/modules/app-wake-gestures-v1-0-t2768266
Set /sys/android_touch/wake_gestures to 1 to enable input events for wake gesture actions. Set to 0 to use traditional sweep2wake or doubletap2wake (wakes up the phone and turns on the screen only).
Note that if you enable wake_gestures, nothing will happen if you don't install the Wake Gesture Xposed module.
Sweep2wake allows you to turn on your phone by swiping your finger across the screen. There are four sweep actions that will work
Add up the values for each gesture you want to enable and put the total in /sys/android_touch/sweep2wake. For example, to enable all gestures, the value is 15 (1+2+4+8). To enable sweep right, sweep left and sweep up, the value is 7 (1+2+4)
DoubleTap2Wake (DT2W) allows you to wake the device by double tapping anywhere on the screen. This causes significant battery drain. You can edit /etc/elementalx.conf to change the setting on boot.
0 = disabled
1 = enabled (bottom of screen only)
2 = enabled (full screen)
Haptic feedback can be enabled for the wake gestures in /sys/android_touch/vib_strength. This setting takes a number between 0 and 90. Default is 20. Setting this to 0 disables haptic feedback for gestures.
S2W/DT2W power key toggle
If enabled, turning the screen off with the power button disables s2w and dt2w to save battery (since s2w/dt2w cause significant battery drain). When you turn the screen back on, s2w and dt2w return to their previous settings. If the screen times out, s2w/dt2w are not disabled this is only if you use the power button to turn it off. You can edit /etc/elementalx.conf to change the setting on boot.
Doubletap2wake and sweep2wake can be automatically disabled after a certain number of minutes. I give a few choices between 5 and 120 minutes in the installer. Default is 30 minutes. You can put in whatever you want in /etc/elementalx.conf.
When the screen is turned on, the timeout is canceled and will start again next time you turn the screen off. This means that if you have your screen set to come on for incoming messages or notifications, the timeout will start over again.
If you also enabled the power button to toggle s2w/dt2w, there is no timeout when you use the power button, the wake functions are immediately disabled (same as before).
You can edit /etc/elementalx.conf to change the setting on boot.
Sweep2Sleep allows you to put the device to sleep by sweeping your finger across the navigation bar area. Unlike Sweep2wake, this does not cause any battery drain. You can edit /etc/elementalx.conf to change the setting on boot.
0 = disabled
1 = sweep right
2 = sweep left
3 = sweep left or right
There are two color presets: stock and slightly cooler. You can edit /etc/elementalx.conf to change the setting on boot.
0 = stock color
1 = slightly cooler color
Backlight dimmer allows you to adjust the LCD screen brightness lower than is possible with stock. Be careful, you can lower the brightness so much you can barely see it. You can edit /etc/elementalx.conf to change the setting on boot.
0 = disabled
1 = enabled
USB fastcharge is optional. This will allow you to charge at a faster rate when connected to a USB port. The default limit for USB ports is 500ma, this increases it to 900ma. Be sure that the computer/laptop/whatever you are plugged into can handle it. Some will automatically cap it at 500ma. Please note that this does not force AC charge mode like previous implementations of force fastcharge. Your battery setting will still say USB mode. You can edit /etc/elementalx.conf to change the setting on boot.
ElementalX Kernel, Kernel for the Google Nexus 5
Source Code: https://github.com/flar2/ElementalX-N5
Kernel Special Features:
Current Stable Version: 4.02
Stable Release Date: 2015-06-25
Current Beta Version: 5.01
Beta Release Date: 2015-06-25
Last Updated 2015-06-26