5,595,196 Members 46,084 Now Online
XDA Developers Android and Mobile Development Forum

[KERNEL][Mar 10][b49] _motley kernel for the N4 (add faux sound control)

Tip us?
 
_motley
Old
(Last edited by _motley; 13th March 2013 at 12:52 PM.)
#1  
_motley's Avatar
Senior Member - OP
Thanks Meter 2406
Posts: 858
Join Date: Aug 2010

 
DONATE TO ME
Angry [KERNEL][Mar 10][b49] _motley kernel for the N4 (add faux sound control)

_motley kernel for the Nexus 4

Disclaimer: You know the gig...I am not responsible for damaging your device or voiding your warranty. Play at your own risk!

ROM devs/cooks: If you want to use this kernel in your ROM, I am fine with that, but please include a "thanks" AND a link back to this thread. Thanks!

Features
  • Highly customizable with scripts. See post #2 for all the tuning options.
  • Google 3.4 base. All stock features are of course supported (camera, NFC etc.)
  • Compiler optimizations (-O2 + others) - using 2012.12 Linaro toolchain
  • Full ramdisk install with init.d support for stock/AOSP (CM already has support, for stock you must install busybox!)
  • CPU Overclock steps 1.56, 1.62, and 1.67GHz (default freq is still stock on boot, OC is optional)
  • 304MHz lowest CPU freq step added with lower voltage than stock, since the device spends a lot of time at this frequency.
  • Safe UV by default for nominal, fast, and faster binned chips.
  • Voltage control - be careful to not save the setting on boot until you are 100% sure it is stable! (thanks faux123! + my tweaks)
  • In-kernel auto_hotplug (thanks to thalamus). I have added and exposed all the tuning parameters and a debug mode to userspace.
  • Customized in-kernel thermal solution smart scaling, dynamic polling, and configurable throttle temp.
  • Custom PowerHAL module (spam-free Android log from PowerHAL events)
  • Controllable touchboost frequency and duration
  • Gamma and Sound control (thanks faux123!)
  • Fsync control (3 modes)
  • USB Force Fast Charge
  • I/O schedulers - SIO(optimized), deadline (optimized), row, cfq, noop, and fiops
  • TCP Congestion Control (several choices available) - veno is the default
  • Governors - Interactive (default), OnDemand, PowerSave, Conservative
  • CIFS, NFS, NTFS r/w, TUN - built-in, no need for any kernel modules
  • Other misc patches and tweaks (see github link at the bottom of this post)
  • GPL compliant - source is kept up to date at github.com and released at the time the kernel is released to the public via this post. Demand that other devs do the same!

Requirements (please read carefully and visit the other dev threads as necessary)
  • Boot-loader must be unlocked and you must have a custom recovery installed (CWM or TWRP).
  • Have your ROM zip on your /sdcard so you can restore your whole ROM if necessary.
  • Do a complete backup using custom recovery so you can restore your boot.img and ROM if necessary!
  • System Tuner is recommended for monitoring/tuning the CPU, especially for voltage control. Other kernel apps like faux123's will likely work as well, but they have not been tested.
  • AOSP ROMs including stock - for init.d support, you must have a working busybox install in /system/xbin.

Installation
  1. Check the requirements above and read release notes below for the build # you are installing for any extra instructions!
  2. If coming from another kernel, read the instructions in red below and follow them before flashing.
  3. Flash the the kernel zip using your custom recovery.
  4. Optional: if you want to revert back to what you had, restore your backup of your boot.img in recovery. Another option for reset back to stock is to flash the stock reset zip above. For other custom ROMs, dirty flash your custom ROM in recovery to get your default kernel and ramdisk back.

If you have issues and are coming from another custom kernel or ROM, follow these instructions first before the install. Many custom kernels are changing the ramdisk or other binaries that require a reset before moving back to stock or another kernel.

Reset for Stock ROM - flash this reset package that includes the stock kernel, ramdisk, thermald, mpdecision, and PowerHAL binary. This can also be used if you are using the stock ROM and want to go back to stock.
4.2.1 N4_421_stock_kernel_and_components.zip
4.2.2 N4_422_stock_kernel_and_components.zip
Reset for any non-stock ROMs like CM, AOKP etc - dirty flash your current ROM or nightly zip then your gapps in recovery (just flash, no wiping). This will give you back your original ramdisk, kernel, and other binaries that other kernel devs may have tweaked, renamed, replaced etc.

Builds

Build 49 - 2013-03-10 (stable) - Android 4.2.2
  • Added faux123's "Sound Control: Sound control for WCD93xx codec" for testing (thanks!)
AnyKernel UPDATE ONLY - must already be on b37 or higher first! Anykernel is the same for both Stock/AOSP and CM 10.1
motley_anykernel_422_nexus_4_build_49.zip

