[Kernel][August 9] Electroactive Kernel 2.52 (Lollipop) Electroactive 3.10 (AndroidM)

Config file or no Config file


  • Total voters
    61

Electrex

Senior Member
Aug 28, 2014
291
1,213
0
electroactive.org

+Electroactive Kernel

FEATURES

  • Overclocking/underclocking options
  • Electroactive default CPU governor with dual-phase frequency, boost_sampling factor, and boostpulse
  • Many other popular CPU governors including UberDemand(Cl3Kener), Badass(Dennis Rassman), Impulse(neobuddy89), and much more.
  • MSM MP-Decision Hotplug
  • Full KCAL support
  • Bleeding-edge CAF updates
  • Full Gamma reverse engineering support
  • Synapse + script & runparts built-in
  • Optional improved Cpu optimization level 'l2' and bus overclocking
  • Power Aware CPU Scheduling
  • Partial-Resume
  • Full voltage control
  • Wake gestures
  • Kernel Samepage Merging
  • CPU Deferred Timers
  • Msm-Thermal-X thermal driver
  • Optional sweep2wake and doubletap2wake
  • Optional USB fastcharge
  • Optional backlight dimmer
  • Kernel compressed with LZ4-r127, GZIP for faster boot times
  • Several I/O controls with ROW as default
  • Optional cooler color
  • Advanced color and gamma control
  • Power-efficient workqueues ported from 3.18 mainstream - improves power efficiency
  • 3.4.x updates and fixes from upstream
  • Build with optimized Toolchains
  • Use Android device as USB keyboard/mouse
  • Full -O3 & graphite and -pthread support
  • Optional max screen off frequency at 1190 MHz
  • Charge light support
  • Optional disable fsync
  • Enhanced TCP with wifi and network enhancements
  • Optimized AES, SHA1, and RWSEM
  • OTG flash drive support FAT32
  • NTFS r/w, CIFS, and exFAT support
  • Fastest ZRam backported from Linux 3.18 kernel
  • Enhanced LMK
  • Tuned virtual memory
  • MultiROM support
  • init.d support
  • /dev/frandom support
  • DriveDroid compatible
  • electroactive.conf support
  • F2FS support
  • Linaro enhancements
  • Thermal throttling control: elexcool, extracool, and stockcool options
  • Compatible with TricksterMOD, Device Control, Kernel Tweaker, Franco Display Control and FauxSound Control, and Synapse Kernel manager
  • Vibration strength tunable
  • FSTRIM built-in kernel

NOTES & INFORMATION
Electroactive governor
The Electroactive CPU governor has been created to get some of the best balances between battery life and performance that you will see on a device. It is a hybrid class governor, using a unique way to merge the best of both interactive and ondemand. It includes some extra additions and enhancements to be more battery saving than interactive governor and some boost tunes and additions that allow better power management and performance in games as well as better power saving when in normal use. CPU boost, graphics boost, fast_start deep_sleep and detection features are built in as well as 300 MHz clock speed in suspend. This governor performs extremely well in games, normal use, battery performance, and just about everything. Some tunables available in the governor:

boostpulse: Immediately boost speed of all CPUs to hispeed_freq for min_sample_time, after which speeds are allowed to drop below hispeed_freq according to load as usual.

boosted_sampling_down_factor: This custom made parameter's set default setting will give several 0.4 second bursts of full throttle CPU to programs. It's about the time that user interface has to produce some meaningful response to your input so to feel smooth, especially while gaming. Besides better responsiveness, this setting will also give better overall speed to many programs which often interchange high CPU demand with IO waits and then suffer because the CPU governor too eagerly throttled down the frequency during those waits.

default_freq_boost_time: this is the default time that the CPU will spend in 'boost mode' before scaling down to normal frequencies, such as when in normal use.

ui_sampling_rate: when you touch the screen, the sampling rate changes temporarily to whatever you set it to.

down_differential: After spending sampling_down_factor*sampling_rate micro seconds at maximum frequency on high load, governor samples the load again to calculate an approximate targeted frequency to scale-down-to which should not trigger up_threshold in the next sample. (Triggering up threshold may cause jumping to max frequency again). Max_load_freq is checked against (up_threshold - down_differential) * current frequency. If found to be smaller, CPU is scaled down to a target frequency as described above. Down_differential also act as the factor to prevent aggressive scale down. Higher value of down_differential corresponds to delayed scaling down.

