Jump to content

  1. 0
  2. 0
  3. 0/5

Rate this Topic

- - - - -

[KERNEL] [OTG] [OC 1.9Ghz] [HOLOYOLO] Community Kernel

  • Please log in to reply

OP JassyCliq

JassyCliq

Android Apprentice

  • 33 posts

Posted 01 May 2013 - 08:03 PM #1

GOAL
The goal of this kernel is to have a central place for developers in the community, who don't want the burden to maintain their own kernel, to have a place to do so. Many times, developers who work on these devices constantly develop issues with others or don't have time to incorporate new features. Our goal is to avoid all that. Anything and everything will be accepted, granted it doesn't break anything. @show-p1984 has been kind enough to not only host the source but grant the use of his buildbot for this project. Every time source is pushed, the bot will start to build the kernel, zip up the package and finally upload it to my goo.im account. If you'd like to become part of this project then go ahead and reach out to me on twitter (@jassycliq) or PM me on here. My short term goal for this kernel is to add all the hotplug drivers available for mako and incorporate them into this one kernel. As it stands we can only use Qcom's binary, show's mpdecision and faux123's intelli-plug as they have switches to turn them off. These can be changed on the fly, as long as the user turns off all the hotplug drivers first then turns on the desired hotplug method. I'd also like to have an app that can control this, well a proper application to be exact.

Features
* CPU OC up to 1.9ghz, Default to 1.5GHz
* CPU UC down to 162mhz
* UV down to 600,000uVolts
* Intelli-plug hotplug driver
* Qualcomm's MPDecision
* MSM MPDecision (kernel based mpdecision)
* Dynamic FSync
* Sweep2Wake
* Snapdragon S4 and Krait optimizations
* 3-Phase Thermal
* GPU OC up to 487mhz
* Faux's Gamma Interface
* Faux Sound/Speaker Control
* Fast Charge
* Schedulers
FIOPS
SIO
NOOP
ROW
CFQ
DEADLINE (tuned for flash devices)
* Governors:
DanceDance
Interactive
Ondemand
Performance
* Advance TCP Congestion Control
Westood+
Reno
Bic
Cubic
Htcp
Veno
* Compiled with gcc 4.7.3 (Linaro 4.7-2013.04)
* -O3 optimized
* WLAN, TUN and CIFS compiled as modules due to size of kernel from the high amounts of optimizations
* Too much to write!

Choosing between the 3 hotplug drivers
This kernel comes with 3 hotplug drivers (intelli-plug, qcoms mpdecision and kernel based mpdecision) by default only Qualcomm's MPDecision is used. To turn one of the others you must use their respective sysfs interfaces after turning off the one's you're not using. To make it easier for you, I have included a small little application that helps you turn through this. If you'd like to make an init.d script to choose which one you want on boot then use the following commands

For kernel based mpdecision
echo "0/1" > /sys/kernel/msm_mpdecision/conf/enabled
echo "0/1" > /sys/kernel/msm_mpdecision/conf/scroff_single_core


For Intelli-Plug
echo "0/1" > /sys/module/intelli_plug/parameters/intelli_plug_active
echo "0/1" > /sys/module/intelli_plug/parameters/eco_mode_active


For Qualcomm's MPDecision
start mpdecision
stop mpdecision


Downloads
http://goo.im/devs/jassycliq/mako

What is msm_thermal?
Kernel based 3-phase thermal control!
This replaces your /system/bin/thermald binary which is renamed by the installer to thermald_bck.
It will throttle your cpu speed to keep it cool and unleash it if the cpu has cooled down enough. (3 phases: low, mid and high)

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

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

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

check_interval_ms = how often shall we check? (sampling rate)
Default: 100ms (=0.1sec)

shutdown_temp = if we reach this shut down the device!
Default: 80°C

If you want to see msm_thermal doing it's job:

adb shell
cat /proc/kmsg | grep 'thermal'


What is msm_mpdecision?


100% kernel based multi core decision! (should cpu1/2/3 be online or not?)
This replaces your /system/bin/mpdecision binary which is renamed by the installer to mpdecision_bck.

Check /sys/kernel/msm_mpdecision/conf/ for the configuration.

startdelay = time until mpdecision starts doing it's magic (20000)
delay = time between checks (70)
pause = if something else plugs in the cpu, fall asleep for 10000ms (10 secs)
scroff_single_core = if the screen is off, don't plug in cpu1/2/3. Additionally: Unplug all cpus except cpu0 when screen is turned off (1)
enabled = enable(1) or disable(0) mpdecision. This does not affect scroff_single_core!
min_cpus = min cpus to be online, cannot be < 1. Default: 1
max_cpus = max cpus to be online, cannot be > 4. (if you set it to 2 and min_cpus to 1 you will basically have a dualcore) Default: 4
idle_freq = a value against that will be checked if a core +/- is requested. (486000)
If cpu0 is below that value and a core up of another cpu is requested, nothing will happen.
If any other cpu is above that value and a core down of that cpu is requested, nothing will happen. (otherwise it would now put down that cpu even though it is still working, which isn't what we want)


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

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

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

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

etc...

The default values are:
NwNs_Threshold: 12, 0, 25, 20, 32, 28, 0, 35
TwTs_Threshold: 140, 0, 140, 190, 140, 190, 0, 190
Where the position and function of the number equals the result of the above explained formula.

(all times are in ms)
If you want to see the mpdecision magic happening:

adb shell
cat /proc/kmsg | grep 'MPDEC'


How does sweep2wake work? Does it keep my phone awake?


Short answer: No.
Long answer:
Sweep2wake works with IRQs (Interrupts).
In technical terms: An Interrupt interrupts the normal operation of a program and executes "special" code instead.

So if you touch your screen, an interrupt is send on which the touch driver reacts. That's it.
Since we have a capacitive touchscreen you also do not need to worry about any pressure onto the screen.

If you want to disable sweep2wake execute this command on your phone (adb shell or directly), you can also add it to an init.d script.

echo "0" > /sys/android_touch/sweep2wake


Why do I have no WLAN?

Due to this kernels very high optimization settings it is too big for our boot.img with WLAN included into the kernel, so it is built as a module. That means it needs to be inserted into the kernel upon boot up, which needs to be automated for maximum comfort = userinit (init.d) support.

The zip adds init.d support to your ramdisk, if that fails for some reason the wlan module cannot be inserted.

if
adb shell lsmod
doesn't show this:
tun 14701 0 - Live 0x00000000
cifs 275399 0 - Live 0x00000000
wlan 2964650 0 - Live 0x00000000 (C)
Then init.d support is probably missing.
You can test it by going to /system/etc/init.d/ and executing 00wlan.
adb shell
su
. /system/etc/init.d/00wlan

Wait a few seconds and try to enable wifi and repeat the above lsmod command (should now show wlan, you can execute 01cifs and 02tun too).
If WLAN now works, init.d support is missing.

You need to have busybox installed in order to be able to get init.d support going, this shouldn't be a problem for most people, since it is usually installed when rooting your phone anyway.
It does not matter if busybox is installed in /system/bin or /system/xbin, my script will detect the location upon flashing and patch the ramdisk accordingly.
If no busybox is found, the script will add init.d support to your ramdisk with the default location: /system/xbin/busybox. All you need to do is install busybox there and reboot your phone.

Edited by JassyCliq, 01 May 2013 - 08:23 PM.

  • 1 Likes

Snuggl3s

Snuggl3s

Average Android

Posted 02 May 2013 - 12:08 AM #2

First! Lol anyway great kernel! Been running great on my N4 so i decided to flash on my Galaxy Nexus but things aren't working to well now. It just gets stuck at the Google screen. Any ideas?
  • 0 Likes

USSENTERNCC1701E

USSENTERNCC1701E

Average Android

Posted 02 May 2013 - 01:10 AM #3

First! Lol anyway great kernel! Been running great on my N4 so i decided to flash on my Galaxy Nexus but things aren't working to well now. It just gets stuck at the Google screen. Any ideas?


I hope I've misunderstood you... are you saying you flashed an N4 kernel on a Galaxy Nexus?
  • 1 Likes

JASKRU

JASKRU

reenigne esrever

Posted 02 May 2013 - 07:47 AM #4

Will test it out when my otg cable shows up today or tomorrow. Thanks for putting this together.
  • 0 Likes

OP JassyCliq

JassyCliq

Android Apprentice

  • 33 posts

Posted 02 May 2013 - 08:03 AM #5

Will test it out when my otg cable shows up today or tomorrow. Thanks for putting this together.


Remember it requires a Y cable. AFAIK the N4 will never be able to support the power since its lacking the HW

Sent from my Nexus 4 using Tapatalk 2
  • 1 Likes

OP JassyCliq

JassyCliq

Android Apprentice

  • 33 posts

Posted 02 May 2013 - 12:45 PM #6

First! Lol anyway great kernel! Been running great on my N4 so i decided to flash on my Galaxy Nexus but things aren't working to well now. It just gets stuck at the Google screen. Any ideas?


Flash dalvik and battery stats 20 times then come back
  • 1 Likes

JASKRU

JASKRU

reenigne esrever

Posted 02 May 2013 - 02:03 PM #7

Will there be an otg toggle somewhere when I go to connect my devices?
  • 0 Likes

OP JassyCliq

JassyCliq

Android Apprentice

  • 33 posts

Posted 02 May 2013 - 04:06 PM #8

Will there be an otg toggle somewhere when I go to connect my devices?


Considering I neither have an OTG cable nor the knowledge of the hack I will have to direct you to the thread on xda. Its in the original android dev section. I only implemented it because people have been wanting it lately. So besides the code cherry-picked, I have no idea if it works or not. Would be awesome if someone would tell me though :unsure:

Sent from my Nexus 4 using Tapatalk 2
  • 0 Likes

JASKRU

JASKRU

reenigne esrever

Posted 02 May 2013 - 09:03 PM #9

Considering I neither have an OTG cable nor the knowledge of the hack I will have to direct you to the thread on xda. Its in the original android dev section. I only implemented it because people have been wanting it lately. So besides the code cherry-picked, I have no idea if it works or not. Would be awesome if someone would tell me though :unsure:

Sent from my Nexus 4 using Tapatalk 2


I can use peripherals, a mouse feels so strange on Android... Did not try a usb memory card. I did try to connect to my dslr but it was very sporadic and did a bunch of connects and disconnects. Tried a couple of different dslr apps but was unsuccessful. I am using a Sony NEX7 though so there could be an issue with that. Most of the camera apps support Nikon and Cannon, but I did try one that supported Sony as well with no success.

Also, display does not keep the sleep setting.

I also tried the ziddey-otg zip from xda and that was the same result.
  • 0 Likes

bgill55

bgill55

I am The reason you are theming

Posted 03 May 2013 - 07:31 AM #10

How do we utilize the sound/speaker control?

Sent from my Nexus 4 using Tapatalk 2
  • 0 Likes