Build 48 - 2013-03-09 (stable) - Android 4.2.2
  • Turned off touchscreen accuracy filter by default and allow users to turn them on via the same interface (see git for all the details). In the commit comments on github, I also document how the stock kernel already allows these adjustments, but now we have easier control of them individually. Let me know if this fixes issues for those having them.
  • Reverted back the changes for notification delays. They didn't fix anything. If you swapped out your prime WiFi INI file, I recommend changing back to stock for now.
AnyKernel UPDATE ONLY - must already be on b37 or higher first! Anykernel is the same for both Stock/AOSP and CM 10.1
motley_anykernel_422_nexus_4_build_48.zip

Build 44 - 2013-03-04 (beta) - Android 4.2.2
  • Updated touchscreen Accuracy Filter Control with franco's cleanup patch. Reverting back to a single threaded workqueue should hopefully help fix the touchscreen issues some reported.
  • Per Google's kernel devs, we should not have CONFIG_NF_CONNTRACK_SIP/CONFIG_NF_NAT_SIP turned on in the config. Testing is under way (introduced in b43 posted in the thread).
AnyKernel UPDATE ONLY - must already be on b37 or higher first! Anykernel is the same for both Stock/AOSP and CM 10.1
motley_anykernel_422_nexus_4_build_44.zip

Build 42 - 2013-03-02 (beta) - Android 4.2.2
  • Added faux123 Speaker Amp Control by request for testing (thx!)
  • Added franciscofranco touchscreen Accuracy Filter Control by request for testing (thx!)
  • Reverted "Mako Gamma: allow values greater than 31 for array positions 5 and 6". Brought to faux's attention and his app is now fixed, so this is no longer needed. Values should be capped at 31 like we have always known.
AnyKernel UPDATE ONLY - must already be on b37 or higher first! Anykernel is the same for both Stock/AOSP and CM 10.1
motley_anykernel_422_nexus_4_build_42.zip

Build 40 - 2013-02-25 (stable) - Android 4.2.2
  • Added upstream smp patches from 4.2.1 back into 4.2.2 build
  • Added optimized ARM RWSEM algorithm backin into 4.2.2 build
AnyKernel UPDATE ONLY - must be on b37 or higher first! Anykernel is the same for both Stock/AOSP and CM 10.1
motley_anykernel_422_nexus_4_build_40.zip

Build 39 - 2013-02-20 (stable) - Android 4.2.2
  • Added usb/hsic patches into 4.2.2 build
  • Turned off prima debugging in 4.2.2 build
AnyKernel UPDATE ONLY - must be on b37 or higher first! Anykernel is the same for both Stock/AOSP and CM 10.1
motley_anykernel_422_nexus_4_build_39.zip

Build 38 - 2013-02-17 (stable) - Android 4.2.2
  • Loosen up validation for gamma interface to allow values greater than 31 for array positions 5 and 6.
AnyKernel UPDATE ONLY - must be on b37 or higher first! Anykernel is the same for both Stock/AOSP and CM 10.1
motley_anykernel_422_nexus_4_build_38.zip

Build 37 - 2013-02-17 (stable) - First build with 4.2.2 support added
  • 4.2.2 - rebased upon android-msm-mako-3.4-jb-mr1.1, ramdisk updated etc.
  • All major features added back in, but I have left a few patches out (hsic etc.) so we can evaluate before adding them back in.
  • Back to b32 colors, from here out you are on your own using the gamma interface of choice.
  • Fixed issue where fsync was still on like in previous builds. Dynamic fsync is now the default (see post 2)
  • Added franco gamma interface, so the kernel can support all popular interfaces until/if a standard interface is adopted.
  • Added refresh_screen sysfs (see post 2). This should only be called by apps or scripts while adjusting colors "live" with the motley or faux interface and NOT implemented on startup via init.d or apps since it will compete with the normal power on process and the colors will be set twice.
  • Use a 4.2.2 ROM and binaries. I will not troubleshoot any issues if you use this on 4.2.1 ROMs and binaries
Stock/AOSP with init.d support: motley_422_n4_exp_build_37_initd.zip
-or-
CM 10.1: motley_422_build_37_CM.zip

Previous builds and release notes:
 