two_phase_frequency: Two-phase is a battery saving technique where even during max cpu frequencies, there are still gaps of inactivity so instead of running @ max frequency all the time, the two phase will alternate between busy/idle phase. Accepts four frequency values separated by comma, for cores 0, 1, 2, and 3.

input_event_min_freq: takes four values separated by comma. These are the input boost frequencies for cores 0, 1, 2, and 3.

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.

powersave_bias: this parameter takes a value between 0 to 1000. It defines the percentage (times 10) value of the target frequency that will be shaved off of the target. For example, when set to 100 -- 10%, when ondemand governor would have targeted 1000 MHz, it will target 1000 MHz - (10% of 1000 MHz) = 900 MHz instead. This is set to 0 (disabled) by default. When AMD frequency sensitivity powersave bias driver -- drivers/cpufreq/amd_freq_sensitivity.c is loaded, this parameter defines the workload frequency sensitivity threshold in which a lower frequency is chosen instead of ondemand governor's original target. The frequency sensitivity is a hardware reported in a value between 0 to 100% that tells software how the performance of the workload running on a CPU will change when frequency changes.

ignore_nice_load: this parameter takes a value of '0' or '1'. When set to '0' (default), all processes are counted towards the 'cpu utilisation' value. When it's set to '1', the processes that are run with a 'nice' value will not count aka ignored in the overall usage calculation. This is useful if you are running a CPU intensive calculation that you do not care how long it takes to complete as you can 'nice' it and prevent it from taking part in the deciding process of whether to increase your CPU frequency.

freq_for_responsiveness: up threshold considered for sampling load is up_threshold_at_min_freq. Also during the part where CPU is at maximum load frequency, governor need to find the optimal frequency as the next frequency - which should not trigger up_threshold in the next sampling. When such a frequency_next is found to be a) less than freq_for_responsiveness b) will not trigger down_threshold in the next sample, then the optimal frequency is set to freq_for_responsiveness.

Electroactive Configuration File
Kernel defaults are used to build a configuration file, based off of elementalx's original config file. The config file is found at /etc/electroactive.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 /sbin/electroactive.sh are set to execute.
Check to see if any scripts or apps are interfering with your settings.
To execute the script file:
  1. Install Terminal Emulator from the Play Store if you haven't already and open it.
  2. In the emulator type: "su" and press enter
  3. Type: "cd sbin" and press enter
  4. Type: "sh electroactive.sh" and press enter
  5. The values should now be applied, with no need to reboot

As always, you can also edit the values using the Synapse app or reboot to apply.

fsync
fsync can be disabled if you're looking for the last ounce of performance. If you disable it however there is a slight risk of data loss if your phone shuts off unexpectedly before the 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

NTFS and exFAT support
This is for anyone who wants to use OTG cable to connect a USB stick or portable hard-drive formatted with Microsoft's NTFS or exFAT filesystems. (Useful for installing and transporting files from your device) You will need Stickmount or a similar app

F2FS support
F2FS support is built into the kernel. No need to flash any other support patches before installing Electroactive.

Color preset
Some users complain that the Nexus 5 screen has too 'warm' colors, so there are two color presets: stock and slightly cooler. You can edit /etc/electroactive.conf to change the setting on boot.
/sys/module/mdss_dsi/parameters/color_preset
0 = stock color
1 = slightly cooler color

Sweep2wake (flar2)
Sweep2wake allows you to turn on your phone by swiping your finger across the screen. There are four sweep actions that will work
Gesture........Value
Sweep right......1
Sweep left........2
Sweep up.........4
Sweep down....8
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)
/sys/android_touch/sweep2wake

Doubletap2wake
DoubleTap2Wake (DT2W) allows you to wake the device by double tapping anywhere on the screen. This causes significant battery drain, so you choose at your own choice if you want it enabled or not. You can edit /etc/electroactive.conf to change the setting on boot.
/sys/android_touch/doubletap2wake
0 = disabled
1 = enabled (bottom of screen only)
2 = enabled (full screen)

Sweep2Sleep
Sweep2Sleep allows you to put the device to sleep by sweeping your finger across the navigation bar area. You can choose different directions to swipe. Unlike Sweep2wake, this does not cause any battery drain. You can edit /etc/electroactive.conf to change the setting on boot.
/sys/android_touch/sweep2sleep
0 = disabled
1 = sweep right
2 = sweep left
3 = sweep left or right

Backlight dimmer
Backlight dimmer allows you to adjust the LCD screen brightness lower than is possible with stock. You can edit /etc/electroactive.conf to change the setting on boot.
/sys/module/lm3630_bl/parameters/backlight_dimmer
0 = disabled
1 = enabled

