[Kernel][AOSP][2.02 | November 2nd] Plasma kernel

Search This thread

ffolkes

Senior Member
Oct 18, 2006
1,338
2,108
New Jersey
plasma.png

I. Thanks!
.
Disclaimer: I take no responsibility for any damage that might occur to your device. You proceed strictly at your own risk. This is a work in progress.
Thank you for your interest in Plasma kernel, I hope you enjoy it. I've poured hundreds upon hundreds of hours of work into putting together a kernel that best showcases our hardware. Plasma kernel would not be possible without super-smart people like AndreiLux, DerTeufel, temasek, googyanas, faux123, and the regular contributors to the official cm kernel repositories. Please donate to them to support their hard work!
.

II. Features
  • CPU frequency range: 100MHz to 2.16GHz
  • ZZMoove, PegasusQ, performance (with support for multiple cores), and LulzactiveQ CPU governors
  • Zen, noop, deadline, row, cfq, sio, vr schedulers
  • Experimental Wolfson AND Voodoo Sound support (choose one or the other on the Audio tab of STweaks, then REBOOT!)
  • CPU voltage control
  • Linux 3.0.101
  • AndreiLux: Screen color calibration with mdnie-control
  • GPU over/underclock and over/undervolt
  • Control the frequency and voltage of all 5 GPU steps
  • Support for GPU clocks from 54MHz to beyond 800MHz
  • Control GPU governor sampling rate
  • Built with 4.8 toolchain
  • Built with -O3 and other optimizations
  • Extra panel brightness (<299)
  • Faux123: Dynamic fsync control (v1.2)
  • AndreiLux: Charging control
  • Support for STweaks
  • Control screen refresh rate (can be reduced to save battery)
  • AndreiLux: Memory/internal voltage control interface
  • AndreiLux: Adaptive Body Bias (ABB) control
  • AndreiLux: Digital brightness control/reduction (better than ScreenFilter)
  • LED control (with some color mixing adjustments by me)
  • Touchwake support, including touchkeys (enable in Screen tab of STweaks)
  • Multi-touch kernel-based gesture engine
  • Proportional Rate Reduction for TCP
  • Joe's RCU
  • Temasek: Frandom module (enable on the Memory/Internal tab of STweaks and REBOOT!)
  • S-Pen settings on the S-PEN tab of STweaks
  • zCache
  • Support for 4x parallel "Turbo ZRAM" (settings are on the "I/O / RAM" tab of STweaks)
  • UKSM
  • Enhanced Touchwake/Slide2Wake functionality
  • Arc-swipes to turn your phone on with one hand (Screen tab of STweaks)
  • Long-tap-off to turn your device off with one hand (Screen tab of STweaks)
  • Power off gesture: tap the top of the screen and a touchkey at the same time to trigger suspend
  • Change your power manager (PM) CPU lock frequency
  • Press the home button 4 times to toggle the screen negative
  • Press the home buttom 3 times as fast as you can to toggle the screen into nightmode (red)
  • exFAT support
  • For more, take a look at the commits
.

III. What's New
Don't forget to check out what was new in 2.0b7 and 2.0b12!

  • [ZRAM Total Disk Size]: By default ZRAM is setup as four (4x) swaps operating in parallel at equal priorities. Set this to the TOTAL amount of RAM you wish to dedicate to ZRAM, and STweaks will automatically divide it evenly by four.
  • [UKSM Enable]: Enable the UKSM daemon that will continuously scan memory for duplicate data.
  • [UKSM Daemon Sampling Rate]: How often the daemon checks for duplicate data.
  • [UKSM CPU Usage Limit]: How much system load (CPU usage) the daemon will use.
  • [Long-tap-off Always On]: Found in its own section under the Touchwake section. When enabled Longtapoff will always work, regardless of how you woke your device. Takes effect immediately.
  • [Many ZZMoove settings]: Many ZZMoove settings on the newly created "ZZMoove Scaling" and "ZZMoove Hotplug" tabs. Descriptions coming soon.
.

IV. Download / Donate

:) Support the development of Plasma kernel by DONATING if you find it useful! :)

AOSP 4.3.x only!
Plasma kernel v2.02 for T-Mobile Note 2 (t889)
Plasma Gesture Pack

:) Support the development of Plasma kernel by DONATING if you find it useful! :)

.

V. Changelog

v2.02 (November 2nd, 2013)
  • Tracked audio/media skipping bug to disabled loggers (thanks pappschlumpf!) By default logging is now enabled. While you can still disable it, it will always be reset upon reboot.
  • Changes to write-back caching (thanks temasek)
  • Support for switching touchkey backlight driver from ROM/kernel (bottom of Screen tab in STweaks) (thanks Yank555-lu)
  • Some bug fixes for Slide2Wake
.

VI. Archived Changelogs


2013-10-29 | v2.00
  • Linux 3.0.101 (thanks temasek)
  • Hopeful bugfixes for untouchable screen, and taps on top triggering suspend
  • Should you encounter a problem like that, cycling on and off (power button) should now reset any state variables
  • Fix FC issues. Works with more ROMs, including the latest AOSP nightlies
  • Allow pm_idx_freq to be set as high as 1600 MHz, theoretically could slightly speed up waking from deep sleep. Set on "Plasma Tuneables" tab of STweaks
  • Added several new tuneable ideas to zzmoove
  • Added "ZZMoove Scaling" and "ZZMoove Hotplug" tabs to STweaks. The descriptions are still a work in progress
  • Moved mDNIe controls to their own "Color" tab
  • Greatly enhanced the longpressoff feature's reliability and ease of use (by upgrading to scheduled_work)
  • Slide2Wake and arc swipes now trigger CPU and memory frequency locks to speed up waking
  • Slide2Wake and arc swipes no longer accidentally send input in the milliseconds after the screen comes on, but before you finished your gesture
  • Added option to Screen tab of STweaks to enable Longtapoff always, regardless of how the device woken
  • Expanded the trigger areas for slide2wake and arc swipes
  • ZRAM/swap is working and compatible with "Turbo ZRAM" (4x parallel ZRAM swaps for quad core devices) (thanks googyanas)
  • ZRAM settings in STweaks now allows you to set one total size of RAM that will be divided into 4x ZRAM swaps. Setting to 0 disables all swaps. Changes are applied instantly. No need for any other ZRAM/swap apps or init.d scripts.
  • UKSM (Ultra KSM (Kernel Samepage Merging)) enabled, with settings on the "I/O / RAM" tab of STweaks. Mostly just a novelty, but what it does is continuously checks RAM for duplicate pages to save space
  • zCache enabled and always running
  • Cleancache enabled
  • Frontswap enabled
  • Enabled LOWMEM_CHECK (thanks googyanas)
  • Enabled SPEEDUP_KEYRESUME as discussed in temasek's thread (Placebo effect? Maybe. Better ask Brian Molko. A cookie for you if you understand that reference) (thanks googyanas)
  • Added my own wake-speed ideas (2-second max-CPU-speed lock, and 2-second max-bus/RAM-speed lock on KEY_POWER press)
  • Permanently fixed (hopefully) the laggy, skippy, media bug
  • Toggle negative screen mode by taping the home button 4 times quickly (but NOT as fast as you can) (based on a commit by gokhanmoral)
  • Toggle nightmode (red) screen mode by pressing the home button 3 times VERY quickly (pretty much as fast as you can) This is purposely designed to be a dim red, as searing bright 255 red isn't particularly easy on your eyes in the dark. Fun fact: this (and the negative one described above) are functional even during boot...triple tap to see your bootscreen turn red :p
  • CPUFreq bug fixes/commits (thanks DerTeufel)
  • Permanent TRIM (thanks googyanas)
  • Added shell scripts to quickly and easily see statistics with as little typing as possible. Open a command prompt on your device, type "su" and press enter to ascend to root. Now you can type "szc" and press enter to see zCache statistics (szc = show zcache). Or type "ssw" to see swapfile/zRAM statistics (ssw = show swap). Note: Some statistics don't fully populate until a few minutes after boot
  • Experimental: Set ZZMoove governor for battery savings by obtaining a root shell as described above, then typing "zzb" and pressing enter (zzb = zzmove battery). Does not reapply after reboot.
  • Compiler optimizations

.

VII. Source
Source for Plasma kernel can be found on my github.

XDA:DevDB Information
Plasma kernel, a Kernel for the T-Mobile Samsung Galaxy Note II

Contributors
ffolkes
Kernel Special Features:

Version Information
Status: Stable
Current Stable Version: 2.02
Stable Release Date: 2013-11-02

Created 2013-10-29
Last Updated 2013-11-02
 

ffolkes

Senior Member
Oct 18, 2006
1,338
2,108
New Jersey
Reserved

FAQ:
Q: I have no earpiece volume!
Be sure to choose Voodoo Sound or Sound Controls on the Audio tab of STweaks, then reboot.
Q: I can stably run this kernel. How can I use the screen-off settings so I can save battery?
You will have to intentionally crash your system to find your lowest value, and should definitely make a nandroid first. Then be sure to turn off dynamic fsync on the bottom of the I/O tab of STweaks, as this being enabled could cause data loss from a crash. When you are done with that, the first thing will be to lower the PM Lock Frequency. Try 600MHz, press Apply, then put your device to sleep, give it a few seconds, and see if it wakes. Be sure it's going into deep sleep! If it wakes up instantly, it wasn't in deep sleep. After booting, things like mediascanner can take minutes to finish and release their partial wakelocks. If you are sure it went into deep sleep, repeat with a lower frequency until you cannot wake. Pull the battery and reboot. Once it boots up, go into STweaks and set PM Lock Frequency to the last stable frequency. You must do this before the screen goes off, or else it'll crash again when it enters deep sleep!

Now, once you are sure of your stable PM frequency, move on to the next step. Set CPU Screen-Off Max Frequency to 200MHz. Use your device for a few minutes or hours or whatever. If you find music skips too much, or calls are slow to wake up the phone, set this to 300MHz, but now be prepared for a possible SOD if your device cannot handle scaling that low. If you experience one, leave this setting at 300MHz, and enable "Keep sleep max frequency fixed" and set CPU Screen-Off Fixed Max Frequency to 200MHz. If your phone was slow to wake at 200MHz before, try setting this to 300MHz.

Err, a bit of a vestigial tail here...don't forget to set Screen-Off Frequency For Responsiveness (it's higher up in the PegasusQ Scaling tab) to whatever your lowest screen-off frequency is. It isn't needed anymore and I should have taken it out probably. Like its waking counterpart, it is a threshold below which aggressive upscaling is used. Basically, it's the frequency the CPU will want to hover at, in this case, while the screen is off.
Q: Explain the PegasusQ screen-off settings.
  • CPU Screen-Off Max Frequency - This becomes the effective policy max as soon as you press the power button. Setting this too low may cause slow waking, or choppy music. Ideally this is just like normally setting the max policy; i.e. the governor will try to get frequencies as low as possible without going over this. This means if you get skips in your music at 200MHz, you can set this to 300MHz and the governor will be able to grab that extra power if it needs it. The problem is, some devices get finicky when they're bouncing around between sub-PM Lock frequencies and will crash. That's where the Fixed Sleep Frequency setting comes in. Read on.
  • Up Threshold While Screen-Off - This becomes the effective Up Threshold value as soon as you press the power button. Setting this higher will make the CPU more reluctant to scale higher (go faster).
  • PM Lock Frequency - This typically hardcoded value normally overrides the governor to throttle the CPU to 800MHz every time the system itself is unsuspended. This means it happens thousands of times a day, and can significantly add up after a few hours. I found different devices could handle different frequencies, so I made this is adjustable and added an interface to lulzactiveq and zzmoove. 500MHz works very stably for me.
  • After Boot Delay - Gives your device a grace period after booting during which none of the screen-off policies will be enforced so your start up tasks can be completed quickly.
  • Enable Fixed Sleep Frequency - This is where things get sorta confusing. If your device can't scale while sleeping, most likely it will be able to tolerate just sticking to one low frequency. But this has a downside...you disable the scaling logic of the governor, so you either have to suffer degraded screen-off performance (skips in your music) with a battery-saving frequency, or set this higher, but then that means you'll be pegging this higher frequency now even though you just needed it occasionally. But yay, I had an idea to put a one-way toggle in there. Read on.
  • CPU Screen-Off Fixed Max Sleep Frequency - So here's the thing. All devices can handle low scaling just fine, as long the screen is merely off (e.g. listening to music, etc). Once the system falls into deep sleep, that's when stability issues arise. So I had an idea... When you play music, you usually interact with the screen then turn it off, but it never actually goes into deep sleep until it's done playing. So I made it so the above Screen-Off Max Frequency will be used, including scaling, until deep sleep is called for. Then from that point on it will become fixed to this setting's frequency until you turn the screen back on, then the toggle gets reset.
v1.60 Release Notes

  • Control your panel refresh frequency - This is inspired by and based on AndreiLux's commits last year. Samsung includes a driver called "lcdfreq" that allows for scaling of panel refresh frequency to save power. It toggles between two states: limited and unlimited. Not all devices actively use this feature in stock builds, but it is possible to enable nonetheless. When in limited mode the panel's refresh rate is reduced from 60Hz (58 actual) to 40Hz (41 actual). I went a step further and made it so the limited mode's panel divider can be set manually (25, 27, 29, 31, 34, 37, 41, 45, 50, 60 fps). I also made it so the limited mode can now be forced, effectively allowing you to adjust the default refresh rate of your panel to save battery. Not everyone needs/wants 60fps. How much battery will this save? I don't know yet, but if you want to find out, the option is on the Screen tab of STweaks. Be sure to check the force checkbox. Very low rates will introduce flickering to some eyes (remember, this is a refresh rate being adjusted, not just fps).
  • Lcdfreq in PegasusQ - Note: This is irrelevant if you have decided to lock your refresh rate as described above. AndreiLux implemented this last year, and I modified it a bit and added more tunables. When enabled, PegasusQ will try to control the state of lcdfreq based on CPU load. Some of you may know AndreiLux abandoned this due to problems with flickering, but I have taken a different approach. His goal was to provide 60Hz as quickly as possible, which ended up frequently alternating between the two states. I'm aiming for the opposite - to stick with limited as long as possible and only boost it during heavy use (like a game). When bounced around between limited and unlimited too rapidly, there can be visible flickering and tearing, and different frequencies seem to slightly affect the color balance, which makes it even more noticeable. Quite possibly why Samsung doesn't use this on Note 2's.
    • lcdfreq_kick_in_down_delay - When PegasusQ decides it wants to call for the panel to be kicked down (into limited mode) it will have to ask this many times before actually doing it.
    • lcdfreq_kick_in_up_delay - When PegasusQ decides it wants to call for the panel to be boosted (into unlimited mode) it will have to ask this many times before actually doing it.
    • lcdfreq_kick_in_freq - Before PegasusQ will consider limiting the refresh rate, the CPU must be running at this frequency or below.
  • Boost lcdfreq on touch - Immediately boosts to the unlimited state, regardless of what PegasusQ calls for. A commit by AndreiLux. At some point I may add to this to make it time based (i.e. hold the boost for x amount of seconds after a touch).
  • Control the touchy backlight - On the Screen tab of STweaks. For ROMs that don't provide this support natively, otherwise it may be unreliable.
v1.65 Release Notes

  • Control your GPU - Over/underclock your GPU! Over/undervolt your GPU, too! Settings explained on the GPU tab of STweaks. Support for frequency, voltage, up/down threshold and GPU governor sampling rate.
  • Lock/Limit your GPU - You can lock your GPU to a specific step, or limit it to a definable maximum number of steps (e.g. 2 or 3)
  • Control S-Pen booster - Control/disable the S-Pen CPU booster. Stock is 800MHz, but I find that overkill.
  • S-Pen X,Y Axis Offset - For some reason Wacom sets this to like 30,30 depending on handedness. I have no idea why, I prefer 0,0. For most users I recommend checking the box on the S-Pen tab in STweaks and leaving the sliders at 0,0.
  • S-Pen Box Filter - Depending upon what you use your S-Pen for, this makes it much easier to draw shapes, but harder to do finer things, like writing. Think of it as "snap to grid".
  • Gestures! - Be sure to scroll down to the FAQ section to read how to use them.
Q: How do gestures work?
Flash the gesture pack and reboot. This places the action and handler scripts in /etc/init.d to be run on boot. The available gestures are listed on the Gestures tab of STweaks. You may customize the scripts, but be warned that flashing the zip again will overwrite them.

Some gestures will require you to hold down a touchkey while performing them. Be sure to have a Touchkey Modifier Delay set in STweaks (Screen tab). 100-200ms works well. Now any time you touch and hold a touchkey and then touch the screen within the delay you just set, you will activate gesture-only mode, during which the touchscreen will no longer send touch events to the operating system, only the gesture engine. This means you won't get any bleed through of gesture draws into the foreground app. It's also a safety of sorts, to prevent critical gestures from being accidentally triggered. The downside is, you can't have your cake and eat it...well, not without some delay at least. If the touchkey modifier was simply piggybacked onto the touchkey driver that would be nice, but it would also mean every time you used it, it would also report the touchkey (Menu/Back) event. Or, if you blocked it always, well then obviously your touchkeys wouldn't work anymore. So a compromise is using a very short delay, and after that delay is up, the touchkey driver checks to see if the screen has been touched and the touchkey is still down. If it has been touched, then gesture-only mode is set in the touchscreen driver until all fingers are up. If the screen has NOT been touched after the delay, then the touchkey driver assumes it's just a normal touchkey press and reports it like normal. This may seem like an insanely small delay, but it's meant for you to touch the touchkey and start drawing with another finger *simultaneously*.

tl;dr: Flash the gesture pack, go to the Screen tab and set the Touchkey Modifier Delay to 150ms or so, then apply it. Now test it. First swipe from near the bottom-left corner, up towards the middle-right side. Nothing should happen. Now repeat, this time putting a finger down on the touchkey and holding, while *at the same time* starting to drawing this simple gesture. Aim to have both fingertips touch down at the same time. If it goes well, the virtual power key will be pressed and it will go into suspend. If you have trouble, increase the delay until you get more practice. Eventually you'll be able to do this gesture one-handed by touching the touchkey with the side of your thumb, and sliding/flicking your index or middle finger outward in an arc.
.
Useful Apps (no affiliation):
BetterBatteryStats XDA / Play
Awesome tool that lets you see both kernel and partial wakelocks, as well as the average percent battery drain.​
CPU Spy XDA / Play
Provides a GUI to CPU time-in-state data.​
Micro CPU Monitor Play
One of my favorite apps ever, this puts a very small 1px bar across the top of the screen for each core. It can be set to come from left or right, the background can be set transparent, and the bar thickness and color are adjustable. Very useful for quickly (and discretely) noticing abnormally high CPU usage.​
top Play
Provides a GUI to the linux command 'top'. Provides a very reliable way to see what processes are using the most CPU time.​
System Monitor Play
This app makes monitoring CPU history easy, and makes it especially easy to see the effects of hotplugging tweaks because of the way it clearly displays the state of each core.​
.
Notes:
How to use the mdnie-control interface:

AndreiLux and Slimer777 have gone to great lengths to create an extremely accurate internal color profile using a spectrophotometer. The color accuracy is terrific. Most computers and tech use a very unnaturally cool color temperature (blue tint to white), so many people are taken by surprise when they see how yellow reality actually is. You need some time to get used to the new colors, but if you are still not pleased with the result, AndreiLux has setup MANY options for you to tweak in STweaks. Personally, I recommend increasing the chroma saturation weight.

Settings can easily be configured in the STweak app now. Download it from the Play Store.

A bit about body bias:

To summarize this feature: When we traditionally change voltages (SetCPU, Performance Control, etc), we are changing the gate voltage of the transistors. This can be a difficult concept to grasp, so here's a super-simple analogy to help: Imagine a light switch instead of a transistor. You reach your finger out to flick it. The force your finger applies would be analogous to the gate voltage. However transistors also have a body voltage, which can be thought of as the resistance behind the switch. By applying a positive difference between the gate and body, (which usually, but not always, equates to reducing the body voltage) we can make the proverbial switch "looser" so it's easier to flip, but now that it's looser, it's starting to leak a small amount of current as a result. So why would we want to do this if it will be leaking more? Because now that the switch is looser, we'll hopefully need less gate voltage (aka finger pressure in the analogy) which would save more power than was lost with that leakage. Or, for someone overclocking instead of undervolting, the "loose" switch will be easier to flip, and you may achieve an overclock not possible by merely ramping up the gate voltage (brute force) in your voltage control app of choice. Basically like the old saying "two steps forward, one step back" - we get something good, but have to sacrifice a little power lost through leakage. But how about the opposite scenario? What if in the analogy you have a really strong finger? Then you're leaking power for no reason because you don't need a "loose" switch. So, we can take advantage of that fitness and tighten it up by applying a negative body bias (also called a Reverse Body Bias, or RBB). This will make the transistor harder to switch, but plug up the leak and therefore increase power efficiency.

Ok, so why does all this exist? Why not just have an enormous negative bias (RBB) from the factory and save all that power lost through leakage? Because not all chips are equal, and not all transistors on the same chip are even equal. Temperature, manufacturing techniques, a few atoms of contamination, etc can make the chip less "fit" and unable to switch as easily as others. So how do they help these weakling transistors from getting the entire chip sent to the factory garbage can? Well, on one hand the gate voltage can be increased, but that is a last resort since it would waste too much power. Before it comes to that, they get a crutch in the form of a positive body bias (also called a Forward Body Bias, or FBB), which hopefully you'll remember was the subject of the first scenario above. And remember what that does? It makes them easier to switch, but at the cost of slightly decreased power efficiency. This offers better power savings when compared to increasing the gate voltage.

Samsung knows all this, and bins their chips according the ASV level, which can be thought of as the "quality" of the chip. The higher the ASV number, the better the chip, and the less power it needs to do its job. At the factory they mix increased gate voltages with varying body voltages to end up with a table of stock body biases. Long story short, this is how they deal with less-than-perfect chips. It's a lottery for the buyer. But since their values aren't tailored to your chip - the hope is that maybe you can scrape by with a bit less power than Samsung thought a chip of that grade could. So what AndreiLux has done is implemented new scaling logic/control code that lets you adjust the body voltage, and thus the body bias. Thanks to him, we now have another tool to help us squeeze a little bit more power out of our chips.

Calculating your body bias is incredibly simple: bodybias = gatevoltage - bodyvoltage. If you know the voltage of a given frequency, you can calculate your body bias by taking the gate voltage (what it says for that frequency in your usual voltage adjustment app) and then subtracting the value of the slice that corresponds to the range the example frequency was in on the ABB tab of STweaks. This can get tricky, because people forget that "body bias" is a difference between two values. If you start off with a stock negative body bias, that is to say that your body voltage is higher than your gate voltage, increasing your body voltage will actually be increasing your bias and you'll be needlessly wasting more power. However if you start off with a positive stock body bias, adding to the body voltage will actually be decreasing your bias since it will be bringing you closer to the gate voltage.​
 

pappy97

Senior Member
Dec 5, 2012
241
54
This kernel looks very nice, thanks.

Does this kernel allow for using USB Dock Audio? (or in other words, is there USB Audio Support without having to use the USB Audio Recorder Pro app?)

Thanks!
 

fermy

Senior Member
Nov 25, 2006
91
8
Not sure if it is the kernel or not, but I'm on liquid smooth, and my phone will freeze and I have to do a battery pull. Has happened twice. Even after the update.

Sent from my SGH-T889 using Tapatalk
 
  • Like
Reactions: regime2008

Top Liked Posts

  • There are no posts matching your filters.
  • 16
    plasma.png

    I. Thanks!
    .
    Disclaimer: I take no responsibility for any damage that might occur to your device. You proceed strictly at your own risk. This is a work in progress.
    Thank you for your interest in Plasma kernel, I hope you enjoy it. I've poured hundreds upon hundreds of hours of work into putting together a kernel that best showcases our hardware. Plasma kernel would not be possible without super-smart people like AndreiLux, DerTeufel, temasek, googyanas, faux123, and the regular contributors to the official cm kernel repositories. Please donate to them to support their hard work!
    .

    II. Features
    • CPU frequency range: 100MHz to 2.16GHz
    • ZZMoove, PegasusQ, performance (with support for multiple cores), and LulzactiveQ CPU governors
    • Zen, noop, deadline, row, cfq, sio, vr schedulers
    • Experimental Wolfson AND Voodoo Sound support (choose one or the other on the Audio tab of STweaks, then REBOOT!)
    • CPU voltage control
    • Linux 3.0.101
    • AndreiLux: Screen color calibration with mdnie-control
    • GPU over/underclock and over/undervolt
    • Control the frequency and voltage of all 5 GPU steps
    • Support for GPU clocks from 54MHz to beyond 800MHz
    • Control GPU governor sampling rate
    • Built with 4.8 toolchain
    • Built with -O3 and other optimizations
    • Extra panel brightness (<299)
    • Faux123: Dynamic fsync control (v1.2)
    • AndreiLux: Charging control
    • Support for STweaks
    • Control screen refresh rate (can be reduced to save battery)
    • AndreiLux: Memory/internal voltage control interface
    • AndreiLux: Adaptive Body Bias (ABB) control
    • AndreiLux: Digital brightness control/reduction (better than ScreenFilter)
    • LED control (with some color mixing adjustments by me)
    • Touchwake support, including touchkeys (enable in Screen tab of STweaks)
    • Multi-touch kernel-based gesture engine
    • Proportional Rate Reduction for TCP
    • Joe's RCU
    • Temasek: Frandom module (enable on the Memory/Internal tab of STweaks and REBOOT!)
    • S-Pen settings on the S-PEN tab of STweaks
    • zCache
    • Support for 4x parallel "Turbo ZRAM" (settings are on the "I/O / RAM" tab of STweaks)
    • UKSM
    • Enhanced Touchwake/Slide2Wake functionality
    • Arc-swipes to turn your phone on with one hand (Screen tab of STweaks)
    • Long-tap-off to turn your device off with one hand (Screen tab of STweaks)
    • Power off gesture: tap the top of the screen and a touchkey at the same time to trigger suspend
    • Change your power manager (PM) CPU lock frequency
    • Press the home button 4 times to toggle the screen negative
    • Press the home buttom 3 times as fast as you can to toggle the screen into nightmode (red)
    • exFAT support
    • For more, take a look at the commits
    .

    III. What's New
    Don't forget to check out what was new in 2.0b7 and 2.0b12!

    • [ZRAM Total Disk Size]: By default ZRAM is setup as four (4x) swaps operating in parallel at equal priorities. Set this to the TOTAL amount of RAM you wish to dedicate to ZRAM, and STweaks will automatically divide it evenly by four.
    • [UKSM Enable]: Enable the UKSM daemon that will continuously scan memory for duplicate data.
    • [UKSM Daemon Sampling Rate]: How often the daemon checks for duplicate data.
    • [UKSM CPU Usage Limit]: How much system load (CPU usage) the daemon will use.
    • [Long-tap-off Always On]: Found in its own section under the Touchwake section. When enabled Longtapoff will always work, regardless of how you woke your device. Takes effect immediately.
    • [Many ZZMoove settings]: Many ZZMoove settings on the newly created "ZZMoove Scaling" and "ZZMoove Hotplug" tabs. Descriptions coming soon.
    .

    IV. Download / Donate

    :) Support the development of Plasma kernel by DONATING if you find it useful! :)

    AOSP 4.3.x only!
    Plasma kernel v2.02 for T-Mobile Note 2 (t889)
    Plasma Gesture Pack

    :) Support the development of Plasma kernel by DONATING if you find it useful! :)

    .

    V. Changelog

    v2.02 (November 2nd, 2013)
    • Tracked audio/media skipping bug to disabled loggers (thanks pappschlumpf!) By default logging is now enabled. While you can still disable it, it will always be reset upon reboot.
    • Changes to write-back caching (thanks temasek)
    • Support for switching touchkey backlight driver from ROM/kernel (bottom of Screen tab in STweaks) (thanks Yank555-lu)
    • Some bug fixes for Slide2Wake
    .

    VI. Archived Changelogs


    2013-10-29 | v2.00
    • Linux 3.0.101 (thanks temasek)
    • Hopeful bugfixes for untouchable screen, and taps on top triggering suspend
    • Should you encounter a problem like that, cycling on and off (power button) should now reset any state variables
    • Fix FC issues. Works with more ROMs, including the latest AOSP nightlies
    • Allow pm_idx_freq to be set as high as 1600 MHz, theoretically could slightly speed up waking from deep sleep. Set on "Plasma Tuneables" tab of STweaks
    • Added several new tuneable ideas to zzmoove
    • Added "ZZMoove Scaling" and "ZZMoove Hotplug" tabs to STweaks. The descriptions are still a work in progress
    • Moved mDNIe controls to their own "Color" tab
    • Greatly enhanced the longpressoff feature's reliability and ease of use (by upgrading to scheduled_work)
    • Slide2Wake and arc swipes now trigger CPU and memory frequency locks to speed up waking
    • Slide2Wake and arc swipes no longer accidentally send input in the milliseconds after the screen comes on, but before you finished your gesture
    • Added option to Screen tab of STweaks to enable Longtapoff always, regardless of how the device woken
    • Expanded the trigger areas for slide2wake and arc swipes
    • ZRAM/swap is working and compatible with "Turbo ZRAM" (4x parallel ZRAM swaps for quad core devices) (thanks googyanas)
    • ZRAM settings in STweaks now allows you to set one total size of RAM that will be divided into 4x ZRAM swaps. Setting to 0 disables all swaps. Changes are applied instantly. No need for any other ZRAM/swap apps or init.d scripts.
    • UKSM (Ultra KSM (Kernel Samepage Merging)) enabled, with settings on the "I/O / RAM" tab of STweaks. Mostly just a novelty, but what it does is continuously checks RAM for duplicate pages to save space
    • zCache enabled and always running
    • Cleancache enabled
    • Frontswap enabled
    • Enabled LOWMEM_CHECK (thanks googyanas)
    • Enabled SPEEDUP_KEYRESUME as discussed in temasek's thread (Placebo effect? Maybe. Better ask Brian Molko. A cookie for you if you understand that reference) (thanks googyanas)
    • Added my own wake-speed ideas (2-second max-CPU-speed lock, and 2-second max-bus/RAM-speed lock on KEY_POWER press)
    • Permanently fixed (hopefully) the laggy, skippy, media bug
    • Toggle negative screen mode by taping the home button 4 times quickly (but NOT as fast as you can) (based on a commit by gokhanmoral)
    • Toggle nightmode (red) screen mode by pressing the home button 3 times VERY quickly (pretty much as fast as you can) This is purposely designed to be a dim red, as searing bright 255 red isn't particularly easy on your eyes in the dark. Fun fact: this (and the negative one described above) are functional even during boot...triple tap to see your bootscreen turn red :p
    • CPUFreq bug fixes/commits (thanks DerTeufel)
    • Permanent TRIM (thanks googyanas)
    • Added shell scripts to quickly and easily see statistics with as little typing as possible. Open a command prompt on your device, type "su" and press enter to ascend to root. Now you can type "szc" and press enter to see zCache statistics (szc = show zcache). Or type "ssw" to see swapfile/zRAM statistics (ssw = show swap). Note: Some statistics don't fully populate until a few minutes after boot
    • Experimental: Set ZZMoove governor for battery savings by obtaining a root shell as described above, then typing "zzb" and pressing enter (zzb = zzmove battery). Does not reapply after reboot.
    • Compiler optimizations

    .

    VII. Source
    Source for Plasma kernel can be found on my github.

    XDA:DevDB Information
    Plasma kernel, a Kernel for the T-Mobile Samsung Galaxy Note II

    Contributors
    ffolkes
    Kernel Special Features:

    Version Information
    Status: Stable
    Current Stable Version: 2.02
    Stable Release Date: 2013-11-02

    Created 2013-10-29
    Last Updated 2013-11-02
    10
    Reserved

    FAQ:
    Q: I have no earpiece volume!
    Be sure to choose Voodoo Sound or Sound Controls on the Audio tab of STweaks, then reboot.
    Q: I can stably run this kernel. How can I use the screen-off settings so I can save battery?
    You will have to intentionally crash your system to find your lowest value, and should definitely make a nandroid first. Then be sure to turn off dynamic fsync on the bottom of the I/O tab of STweaks, as this being enabled could cause data loss from a crash. When you are done with that, the first thing will be to lower the PM Lock Frequency. Try 600MHz, press Apply, then put your device to sleep, give it a few seconds, and see if it wakes. Be sure it's going into deep sleep! If it wakes up instantly, it wasn't in deep sleep. After booting, things like mediascanner can take minutes to finish and release their partial wakelocks. If you are sure it went into deep sleep, repeat with a lower frequency until you cannot wake. Pull the battery and reboot. Once it boots up, go into STweaks and set PM Lock Frequency to the last stable frequency. You must do this before the screen goes off, or else it'll crash again when it enters deep sleep!

    Now, once you are sure of your stable PM frequency, move on to the next step. Set CPU Screen-Off Max Frequency to 200MHz. Use your device for a few minutes or hours or whatever. If you find music skips too much, or calls are slow to wake up the phone, set this to 300MHz, but now be prepared for a possible SOD if your device cannot handle scaling that low. If you experience one, leave this setting at 300MHz, and enable "Keep sleep max frequency fixed" and set CPU Screen-Off Fixed Max Frequency to 200MHz. If your phone was slow to wake at 200MHz before, try setting this to 300MHz.

    Err, a bit of a vestigial tail here...don't forget to set Screen-Off Frequency For Responsiveness (it's higher up in the PegasusQ Scaling tab) to whatever your lowest screen-off frequency is. It isn't needed anymore and I should have taken it out probably. Like its waking counterpart, it is a threshold below which aggressive upscaling is used. Basically, it's the frequency the CPU will want to hover at, in this case, while the screen is off.
    Q: Explain the PegasusQ screen-off settings.
    • CPU Screen-Off Max Frequency - This becomes the effective policy max as soon as you press the power button. Setting this too low may cause slow waking, or choppy music. Ideally this is just like normally setting the max policy; i.e. the governor will try to get frequencies as low as possible without going over this. This means if you get skips in your music at 200MHz, you can set this to 300MHz and the governor will be able to grab that extra power if it needs it. The problem is, some devices get finicky when they're bouncing around between sub-PM Lock frequencies and will crash. That's where the Fixed Sleep Frequency setting comes in. Read on.
    • Up Threshold While Screen-Off - This becomes the effective Up Threshold value as soon as you press the power button. Setting this higher will make the CPU more reluctant to scale higher (go faster).
    • PM Lock Frequency - This typically hardcoded value normally overrides the governor to throttle the CPU to 800MHz every time the system itself is unsuspended. This means it happens thousands of times a day, and can significantly add up after a few hours. I found different devices could handle different frequencies, so I made this is adjustable and added an interface to lulzactiveq and zzmoove. 500MHz works very stably for me.
    • After Boot Delay - Gives your device a grace period after booting during which none of the screen-off policies will be enforced so your start up tasks can be completed quickly.
    • Enable Fixed Sleep Frequency - This is where things get sorta confusing. If your device can't scale while sleeping, most likely it will be able to tolerate just sticking to one low frequency. But this has a downside...you disable the scaling logic of the governor, so you either have to suffer degraded screen-off performance (skips in your music) with a battery-saving frequency, or set this higher, but then that means you'll be pegging this higher frequency now even though you just needed it occasionally. But yay, I had an idea to put a one-way toggle in there. Read on.
    • CPU Screen-Off Fixed Max Sleep Frequency - So here's the thing. All devices can handle low scaling just fine, as long the screen is merely off (e.g. listening to music, etc). Once the system falls into deep sleep, that's when stability issues arise. So I had an idea... When you play music, you usually interact with the screen then turn it off, but it never actually goes into deep sleep until it's done playing. So I made it so the above Screen-Off Max Frequency will be used, including scaling, until deep sleep is called for. Then from that point on it will become fixed to this setting's frequency until you turn the screen back on, then the toggle gets reset.
    v1.60 Release Notes

    • Control your panel refresh frequency - This is inspired by and based on AndreiLux's commits last year. Samsung includes a driver called "lcdfreq" that allows for scaling of panel refresh frequency to save power. It toggles between two states: limited and unlimited. Not all devices actively use this feature in stock builds, but it is possible to enable nonetheless. When in limited mode the panel's refresh rate is reduced from 60Hz (58 actual) to 40Hz (41 actual). I went a step further and made it so the limited mode's panel divider can be set manually (25, 27, 29, 31, 34, 37, 41, 45, 50, 60 fps). I also made it so the limited mode can now be forced, effectively allowing you to adjust the default refresh rate of your panel to save battery. Not everyone needs/wants 60fps. How much battery will this save? I don't know yet, but if you want to find out, the option is on the Screen tab of STweaks. Be sure to check the force checkbox. Very low rates will introduce flickering to some eyes (remember, this is a refresh rate being adjusted, not just fps).
    • Lcdfreq in PegasusQ - Note: This is irrelevant if you have decided to lock your refresh rate as described above. AndreiLux implemented this last year, and I modified it a bit and added more tunables. When enabled, PegasusQ will try to control the state of lcdfreq based on CPU load. Some of you may know AndreiLux abandoned this due to problems with flickering, but I have taken a different approach. His goal was to provide 60Hz as quickly as possible, which ended up frequently alternating between the two states. I'm aiming for the opposite - to stick with limited as long as possible and only boost it during heavy use (like a game). When bounced around between limited and unlimited too rapidly, there can be visible flickering and tearing, and different frequencies seem to slightly affect the color balance, which makes it even more noticeable. Quite possibly why Samsung doesn't use this on Note 2's.
      • lcdfreq_kick_in_down_delay - When PegasusQ decides it wants to call for the panel to be kicked down (into limited mode) it will have to ask this many times before actually doing it.
      • lcdfreq_kick_in_up_delay - When PegasusQ decides it wants to call for the panel to be boosted (into unlimited mode) it will have to ask this many times before actually doing it.
      • lcdfreq_kick_in_freq - Before PegasusQ will consider limiting the refresh rate, the CPU must be running at this frequency or below.
    • Boost lcdfreq on touch - Immediately boosts to the unlimited state, regardless of what PegasusQ calls for. A commit by AndreiLux. At some point I may add to this to make it time based (i.e. hold the boost for x amount of seconds after a touch).
    • Control the touchy backlight - On the Screen tab of STweaks. For ROMs that don't provide this support natively, otherwise it may be unreliable.
    v1.65 Release Notes

    • Control your GPU - Over/underclock your GPU! Over/undervolt your GPU, too! Settings explained on the GPU tab of STweaks. Support for frequency, voltage, up/down threshold and GPU governor sampling rate.
    • Lock/Limit your GPU - You can lock your GPU to a specific step, or limit it to a definable maximum number of steps (e.g. 2 or 3)
    • Control S-Pen booster - Control/disable the S-Pen CPU booster. Stock is 800MHz, but I find that overkill.
    • S-Pen X,Y Axis Offset - For some reason Wacom sets this to like 30,30 depending on handedness. I have no idea why, I prefer 0,0. For most users I recommend checking the box on the S-Pen tab in STweaks and leaving the sliders at 0,0.
    • S-Pen Box Filter - Depending upon what you use your S-Pen for, this makes it much easier to draw shapes, but harder to do finer things, like writing. Think of it as "snap to grid".
    • Gestures! - Be sure to scroll down to the FAQ section to read how to use them.
    Q: How do gestures work?
    Flash the gesture pack and reboot. This places the action and handler scripts in /etc/init.d to be run on boot. The available gestures are listed on the Gestures tab of STweaks. You may customize the scripts, but be warned that flashing the zip again will overwrite them.

    Some gestures will require you to hold down a touchkey while performing them. Be sure to have a Touchkey Modifier Delay set in STweaks (Screen tab). 100-200ms works well. Now any time you touch and hold a touchkey and then touch the screen within the delay you just set, you will activate gesture-only mode, during which the touchscreen will no longer send touch events to the operating system, only the gesture engine. This means you won't get any bleed through of gesture draws into the foreground app. It's also a safety of sorts, to prevent critical gestures from being accidentally triggered. The downside is, you can't have your cake and eat it...well, not without some delay at least. If the touchkey modifier was simply piggybacked onto the touchkey driver that would be nice, but it would also mean every time you used it, it would also report the touchkey (Menu/Back) event. Or, if you blocked it always, well then obviously your touchkeys wouldn't work anymore. So a compromise is using a very short delay, and after that delay is up, the touchkey driver checks to see if the screen has been touched and the touchkey is still down. If it has been touched, then gesture-only mode is set in the touchscreen driver until all fingers are up. If the screen has NOT been touched after the delay, then the touchkey driver assumes it's just a normal touchkey press and reports it like normal. This may seem like an insanely small delay, but it's meant for you to touch the touchkey and start drawing with another finger *simultaneously*.

    tl;dr: Flash the gesture pack, go to the Screen tab and set the Touchkey Modifier Delay to 150ms or so, then apply it. Now test it. First swipe from near the bottom-left corner, up towards the middle-right side. Nothing should happen. Now repeat, this time putting a finger down on the touchkey and holding, while *at the same time* starting to drawing this simple gesture. Aim to have both fingertips touch down at the same time. If it goes well, the virtual power key will be pressed and it will go into suspend. If you have trouble, increase the delay until you get more practice. Eventually you'll be able to do this gesture one-handed by touching the touchkey with the side of your thumb, and sliding/flicking your index or middle finger outward in an arc.
    .
    Useful Apps (no affiliation):
    BetterBatteryStats XDA / Play
    Awesome tool that lets you see both kernel and partial wakelocks, as well as the average percent battery drain.​
    CPU Spy XDA / Play
    Provides a GUI to CPU time-in-state data.​
    Micro CPU Monitor Play
    One of my favorite apps ever, this puts a very small 1px bar across the top of the screen for each core. It can be set to come from left or right, the background can be set transparent, and the bar thickness and color are adjustable. Very useful for quickly (and discretely) noticing abnormally high CPU usage.​
    top Play
    Provides a GUI to the linux command 'top'. Provides a very reliable way to see what processes are using the most CPU time.​
    System Monitor Play
    This app makes monitoring CPU history easy, and makes it especially easy to see the effects of hotplugging tweaks because of the way it clearly displays the state of each core.​
    .
    Notes:
    How to use the mdnie-control interface:

    AndreiLux and Slimer777 have gone to great lengths to create an extremely accurate internal color profile using a spectrophotometer. The color accuracy is terrific. Most computers and tech use a very unnaturally cool color temperature (blue tint to white), so many people are taken by surprise when they see how yellow reality actually is. You need some time to get used to the new colors, but if you are still not pleased with the result, AndreiLux has setup MANY options for you to tweak in STweaks. Personally, I recommend increasing the chroma saturation weight.

    Settings can easily be configured in the STweak app now. Download it from the Play Store.

    A bit about body bias:

    To summarize this feature: When we traditionally change voltages (SetCPU, Performance Control, etc), we are changing the gate voltage of the transistors. This can be a difficult concept to grasp, so here's a super-simple analogy to help: Imagine a light switch instead of a transistor. You reach your finger out to flick it. The force your finger applies would be analogous to the gate voltage. However transistors also have a body voltage, which can be thought of as the resistance behind the switch. By applying a positive difference between the gate and body, (which usually, but not always, equates to reducing the body voltage) we can make the proverbial switch "looser" so it's easier to flip, but now that it's looser, it's starting to leak a small amount of current as a result. So why would we want to do this if it will be leaking more? Because now that the switch is looser, we'll hopefully need less gate voltage (aka finger pressure in the analogy) which would save more power than was lost with that leakage. Or, for someone overclocking instead of undervolting, the "loose" switch will be easier to flip, and you may achieve an overclock not possible by merely ramping up the gate voltage (brute force) in your voltage control app of choice. Basically like the old saying "two steps forward, one step back" - we get something good, but have to sacrifice a little power lost through leakage. But how about the opposite scenario? What if in the analogy you have a really strong finger? Then you're leaking power for no reason because you don't need a "loose" switch. So, we can take advantage of that fitness and tighten it up by applying a negative body bias (also called a Reverse Body Bias, or RBB). This will make the transistor harder to switch, but plug up the leak and therefore increase power efficiency.

    Ok, so why does all this exist? Why not just have an enormous negative bias (RBB) from the factory and save all that power lost through leakage? Because not all chips are equal, and not all transistors on the same chip are even equal. Temperature, manufacturing techniques, a few atoms of contamination, etc can make the chip less "fit" and unable to switch as easily as others. So how do they help these weakling transistors from getting the entire chip sent to the factory garbage can? Well, on one hand the gate voltage can be increased, but that is a last resort since it would waste too much power. Before it comes to that, they get a crutch in the form of a positive body bias (also called a Forward Body Bias, or FBB), which hopefully you'll remember was the subject of the first scenario above. And remember what that does? It makes them easier to switch, but at the cost of slightly decreased power efficiency. This offers better power savings when compared to increasing the gate voltage.

    Samsung knows all this, and bins their chips according the ASV level, which can be thought of as the "quality" of the chip. The higher the ASV number, the better the chip, and the less power it needs to do its job. At the factory they mix increased gate voltages with varying body voltages to end up with a table of stock body biases. Long story short, this is how they deal with less-than-perfect chips. It's a lottery for the buyer. But since their values aren't tailored to your chip - the hope is that maybe you can scrape by with a bit less power than Samsung thought a chip of that grade could. So what AndreiLux has done is implemented new scaling logic/control code that lets you adjust the body voltage, and thus the body bias. Thanks to him, we now have another tool to help us squeeze a little bit more power out of our chips.

    Calculating your body bias is incredibly simple: bodybias = gatevoltage - bodyvoltage. If you know the voltage of a given frequency, you can calculate your body bias by taking the gate voltage (what it says for that frequency in your usual voltage adjustment app) and then subtracting the value of the slice that corresponds to the range the example frequency was in on the ABB tab of STweaks. This can get tricky, because people forget that "body bias" is a difference between two values. If you start off with a stock negative body bias, that is to say that your body voltage is higher than your gate voltage, increasing your body voltage will actually be increasing your bias and you'll be needlessly wasting more power. However if you start off with a positive stock body bias, adding to the body voltage will actually be decreasing your bias since it will be bringing you closer to the gate voltage.​
    4
    Sorry it has gone so long without an update. Here is 2.04b2 for 4.3.x (Jellybean). For a change log, check the last pages of the Sprint thread.
    1
    Very nice a lot greatness in the kernel. Would you consider making one for touch wiz?

    Sent from my SGH-T889 using XDA Premium 4 mobile app
    1
    Would you guys say this kernel is better than AGNi?
    It hasn't been updated in 10 months...

    Find the latest on the Plasma Kernel G+ community. This forum is hardly used anymore.

    Plasma is my favorite kernel, I use it with every AOSP ROM. It is in very active development... ffolkes can't seem to stop having ideas to pack into this kernel. Soooooo many features!

    Sent from my SGH-T889 using XDA Free mobile app