[KERNEL] Semaphore N4 3.4.2

Search This thread

stratosk

Recognized Developer
Mar 3, 2011
6,224
31,853
Thessaloniki
www.semaphore.gr
semaphore_logo.png



This is a kernel based on stock one, tested on stock KK 4.4.3, JB 4.2.2, CM10.1, JB 4.3, Lollipop 5.0


Versions >= 3.0.0b are for Lollipop 5.1.x
Versions >= 2.2.0 are for KK 4.4.3
Versions >= 1.8.5 are for KK 4.4.1 / 4.4.2 only
Versions >= 1.8.0 are for KK 4.4 only
Versions >= 1.5.0 are for JB 4.3 only


More features will be added soon. Please don't ask for ETA.


Features
- Linux kernel 3.4.112
- built with Linaro gcc 4.8.2 201306
- enabled O2 optimizations
- ondemand (Changed calculation of frequency, tweaked)
- conservative
- mpdecision dropped
- dyn_hotplug driver
- Noop scheduler (default)
- SIO scheduler
- Touch wake
- Double Tap to Wake
- Gamma control
- LED triggers: touchwake, thermal
- Undervolting
- removed many debug options

For more information check the semaphore kernel website: www.semaphore.gr

Please use Semaphore Manager application to control every kernel's feature.

Thanks to
- Linux developers
- faux123 for ideas about gamma tables
- Ezekeel for touchwake
- my wife who always supports me
- a German friend who helped to buy N4

All people who support this kernel by testing, reporting issues, donating or simply using it.

Thanks italia0101 for his review.

Change log

3.4.2 (19/05/2016)
- Linux kernel 3.4.112

3.4.1 (24/03/2016)
- Linux kernel 3.4.111

3.4.0 (02/11/2015)
- Linux kernel 3.4.110

3.3.0 (23/09/2015)
- Linux kernel 3.4.109

3.2.6 (16/08/2015)
- Merge Android 5.1.1_r0.14 changes

3.2.5 (21/06/2015)
- Linux kernel 3.4.108

3.2.0 (21/05/2015)
- Merge Android 5.1.1 changes

3.1.5 (20/04/2015)
- Linux kernel 3.4.107
- Double tap to wake: add option to temporarily disable after power key pressed. Auto enabled again after device resumed. Enable this feature using the command:
echo 1 > /sys/devices/virtual/input/lge_touch/dt_wake_pwr_disable

3.1.0 (15/04/2015)
- Merge Android-5.1.0_r0.9 changes

3.0.5 (22/03/2015)
- cpufreq: new per cpu tunable util_threshold (default 25)
- Dynamic hotplug: Change algorithm. If CPUs have different util_threshold, the CPU with the greater one will be chosen
- ondemand: new tunable down_threshold. If load below this threshold lowest frequency will be user.

3.0.2 (18/02/2015)
- Linux kernel 3.4.106

3.0.1 (11/12/2014)
- Merge latest changes from Android source (5.0.1)

3.0.0
- Linux kernel 3.4.105
- Fix initramfs issues (mpdfake, initscripts) due to SELinux. Semaphore init script uses Chainfire's supolicy tool (included in latests SuperSU) to patch sepolicy

3.0.0b (18/11/2014)
- Lollipop release
- Merged latest lollipop branch
- Linux 3.4.104

2.4.0 (19/08/2014)
- Linux kernel 3.4.103
- ondemand: a small fix in check load condition (thanks to moddingg33k)
- tick-sched: Remove unnecessary statistics calculation required by mpdecision (thanks to moddingg33k)
- tick-sched: A couple of fixes from mainline

2.3.3 (19/07/2014)
- Linux kernel 3.4.99

2.3.0 (27/06/2014)
- Linux kernel 3.4.95
- ondemand: Change the calculation of next frequency to utilize lower frequencies more (the governor will be more sensitive to lower loads)
- ondemand: Change default touch load to 65 to keep the touch frequency to 1134MHz (because of the change in calculation)
Please note that you have to change the touch load to 65 in Semaphore Manager until the app update.

2.2.5 (15/06/2014)
- Linux kernel 3.4.93
- ondemand: Be friendly towards latency-sensitive bursty workloads (backport 2 patches that intended for 3.16)

About Double Tap to Wake.
Implemented from scratch and hints from show-p1984 and LG G pad kernels (thanks).

The basic idea is known: touchscreen remains _always_ powered to handle input events
and wake up the device with a double tap.
User have to double tap on the _center_ of the screen (to limit accidentally wake ups).
Double tap is disabled by default. To enable it run the command bellow as su:

echo 1 > /sys/devices/virtual/input/lge_touch/dt_wake_enabled

If you run the above command during screen off, the command will remain pending until
the next power on. Then it will be actually executed.

Touchwake functionality is still implemented and it should be disabled if double tap to wake
is enabled.


1.8.8 (22/12/2013)
- Linux kernel 3.4.75
- dyn_hotplug: Activate the driver 1min after boot (because during init scripts execution all CPUs should be online to get initial settings. Fixes issue where a CPU governor could be set with default performance governor. Thanks to ihancioglu for reporting and reproducing the issue).
- cpufreq: set initial utilization to zero on device CPU addition

Full changelog: http://www.semaphore.gr/changelog/n4-version


Sources
Semaphore kernel sources


Please use it at your own risk!


Zip files in download section are for flashing from CWM recovery.

'j' versions are for JSS15J ROMs only
The normal files are for JWR66V &JWR66Y ROMs only

Alternative download from http://www.semaphore.gr/downloads/nexus-4

XDA:DevDB Information
Semaphore, Kernel for the Google Nexus 4

Contributors
stratosk
Source Code: https://github.com/stratosk/kernel_msm

Kernel Special Features:

Version Information
Status: Stable
Current Stable Version: 3.4.2
Stable Release Date: 2016-05-19

Created 2013-07-30
Last Updated 2016-05-19
 

Attachments

  • Semaphore_N4_1.4.0.zip
    6.4 MB · Views: 884
  • Semaphore_N4_1.4.1.zip
    6.4 MB · Views: 878
  • Semaphore_N4_1.5.0.zip
    6.4 MB · Views: 674
  • Semaphore_N4_1.5.0j.zip
    6.4 MB · Views: 292
  • Semaphore_N4_1.5.1.zip
    6.8 MB · Views: 2,218
  • Semaphore_N4_1.5.1j.zip
    6.8 MB · Views: 4,918
Last edited:

stratosk

Recognized Developer
Mar 3, 2011
6,224
31,853
Thessaloniki
www.semaphore.gr
About undervolting

As you may know, APQ8064 comes to 4 versions (PVS bin): Slow, Nominal, Fast, Faster.
Every bin has it's own voltage table. Nominal bin chips use lower voltages than Slow bin,
Fast lower than Nominal and finally Faster even lower voltages.

Stock kernel uses a paramater boost_uV. By default, is added in voltages but it can be disabled.
The value of boost_uV is 0 for Slow bin chips and 25000 uV = 25 mV for Nominal, Fast and Faster.

The boost_uV may be disabled (= undervolting by 25000 uV in Nominal, Fast and Faster) using this command:

Code:
echo n > /sys/module/acpuclock_krait/parameters/boost


I implemented 3 more paramater that handle undervolting:
- lower_uV: undervolting value for lower frequencies
- higher_uV: undervolting value for higher frequencies
- higher_khz_thres: above this frequency (default 1350000KHz) higher_uV will be used. Else lower_uV will be used.

Undervolting value is subtracted from stock voltage. The final voltage for each frequency is calulated:
Vdd(final) = Vdd(core) + boost_uV - uV

So, to undervolt frequencies 384000-1242000 by 25mV and the other frequencies by 12.5mV use these command:

Code:
echo 25000 > /sys/module/acpuclock_krait/parameters/lower_uV
echo 12500 > /sys/module/acpuclock_krait/parameters/higher_uV

The higher_khz_thres maybe changed using this command (for example to use higher_uV from 981000KHz):

Code:
echo 918000 > /sys/module/acpuclock_krait/parameters/higher_khz_thres

Also, I added a debugfs file (acpuclk/acpu_table) to show the acpu table frequencies and voltages.
For example to get the information about the current status use this command:

Code:
cat /sys/kernel/debug/acpuclk/acpu_table

and the output:

Code:
CPU PVS: Fast
Boost uV: 25000
Boost uV enabled: No
Higher KHZ threshold: 1350000
Lower under uV: 37500
Higher under uV: 25000

CPU KHz  VDD(stock)  VDD(final)  Difference
 384000      875000      812500      -62500  
 486000      900000      837500      -62500  
 594000      925000      862500      -62500  
 702000      950000      887500      -62500  
 810000     1000000      937500      -62500  
 918000     1025000      962500      -62500  
1026000     1050000      987500      -62500  
1134000     1100000     1037500      -62500  
1242000     1125000     1062500      -62500  
1350000     1150000     1100000      -50000  
1458000     1162500     1112500      -50000  
1512000     1175000     1125000      -50000

Please note that undervolting may cause instabilities in your phone. Be careful!
 
Last edited:

Bluewall

Senior Member
Apr 7, 2010
2,191
863
Sion
fr.miui.ch
Hey welcome here man! I've heard a lot of good things about Semaphore :)

Little quick question, do you use Mpdecision or do you have your custom hot-plug?

Thanks and glad to see you!

Envoyé depuis mon Nexus 4 avec Tapatalk
 
  • Like
Reactions: kurtfhouse

alcaprone

Senior Member
Jan 3, 2012
267
14
Great to see you here stratosk! I'll try your kernel asap ;)

Sent from my Nexus 4 using xda app-developers app
 

stratosk

Recognized Developer
Mar 3, 2011
6,224
31,853
Thessaloniki
www.semaphore.gr
Hey welcome here man! I've heard a lot of good things about Semaphore :)

Little quick question, do you use Mpdecision or do you have your custom hot-plug?

Thanks and glad to see you!

Envoyé depuis mon Nexus 4 avec Tapatalk

Thanks!
At the moment stock options. Just rebased to Linux 3.4.40 and enabled O2
 

H-Body

Senior Member
Jan 19, 2012
324
133
Great to see you in this section! My old SGS is still running your kernel. Hopefully this kernel will become as succesfull as your old one ;).
 

Higadeb

Senior Member
Sep 10, 2010
500
143
Woo, Stratosk! Nice to see you here :) I used Semaphore on my old SGS1 for what must have been 12-18months straight (well still do technically when I use it for music).
I'm straight on this when my finals are over.
 

matesc

Senior Member
May 19, 2012
637
320
Vienna
This is like Xmas! Welcome Stratos. I am sure, I am not the only one who is really glad to see you here. Enjoy your new phone! :D
 

Maddmatt

Senior Member
Aug 10, 2010
407
58
Nice, welcome! I just upgraded from an i9000 where I used your kernel. Will be interesting to see what develops here :)
 

TheeWolf

Senior Member
Oct 8, 2011
900
193
Ladies and gentlemen, this guy is a legend in the I9000 forums. Glad to finally see you here stratosk :)
 

chucky91

Senior Member
Oct 25, 2010
54
2
Grigny
Ho Kernel Semaphore, I had this kernel in my old SGS... I think I will install this kernel in my N4 :D

Envoyé depuis mon Nexus 4 avec xda app-developers app
 

Top Liked Posts

  • There are no posts matching your filters.
  • 635
    semaphore_logo.png



    This is a kernel based on stock one, tested on stock KK 4.4.3, JB 4.2.2, CM10.1, JB 4.3, Lollipop 5.0


    Versions >= 3.0.0b are for Lollipop 5.1.x
    Versions >= 2.2.0 are for KK 4.4.3
    Versions >= 1.8.5 are for KK 4.4.1 / 4.4.2 only
    Versions >= 1.8.0 are for KK 4.4 only
    Versions >= 1.5.0 are for JB 4.3 only


    More features will be added soon. Please don't ask for ETA.


    Features
    - Linux kernel 3.4.112
    - built with Linaro gcc 4.8.2 201306
    - enabled O2 optimizations
    - ondemand (Changed calculation of frequency, tweaked)
    - conservative
    - mpdecision dropped
    - dyn_hotplug driver
    - Noop scheduler (default)
    - SIO scheduler
    - Touch wake
    - Double Tap to Wake
    - Gamma control
    - LED triggers: touchwake, thermal
    - Undervolting
    - removed many debug options

    For more information check the semaphore kernel website: www.semaphore.gr

    Please use Semaphore Manager application to control every kernel's feature.

    Thanks to
    - Linux developers
    - faux123 for ideas about gamma tables
    - Ezekeel for touchwake
    - my wife who always supports me
    - a German friend who helped to buy N4

    All people who support this kernel by testing, reporting issues, donating or simply using it.

    Thanks italia0101 for his review.

    Change log

    3.4.2 (19/05/2016)
    - Linux kernel 3.4.112

    3.4.1 (24/03/2016)
    - Linux kernel 3.4.111

    3.4.0 (02/11/2015)
    - Linux kernel 3.4.110

    3.3.0 (23/09/2015)
    - Linux kernel 3.4.109

    3.2.6 (16/08/2015)
    - Merge Android 5.1.1_r0.14 changes

    3.2.5 (21/06/2015)
    - Linux kernel 3.4.108

    3.2.0 (21/05/2015)
    - Merge Android 5.1.1 changes

    3.1.5 (20/04/2015)
    - Linux kernel 3.4.107
    - Double tap to wake: add option to temporarily disable after power key pressed. Auto enabled again after device resumed. Enable this feature using the command:
    echo 1 > /sys/devices/virtual/input/lge_touch/dt_wake_pwr_disable

    3.1.0 (15/04/2015)
    - Merge Android-5.1.0_r0.9 changes

    3.0.5 (22/03/2015)
    - cpufreq: new per cpu tunable util_threshold (default 25)
    - Dynamic hotplug: Change algorithm. If CPUs have different util_threshold, the CPU with the greater one will be chosen
    - ondemand: new tunable down_threshold. If load below this threshold lowest frequency will be user.

    3.0.2 (18/02/2015)
    - Linux kernel 3.4.106

    3.0.1 (11/12/2014)
    - Merge latest changes from Android source (5.0.1)

    3.0.0
    - Linux kernel 3.4.105
    - Fix initramfs issues (mpdfake, initscripts) due to SELinux. Semaphore init script uses Chainfire's supolicy tool (included in latests SuperSU) to patch sepolicy

    3.0.0b (18/11/2014)
    - Lollipop release
    - Merged latest lollipop branch
    - Linux 3.4.104

    2.4.0 (19/08/2014)
    - Linux kernel 3.4.103
    - ondemand: a small fix in check load condition (thanks to moddingg33k)
    - tick-sched: Remove unnecessary statistics calculation required by mpdecision (thanks to moddingg33k)
    - tick-sched: A couple of fixes from mainline

    2.3.3 (19/07/2014)
    - Linux kernel 3.4.99

    2.3.0 (27/06/2014)
    - Linux kernel 3.4.95
    - ondemand: Change the calculation of next frequency to utilize lower frequencies more (the governor will be more sensitive to lower loads)
    - ondemand: Change default touch load to 65 to keep the touch frequency to 1134MHz (because of the change in calculation)
    Please note that you have to change the touch load to 65 in Semaphore Manager until the app update.

    2.2.5 (15/06/2014)
    - Linux kernel 3.4.93
    - ondemand: Be friendly towards latency-sensitive bursty workloads (backport 2 patches that intended for 3.16)

    About Double Tap to Wake.
    Implemented from scratch and hints from show-p1984 and LG G pad kernels (thanks).

    The basic idea is known: touchscreen remains _always_ powered to handle input events
    and wake up the device with a double tap.
    User have to double tap on the _center_ of the screen (to limit accidentally wake ups).
    Double tap is disabled by default. To enable it run the command bellow as su:

    echo 1 > /sys/devices/virtual/input/lge_touch/dt_wake_enabled

    If you run the above command during screen off, the command will remain pending until
    the next power on. Then it will be actually executed.

    Touchwake functionality is still implemented and it should be disabled if double tap to wake
    is enabled.


    1.8.8 (22/12/2013)
    - Linux kernel 3.4.75
    - dyn_hotplug: Activate the driver 1min after boot (because during init scripts execution all CPUs should be online to get initial settings. Fixes issue where a CPU governor could be set with default performance governor. Thanks to ihancioglu for reporting and reproducing the issue).
    - cpufreq: set initial utilization to zero on device CPU addition

    Full changelog: http://www.semaphore.gr/changelog/n4-version


    Sources
    Semaphore kernel sources


    Please use it at your own risk!


    Zip files in download section are for flashing from CWM recovery.

    'j' versions are for JSS15J ROMs only
    The normal files are for JWR66V &JWR66Y ROMs only

    Alternative download from http://www.semaphore.gr/downloads/nexus-4

    XDA:DevDB Information
    Semaphore, Kernel for the Google Nexus 4

    Contributors
    stratosk
    Source Code: https://github.com/stratosk/kernel_msm

    Kernel Special Features:

    Version Information
    Status: Stable
    Current Stable Version: 3.4.2
    Stable Release Date: 2016-05-19

    Created 2013-07-30
    Last Updated 2016-05-19
    189
    About undervolting

    As you may know, APQ8064 comes to 4 versions (PVS bin): Slow, Nominal, Fast, Faster.
    Every bin has it's own voltage table. Nominal bin chips use lower voltages than Slow bin,
    Fast lower than Nominal and finally Faster even lower voltages.

    Stock kernel uses a paramater boost_uV. By default, is added in voltages but it can be disabled.
    The value of boost_uV is 0 for Slow bin chips and 25000 uV = 25 mV for Nominal, Fast and Faster.

    The boost_uV may be disabled (= undervolting by 25000 uV in Nominal, Fast and Faster) using this command:

    Code:
    echo n > /sys/module/acpuclock_krait/parameters/boost


    I implemented 3 more paramater that handle undervolting:
    - lower_uV: undervolting value for lower frequencies
    - higher_uV: undervolting value for higher frequencies
    - higher_khz_thres: above this frequency (default 1350000KHz) higher_uV will be used. Else lower_uV will be used.

    Undervolting value is subtracted from stock voltage. The final voltage for each frequency is calulated:
    Vdd(final) = Vdd(core) + boost_uV - uV

    So, to undervolt frequencies 384000-1242000 by 25mV and the other frequencies by 12.5mV use these command:

    Code:
    echo 25000 > /sys/module/acpuclock_krait/parameters/lower_uV
    echo 12500 > /sys/module/acpuclock_krait/parameters/higher_uV

    The higher_khz_thres maybe changed using this command (for example to use higher_uV from 981000KHz):

    Code:
    echo 918000 > /sys/module/acpuclock_krait/parameters/higher_khz_thres

    Also, I added a debugfs file (acpuclk/acpu_table) to show the acpu table frequencies and voltages.
    For example to get the information about the current status use this command:

    Code:
    cat /sys/kernel/debug/acpuclk/acpu_table

    and the output:

    Code:
    CPU PVS: Fast
    Boost uV: 25000
    Boost uV enabled: No
    Higher KHZ threshold: 1350000
    Lower under uV: 37500
    Higher under uV: 25000
    
    CPU KHz  VDD(stock)  VDD(final)  Difference
     384000      875000      812500      -62500  
     486000      900000      837500      -62500  
     594000      925000      862500      -62500  
     702000      950000      887500      -62500  
     810000     1000000      937500      -62500  
     918000     1025000      962500      -62500  
    1026000     1050000      987500      -62500  
    1134000     1100000     1037500      -62500  
    1242000     1125000     1062500      -62500  
    1350000     1150000     1100000      -50000  
    1458000     1162500     1112500      -50000  
    1512000     1175000     1125000      -50000

    Please note that undervolting may cause instabilities in your phone. Be careful!
    126
    reserved for future use
    84
    New version 1.8.8
    - Linux kernel 3.4.75
    - dyn_hotplug: Activate the driver 1min after boot (because during init scripts execution all CPUs should be online to get initial settings. Fixes issue where a CPU governor could be set with default performance governor. Thanks to ihancioglu for reporting and reproducing the issue).
    - cpufreq: set initial utilization to zero on device CPU addition
    79
    New version 2.1.1
    - Linux kernel 3.4.87