USB fast-charge
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. This only works on laptops/desktops/any computer but not the phone's charger. You can edit /etc/electroactive.conf to change the setting on boot.

MSM Thermal-X Driver Options
MSM Thermal-X will throttle your cpu speed to keep it cool and unleash it if the cpu has cooled down enough. The input-event boost will temporarily boost the cpu frequency to prevent any lag while not hogging up battery.

Check /sys/kernel/msm_thermal/conf/ for the thermal configuration

allowed_max_high = highest threshold (phase 3)
allowed_max_low = remove the throttling if we cooled down to this (clr_thrshold)
allowed_max_freq = max frequency if throttled (limit)

[...]mid[...] = same as above, just for phase 2
[...]low[...] = Lowest threshold (phase 1)

check_interval_ms = how often shall we check? (sampling rate)
shutdown_temp = if we reach this shut down the device!

MSM MP-Decision Hotplug Options

MP-Decision Enabled
Enables/Disables the hotplug. On disabled the backup cpu-control will be stock Qualcomm mp_decision
# 1 for enabled
# 0 for disabled
echo "1" > /sys/kernel/msm_mpdecision/conf/enabled

Touch Boost
Touch-boost will temporarily raise cpu_min to a frequency determined by an mp_decision algorithm.
# 1 for enabled
# 0 for disabled
echo "1" > /sys/kernel/msm_mpdecision/conf/boost_enabled

Idle Frequency
If the first core is below this frequency, then don't plug the other cores.
echo "300000" > /sys/kernel/msm_mpdecision/conf/idle_freq

EcoMode
Ecomode tries to limit cores to just 2 unless there is a very heavy workload in which cores 3 and 4 are temporarily brought online and won't kick on until both CPUs are maxed out then it will allow for all 4 cores to come temporarily online.
echo "99" > /sys/kernel/msm_mpdecision/conf/nwns_threshold_4

StrictMode
Strict mode functions so only 1 CPU tries to be online at first before bringing up cpu1 and cpu2 online.
echo "85" > /sys/kernel/msm_mpdecision/conf/nwns_threshold_2
echo "99" > /sys/kernel/msm_mpdecision/conf/nwns_threshold_4

Max CPUs online
Max cpus to be online, cannot be > 4. (if you set it to 2 and min_cpus to 1 you will basically have a dualcore).
echo "4" > /sys/kernel/msm_mpdecision/conf/max_cpus

Min CPUs online
Min cpus to be online, cannot be < 1.
echo "1" > /sys/kernel/msm_mpdecision/conf/min_cpus

Screen-off Single core
If the screen is off, don't plug in cpu1/2/3. Additionally: Unplug all cpus except cpu0 when screen is turned off.
echo "1" > /sys/kernel/msm_mpdecision/conf/scroff_single_core

Pause
If something else plugs in the cpu, i.e. CPU-Governor or Thermal, fall asleep for <#>ms.
echo "10000" > /sys/kernel/msm_mpdecision/conf/pause

StartDelay
Time until mpdecision starts to work.
echo "20000" > /sys/kernel/msm_mpdecision/conf/startdelay

Delay
Time between checks.
echo "130" > /sys/kernel/msm_mpdecision/conf/delay

Hot plug thresholds
This formula calculates which value will be used: (number_of_cpus_online - 1) * 2
The result of this formula will be the nwns_threshold where a new cpu is hotplugged.
The result of this formula + 1 will be the nwns_threshold where a cpu is unplugged.

nwns_threshold_x = runqueue threshold, if this is reached cpuX will be hot/unplugged
twts_threshold_x = time threshold, this amount of time must have passed for the related action to be taken (hot/unplug)

Example:
One cpu is online.
(1 - 1) * 2 = 0 ergo:
nwns_threshold_0 = cpu1 will be hotplugged at this value
((1 - 1) * 2) + 1 = 1
nwns_threshold_1 = cpu0 will be unplugged at this value
Since we can't unplug cpu0 this is '0'.

Two cpus are online.
(2 - 1) * 2 = 2 ergo:
nwns_threshold_2 = cpu2 will be hotplugged at this value
((2 - 1) * 2) + 1 = 3
nwns_threshold_3 = cpu1 will be unplugged at this value

echo "#" > /sys/kernel/msm_mpdecision/conf/nwns_threshold_X
echo "#" > /sys/kernel/msm_mpdecision/conf/twts_threshold_X
etc...
Some values are:
NwNs_Threshold: 12, 0, 25, 20, 32, 28, 0, 35
TwTs_Threshold: 140, 0, 140, 190, 140, 190, 0, 190
Where the position and function of the number equals the result of the above explained formula (all times are in ms).


INSTALLATION
  1. If you come from another kernel, dirty-flash your ROM first without wiping any data
  2. If you are an F2FS user, flash the F2FS support patch found below
  3. Flash Electroactive kernel in recovery
  4. Reboot

*F2FS users:
THIS KERNEL USES YOUR RAMDISK, it will just modify it on the fly while flashing. These changes are so to not create any incompatibilities with ROMs or other kernels. Some things to consider when using F2FS:
Use F2FS in only r/w partitions (/data and /cache).
F2FS in /system does not make any difference and requires selinux to be set to permissive, and Electroactive kernel is enforcing by default, although you can change this in the .config file found in /etc/electroactive.conf, but is still not recommended.

DOWNLOADS

Android M Preview/2
Electroactive-N5-3.10-M

Android 5.1/5.1.1
Electroactive-N5-2.50





Please consider a donation to support the Electroactive Kernel Project, and support for more devices.

Donors Hall of Fame
Send me a PM or email me if I didn't add you after you donated and I'll add you to the list
- danmaman
- Chirag7
- Zidane23

XDA:DevDB Information
Electroactive Kernel, Kernel for the Google Nexus 5

Contributors
Electrex
Source Code: https://github.com/Electrex/Electroactive-N5

Kernel Special Features:

Version Information
Status: Stable
Current Stable Version: 2.50/3.10
Stable Release Date: 2015-08-09
Current Beta Version: 2.52
Beta Release Date: 2015-09-27

Created 2015-04-10
Last Updated 2015-09-27
 
Last edited:

Electrex

Senior Member
Aug 28, 2014
291
1,213
0
electroactive.org
Changelog:

August 9, 2015 - Electroactive-N5-2.50/3.10-M
-MSM-Thermal-X input/output control, 3-phase, inputboost
-MSM MP-Decision Hotplug
-Electroactive CPU Governor Revision 2
-Set FIOPS default io scheduler
-Add Zen io scheduler

July 21, 2015 - Electroactive-N5-2.45/3.05-M
-MSM-Thermal-X
-KSM-Kernel Samepage Merging
-CPU Deferred-Timers
-Power Efficient Workqueues
-Cortex-A15 target architecture overhauls
-Merge Android M Prev2
-Linux 3.4.108
-Resolve some memory leak issues, more like a band-aid until Google gets their game up
-Fix performance regression in vfs
-push readahead value to 512 kb
-Back to ROW i/o scheduler w/change of params
-Revert PM-Suspend Freeze to prevent processes from running when device is idle.
-Add suspend_again mechanism to Partial Resume
-linaro-4.9.4 toolchain
-Remove android logger
-Use Android device as USB keyboard/mouse

June 29, 2015 - Electroactive-N5-2.40/3.00-M
-CPU Power Aware Scheduling
-Partial-Resume Framework
-Merged android M sources
-Fix cpu sticking issue
-Introduce PM Suspend Freeze
-Remove compiler warnings to prevent any issues in installation
-Re-add fsync control
-Add GPU sysfs reporting in pwrctrl
-Add 8974 support for enabling GPU GDHS
-Use new global screen-off detection variable
-Electroactive cpu governor: Introduce powersave-bias
-Greatly improve memory access performance
-Skip sensor_ind wakeup source activation via sysfs to prevent wakelocks

June 2, 2015 - Electroactive-N5-2.10
-Major Update. Getting close to second major release.
-More chrome fixes, should be almost completely gone. General UI speed-up and smoothness optimizations.
-Memory leak issue fixes, a bit better memory efficiency.
-Fix issues with any previously installed kernel files not being removed/reappearing after installation.
-Battery life issues with wake-locks and screen power consumption are fixed, GPU and CPU drivers updated.
-2 different versions of kernel: TC-DEF and TC-TEST. Only differences are the compiler toolchains and GCC. Try both and report which is better. TC-DEF uses the default old style build compiler and TC-TEST uses the new test compiler.
-Update advanced color control
-Kernel sources updated back to 3.4.107 from 3.4.0, some backports from Linux 3.18+ kernel sources.
-F2FS Support Built-In to ramdisk. No need to flash any F2FS support patch before installing kernel.
-More focus on optimization.