Exp build 35 - 2013-02-11 (stable) - Last build for 4.2.1 for now
  • New default gamma values (this is an experiment, so let's see how everyone likes it)
  • cifs support for 4.2 (no modules required) - make sure you pass unc=\\\\server_name\\share_name as a mount option, or it will not work. It is a problem in the mainline kernel for 3.4 where they seem to have accidentally made the unc option mandatory. Also, no promises that the mount will be solid after the device sleeps. For now, I suggest you unmount after you are done using the file system unless we find a workaround. I have tested with cifsmanager from the app store. Other apps may or may not work.
  • Vibrator default is now 80 in init.mako.rc. This thing was anemic and it was about time.
  • FIOPS io scheduler added for testing by request
  • Applied several kernel\sched patches
  • auto_hotplug tweaks, nothing major.
  • Added dynamic fsync (thanks faux123) - I will update post 2 with the 3 different FSYNC options. Both toggles were left in the kernel since they are both available in different apps. If someone liked it the way it was, I didn't want to take that away.
Stock/AOSP with init.d support: motley_n4_exp_build_35_initd.zip
-or-
CM 10.1: motley_exp_build_35_CM.zip

Exp build 32 - 2013-02-03 (stable)
  • Merged Google's latest kernel patches for off-mode charging (from android-msm-mako-3.4-jb-mr1)
  • Interactive governor default tweaks - seems to give better user experience in testing thus far.
  • One other patch from Google's common 3.4 repo (sync: Fix race condition between merge and signal)
AnyKernel UPDATE ONLY - You must already be on exp b31. If not flash that first, then flash this. This works for both Stock/AOSP and CM
motley_anykernel_nexus_4_EXP_build_32.zip

Exp build 31 - 2013-01-28 (stable)
  • Added support for generic gamma control via sysfs with scripts (will update post #2 with details and examples). Again, thanks to faux123 for sharing his code.
  • Back on Linaro toolchain. Touch Control (PGM) support is still working fine.
  • TCP Congestion Control default changed to "veno" to see if it helps achieve faster speeds for some. Also added cubic, bic, illinois, and yeah for testing. Westwood+, reno, and vegas still available.
Stock/AOSP with init.d support: motley_n4_exp_build_31_initd.zip
-or-
CM 10.1: motley_exp_build_31_CM.zip
-or-
AnyKernel UPDATE ONLY - If you already on this kernel exp b17 or higher. For both Stock/AOSP and CM (keep this around for those who may want it for some reason)
motley_anykernel_nexus_4_EXP_build_31.zip

Exp build 28 update - 2013-01-24 (alpha 3)
  • Added support for gamma control (thanks to faux123, the faux123 app is required). Will likely provide something more generic in the future for tuning via sysfs without a 3rd party app.
  • Added some modest CPU OC steps of 1.56, 1.62, and 1.67GHz (voltages are scaled by bin but might not yet be optimal as the defaults). It still boots to the stock 1.5GHz, so it won't affect those that don't want to OC.
  • Giving the Google 4.7 toolchain a try. This base will give Touch Control a chance to work when the dev has a change to take a look. I am also inquiring to see if he thinks we can give Linaro a try. Google has made a lot of strides in this latest version, but I don't think it is yet on par with Linaro. I may do another alpha build with Linaro so we can compare. Perhaps I don't have the proper optimizations in place. we will see where this goes.
  • Thermal throttling improvements (new tuneable "min_freq_index" - what freq does it throttle down to before returning to max?)(default = 7 = 1.13GHz). This is the index in the frequency table as seen in Trickster MOD, System Tuner etc. It is zero based (i.e. 304MHz is zero). Several other changes, see my git commits for details.
  • Touch Control (PGM) support now available (thanks to bponury for his support!)
AnyKernel UPDATE ONLY - If you are not on b17 or higher already, flash build 17 first (Stock/AOSP or CM), then flash the AnyKernel zip for both Stock/AOSP and CM

Exp build 22 update - 2013-01-19 (stable)
  • Added hsic/usb patches (thanks to code aurora, harsh, thracemerin, and all the other kernel devs that helped with testing and troubleshooting)
  • See this post for some more info and why it was first released. It is now considered beta and not alpha.
AnyKernel UPDATE ONLY - If you are not on it already, flash build 17 first (Stock/AOSP or CM), then flash the AnyKernel zip for both Stock/AOSP and CM
motley_anykernel_nexus_4_EXP_build_22.zip

Exp build 21 update - 2013-01-19 (stable)
  • I am hoping this has us back to the b12 smoothness and we have settled in on some good defaults for moving forward.
  • Upgraded prima WLAN driver to 3.2.1.13 (connected to 3 different WiFi networks yesterday and it is working flawless for me)
  • Interactive gov tweaks based upon testing and feedback (boostpulse freq is now stock)
  • Default throttle temp now 67C
  • Other minor patches: auto_hotplug kick start on resume, update L2 voltage table, etc. (see github)
AnyKernel UPDATE ONLY - If you are not on it already, flash build 17 first (Stock/AOSP or CM), then flash the AnyKernel zip for both Stock/AOSP and CM
motley_anykernel_nexus_4_EXP_build_21.zip

Exp build 17 - 2013-01-16 (stable)
  • Back to new 3.4 Google interactive governor base like in b12
  • PowerHAL and boostpulse setup from b12 is also back. Touchboost default settings have been tweaked based on user feedback (how long does it boost? boostpulse_duration, what freq to boost to? hispeed_freq). If you want to use OnDemand, or don't want any touchboost, then you can flash the "inert" PowerHAL at the bottom of this post.
  • auto_hotplug enhancements rev 3 (see github) - I will update post #2 as soon as I can. We now have control over how many cpu cores you want online (for battery or performance). Thanks to mathkid for the min_online_cpus commit. It gave me the idea for max_online_cpus.
  • Back to the partial mako display partial revert by popular demand. My RBG tweak was reverted back to stock (255,255,255). Remember, the RGB can be changed in this kernel and it will persist after screen off/on without an app (see post #2). Trickster MOD can be used to tweak RGB.
  • OnDemand gov - latest patches from Code Aurora.
  • Note: Make sure you test with out of the box voltages, especially in the mid-range! There is already a healthy amount of under-volting in this kernel for all binned chips except "slow".
Stock/AOSP with init.d support: Attachment 1651464
-or-
CM 10.1: Attachment 1651468

Exp build 14 - 2013-01-14 (beta)
  • Reverted back to stock interactive governor base.
  • Added touchboost changes into stock interactive gov base and tweaked touchboost default settings based on user feedback.
  • Reverted back to b10 inert PowerHAL (same a separate flash I provided for b12 for those having issues)
  • Reverted one other scheduler patch that I thought could be playing a role in the reboot. I also didn't think it showed benefits after testing.
  • Notes: you can control touchboost using the interactive gov (turn off/on touchboost: input_boost, length of boost pulse: above_hispeed_delay, freq to boost to: hispeed_freq)
Stock/AOSP with init.d support: Attachment 1645970
-or-
CM 10.1: Attachment 1645993


Exp build 12 - 2013-01-13 (beta)
  • Touchboost control - connected custom Android PowerHAL module with interactive touchboost. Then, I married interactive touchboost with autoplug touchboost. If you want to tune tune interactive governor touchboost differently, you can use sysfs scripts, Trickster MOD or other capable apps (how long does it boost? boostpulse_duration, what freq to boost to? hispeed_freq)
  • Added touchscreen patch (thanks faux123) - seems to make the touchscreen more usable and responsive in my testing.
  • autoplug enhancements rev 2 - added ability to change # of sampling_periods on the fly using a module parameter (whilst preserving past history). Added get/set methods for all module parameters to make them safe. See github for all the details.
  • Added "row io scheduler by request - SIO is still the default for now.
  • Some other misc patches
Stock/AOSP with init.d support: Attachment 1641515
-or-
CM 10.1: Attachment 1641518

Exp build 10 - 2012-12-30 (stable)
  • Important: Since freqs have been added at the high end below 1.5GHz for smoother scaling, if you use voltage control make sure voltage data is not applied on start-up since you won't have the values for the new freqs.
  • Userspace tuning for thermal and hotplug (see post 2 for details shortly)
  • Enhanced thermal throttling and frequency scaling (see github commits for details, too many changes to list here)
  • Merged Code Aurora HSIC patches that hopefully will reduce duration of the infamous wakelock (and revert of prior trial workaround)
  • Added optimized ARM RWSEM algorithm
  • SMP patches from 3.5 that address hotplug efficiency and lay the foundation for other future patches I am studying.
  • Some other minor patches and changes (see github)
Stock/AOSP with init.d support: Attachment 1604553
-or-
CM 10.1: Attachment 1604557

Exp build 8 - initial release
  • Same base features as build 57 mainline
  • ARM auto hotplug v0.220 by _thalamus
  • Custom PowerHAL (chatter-free Android log)
  • Interactive (default) - with input boost
  • MSM-thermal in-kernel solution
  • thermald and mpdecision are disabled (services are not started in the ramdisk)


Inert PowerHAL library
This is a shell PowerHAL library that allows Android to function and stops the input boostpulse requests
(same as included in b8 and b10 Exp kernels).It was originally released for testing b12, but can be used in other builds. Personally, I would only flash the "inert PowerHAL" if you are using OnDemand full-time and no longer using interactive (set on boot), OR if you are using interactive and want to completely remove the boostpulse requests coming from Android. In the later case, UI performance may be sacrificed a bit for better battery.
motley_inert_powerhal.zip

Mirror site - thanks tlongren! - will typically be updated within a day after I post
http://www.longren.org/nexus4/motley

Git repo:
https://github.com/motley-git/kernel-Nexus4

(http://www.gnu.org/copyleft/gpl.html)
Nexus 4 (my custom kernel for the 4 click here)
Nexus 7 (my custom kernel for the 7 click here) -Thx to fordwolden, the most generous guy on XDA!
Transformer Prime (my custom kernel for the Prime click here)

Always have your stuff when you need it with Dropbox. 2GB account is free! Use this LINK and you and I both get 500MB extra free
The Following 231 Users Say Thank You to _motley For This Useful Post: [ Click to Expand ]
 
_motley
Old
(Last edited by _motley; 18th February 2013 at 03:08 AM.)
#2  
_motley's Avatar
Senior Member - OP
Thanks Meter 2406
Posts: 858
Join Date: Aug 2010

 
DONATE TO ME
Setting custom RGB color settings via sysfs

This can be done from the adb shell on your PC, or any terminal app. If you change them, they will not persist after a reboot. However, you can set them in an init.d script if you found another color combination that you like better than the one I have used.

Code:
echo "255 255 255" > /sys/devices/platform/kcal_ctrl.0/kcal
echo 1 > /sys/devices/platform/kcal_ctrl.0/kcal_ctrl
Command 1 sets the color and Command 2 commits them. Stock is 255 255 255.

Setting custom Gamma settings via sysfs - Exp kernel build 31+ only - thanks to faux for sharing his code
Warning: changing these values can be potentially be dangerous to your display if you make a mistake. For those that feel comfortable with what they are doing and want to experiment, please report back and share your findings.

Important, please read!
  • There are ten digits in the string separated by one space
  • First digit is a checksum and is never stored. The checksum is simply the sum of the other 9 numbers. This is to make it harder to so the interface is respected and you are forced to think about what you are doing.

There are 3 sysfs interfaces for gamma, one for each color:
Code:
#!/system/bin/sh
# Show the current configuration and the checksum
cat /sys/devices/platform/mipi_lgit.1537/kgamma_red
cat /sys/devices/platform/mipi_lgit.1537/kgamma_green
cat /sys/devices/platform/mipi_lgit.1537/kgamma_blue
Update:
Recently molesarecoming started opening this up and showing us what the values can be used to adjust. Franco then suggested that the white and grays should be swapped in moles original work. So, for init.d values using this interface, we have the following "banks" if values if we agree with Franco on the swap of the whites and grays.
Code:
R: checksum, g_white, g_mids, g_black, 0, g_contrast, g_brightness, g_saturation, g_grey, 2
G: checksum, g_white, g_mids, g_black, 0, g_contrast, g_brightness, g_saturation, g_grey, 2
B: checksum, g_white, g_mids, g_black, 0, g_contrast, g_brightness, g_saturation, g_grey, 2
(the zero in position 5's and the 2's in position 10 are recommended to be left alone since they are currently unknowns)

Minus the checksum, the 27 values mirror the 3 color arrays (3 x 9 = 27) in the actual LG LCD driver. Minus the unknowns, we are left with 21 values. Note that every one of the variables can have their value tweaked by color (saturation for red, saturation for green etc.), however, it is recommended that you start with all the values of one type being the same and then tweak from there if you really want to fine tune.

You have a lot of power in your hands even without fine tuning. Many will argue that fine tuning isn't required. If you look at the stock settings by Google in post 2, they took advantage of fine tuning for whatever reason. Even though many don't like these settings by Google, it shows how flexible the interface can be.

Instructions:
1) Start with a preset config (LG or Google) as shown further below. This is a set of 3 lines, 10 numbers for each line.

2) Tweak columns for their values as above. For example, we tweak contrast and brightness as in faux's original app. We could also do the same for saturation, blacks, whites, grays etc.

Example: start with LG presets with numbers to adjust:
383 114 21 118 0 10 4 80 48 2
383 114 21 118 0 7 4 80 48 2
383 114 21 118 0 5 1 80 48 2

3) Now update the checksum in column 1 (first digit = sum of last 9 digits)

397 114 21 118 0 10 4 80 48 2
394 114 21 118 0 7 4 80 48 2
389 114 21 118 0 5 1 80 48 2

4) Create a script inside a text file - my recommendation for your first test

Code:
#!/system/bin/sh
# Set data color pro presets from shared Google spreadsheet (thanks user acer73!)
# Use LG presents as your starting values and then adjust columns 6 & 7 from the spreadsheet
echo "397 114 21 118 0 10 4 80 48 2" > /sys/devices/platform/mipi_lgit.1537/kgamma_red
echo "394 114 21 118 0 7 4 80 48 2" > /sys/devices/platform/mipi_lgit.1537/kgamma_green
echo "389 114 21 118 0 5 1 80 48 2" > /sys/devices/platform/mipi_lgit.1537/kgamma_blue

#Set the complimentary RGB values for this calibration
echo "248 248 248" > /sys/devices/platform/kcal_ctrl.0/kcal
echo 1 > /sys/devices/platform/kcal_ctrl.0/kcal_ctrl
5) Run the script (or you can echo each line manually to test from adb if you prefer).

6) Turn the screen off and on for the gamma change to take effect.

7) Check the dmesg output for any clues and to see the output of the result.

8) Place the script into your /system/etc/init.d/ folder (or equivalent) for a permanent color change!

Screen refresh (added in b37) - this should only be called by apps or scripts while adjusting and testing colors "live" with the motley or faux sysfs interface. It should NOT be implemented on startup via init.d or by apps since it will compete with the normal power on process.

