Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,737,741 Members 47,342 Now Online
XDA Developers Android and Mobile Development Forum

[Kernel][4.4] M-Kernel - a69 [WiFi/3G] [f2fs/ext4] [6/23]

Tip us?
 
Metallice
Old
(Last edited by Metallice; 20th June 2014 at 12:52 AM.)
#1  
Metallice's Avatar
Recognized Contributor - OP
Thanks Meter 4674
Posts: 3,125
Join Date: Jun 2010

 
DONATE TO ME
Default [Kernel][4.4] M-Kernel - a69 [WiFi/3G] [f2fs/ext4] [6/23]

Page 1: Information
Page 2: Changelog and Downloads
Page 3: Additional info and FAQ

Instructions:

Make sure you are on the latest bootloader version before flashing this or any other custom kernel. Search for a flashable zip or use fastboot and the google factory images. Fastboot method highly recommended as the safer method.

Download Kernel to internal SD card. Flash in recovery. Reboot. Congratulate yourself for wisely installing the best nexus 7 kernel.

Basic feature list:

Milestone Release 2 (mr2)

  • For now just go to the Github. Honestly... I think I'm done with feature lists. PIA. I shouldn't have to justify my work. The kernel has everything you could ever need. Tada.
  • A lot has changed since mr1 below...

Milestone Release 1 (mr1)
  • Based on latest google aosp tegra kernel source mr2 for android 4.3
  • compatible with all 4.3.x based ROMS
  • Based on latest google aosp tegra kernel source mr1.1 for android 4.2.2
    • compatible with all 4.2.x based ROMS
  • CPU over clock up to 1.7GHz
  • GPU over clock up to 700MHz
  • LP core overclock to 666MHz
  • Custom user voltage control for CPU and Core components such as EMC, GPU, and LP (faux123)
  • CIFS, NFS, NTFS, HFS, ZRAM, and more built in.
  • Switch to higher quality dithering mode for better gradient quality (error diffusion)
  • Disabled KSM and compactions for performance.
  • Useless debugging removed.
  • FSync control (Ezekeel)
  • User configurable Wifi power management mode (PMFAST/PMMAX)
  • Included ramdisk with optimized mount options such as discard and noauto_da_alloc (no need for init.d scripts to enable anymore)
  • Included ramdisk with optimized VM settings
  • optimized compiler flags
  • Latest linaro 2013 gcc toolchain
  • Dynamic EDP - enable edp cpu maximum frequency limits only above a certain temperature (motley)
  • Disable 100MHz max frequency decrease when more than one CPU core active
  • Default CPU voltages set to ID 3 levels
  • Runnable threads hot plugging
  • Glibc memcpy and memmove
  • Deadline improvements for solid state drives
  • Force high current charging over pc USB (imoseyon)
  • Proportional Rate Reduction for TCP
  • Fixed current_now property for current viewing apps
  • Optimized SLUB and use SLUB by default instead of SLAB
  • Tegra 3 variant display (faux123)
  • Faster LP -> G transitioning
  • Optimized swahb32 byteswap helper
  • Asynchronous I/O latency improved through removal of plug in do_io_submit()
  • Tweaked CFS parameters
  • Optimized ARM RWSEM algorithm
  • Block: recursive merge requests
  • timer: optimize aplpy_slack()
  • Disabled GENTLE_FAIR_SLEEPERS to improve performance
  • Balanced EDP frequency limits to be same across all cores
  • LowMemoryKiller asynchronous compaction and compaction when killing processes
  • allow use of a controller native max block size
  • optimized crypto algorythms
  • Optimized AES and SHA1 routines
  • Better hotplugging delays
  • Increase boost_up_threshold for AVP clock
  • kexec-hardboot support for multirom
  • minimum cpu performance loch for audio playback (faux123) with additional fixes
  • decreased minimum backlight level for better low light viewing
  • switch do_fsync() to fget_light()
  • Added latest BFQ I/O scheduler
  • Fix crash when unplugging OTG devices (intersectRaven)
  • Added Tegra high performance AHB memory driver with additional fixes and improvements
  • Input: Send one packet at a time
  • support for ROM built-in OTG support
  • Added latest ROW scheduler with additional patches and improvements
  • Set Core voltage to 0.95V in Low Power mode 1 for significant semi-idle battery savings
  • TCP congestion control with Westwood+ set as default
  • Disabled speaker dynamic range compression for improved speaker audio quality
  • Lock performance governor to all 4 cores
  • LowMemoryKiller fixes and improvements
  • Many scheduler improvements and optimizations
  • A million other patches, fixes, and improvements that I don't have the time or space to list

