[Motorola Droid Bionic] dtrail1:
/// JellyBeanX-kernel ///

​

READ THIS: READ BEFORE YOU ASK and HELP TO KEEP THIS THREAD MORE CLEAN! BUT ALSO BETTER ASK ONCE MORE BEFORE YOU MESS UP YOUR PHONE! :D If you find something missing in this OP/FAQ, please PM me and I will add it. Thank you!

This is a custom kernel mostly based on Motorola's 3.0.8 Hybrid Kernel which was initiated first by the STS-Dev-Team (Hashcode, Dhacker).

I created this kernel for my main goal: BATTERY LIFE! Like many other custom kernels this one also supports several performance related features like OVERCLOCKING, UNDERVOLTUNG, GPU CONTROL, CPU OPTIONS, RAM TWEAKS, etc etc... But my main goal was not to bring up a kernel which is fast as hell - I want to bring up a kernel that is fast + a long lasting battery! Many custom kernels are also very fast but they don't save battery. JBX-Kernel is supposed to push your device to great speed while being on low power settings. I hope you enjoy it!

If you want to support me and my work just leave me a beer. :)

You can find the FAQ at the bottom of this post!

LATEST CHANGES

FULL HD Video Recording is working now!!! See Downloads section below!

--> DETAILED CHANGELOG JBX-kernel Hybrid 4.4 <--

Kernel Guide by Placca 1.8!!

Check the FAQ section at the bottom of this post to download it! It will make many things easier for you and help you to understand the kernel and its features!

FEATURES

JBX-Kernel Hybrid

Battery Friend toggle (a battery friendly mode)

Intelli-Plug (Kernel side replacement for msm MPDecisions) by Faux123 + patches by me (no hotplugging when screen is ON)

Dynamic Hotplug: Second core will be turned off ONLY while screen is off - independent from selected governor. (Not needed when using Intelli-Plug)

Optimized OPP Table for smooth CPU scaling

Frequencies: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300

Modifed Smartreflex driver (Custom Sensor for detecting n-Value).

Smartreflex Tuning Interface: Set min/max calibrated voltage

Overclocking using Live OC (mine runs stable at a maximum frequency of 1,498ghz!)

hwmod, uart, IRQs - cleanups from pre-kexec config to safe power

CPU: lower voltages for CORE and IVA. Give CORE the abbility to scale up to higher voltage if needed

Added IVA_NITROSB

Dynamic fsync control: FSYNC interval is dynamic depending on screen state (SCREEN OFF: synchronous, SCREEN ON: asynchronous)

HTC's Asynchronous Fsync port - read explanation below*

Dynamic page-writeback: Page writeback interval is dynamic depending on screen state.

Frandom v2

JRCU / Tiny RCU (currently JRCU in use)

Raised voltage limits for mpu a bit

Raised the temperature limits from 64c* to 74c* (degrees)

optimized CRC32 algorithm (better code generation)

RW Readahead dynamically depending on storage device (automatic detection of the best value)

zRAM support

GPU has 4 scaling steps and OC to 384mhz (Base freq: 102 mhz --> 154 mhz, 307 mhz, 384 mhz)

GPU C4 states / GPU Control (Governors, Frequencies)

Multicore Power Saving Mode Control

ARCH Dependant Power feature

Gamma Control

Front Buffer Delay Control (draw in x msecs on early suspend)

Screen/Display: Modified OMAPDSS for sharpness and lightning colors

OMAPDSS: Added variable clock rate and OPP - allows the screen to scale down power and voltage

lowmemkiller: Heavy modified for R/W Speed and efficient performance

ZCACHE, ZSMALLOC, XVMALLOC backported from 3.4, 3.7 and 3.10 (ZCACHE currently not in use)

Custom Voltage Support

IO-Schedulers: SIOPlus, Fifo, Row, VR, Noop, Deadline, CFQ, BFQ

ROW Scheduler is heavily tweaked to be the fastest scheduler ever!

CPU: More Governors

Deep Idle

ARM Topology

Many improvements in overall OMAP PM

SELinux permissive

GREAT performance!

battery life!

Support for Trickster Mod Kernel Control App (Download from Gplay)

*]Too much stuff to list here. See "Sources" below and check my Github

* HTC's Asynchronous Fsync and Dynamic Fsync:

Asynchronous fsync (called "afsync" or "async fsync") from HTC is ported into this kernel. By default it's enabled and dynamic fsync is disabled (and as well it isn't needed anymore). But just to test a little bit around to see which one of both features is the better one - for battery & performance. But currently Tricktser Mod doesn't support a toggle for afsync, so I had to find another way to use Trckster. Finally I did it like this:

The dynamic fsync toggle in Trickster Mod is now serving both functions - the dynamic fsync AND the asynchronous fsync! How? By default Dynamic Fsync is disabled, and Afsync is enabled. If you now enable Dynamic fsync using the toggle, Afsync will be automatically disabled, so both functions are not conflicting each other - and this way we have a working toggle for both of them.

REQUIREMENTS

NOTE: This will NOT work on Stock(-based) Roms!!

Rooted device

Must use a Kexec Rom (CM, AOKP, AOSP)

Recovery (BMM, SS)

REMOVE any kernel modules you used before

DEACTIVATE ANY CPU tweaks, onboot settings etc otherwise your phone may not boot!

CAUTION: The kernel needs a clean setup related to CPU tweaks / Settings, etc...Keep your device as clean as possible regarding to Tweaks, CPU special settings, etc. The Kernel brings its own CPU settings and after you can boot it succesfully, you can set it like you want!

This kernel may not work on all roms! Check and report.

TO DO LIST

- Fix bugs

INSTRUCTIONS

NOTE: CLICK here for a detailled Installation Guide (about the Aroma Installer, the features to select and more)

Download zip file from below

Reboot into recovery

Flash the kernel (BMM users: DON'T use the "Flash Kernel" Option! This is a usual zip file!)

Reboot

Download Trickster Mod App from Gplay! Read the FAQ to learn about playing with kernel features!

Enjoy!

NOTE: For updates you can use the built-in OTA UpdateMe App!

Something went wrong?

If you think you have set wrong "on-boot-values" in Trickster Mod flash this:

TRICKSTER RESET: http://dtrailer.de/kernel/trickster_reset.zip

FAQ

CAUTION: This FAQ and the whole OP, additional informations about Governors, IO Schedulers and detailed informations about the usage of Trickster Mod and this kernel can be viewed in the awesome Kernel Guide by Placca!

Kernel Guide 1.8

PDF: http://www.mediafire.com/download/7zaddcmvtxfk9ry/JBX+Kernel+Guide_v1.8.pdf

CHM: http://www.mediafire.com/download/g3ck1bf1k3a3j38/JBX+Kernel+Guide_v1.8.chm

CLICK THE BUTTON BELOW TO OPEN THE FAQ!

Please check the following points if you don't know how to use the features of the kernel or you are facing any kind of issues.

INDEX

1. Kernel Features

1.1 Smartreflex (Turn ON/OFF, adjust min/max range)

1.2 Live OC (Realtime Overclocking)

1.3 Custom Voltage (EMIF)

1.4 GPU Overclock & GPU Governor (UPDATED)

1.5 Gamma Control

1.6 Battery Friend

1.7 Suspend Governor (CURRENTLY DISABLED)

1.8 IVA Overclock

1.9 DPLL Cascading

1.10 HDMI toggle

1.11 Intelli-Plug

2. Issues

1.1 How can I change the smartreflex minimum/maximum voltage

What is Smartreflex?

SR is compareable with an CPU governor but not for scaling frequencies but for voltages. That means SR has a fixed range of voltage (min/max) and calculates the optimal voltage for each CPU frequency. In example on light use of the CPU it scales down to lower voltage - on heavy use it can sclae to higher voltage. This is an efficient system to save power! Compared to EMIF which uses the hardcoded voltages it saves more power because it's variable. EMIF cannot vary between the values.

This interface has a hardcoded range of 830mV min to 1450mV max. Usually there is no need to adjust these values but irt can be usefull in example when using high overclocked frequencies above 1,5ghz! Usually SR cannot handle frequencies above 1,5ghz and I have hardcoded the maximum range of 1,45mV which should allow SR to handle it. In prior times the users had to turn off SR when OCing above 1,5ghz which causes the CPU to eat more power. But you can try around and report your results.

CAUTION: Don't raise the maximum SR voltage too high! It can burn your board = no phone anymore! I recommend to not use higher values than 1490mV! As already mentioned: THe default value should be enough!

ANd also: USUALLY THERE IS NO NEED TO CHANGE ANYTHING ON SR! IF YOU DON'T KNOW WHAT YOU'RE DOING, PLEASE LEAVE IT ALONE!

Ok, now let's see how to do this:

Turn ON/OFF SR

1. Open Trickster Mod

2. Head to the "Specific section"

3. Scroll down to "Smartreflex"

4. You can toggle ON/OFF SR for each component (IVA, CORE, MPU)

Usually I recommend to keep SR ON because it saves power! But in some cases when overclocking the CPU (MPU) the device could freeze - whether you OCed too much or SR couldn't handle the frequency! In this case you can try to raise the vmax value of SR a little bit (CAREFULLY!) and try again. If it sitll freezes and you're sure that you didn't OC too much, turn SR OFF at least for MPU!

Maximum Voltage

Currently there is no app which supports the feature of adjusting the SR vmax value, because I wrote this feature some days ago.

But in the next Trickster Mod version this option will be supported!

example:

# To read the current vmax value. Replace XXX with one of the following:

sc_core - for core max sr voltage

sr_iva - for iva max sr voltage

sr_mpu - for mpu max sr voltage (mpu is most related for CPU scaling)

cat /sys/kernel/debug/smartreflex/XXX/vmax

# You will get an output, e.g. for mpu = 1450000 (1450mV)

# To set a new value, do the following command (replace XXX with a value like above - BE CAREFUL! USUALLY THE DEFAULT VALUE ENOUGH AND YOU CAN LEAVE IT UNTOUCHED!)

echo XXX > /sys/kernel/debug/smartreflex/XXX/vmax

Minimum Voltage

It's easy because Trickster Mod supports it!

1. Open Trickster Mod

2. Head to the "Specific section"

3. Scroll down to "Smartreflex"

4. Below each SR component (IVA, CORE, MPU) there is displayed a value (usually 830 default) which means this is the lowest scalable voltage for this component. You can try to decrease this value for the case you want to UV a bit more - or raise it a bit for the case you think that the set range is too low and causes freezes on your device.

1.2 How do I use Live OC (Live OVerclock)?

This feature allows you to overclock the CPU in realtime. It works with a multiplier value set by the user. The default multplier value is "100", which means: No OC! If you want to raise the OC frerquency, just raise this value step by step.

FOr my device the maximum working OC value is "111" which means the maximum frequency is running at 1498mhz!

NOTE: Keep in mind that you tunr Smartreflex OFF for higher freqs than 1500mhz - or raise the maximum SR voltage range for "MPU" a little bit and test if it works.

Ok, how to use Live oC in action:

Open Trickster Mod App and swipe to the tab "Specific". There you will find something like this:

MPU OC [100]

DON'T TOUCH THE "CORE OC" SECTION, IT WILL CAUSE FREEZES!

Now slowly increase the value "100" to something higher, e.g. "105". Tap the hook in the right upper corner to confirm. To see your new set of frequencies you can now whether close and restart Trickster Mod or just use any monitoring app like Cool Tool which will show your frequencies in real time. That's it!

CAUTION:

You can damage your phone forever!!!! This feature allows you to set very high frequencies (also up to 2,0ghz...) - That DOESN'T mean that your phone can run these frequencies!

If your phone freezes or crashes you have probably set too high OC - or your voltage is too low.

1.3 How do I use Custom Voltage (EMIF)?

NOTE: This only adjusts the fixed voltage! When you have Smartreflex ON it can still vary! You have to see the bigger picture: This voltage value sets the "middle point" for voltages. Smartreflex is still able to increase or decrease the voltage. When Smartreflex is OFF the CPU will stay on this voltage you set here and probably eats also more power.

How does EMIF works together with Smartreflex:

-------
| CPU |
-------
|
------------------ ------------------
|Voltage 1015 mV | ---->| SMARTREFLEX ON| = 1015mV +/- "vmax"/"vmin"
------------------ -------------------
|
--------------------
|SMARTREFLEX OFF| ----> 1015mV FIXED! No changes!
-------------------

Thi smeans if you change the voltage for a scaling step (OPP) while SR is ON, SR will adjust the voltage from this value, means: mV-Value +/- SR vmin/vmax. WHen SR is OFF it will stay on this mV as a fixed value.

How to adjust the voltage?

Well, this feature can be used with all generic apps which are supporting voltage settings. But we are prepared well, you can adjust voltages also with the "Trickster Mod App".

When you open the app, head to the tab "Specific" and below the "Live OC Section" you will find your voltage table, which looks like this:

<-->

1200 [1398]
1000 [1388]
900 [1371]
...
..
..

Now just tap the arrows in the right upper above the first voltage value and just type or tap (per direction) a value, e.g. "-25". To apply it, confirm by tapping the hook in the right upper corner of your screen. That's it, your new voltage values are now set and applied. And also mind here: If your phone freezes you porbably have set it too low.

CAUTION:

NEVER SET HIGHER VOLTAGE THAN 1490mv here!!!!! Or you might damage your phone FOREVER!

This voltage is not the same like Smartreflex! But it's still voltage! Just be carefull!!

1.4 How can I use GPU OC and GPU Governor?

GPU Overclock doesn't work like Live OC! You cannot really set custom frequencies for the GPU, but you can select and set the maximum frequency from a hardcoded range!

For the GPU there are the following available frequencies:

154mhz (FIXED!)

307mhz

384mhz

416mhz

The minimum frequency of 154 is FIXED! This means you cannot change it because the GPU needs a minimum speed to run with. But the kernel allows you to select the maximum speed. This can be usefull for playing games and also for saving power . In example when not playing games you don't need the GPU to run at 416mhz! Set it to 307mhz in this case and save power.

When you open Trcikster Mod and head to the "specific section tab", you will find "GPU MAX FREQUENCY" and it's currently set maximum frequency. Tap on it to select your preferred one:

- 154 Mhz

- 307 MHz

- 384 MHz

That's it. The new setting will be your new maximum GPU frequency.

Below there's another option called "GPU Governor". Just tap on it and select your prefered one.

NOTE: If you want to track current GPU frequencies and watch governor's behavior, just switch to Trickster's "Informations" - Tab and watch the frequencies clock.

1.5 How can I use Gamma Control?

What is gamma? The gamma setting sets the color range for the screen. You can compare it to the contrast. We all know that the touchscreen eats most of the power compaerd to all other components in a smartphone! A lower brightness causes less power consumption and a lower gamma or contrast range alos helps a little bit to save power.

In this kernel you can choose from a range of "5 - 10" while "5" is very bright while "10" is very dark. The default setting is "5" BUT CAUTION: Trickster Mod will display a range of "0" to "10" and the default setting will be shown as "0". This is caused by the fact that this feature was ported from the Gnex device where you can choose from a higher range. The only sideeffect is that the values "0" - "5" won't show any difference.

How to set the gamma value?

Well, once again open Trickster Mod and swipe to the tab on the right end. Just select your preferred value by using the slider.

Alternately you can use sysfs by terminal or adb:

OMAP Gamma interface:

echo i > /sys/devices/platform/omapdss/manager0/gamma

Replace i with 0-10 of your choice.

1.6 What is "Battery Friend and how to use it?

Battery Friend is a simple toggle (ON/OFF) which sets your device into a battery friendly mode without the need to play with all settings in Trickster Mod /sysfs until you find a good setting. In fact it does the job for you.

What does it affect?

NOTE: Doesn't lock anyx frequencies anymore!

locks dynamic Fsync enabled

locks Fsync disabled

Doesn't allow any OC (Live OC will not have any effect, Core OC is not allowed in this kernel)

Increases the dirty ratio interval to 90% (starts working at this value)

Enables Dynamic Hotplug: This doesn't allow hotplugging during device is active - and it will always turn CPU1 OFF during suspend! It also prevents from conflicts when user uses a hotplug governor (which isn't a good idea though) - but hotplug governors are causing higher battery drain!

Dynamic Page-writeback always enabled

How to toggle Battery Friend:

For now the only way is via terminal, adb shell or root explorer (text editor)

For terminal and adb:

echo 1 > sys/kernel/battery_friend/battery_friend_active /* Enable */
echo 0 > sys/kernel/battery_friend/battery_friend_active /* Disable */

For Root Explorer

Open Root Explorer

Navigate to sys/kernel/battery_friend/

Open "battery_friend_active" with Text Editor

Change "0" to "1" and safe the file to enable

Change "1" to "0" and safe the file to disable

1.7 Suspend Governor Control (CURRENTLY DISABLED)

Suspend Governor Control is a kernel module written by me. You can use it to set your preferred Screen-Off-governor.

For now it's only supported by sysfs (Trickster Mod will support all my current and upcoming features as soon as it gets updated with its new UI mode!

How to set suspend governor

Open a terminal or use adb shell

su
echo "x" > /sys/kernel/suspend_gov/suspend_gov

Replace x with one of these values:

0 = Ondemand

1 = Ktoonservative

2 = Conservative

3 = OndemandX

NOTE: No matter what governor you use for suspend mode, if Battery Friend is enabled the second core will be turned off during suspend!

1.8 IVA Overclock

What is IVA OC?

IVA OPPs are controlling the CPU load for sound events. It could be useful (in some cases) when you get sound related laggs. Just set the maximum frequency to highspeed. This will allow more CPU power for sound events but also will cause higher battery consumption.

How to use IVA OC?

If you want to check the current IVA frequency. Just type in Terminal or ADB:

cat /sys/devices/system/cpu/cpu0/cpufreq/iva_clock

You will get an output like this:

132 Mhz

2. You can whether enable IVA highspeed: 130 - 430 Mhz ["1"] or enable IVA normal speed: 130 - 332 Mhz ["0"]

320 Mhz max: echo "0" > sys/devices/system/cpu/cpu0/cpufreq/iva_freq_oc

430 Mhz max: echo "1" > sys/devices/system/cpu/cpu0/cpufreq/iva_freq_oc

1.9 DPLL Cascading

DPLL: Davis–Putnam–Logemann–Loveland (DPLL) algorithm

To get more info about this please see wiki

But to sum it up shortly: It helps to use/stream media (music) in a low power mode.

NOTE: DPLL Cascading will be available to be switched easily via Trickster Mod App soon!

How to switch DPLL?

DPLL is ENABLED by default!

Open Trickster Mod -> Speicific Tab --> DPLL (soon)

sysfs:

Turn off:

echo 0 > /sys/kernel/dpll/dpll_active

Turn on:

echo 1 > /sys/kernel/dpll/dpll_active

1.10 HDMI toggle

Some users are facing a RAZR-sepcific problem: HDMI cable is detected, even though there is no cable plugged!

Therefor I included a toggle to switch HDMI wether ON or OFF. Additinally there's an init.d script included within the AROMA Installer you can select during the installation of JBX-Kernel.

To enable/disable HDMI on-the-fy:

sysfs:

Turn off:

echo 0 > /sys/kernel/hdmi/hdmi_active

Turn on:

echo 1 > /sys/kernel/hdmi/hdmi_active

1.11 Intelli-Plug

For intelli-plug hotplugging is now only allowed when the device enters sleep.

To enable hotplugging universally just change the value of the following entry whether to 1 (on) or 0 (off):

sys/module/intelli-plug/parameters/int_hotplug

DONATE

If you like my work and want to support me, I'd enjoy a little beer or coffee. You can find my beer mug below my username ;)

SOURCE

JBX-Kernel 4.4

CREDITS

Shurribbk - Co-Development

Kholk & [mbm] - Kexec inital Release

Hashcode & Dhacker - Making Kexec stable and initiating compatible kernels

Motorola - 3.0.8 Kernel Source

Surdu_Petru - Sharing Knowledge and helping with problems

nithubhaskar - Hints and answering my questions

Ezekeel, Imoseyon - Custom Voltage, Live OC, Temp Control, Gamma Control Source Code

faux123 - Some features, like Intelli-Plug, Intellidemand, Intelliactive

bigeyes0x0 - Trickster Mod App

Team Trickster - Great support and adding new features from my suggestions

Placca - Awesome kernel guide

RandomPooka - for special testing and support