May 19, 2015 - Electroactive-N5-2.00
-Kernel Rebased
-Removed unneeded/unwanted commits and left all the good stuff in new base
-Add deeper incremental overclocking up to 2.95 GHz. Still boots at stock frequency
-Min CPU frequency down to 96 MHz, options for 192 and 249 MHz. Still boots at stock frequency
-Built with -O3 CFLAGS Makefile variables for extreme optimization
-Add MultiROM support
-exFAT support built-in to kernel rather than a module
-Add some speed and stability updates
-Add additional thermal driver settings

May 14, 2015 - Electroactive-N5-1.56
-Add sanity check to avoid unregistering the driver twice (therefore preventing kernel panic)
-Add optimized SHA-256/224
-Update kernel sources to linux 3.4.107
-Move VFP init to an earlier boot stage
-CAF sound codec driver
-Fix voltage tables and scripts
-Specifically modified PVS voltage tables per each unique device. Stock voltages now set
differently depending on your CPU binning.
-Update msm-kernel sources to android-5.1.1_r0.10
-Update Documentation & arch to 3.4.104
-Fix SMD packet sync loss issue
-lmk tune up
-Fix kernel script errors
-Chrome freeze issues gone
-Overclocking up to 2.9 GHz (experimental)
-Min CPU frequency down to 96 MHz
-Can have different frequencies for each CPU core
-Ramdisk updated to be more compatible and better performance on more ROMs
-FSTRIM now built-in: trims /data and /cache to discard any unused data blocks on boot, no more lag (only f2fs)

April 30, 2015 - Electroactive-N5-1.47
-optimize memory allocation in check_partition()
-Fix changes not applying on boot
-Add electroactive.sh script support
-Thermal throttling set to Cooler by default for less heat

April 25, 2015 - Electroactive-N5-1.45
-Add Optimax governor and Electrodemand
-NEW GOVERNOR: Electroactive (Hybrid: Interactive + Ondemand) with two-phase frequency and over 20 tunables
-Fix kernel, governor, and cpu tables. More .config functionality
-Stability improvements
-Synapse integration built-in

April 17, 2015 - Electroactive-N5-1.40
-More options in the .config file. Customize ALL hotplug settings
-Fix hotplug compatibility issues
-Update clock vote for improved performance
-Removed some unneeded governors
-Stability improvements
-First major release

April 11, 2015 - Electroactive-N5-1.35
-Add new improved default hotplug: Intelli_Plug, (much more added features and functionality)
-Update kernel sources to 3.4.106 from Kernel.org
-O3 graphite and -pthread optimizations/improvements
-LZ4 compression for much faster boot times

April 9, 2015 - Electroactive-N5-1.30
-Initial release
-Use UBERTC Compiler for kernel
-Add fixed PCI i/o mapping
 
Last edited:

Notechis

Senior Member
Nov 22, 2012
1,315
591
0
The Hitchhiker's Guide to the Galaxy
Seems stable und fast so far, pretty good work ... A few governors for my taste to much, but the default one is a beast ;)

Bricked Cataclysm

---------- Post added at 09:39 PM ---------- Previous post was at 09:37 PM ----------

I really like ElementalX as a base

Bricked Cataclysm
 

Electrex

Senior Member
Aug 28, 2014
291
1,213
0
electroactive.org
Hi Electrex,
1st thanks for your awesome work!
2nd your kernel is ukm compatible? (or trickster or elementalx app?)

Tia!
Yes, in the description, I posted all of the compatible kernel managers. I'll put them here too, as my OP is a bit cluttered:

Compatible with ElementalX Kernel app, TricksterMOD, Device Control, Kernel Tweaker, Franco Display Control, FauxSound Control, and Synapse Kernel manager.

You can also edit the .config file in /etc folder without an app to change kernel settings.
 
Last edited:

idkidk

Senior Member
Oct 1, 2009
411
44
0
Piacenza
Yes, in the description, I posted all of the compatible kernel managers. I'll put them here too, as my OP is a bit cluttered:

Compatible with ElementalX Kernel app, TricksterMOD, Device Control, Kernel Tweaker, Franco Display Control, FauxSound Control, and Synapse Kernel manager
My apologies. I see, thanks!
 

madsurgeon

Senior Member
Jan 30, 2013
397
258
93
Kudos!

Hello,

This is a really nice piece of work, the responsiveness is excellent and battery life is great! Using stock settings. Has all the features i need.

Thank you for sharing your work with us!