Code:
echo 1 > /sys/devices/platform/mipi_lgit.1537/refresh_screen

Presets:

Code:
#!/system/bin/sh
# Set LG presets (motley stock) - i.e. popular partial revert of Google's tweaks just before release
echo "383 114 21 118 0 0 0 80 48 2" > /sys/devices/platform/mipi_lgit.1537/kgamma_red
echo "383 114 21 118 0 0 0 80 48 2" > /sys/devices/platform/mipi_lgit.1537/kgamma_green
echo "383 114 21 118 0 0 0 80 48 2" > /sys/devices/platform/mipi_lgit.1537/kgamma_blue

Code:
#!/system/bin/sh
# Set stock Google presets (from kernel source code)
echo "332 64 68 118 1 0 0 48 32 1" > /sys/devices/platform/mipi_lgit.1537/kgamma_red
echo "332 64 68 118 1 0 0 48 32 1" > /sys/devices/platform/mipi_lgit.1537/kgamma_green
echo "364 32 35 116 0 31 16 80 51 3" > /sys/devices/platform/mipi_lgit.1537/kgamma_blue
Code:
#!/system/bin/sh
# Set faux Google presets (not sure why his numbers differ)
echo "460 64 68 118 1 32 96 48 32 1" > /sys/devices/platform/mipi_lgit.1537/kgamma_red
echo "461 64 68 118 1 33 96 48 32 1" > /sys/devices/platform/mipi_lgit.1537/kgamma_green
echo "445 32 35 116 0 32 96 80 51 3" > /sys/devices/platform/mipi_lgit.1537/kgamma_blue

Spreadsheet with shared settings
https://docs.google.com/spreadsheet/...rX1Rya0E#gid=0


FSYNC Control

Notes: I thought about combining these options, but many kernel apps already support these two options. So, I have them both and they can be controlled in combination to give us the 3 modes. If you set fsync_enabled = 0 it will be OFF regardless of how Dyn_fsync_active is set.

3 Modes:

Dynamic (default in b35 and higher)- fsync is asynchronous when screen is on, when screen is off it is committed synchronously
dynamic fsync ON
fsync ON
Code:
echo 1 > /sys/kernel/dyn_fsync/Dyn_fsync_active
echo 1 > /sys/class/misc/fsynccontrol/fsync_enabled
Off (best performance, less safe) - fsync is always asynchronous (b32 and prior builds)
dynamic fsync OFF
fsync OFF
Code:
echo 0 > /sys/kernel/dyn_fsync/Dyn_fsync_active
echo 0 > /sys/class/misc/fsynccontrol/fsync_enabled
Stock (safest) - fsync is always committed synchronously
dynamic fsync OFF
fsync ON
Code:
echo 0 > /sys/kernel/dyn_fsync/Dyn_fsync_active
echo 1 > /sys/class/misc/fsynccontrol/fsync_enabled
There is a lot of info out there on fsync, that will not be discussed here. I have run fsync off on several devices for awhile now and haven't experienced any issues. If you are using a device that is not stable and crashes alot, I recommend enabling it via init.d or script manager on boot. Hopefully your N4 is as stable as is mine.

USB Force Fast Charge

You can turn it on with popular apps (like Trickster MOD) that support the common sysfs toggle as shown below.

If you don't like it or don't want to use it, it is off by default.

Turn ON:
Code:
echo 1 > /sys/kernel/fast_charge/force_fast_charge
Turn OFF:
Code:
echo 0 > /sys/kernel/fast_charge/force_fast_charge
Notes:
  • When it is ON, you will not be able to connect your phone to your PC (adb, mtp etc.). This is expected behavior.
  • To start charging: turn fast charge ON, plug the USB cable into your PC, and charge up.
  • To stop charging: unplug the USB cable and turn fast charge OFF. Now you can plug back into your PC for normal trickle charging, adb/mtp etc.
  • Tip: if you see it connect to your PC (media device or adb), it isn't working. Unplug the cable, wait a couple seconds and plug it in again.

Boostpulse control - Experimental build only

Trickster MOD works great to play with these.

How long does it boost when Android senses touch? (in b10 and b14 it is above_hispeed_delay)
Code:
/sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
What freq does it boost to?
Code:
/sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Turn touchboost OFF/ON (in b10 and b14 only)
Code:
/sys/devices/system/cpu/cpufreq/interactive/input_boost
Thermal Throttling and Hotplug Control - Experimental build only
Warning: these do not have to be changed from the defaults and could potentially be dangerous if you make a mistake. For those that know what they are doing and want to experiment with settings, scripts etc. please report back your findings.

msm_thermal:

Throttle temp in C. Default is 70, valid range is 45 to 80 (recommend to not go over 75):
Code:
/sys/module/msm_thermal/parameters/throttle_temp
Minimum freq used in throttle down before returning to max, default is 7 = 1.13GHz. Range is 4 to 8 (810Mhz to 1.24GHz)
This is the index in the frequency table as seen in Trickster MOD, System Tuner etc. It is zero based (i.e. 304MHz is zero).
Code:
/sys/module/msm_thermal/parameters/min_freq_index
Turn on thermal debugging so you can see what is happening in the kernel log:
Code:
/sys/module/msm_thermal/parameters/thermal_debug
auto_hotplug:
Load based hotplugging parameters. I have taken _thalamus' base (thanks!) and have exposed most of the tuning parameters to userspace.

Turn off/on hot_plug debugging Y/N, default N, this spams the kernel log like crazy, turn on only when troubleshooting/testing
Code:
/sys/module/auto_hotplug/parameters/debug
Load at which a CPU is taken offline, 40-125, default 80:
Code:
/sys/module/auto_hotplug/parameters/disable_load_threshold
Load at which an extra CPU is put online, 130-250, default 200:
Code:
/sys/module/auto_hotplug/parameters/enable_load_threshold
Load at which all CPU's are enabled, 270-550, default is 400 (or 100 x number of cores):
Code:
/sys/module/auto_hotplug/parameters/enable_all_load_threshold
Sample rate in milliseconds, converted to jiffies at runtime, 10-50ms, default 20:
Code:
/sys/module/auto_hotplug/parameters/min_sampling_rate
Number of samples in the circular buffer, 5-50, default 10 (more samples = less aggressive; less samples = more aggressive):
Code:
/sys/module/auto_hotplug/parameters/sampling_periods
Maximum number of cores online (regardless of load) when screen is on, 1-4, default 4 (tune down for battery savings):
Code:
/sys/module/auto_hotplug/parameters/max_online_cpus
Minimum number of cores online (regardless of load) when screen is on, 1-4, default 1 (tune up for performance/bench-marking):
Code:
/sys/module/auto_hotplug/parameters/min_online_cpus

Vibration Intensity

You can also use Trickster MOD to set this.

Example increase intensity:
Code:
echo "90" > /sys/class/timed_output/vibrator/amp
To go back to stock:
Code:
echo "70" > /sys/class/timed_output/vibrator/amp
Why are the base voltage tables different on some phones

What CPU do you have? Nominal, Fast, Faster ...or Slow

The phones with the lower default voltage values use the "fast" or "faster" frequency table, consider yourself lucky. This explains why some can't UV as much as others since they are starting with lower mV's to start. These are built in factory tolerances that depend upon the binning of your chip. I am familiar with the same thing in the tegra3 world where I have had more experience. So, don't worry as this is commonly done in this industry. Hopefully folks don't go freaking out because they have a nominal chip like I do. It's probably good for a dev to have a nominal chip so we can better honor the limits.

http://en.wikipedia.org/wiki/Product_binning

How do I tell what I have?
If you boot up your phone fresh and look at the dmesg output (kernel log) while the messages are still there, you will find one of the following output messages where it selects it's frequency plan depending on the binning of the chip.

Code:
adb shell dmesg | grep PVS
acpuclk-8064 acpuclk-8064: ACPU PVS: Nominal
-or-
acpuclk-8064 acpuclk-8064: ACPU PVS: Fast
-or-
acpuclk-8064 acpuclk-8064: ACPU PVS: Faster
-or-
acpuclk-8064 acpuclk-8064: ACPU PVS: Slow

I have tweaked all the frequency tables nominal, fast, and faster (as well as slow to compensate for the lower freq) to keep them similarly scaled relative to stock. If you don't like the safe defaults (already UV'ed), then use voltage control and come up with your own preferred values.
Nexus 4 (my custom kernel for the 4 click here)
Nexus 7 (my custom kernel for the 7 click here) -Thx to fordwolden, the most generous guy on XDA!
Transformer Prime (my custom kernel for the Prime click here)

Always have your stuff when you need it with Dropbox. 2GB account is free! Use this LINK and you and I both get 500MB extra free
The Following 68 Users Say Thank You to _motley For This Useful Post: [ Click to Expand ]
 
overhauling
Old
(Last edited by overhauling; 15th February 2013 at 03:40 PM.)
#3  
overhauling's Avatar
Senior Member
Thanks Meter 714
Posts: 549
Join Date: Aug 2011

 
DONATE TO ME
SWEET!
The Boot Box Project - Boot Animations: http://forum.xda-developers.com/show...php?p=41827858
Device specific Boot Box threads: Nexus 4, Nexus 5, Galaxy S4
The Following User Says Thank You to overhauling For This Useful Post: [ Click to Expand ]
 
_Opiate_
Old
#4  
_Opiate_'s Avatar
Senior Member
Thanks Meter 12
Posts: 471
Join Date: Jun 2010
Sweetness! New kernel!

Sent from my Galaxy Nexus using Tapatalk 2
Nexus One (AT&T 3G)
HTC Aria AT&T
Samsung Captivate AT&T
Samsung Vibrant - SIM Unlocked on AT&T
Samsung GalaxyTab (AT&T)
HTC Inspire 4G
Samsung Galaxy S II Int. - Factory Unlocked (AT&T)
Galaxy Nexus GSM
The Following User Says Thank You to _Opiate_ For This Useful Post: [ Click to Expand ]
 
slimldj
Old
#5  
slimldj's Avatar
Senior Member
Thanks Meter 375
Posts: 1,687
Join Date: Nov 2011
Location: London
I definitely giving this s try out.

Thanks for your work.

Sent from my Nexus 4 using xda premium
Sony Xperia Z1 Honami
ROM: iHackers
KERNEL: Stock
The Following User Says Thank You to slimldj For This Useful Post: [ Click to Expand ]
 
stormtroopercs
Old
#6  
stormtroopercs's Avatar
Senior Member
Thanks Meter 211
Posts: 855
Join Date: Aug 2010
Location: Torrance,California
On my phone the zip is showing duplicate files inside?

Sent from my Nexus 4 using Tapatalk 2
[DEVICE] nexus 4
[ROM] PARANOIDANDROID
[KERNEL] Latest Franco
The Following User Says Thank You to stormtroopercs For This Useful Post: [ Click to Expand ]
 
hol17
Old
#7  
Senior Member
Thanks Meter 68
Posts: 427
Join Date: Sep 2009
Location: Edmonton
Quote:
Originally Posted by stormtroopercs View Post
On my phone the zip is showing duplicate files inside?

Sent from my Nexus 4 using Tapatalk 2
File looks fine on a computer.
Attached Thumbnails
Click image for larger version

Name:	kernel.jpg
Views:	13333
Size:	29.9 KB
ID:	1523226  
The Following User Says Thank You to hol17 For This Useful Post: [ Click to Expand ]
 
_motley
Old
#8  
_motley's Avatar
Senior Member - OP
Thanks Meter 2406
Posts: 858
Join Date: Aug 2010

 
DONATE TO ME
Quote:
Originally Posted by stormtroopercs View Post
On my phone the zip is showing duplicate files inside?

Sent from my Nexus 4 using Tapatalk 2
Quote:
Originally Posted by hol17 View Post
File looks fine on a computer.
That is odd. I just looked at it on my phone with ES zip viewer and it looks fine. Also looks good in Linux and flashes fine using CWM touch. Does Root Explorer officially support JB4.2?
Nexus 4 (my custom kernel for the 4 click here)
Nexus 7 (my custom kernel for the 7 click here) -Thx to fordwolden, the most generous guy on XDA!
Transformer Prime (my custom kernel for the Prime click here)

Always have your stuff when you need it with Dropbox. 2GB account is free! Use this LINK and you and I both get 500MB extra free
The Following 4 Users Say Thank You to _motley For This Useful Post: [ Click to Expand ]
 
KidCarter93
Old
#9  
KidCarter93's Avatar
Forum Moderator
Thanks Meter 6411
Posts: 14,170
Join Date: Mar 2012
Location: Coventry
I've just added this kernel to the Nexus 4 Complete Index

Sent from my GT-I9100 using xda premium
I'm subscribed to too many threads so I may not notice your reply. To make sure I do, quote my post or add "@KidCarter93" to your reply."
[ m7 | 4.19.401.8 | S-OFF ]
Forum Rules | XDA New User Guide | Getting Moderator Help

"There are 10 types of people in the world - those who understand hexadecimal and F the rest."
Follow me on Twitter - @XDAKidCarter93
The Following 2 Users Say Thank You to KidCarter93 For This Useful Post: [ Click to Expand ]
 
_motley
Old
#10  
_motley's Avatar
Senior Member - OP
Thanks Meter 2406
Posts: 858
Join Date: Aug 2010

 
DONATE TO ME
Quote:
Originally Posted by KidCarter93 View Post
I've just added this kernel to the Nexus 4 Complete Index

Sent from my GT-I9100 using xda premium
Thx, appreciate it!
Nexus 4 (my custom kernel for the 4 click here)
Nexus 7 (my custom kernel for the 7 click here) -Thx to fordwolden, the most generous guy on XDA!
Transformer Prime (my custom kernel for the Prime click here)

Always have your stuff when you need it with Dropbox. 2GB account is free! Use this LINK and you and I both get 500MB extra free

The Following 5 Users Say Thank You to _motley For This Useful Post: [ Click to Expand ]
THREAD CLOSED
Subscribe
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes