[Kernel] [4.3.1][CM 10.2] crpalmer's kernel for the official nightlies

Search This thread

crpalmer

Inactive Recognized Developer
Mar 25, 2011
2,999
8,280
This kernel extends the CM kernel with some new features:

New init.d scripts to allow some tweaking without needing any 3rd party apps
* See the next post for details.

Replaced HTC's mpdecision with a new custom hot-plug driver that I created:

* This hot-plug driver is more aggressive about bring cores on and off-line to match the load on the system.
* Bringing cores online earlier makes your phone more responsive / smooth.
* Taking cores offline earlier improves battery life.
* It ramps up very quickly on resume to avoid lag.

Replaced HTC's lightsensor table with one that is more sensible and that matches what other devices use. If you have custom auto-brightness settings, you'll probably need to tweak them after installing this kernel.

There are many additional changes to boost performance and battery life:

* Linaro -O3 compiled (Linaro 4.8).
* Overclocking
* I disable tons of HTC debugging crap left enabled and needlessly consuming battery.
* Improvements to the core locking code of the kernel.
* Patches that transform traditional locks into RCU backed data structures.
* CAF version of the ondemand
* CAF changes to power management to sleep faster and waste less CPU during suspend.
* Improved code for moving data to/from user-space and manipulating strings within the kernel.

Other features:

* Voltage control (faux123) to allow user-space under-volting.
* BFQ I/O scheduler.

Links

A link to each version is included in the changelog entry. Scroll down to the changelog to download the latest version.

Source (GitHub):
* Kernel source
* Build tools

Installation Instructions:

If you are S-OFF you can flash the update.zip in recovery.

If you are S-ON, then after you flash the update.zip in recovery then, while still in recovery, you must run

Code:
adb pull /tmp/boot.img
<reboot into bootloader>
fastboot flash boot boot.img

Changelog:

The following kernels likely do not work with CM builds from before October 2, 2013:

Version 4.9.0: November 6, 2013:Linux 3.4.67, Optimizations, Underclocking, Scheduler
* Linux 3.4.67
* Various optimizations from franciscofranco's N5 kernel
* Underclocking based on faux123's N4 kernel
* Scheduler overhaul from faux123's N4 kernel

Version 4.7.4: October 21, 2013:Linux 3.4.66, Westwood+, Upstream
* Linux 3.4.66
* Switch to Westwood+ for TCP congestion control (theoretically better for wireless networks).
* Merge upstream changes to the kernel

Version 4.4.15: October 4, 2013:revert audio change
* Revert: slight changes to audio from CAF (they broke alarms!)

Version 4.4.14: October 2, 2013: merge upstream, audio, scheduling, ondemandCRP, SIP
* Slight changes to audio from CAF
* HRTICK enabled to improve scheduling responsiveness (merged)
* Fix for cisco phones (merged)
* Fix buffer overflow in printk
* Added ondemandCRP governor
* Merged all upstream changes.
** New ondemand governor, updated interactive governor
** More responsive CPU scaling
** Video updates
** Multi-touch fix
** Fix video underruns (blue flicker)

The following kernels do not work with CM builds from after October 2, 2013:

Version 4.3.3: September 20, 2013: merge upstream, camera fix
* Merged all upstream changes.
* Fix focus and possibly other camera oddities

Version 4.2.3: September 15, 2013: Fix init.d script
* Actually disable mpdecision! (thanks orangechoochoo)

Version 4.2.2: September 14, 2013: Sony panel, OTG
* Re-introduce Sony panel (merged)
* Fix USB OTG host mode (merged)
* Use invisiblek's improved splash screen fix and remove my hack

Version 4.1.1: September 10, 2013: GPU / Display / Clocks / Flicker?
* Synch the GPU code with the M7 / upstream
* Make the display code more inline with the M7 / upstream, use the proper late_init ./ early _off interface
* Add missing clocks
* These changes (most notably the clocks change) may have improved the screen flickering (only time will tell).

Version 4.0.12: September 9, 2013: First release
 
Last edited:

crpalmer

Inactive Recognized Developer
Mar 25, 2011
2,999
8,280
init.d tweaks

I created some scripts that run on boot (init.d) because I install my kernel so many times that I would go insane if I had to use an installer to configure it each time. By using these scripts and configuration files on the sdcard, I can just configure it once and keep installing away to my heart's content.

After installing this kernel, there will be:

/system/etc/init.d/99crpalmer

run at boot, even if you switch to another kernel. It is safe to leave this file there and to let it run as it only makes changes if the kernel contains "crpalmer" in the version. If run with a kernel that contains crpalmer in the version, it will rename mpdecision so it can't run. If you install another kernel it will then rename mpdecision back so that it will run in the new kernel. In addition to stopping the built-in mpdecision it will allow the following tweaks:

CPU Frequencies
* Frequencies loaded from /sdcard/crpalmer-cpufreq-min and /sdcard/crpalmer-cpufreq-max
* Governor loaded from /sdcard/crpalmer-cpufreq-governor
* If you specify either or both of these frequencies, it will lock down all of the CPU frequency controls. I had to do this because HTC overrides them in a script that is run very late in the boot process (thanks HTC!).
* E.g. adb shell su -c "echo 192000 > /sdcard/crpalmer-cpufreq-min"
* E.g. adb shell su -c "echo 1728000 > /sdcard/crpalmer-cpufreq-max"
* E.g. adb shell su -c "echo interactive > /sdcard/crpalmer-cpufreq-governor"

Undervolting
* + or - value loaded from /sdcard/crplamer-uv
* The undervolting in 2.0.23 for FAST binned CPUs would be specified as:
* E.g. adb shell su -c "echo -100 > /sdcard/crpalmer-uv"

Lightsensor
* My light sensor changes didn't sound like they worked well for everyone. If you don't like them you can disable them by:
* E.g. adb shell touch /sdcard/crpalmer-stock-lightsensor

HTC Colour "Enhancement"
* If this file is present then the HTC's colour "enhancement" will be used, otherwise it will be disabled.
* If this file contains the string "m7" then it will use one of the colour enhancement that was used in the M7 kernel for a panel most like ours.
** E.g. adb shell touch /sdcard/crpalmer-color-enhancement

My WIFI Won't Turn On

If your WIFI won't turn on then the most likely cause is that either you didn't flash the boot.img (e.g. not S-OFF) or your modules don't match the kernel. To figure out what's wrong, first boot the ROM after having installed my kernel. Second, verify that you are running my kernel by running

adb shell cat /proc/version

and seeing that it says crpalmer in (it should match the version that you think you installed, but at least saying crpalmer is a good start). Then do:

adb shell dmesg -c
(turn on wifi)
adb shell dmesg

and look for an error that says crpalmer in it (something like a module version mismatch error). If you see that, it should tell you the version number of the modules that are installed and the version of the kernel.
 
Last edited:

crpalmer

Inactive Recognized Developer
Mar 25, 2011
2,999
8,280
Note for those of you used to an existing kernel of mine.

This kernel involves reporting all of my changes to a new base. As such, it is likely to have some issues at the moment. Please let me know if something isn't working right.

This kernel is based on Linux 3.4.10 and not the latest 3.4 Linux kernel. I may change that in the future, but for the time being it makes it easier to try to move code to and from the CM repos to leave it at 3.4.10 and therefore I won't be changing that for now.

This kernel does not contain my thermal driver. I haven't spend the time to port it to this kernel yet and the stock seems to be working a lot better than the DNA one. Therefore, I may never bother porting it.

This kernel does not contain force fast-charge. I may add it again the future.
 

d08speed3

Senior Member
Jul 23, 2010
2,723
522
This cant work on the latest unofficial CM correct?

Sent from my HTC6435LVW using xda app-developers app
 

Arte Suave

Senior Member
Sep 19, 2010
145
15
Just flashed this. I'm new to your kernel init.d settings. How do I make them run exactly?

Sent from my HTC6435LVW using XDA Premium 4 mobile app
 

d08speed3

Senior Member
Jul 23, 2010
2,723
522
Kernel is running great! Can you pleassssssse add fast charge :)

Sent from my HTC6435LVW using xda app-developers app

---------- Post added at 07:18 AM ---------- Previous post was at 06:40 AM ----------

Kernel is running great! Can you pleassssssse add fast charge :)

Sent from my HTC6435LVW using xda app-developers app

Scrolling does feel choppy

Sent from my HTC6435LVW using xda app-developers app
 

JoshDB

Senior Member
Feb 11, 2011
68
4
Spokane
Not sure how relevant this is to folks, but my phone's running PPSSPP games, most noticeably Dissidia 012, much better with this kernel and CM10.2 than it was with the 4.3 roms from about a week ago.
 

crpalmer

Inactive Recognized Developer
Mar 25, 2011
2,999
8,280
I just posted a new release. I have been completely flicker free today running this kernel. It could be a fluke, but at the moment I am (once again) optimistic that we might have a solution.

If you have bad flickering on CM ROMs, can you let me know how this version works for you?

Version 4.1.1: September 10, 2013: GPU / Display / Clocks / Flicker?
* Synch the GPU code with the M7 / upstream
* Make the display code more inline with the M7 / upstream, use the proper late_init ./ early _off interface
* Add missing clocks
* These changes (most notably the clocks change) may have improved the screen flickering (only time will tell).
 

d08speed3

Senior Member
Jul 23, 2010
2,723
522
I see you added smartmax governor. I've never used it have you? Just wondering.

Sent from my HTC6435LVW using xda app-developers app
 

schott12521

Member
Nov 14, 2012
24
5
Maryland
This kernel is amazing so far; it fixed the wonky boot image thingy, and most of my flickering is gone as well, and mine was pretty bad occasionally. Lets see if it holds tomorrow. Only other thought is maybe USB OTG, but thanks CrPalmer.
 

erikmentze

Member
Jan 5, 2010
6
3
Rock solid on my device, but I've never had very bad flickering (knock on wood). Thanks for the great work!
 

mike_augie

Senior Member
Apr 25, 2012
605
131
Been running cyan since day of release and both Ur kernels for 4.3 l since u put them out a few days ago ... Had slight flickering nothing hard core like some had reported could see it more in bright light but seems to have almost totally took care of mine ...

Sent from my HTC6435LVW using xda app-developers app
 

Top Liked Posts

  • There are no posts matching your filters.
  • 33
    This kernel extends the CM kernel with some new features:

    New init.d scripts to allow some tweaking without needing any 3rd party apps
    * See the next post for details.

    Replaced HTC's mpdecision with a new custom hot-plug driver that I created:

    * This hot-plug driver is more aggressive about bring cores on and off-line to match the load on the system.
    * Bringing cores online earlier makes your phone more responsive / smooth.
    * Taking cores offline earlier improves battery life.
    * It ramps up very quickly on resume to avoid lag.

    Replaced HTC's lightsensor table with one that is more sensible and that matches what other devices use. If you have custom auto-brightness settings, you'll probably need to tweak them after installing this kernel.

    There are many additional changes to boost performance and battery life:

    * Linaro -O3 compiled (Linaro 4.8).
    * Overclocking
    * I disable tons of HTC debugging crap left enabled and needlessly consuming battery.
    * Improvements to the core locking code of the kernel.
    * Patches that transform traditional locks into RCU backed data structures.
    * CAF version of the ondemand
    * CAF changes to power management to sleep faster and waste less CPU during suspend.
    * Improved code for moving data to/from user-space and manipulating strings within the kernel.

    Other features:

    * Voltage control (faux123) to allow user-space under-volting.
    * BFQ I/O scheduler.

    Links

    A link to each version is included in the changelog entry. Scroll down to the changelog to download the latest version.

    Source (GitHub):
    * Kernel source
    * Build tools

    Installation Instructions:

    If you are S-OFF you can flash the update.zip in recovery.

    If you are S-ON, then after you flash the update.zip in recovery then, while still in recovery, you must run

    Code:
    adb pull /tmp/boot.img
    <reboot into bootloader>
    fastboot flash boot boot.img

    Changelog:

    The following kernels likely do not work with CM builds from before October 2, 2013:

    Version 4.9.0: November 6, 2013:Linux 3.4.67, Optimizations, Underclocking, Scheduler
    * Linux 3.4.67
    * Various optimizations from franciscofranco's N5 kernel
    * Underclocking based on faux123's N4 kernel
    * Scheduler overhaul from faux123's N4 kernel

    Version 4.7.4: October 21, 2013:Linux 3.4.66, Westwood+, Upstream
    * Linux 3.4.66
    * Switch to Westwood+ for TCP congestion control (theoretically better for wireless networks).
    * Merge upstream changes to the kernel

    Version 4.4.15: October 4, 2013:revert audio change
    * Revert: slight changes to audio from CAF (they broke alarms!)

    Version 4.4.14: October 2, 2013: merge upstream, audio, scheduling, ondemandCRP, SIP
    * Slight changes to audio from CAF
    * HRTICK enabled to improve scheduling responsiveness (merged)
    * Fix for cisco phones (merged)
    * Fix buffer overflow in printk
    * Added ondemandCRP governor
    * Merged all upstream changes.
    ** New ondemand governor, updated interactive governor
    ** More responsive CPU scaling
    ** Video updates
    ** Multi-touch fix
    ** Fix video underruns (blue flicker)

    The following kernels do not work with CM builds from after October 2, 2013:

    Version 4.3.3: September 20, 2013: merge upstream, camera fix
    * Merged all upstream changes.
    * Fix focus and possibly other camera oddities

    Version 4.2.3: September 15, 2013: Fix init.d script
    * Actually disable mpdecision! (thanks orangechoochoo)

    Version 4.2.2: September 14, 2013: Sony panel, OTG
    * Re-introduce Sony panel (merged)
    * Fix USB OTG host mode (merged)
    * Use invisiblek's improved splash screen fix and remove my hack

    Version 4.1.1: September 10, 2013: GPU / Display / Clocks / Flicker?
    * Synch the GPU code with the M7 / upstream
    * Make the display code more inline with the M7 / upstream, use the proper late_init ./ early _off interface
    * Add missing clocks
    * These changes (most notably the clocks change) may have improved the screen flickering (only time will tell).

    Version 4.0.12: September 9, 2013: First release
    15
    New version:

    Version 4.9.0: November 6, 2013:Linux 3.4.67, Optimizations, Underclocking, Scheduler
    * Linux 3.4.67
    * Various optimizations from franciscofranco's N5 kernel
    * Underclocking based on faux123's N4 kernel
    * Scheduler overhaul from faux123's N4 kernel

    Based on some limited testing, I believe that the scheduler changes help the bluetooth audio playback (a2dp) when the screen is off.

    This is likely the last 10.2 kernel that I will be releasing as I plan to move to CM 11 as soon as it is stable enough to use.
    14
    New version. Please let me know if you have any camera problems with this release (and provide specific steps to reproduce / understand what you are seeing because I don't know of any remaining issues, but I'm a very pedestrian user of the camera's functionality):

    Version 4.3.3: September 20, 2013: merge upstream, camera fix
    * Merged all upstream changes.
    * Fix focus and possibly other camera oddities
    10
    init.d tweaks

    I created some scripts that run on boot (init.d) because I install my kernel so many times that I would go insane if I had to use an installer to configure it each time. By using these scripts and configuration files on the sdcard, I can just configure it once and keep installing away to my heart's content.

    After installing this kernel, there will be:

    /system/etc/init.d/99crpalmer

    run at boot, even if you switch to another kernel. It is safe to leave this file there and to let it run as it only makes changes if the kernel contains "crpalmer" in the version. If run with a kernel that contains crpalmer in the version, it will rename mpdecision so it can't run. If you install another kernel it will then rename mpdecision back so that it will run in the new kernel. In addition to stopping the built-in mpdecision it will allow the following tweaks:

    CPU Frequencies
    * Frequencies loaded from /sdcard/crpalmer-cpufreq-min and /sdcard/crpalmer-cpufreq-max
    * Governor loaded from /sdcard/crpalmer-cpufreq-governor
    * If you specify either or both of these frequencies, it will lock down all of the CPU frequency controls. I had to do this because HTC overrides them in a script that is run very late in the boot process (thanks HTC!).
    * E.g. adb shell su -c "echo 192000 > /sdcard/crpalmer-cpufreq-min"
    * E.g. adb shell su -c "echo 1728000 > /sdcard/crpalmer-cpufreq-max"
    * E.g. adb shell su -c "echo interactive > /sdcard/crpalmer-cpufreq-governor"

    Undervolting
    * + or - value loaded from /sdcard/crplamer-uv
    * The undervolting in 2.0.23 for FAST binned CPUs would be specified as:
    * E.g. adb shell su -c "echo -100 > /sdcard/crpalmer-uv"

    Lightsensor
    * My light sensor changes didn't sound like they worked well for everyone. If you don't like them you can disable them by:
    * E.g. adb shell touch /sdcard/crpalmer-stock-lightsensor

    HTC Colour "Enhancement"
    * If this file is present then the HTC's colour "enhancement" will be used, otherwise it will be disabled.
    * If this file contains the string "m7" then it will use one of the colour enhancement that was used in the M7 kernel for a panel most like ours.
    ** E.g. adb shell touch /sdcard/crpalmer-color-enhancement

    My WIFI Won't Turn On

    If your WIFI won't turn on then the most likely cause is that either you didn't flash the boot.img (e.g. not S-OFF) or your modules don't match the kernel. To figure out what's wrong, first boot the ROM after having installed my kernel. Second, verify that you are running my kernel by running

    adb shell cat /proc/version

    and seeing that it says crpalmer in (it should match the version that you think you installed, but at least saying crpalmer is a good start). Then do:

    adb shell dmesg -c
    (turn on wifi)
    adb shell dmesg

    and look for an error that says crpalmer in it (something like a module version mismatch error). If you see that, it should tell you the version number of the modules that are installed and the version of the kernel.
    8
    I just posted a new release. I have been completely flicker free today running this kernel. It could be a fluke, but at the moment I am (once again) optimistic that we might have a solution.

    If you have bad flickering on CM ROMs, can you let me know how this version works for you?

    Version 4.1.1: September 10, 2013: GPU / Display / Clocks / Flicker?
    * Synch the GPU code with the M7 / upstream
    * Make the display code more inline with the M7 / upstream, use the proper late_init ./ early _off interface
    * Add missing clocks
    * These changes (most notably the clocks change) may have improved the screen flickering (only time will tell).