A complete list of changes is available at my Github.
Source: https://github.com/Metallice/android_kernel_grouper

Recommended Settings:

The only app supported for changing any kernel parameters and settings is TricksterMod - https://play.google.com/store/apps/d...0.trickstermod

CPU governor - TouchDemand with default parameters (default)
I/O Scheduler -
- Deadline (default) for pure I/O speed. Fastest read and write speeds. May cause occasional lag during background downloading/installing
- ROW for pure read speed. Fast reads which are often the most important on mobile. Similar concerns like deadline.
- BFQ for overall smoothness. Slower than Deadline and ROW, but prevents stutters while downloading in background
Max Frequency - 1.2Ghz (Stock max for 2+ cores)
- Note: Tegra sets the max frequency to 1.5Ghz at boot, make sure to change it manually or have an app set it at boot to avoid battery loss.
- Note 2: DO NOT USE SYSTEM TUNER TO SET FREQUENCIES. CONFLICTS WITH AUDIO PERFLOCK IN KERNEL. Do NOT use system tuner to set frequencies as it conflicts with audio performance lock in this kernel. Will prevent you from lowering your maximum frequency. Use Trickstermod.
GPU Max Freq - 446Mhz (maintains good battery life while smoothing out some THD games)
- Possible frequencies -
Fsync - On
Dynamic Fsync - On (be aware of data loss concerns, even if they actually are minimal)
SmartDimmer/PRISM - Off (On for a63+)
zRAM - off/none (default) (absolutely worthless on android 4.0+ with >1GB RAM)
Data remounting - already included in ramdisk. Additional scripts not needed.

I DO NOT RECOMMEND, nor will I support, any kind of optimization/superdupercharge/placebo script. All settings are already optimized in kernel and ramdisk. Using these scripts or tweaks will only lead to problems and performance degradation.

__________________________________________

If you'd like to buy me some caffeine so I can continue to fit studying and kernel-ing in my busy schedule, feel free to donate below. Thanks so much for all of your support! Clicking the thanks button is always appreciated too

The Following 523 Users Say Thank You to Metallice For This Useful Post: [ Click to Expand ]
 
Metallice
Old
(Last edited by Metallice; 24th June 2014 at 03:34 AM.)
#2  
Metallice's Avatar
Recognized Contributor - OP
Thanks Meter 4674
Posts: 3,125
Join Date: Jun 2010

 
DONATE TO ME
Alpha Changelog (stable feature list above):

a69 -
Quick fix to allow overclocking on stock roms.

a68 -
Update to latest 4.4.3 kernel source
Sync with latest CM 4.4.3 ramdisk
Update to 4.8 toolchain
F2FS support
Zip installation supports all permutations of ext4/f2fs layouts
Based on work by frantisek.nesveda, but modified to support all layouts and be more flexible
Make sure to go to his thread -HERE- and click the thanks button!
Upgrade to BFQ v7r4
Adjust touchboost values
Enable Kernel Samepage Merging - I've gone back and forth on this. For now, enabled.
Probably some other changes I'm forgetting.

a67 - Update + sync ramdisk from cm11 to enable native USB OTG. Add thermal charging shut off. Some kconfig tweaks.

a66 - Only hold wakelock is touch/slide to wake is enabled. Tweak default BFQ values a bit.

a65 - Update BFQ from 5.1 to 6r2. Set BFQ as default for testing. Tweak Deadline and CFQ (Franco's CFQ values). If CFQ is still causing reboots for some, I will revert it to stock in next build. Cgroups timer slack controller. Enable RCU priority boosting for testing.

a64 - merge 4.4 kernel changes. Update ramdisk for 4.4

a63.1 - CM hotfix

a63 - Add Tegra 4 SmartDimmer (ported from TripNRaVeR's port for the One X). It either works much better or is completely broken. Either way, it's an improvement from the old SmartDimmer. Add necessary ramdisk change for PAC rom. Add dm9620 usb ethernet support. Switch back to linaro 4.7 toolchain from google 4.6 (used in mr2 for stability reasons).

a62 - Add double tap to wake thanks to flar2 and sgt. meow. Add configurable timer to keep double tap to wake active after screen shut off. Remove Fsync toggle. Pointless and confusing with Dynamic Fsync available now. Update Dynamic Fsync from faux123. Set backlight levels back to defaults and disable otf_scaling. Some random stuffs.

New sysfs:
/sys/android_touch/wake_timeout
Value is in seconds. Defaults to 60. Set to 0 to keep double tap to wake permanently active at the price of battery.

a61 - Enable compass driver. Add Dynamic Fsync by Faux123. Disable Fsync off at boot. Enable Dynamic Fsync at boot. Remove wifi pm fast/max toggle as it is now pointless and won't work since 4.3 kernel update. Add an older, but simpler, version of usb host mode by mehrvarz. Fixed and enabled many 4.3 config options relating to things like selinux.

a60 - More ramdisk fixes

a59 - Update cm10.2 ramdisk to fix storage issues. Fix 00su init.d.

a58 - Incorporate cm10.2 ramdisk.

a57 - Update to 4.3 kernel base. 4.3 stock only. Ramdisk base courtesy of Francisco Franco. Fsync off at boot since the internal storage is just so appallingly slow.

a56 - Add back some missing config options removed in a55 to support various features. No CIFS support. Couldn't get it to boot for some reason.

a55 - Add v2 of Tegra AHB patch set. Remove and revert USBHOST patches. Revert to almost stock kernel config for testing (will probably revert back later). Revert to stock PA ramdisk for testing. Tweak default TouchDemand parameters for bettter performance. Hard-code deadline and cfq tuneables thanks to the work by those in Franco's thread - details in commitlog on github. Set deadline as default I/O scheduler. Add core hotplugging lock during touch boost/input to interactive governor based on implementation in stock interactive governor (not fully tested). Other minor, inconsequential changes.

a54 - Remove AHB bus drivers and patches.

a53 - USBHOST support and patches. WiFi adhoc IBSS support.

a52 - revert voltage table changes

a51 - fix flickering at brightness level 13 when smartdimmer was enabled by setting SD min to 10. Re-enable a 3g modem reset assignment fix. It was disabled in a49/a50; let's see if re-enabling it causes 3g drops to return (Otherwise TCP proportional rate reduction was the cause). Re-enable wifi p2p patch that was disabled in a49 under the impression it wasn't included in the stock kernel when it actually is (whoops). Increase the some DVFS voltages so that that they are at least as high pre-a50 (according to DVFS debug showing actual running voltage) and not more than 25mV greater than pre-a50. Hard-code default pm_qos_max_cpus as 4 instead of ULONG_MAX. Fixes aesthetic bug where the default tegra hotplug max_cores was 2147483647 (For the curious - it is 2^31 − 1, the maximum value for a 32-bit signed integer in computing).

Oh, and change thread title to accord with new XDA requirements.

a50 - re-enable dynamic edp. Rework some edp limits. Rework DVFS voltage tables to better match frequencies, YMMV. Removed 1.7GHz max frequency option as it was pretty split whether your device could run it or not. If people were more responsible and wouldn't complain about issues when running 1.7 or higher I would leave it in, but unfortunately that's just not the case. So it saves me headaches in the future. Sorry. It's a minor increase from 1.6GHz and most can do 1.6 just fine.

a49 - add some rwsem patches. Revert TCP proportional patch. Revert a wifi p2p patch. Fully stock /net and drivers/net in source now. Add custom min/max backlight interface. I'll add more info when I'm not so busy. Removed zRam support.

Change your max backlight (min - 255) - /sys/module/board_grouper_panel/parameters/max_backlight
Change your min backlight (1 - max) - /sys/module/board_grouper_panel/parameters/min_backlight
Enable/Disable on-the-fly backlight level redistribution through available brightness slots based on new min/max using math below (0/1) - /sys/module/board_grouper_panel/parameters/otf_scaling
- brightness = min_backlight + DIV_ROUND_CLOSEST(((max_backlight - min_backlight) * max((brightness - 10),0)),245);

a48 - actually upload a kernel that is mr1 + row patches + flash fix

a47 - mr1 + row patches + flash fix accidentally uploaded old kernel version...

a46 - disable have_efficient_unaligned_access. Add USB Host mode charging patches.

a45 - Fix adobe flash corruption. Add ARM unaligned access and enable have efficient unaligned access. Make sure slider min brightness and auto-brightness min have the same backlight value.

a44 - Start over at mr1. Add ROW patches. Add LZ4 compression.

a43 - revert all network and wireless patches since mr1.

a42 - revert some config options. Fix fixed_mode on boot for multiboot. Sched_mc_power_savings set to 0 instead of 2 to see how it affects wakeup.

a41 - ARM cpu topology and relevant patches. Enable multi-core scheduling. Enable maximum multi-core scheduling power savings for testing. Switch back to LZ4 ramdisk compression as Multiboot supports it now. Increase touchdemand sampling down factor since sampling rate was decreased previously.

a40 - Revert SLQB. Add latest usb host mode charging from mehrvarz's repo. Force detect/report usb as ac, no apparent benefit. Enabled a config SVIPC or something... I forget. Enabled rndis support from CM.

a39 - SLQB allocator. Switch back to Gzip ramdisk compression for multirom.

a38 - Fix adobe flash playback. Super fast Lz4 compressed for ramdisk and kernel. Arm unaligned efficient memory access. Some misc. wifi and network patches. Many other changes. No guarantees.

__________________________________________________


Downloads:

Alphas 4.4 -


Milestone 4.3.x Releases -

Alphas 4.3 (post mr2) -

Alphas 4.3 (pre mr2) -


Milestone 4.2.x Releases -


Alphas 4.2.x -

__________________________________________________
Legacy downloads available at http://goo.im/devs/Metallice/Nexus7
The Following 195 Users Say Thank You to Metallice For This Useful Post: [ Click to Expand ]
 
Metallice
Old
(Last edited by Metallice; 17th April 2013 at 04:56 PM.)
#3  
Metallice's Avatar
Recognized Contributor - OP
Thanks Meter 4674
Posts: 3,125
Join Date: Jun 2010

 
DONATE TO ME
THIS ENTIRE POST IS A WIP THAT I WILL FINISH LATER.

Glossary of terms:

(that one may not be as familiar with as things like CPU and GPU)

SoC - A System on a Chip, which the Tegra 3 is, is an integrated circuit that includes all the important components of a computer, such as CPU, GPU, RAM, etc into a single chip
Hotplugging - the process of turning CPU cores on and off.
G core(s) - One of four ARM A9 CPU cores found in the Tegra 3 SoC
LP (core) - The ARM A9 "Low-Power" CPU core found in the Tegra 3 SoC in addition to the 4 G cores. The LP core, contrary to what many seem to believe, does not run in tandem with the 4 G cores.
Runnable Threads (hot plugging) - Limits turning on more cpu cores based on the average number of running threads
Touchdemand - A modified ondemand-based governor that I designed and configured to better suit the Tegra 3 and android based on my observations
Variant -
Scheduler -
Other things

FAQ:

What's the difference between the mr(#) version/download and the a(#) version/download? Which should i download? What do these acronyms mean/stand for?

The mr# (ex. mr1) stands for milestone release number #. The milestone builds are the stable, bug-free, and thoroughly, extensively, and expansively tested builds of m-kernel.

The a# (ex. a38) stands for alpha build number #. The alpha builds listed under downloads are all of the alpha builds after the latest milestone build listed in reverse chronological and "morphological" (? FIX) order. It is the continuation of the "alpha branch" of m-kernel, and is basically the latest milestone with a ton of patches, fixes, and changes that are completely UNTESTED by anyone but me. The number and substantiality of changes since the latest milestone obviously vary and also depends on the number of alpha builds since the latest milestone release. An alpha build isn't guaranteed to be stable, working, and bug-free. They are testing builds leading up to the next milestone


Do you recommend setting the maximum number of cores to 2?

I don't necessarily recommend everyone do this, for it really comes down to personal preference. However, limiting the maximum cores to two is a very simple change to make that will slightly improve battery, with little to no impact on performance. Android 4.x is highly optimized for dual-core processing. There is no part of the Android 4.x OS that needs more than 2 cores for a smooth experience, and likewise there are few to no android applications that need 2 cores.

For the most part, the 3rd and 4th g cores are only activated during time sensitive actions such as opening an app for the first time (i.e. not previously opened and cached in RAM) and during screen rotation. These are short lived operations meaning those 3rd and 4th g cores are quickly turned off afterwards. In essence a small hit to battery life for even smaller benefits.

Why won't my minimum frequency go below 340MHz?!?

As long as you don't use system tuner, the minimum frequency does go below 340MHz. The minimum frequency is temporarily raised to 340MHz during an audio event to prevent audio playback problems when using ondemand and similar governors. The minimum frequency returns to the previous value afterwards. Some apps may show the minimum frequency as 340MHz because clicking the app to open it created a sound causing the minimum to temporarily rise. The app does not change when the minimum frequency goes back to its previous value.

Why can't over clock the GPU as high as I can on other kernels!?!

You can. You have to raise the voltage for the top GPU slot. Other kernels do this automatically and to fixed values. The amount necessary depends on the GPU frequency you are trying to run and your device. No devices are alike and the voltage necessary at whatever frequency will vary considerably from device to devices. Be aware that having to overvolt to run a certain frequency may mean suggest that you shouldn't run that frequency anyway. Raising the GPU frequency and voltage has risks to consider

What is this tegra 3 "variant" or whatever? How do I find it? What does it meeeeaaaannnn??!!?

You can find this info in /sys/kernel/debug/t3_variant

In the stock kernel/source, each device sku is recognized and assigned four ID values. For the CPU there is a primary "cpu speedo id" and a secondary "cpu process id". For the SOC, or core (think LP core, RAM, GPU, etc), there is a primary "soc speedo id" and a secondary "soc process id."

Each "pair" of ids is used to choose the respective voltage tables for the components they represent. I'm going to ignore the soc/core ids as they aren't relevant to my point and are the same for all our devices.

The CPU voltage tables are represented by ( cpu_speedo_id # , cpu_process_id #). The voltage tables that share the same first number, the cpu_speedo_id, all end with the same MHz value. To make things simple, Tegra uses the maximum frequency in the voltage table to determine the maximum frequency. All of our Nexus 7 Tegra 3s share the same cpu_speed_id, corresponding to a maximum frequency of 1.3GHz.

The second number, the cpu_process_id, differs between all of our N7 T3's. For whatever reason, Faux123 and everyone refers to value as our "variant." Why Faux123 calls this your "variant" instead of the true name cpu_process_id I don't know. Regardless, this value, cpu_process_id determines the voltages for each frequency in the table. For each increase in cpu_process_id, the RANGE of voltages for the voltage table is compressed by 25mV (i.e. the voltage for the top frequency is decreased by 25mV while the bottom stays at 800mV and the middle frequency voltages are adjusted accordingly).

Therefore, in a direct sense, the cpu_process_id, or "variant", HAS NOTHING TO DO WITH CPU FREQUENCY. I'll repeat this. YOUR CPU_PROCESS_ID OR VARIANT HAS NO DIRECT CONNECTION TO THE MAXIMUM FREQUENCY CAPABILITIES OF YOUR CHIP. Variant/cpu_process_id refers to the voltage tolerance of your cpu. While there may be correlation or secondary connection to the maximum frequency capabilities of your chip, there is not direct connection. Additionally, cpu_process_id HAS NOTHING TO DO WITH YOUR SOC/CORE AT ALL, WHICH INCLUDES YOUR GPU/LP/RAM. A high cpu_process_id tells you nothing about your core and how high you can clock your GPU.

TL;DR - Variant, or more accurately cpu_process_id, refers to voltage tolerance, and has no direct connection to the max frequency abilities of your chip, and definitely has absolutely no relationship to your core/GPU.

To do:

Core voltages quirks.

Max freq delay necessity.

Why doesn't the kernel come with recommended settings?
The Following 117 Users Say Thank You to Metallice For This Useful Post: [ Click to Expand ]
 
Metallice
Old
#4  
Metallice's Avatar
Recognized Contributor - OP
Thanks Meter 4674
Posts: 3,125
Join Date: Jun 2010

 
DONATE TO ME
One more
The Following 59 Users Say Thank You to Metallice For This Useful Post: [ Click to Expand ]
 
azoller1
Old
#5  
azoller1's Avatar
Senior Member
Thanks Meter 1604
Posts: 1,748
Join Date: Aug 2011
Location: Lenexa

 
DONATE TO ME
Default Re: [Kernel[3G+Wifi] M-Kernel - mr1

Sweet will flash this and give you some results later

Sent from my VS920 4G using Tapatalk 2
DONATIONS WOULD BE NICE!!-- HERE

Device: LG Spectrum 16GB 4G
Rom: Running Beanstalk Builds
Kernel: Running My S-Kernel JB

Device: Asus TF300T 32GB
Rom: Running My Own CyanogenMod Builds
Kernel: Running Stock CM Kernel

MY DEV
GOO.IM FILES/FOLDERS
ANDROID FILE HOST DEVICES
SOURCEFORGE FILES
The Following 2 Users Say Thank You to azoller1 For This Useful Post: [ Click to Expand ]
 
tdizzle404
Old
#6  
tdizzle404's Avatar
Senior Member
Thanks Meter 1085
Posts: 4,461
Join Date: Nov 2010
Location: North Georgia

 
DONATE TO ME
Default Re: [Kernel[3G+Wifi] M-Kernel - mr1

Quote:
Originally Posted by azoller1 View Post
Sweet will flash this and give you some results later

Sent from my VS920 4G using Tapatalk 2
+1 I got a good feeling about this one

Sent from my SGH-T999 using xda app-developers app
Htc Droid DNA
Grouper
A Must Read for Noob to Dev!
^^^^A good read while you let your phone sit for 10
If Ive helped you please hit THANKS
The Following User Says Thank You to tdizzle404 For This Useful Post: [ Click to Expand ]
 
Metallice
Old
(Last edited by Metallice; 27th February 2013 at 05:20 PM.)
#7  
Metallice's Avatar
Recognized Contributor - OP
Thanks Meter 4674
Posts: 3,125
Join Date: Jun 2010

 
DONATE TO ME
Quote:
Originally Posted by tdizzle404 View Post
+1 I got a good feeling about this one

Sent from my SGH-T999 using xda app-developers app
I really hope you're making a joke... I've had a thread in android development for a while now... 37 versions...
The Following 12 Users Say Thank You to Metallice For This Useful Post: [ Click to Expand ]
 
azoller1
Old
#8  
azoller1's Avatar
Senior Member
Thanks Meter 1604
Posts: 1,748
Join Date: Aug 2011
Location: Lenexa

 
DONATE TO ME
Default Re: [Kernel[3G+Wifi][4.2.2] M-Kernel - mr1

So really there is no need for gpu over clock unless for a benchmark?

Sent from my VS920 4G using Tapatalk 2
DONATIONS WOULD BE NICE!!-- HERE

Device: LG Spectrum 16GB 4G
Rom: Running Beanstalk Builds
Kernel: Running My S-Kernel JB

Device: Asus TF300T 32GB
Rom: Running My Own CyanogenMod Builds
Kernel: Running Stock CM Kernel

MY DEV
GOO.IM FILES/FOLDERS
ANDROID FILE HOST DEVICES
SOURCEFORGE FILES
 
Metallice
Old
#9  
Metallice's Avatar
Recognized Contributor - OP
Thanks Meter 4674
Posts: 3,125
Join Date: Jun 2010

 
DONATE TO ME
Quote:
Originally Posted by azoller1 View Post
So really there is no need for gpu over clock unless for a benchmark?

Sent from my VS920 4G using Tapatalk 2
Says who? Me? Where?

No of course that's not true. GPU overclock can have benefits. Minimal due to RAM bottlenecking, but it will still marginally imrprove FPS in some cases.
The Following 6 Users Say Thank You to Metallice For This Useful Post: [ Click to Expand ]
 
element800
Old
#10  
Senior Member
Thanks Meter 46
Posts: 394
Join Date: Apr 2012
I love your work metallica, we really appreciate it

I remember you made 5(+) different versions just because for 2 people having wifi issues...

You really spend a lot of time at this and this is a great kernel.

Thanks!
Samsung Galaxy S4 : Stock.
Nexus 7 : Stock.
Sony Xperia S : CM11, not in use anymore.

The Following User Says Thank You to element800 For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes