FORUMS
Remove All Ads from XDA

[APP][5.0+] Spectrum - A kernel manager for users [ROOT]

1,212 posts
Thanks Meter: 3,187
 
Post Reply Email Thread
Announcement from frap129: Advanced Users can now add Spectrum support to a kernel with Spectrum Injector! See the third post for details


Spectrum

Index:
This post: Overview, features, screenshots, and development.
2nd post: How to add Spectrum support to your kernel
3rd post: Spectrum Injector

What:
Spectrum is a simple, profile oriented kernel manager that allows developers to create profiles to serve to their users. This is useful for users who are inexperienced with kernel tweaking or users who want something that's a single click away.

How:
Choose from Balance, Performance, Battery, or Gaming profiles to quickly and easily change kernel settings to your preference, now even easier with the included QuickTiles.

Features:
  • Dark Material Design theme
  • 4 Profiles to choose from: Balance, Performance, Battery, and Gaming
  • Nougat Quicktile support
  • Launch QuickTile
  • Profile selector QuickTile
  • Customizable kernel name string
  • Easy to add, yet versatile kernel support
  • some eastereggs but shhh

History:
I initially intended Spectrum to be a companion app/updater for my kernel, Electron. However, I decided to make the app open and available for any developer to integrate into their kernel so that more users can have a simple kernel experience.

Download:
Spectrum on Google Play
Spectrum is also open source, you can find it on GitHub.

Thanks:
I'd like to give a special thanks to @The Flash for being an early adopter of Spectrum with Flash Kernel, and the tons of support and testing he gave while Spectrum was in development. I'd also like to thank @xanaxdroid for all the testing, critiquing, and support throughout development. Also, a huge thanks to @franciscofranco for the inspiration and giving code improvement tips. Couldn't have done it without you guys.

XDA:DevDB Information
Spectrum Kernel Manager, App for all devices (see above for details)

Contributors
frap129
Source Code: https://github.com/frap129/spectrum


Version Information
Status: Stable
Current Stable Version: 1.1
Stable Release Date: 2017-05-04

Created 2017-05-04
Last Updated 2017-07-15
The Following 108 Users Say Thank You to frap129 For This Useful Post: [ View ]
 
 
4th May 2017, 09:38 PM |#2  
frap129's Avatar
OP Recognized Developer
Thanks Meter: 3,187
 
Donate to Me
More
How to add Spectrum support to your kernel:
Original documentation: GitHub

You'll need to add these 2 files to your devices ramdisk:
  • init.spectrum.rc
  • init.spectrum.sh
These files can be found on Github https://github.com/frap129/spectrum/tree/master/ramdisk

Now we have to include these ramdisk files. To do this, add
Code:
import /init.spectrum.rc
to the top of your devices main ramdisk file, usually called init.DEVICENAME.rc.

Next let's add your kernel name to the app. Open init.spectrum.rc and change "Electron" in
Code:
setprop persist.spectrum.kernel Electron
to your kernel's name.

Now just customize the 4 profiles in init.spectrum.rc to your liking! Profile 0 (Balanced) is the default, however, this can be changed in init.spectrum.sh. Here's my init.spectrum.rc file as an example:
Code:
# SPECTRUM KERNEL MANAGER
# Ramdisk file for profile based kernel management
# Implimentation inspired by Franco's fku profiles

# Initialization
on property:sys.boot_completed=1
   # Set default profile on first boot
   exec u:r:init:s0 root root -- /init.profiles.sh
   exec u:r:su:s0 root root -- /init.profiles.sh
   # Enable Spectrum support
   setprop spectrum.support 1

# Balance (default profile)
on property:persist.spectrum.profile=0
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor relaxed
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 302400
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 1708000
    write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor chill
    write /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq 633600
    write /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq 1958400
    write /sys/module/cpu_boost/parameters/input_boost_enabled 1
    write /sys/module/cpu_boost/parameters/input_boost_freq "0:960000 1:960000 2:960000 3:960000 4:0 5:0 6:0 7:0"
    write /sys/module/cpu_boost/parameters/boost_ms 0
    write /sys/module/cpu_boost/parameters/input_boost_ms 40
    write /sys/module/cpu_boost/parameters/migration_load_threshold 15
    write /sys/module/cpu_boost/parameters/sync_threshold 0
    write /sys/module/msm_performance/parameters/touchboost 0
    write /sys/devices/system/cpu/cpu0/cpufreq/relaxed/boost_count 5
    write /sys/devices/system/cpu/cpu0/cpufreq/relaxed/boost_ceiling 10
    write /sys/devices/system/cpu/cpu4/cpufreq/chill/boost_count 10
    write /sys/devices/system/cpu/cpu0/cpufreq/relaxed/freq_step 6
    write /sys/devices/system/cpu/cpu4/cpufreq/chill/freq_step 4
    write /sys/devices/system/cpu/cpu0/cpufreq/relaxed/down_threshold 60
    write /sys/devices/system/cpu/cpu0/cpufreq/relaxed/down_threshold_suspended 85
    write /sys/devices/system/cpu/cpu4/cpufreq/chill/down_threshold 75
    write /sys/devices/system/cpu/cpu4/cpufreq/chill/down_threshold_suspended 99
    write /sys/devices/system/cpu/cpu0/cpufreq/relaxed/up_threshold 70
    write /sys/devices/system/cpu/cpu4/cpufreq/chill/up_threshold 90
    write /sys/class/leds/lcd-backlight/max_brightness 255
    write /sys/class/kgsl/kgsl-3d0/devfreq/governor msm-adreno-tz
    write /sys/module/adreno_idler/parameters/adreno_idler_active 1
    write /dev/cpuset/foreground/cpus 0-2,4-7
    write /dev/cpuset/foreground/boost/cpus 4-7
    write /dev/cpuset/top-app/cpus 0-7
    write /sys/module/lazyplug/parameters/nr_possible_cores 8

# Performance (based on DrunkSauce Lite)
on property:persist.spectrum.profile=1
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 302400
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load 75
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay 0
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate 40000
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq 960000
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_slack -1
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads 80 384000:33 460800:25 600000:50 672000:65 787200:70 864000:85 960000:90 1248000:92
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time 50000
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/boost 1
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/align_windows 0
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis 166667
    write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor interactive
    write /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq 633600
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load 90
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay 0
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate 20000
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq 1440000
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_slack -1
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads 74 768000:73 864000:64 960000:80 1248000:61 1344000:69 1440000:64 1536000:74 1632000:69 1689600:67 1824000:72
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time 30000
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/boost 1
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/align_windows 0
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_migration_notif 1
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_sched_load 1
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis 20000
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/boostpulse_duration 80000
    write /sys/module/cpu_boost/parameters/input_boost_enabled 1
    write /sys/module/cpu_boost/parameters/input_boost_freq "0:1248000 1:1248000 2:1248000 3:1248000 4:0 5:0 6:0 7:0"
    write /sys/module/cpu_boost/parameters/boost_ms 80
    write /sys/module/cpu_boost/parameters/input_boost_ms 420
    write /sys/module/msm_performance/parameters/touchboost 0
    write /sys/class/leds/lcd-backlight/max_brightness 255
    write /sys/class/kgsl/kgsl-3d0/devfreq/governor msm-adreno-tz
    write /sys/module/adreno_idler/parameters/adreno_idler_active 1
    write /dev/cpuset/foreground/cpus 0-2,4-7
    write /dev/cpuset/foreground/boost/cpus 4-7
    write /dev/cpuset/top-app/cpus 0-7
    write /sys/module/lazyplug/parameters/nr_possible_cores 8

# Battery
on property:persist.spectrum.profile=2
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor relaxed
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 302400
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 1248000
    write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor relaxed
    write /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq 633600
    write /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq 768000
    write /sys/module/cpu_boost/parameters/input_boost_enabled 0
    write /sys/module/cpu_boost/parameters/input_boost_freq "0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0"
    write /sys/module/cpu_boost/parameters/boost_ms 0
    write /sys/module/cpu_boost/parameters/input_boost_ms 40
    write /sys/module/cpu_boost/parameters/migration_load_threshold 15
    write /sys/module/cpu_boost/parameters/sync_threshold 0
    write /sys/module/msm_performance/parameters/touchboost 0
    write /sys/devices/system/cpu/cpu0/cpufreq/relaxed/boost_count 6
    write /sys/devices/system/cpu/cpu0/cpufreq/relaxed/boost_ceiling 12
    write /sys/devices/system/cpu/cpu4/cpufreq/chill/boost_count 12
    write /sys/devices/system/cpu/cpu0/cpufreq/relaxed/freq_step 6
    write /sys/devices/system/cpu/cpu4/cpufreq/chill/freq_step 4
    write /sys/devices/system/cpu/cpu0/cpufreq/relaxed/down_threshold 70
    write /sys/devices/system/cpu/cpu0/cpufreq/relaxed/down_threshold_suspended 85
    write /sys/devices/system/cpu/cpu4/cpufreq/chill/down_threshold 75
    write /sys/devices/system/cpu/cpu4/cpufreq/chill/down_threshold_suspended 99
    write /sys/devices/system/cpu/cpu0/cpufreq/relaxed/up_threshold 75
    write /sys/devices/system/cpu/cpu4/cpufreq/chill/up_threshold 90
    write /sys/class/kgsl/kgsl-3d0/devfreq/governor powersave
    write /sys/class/leds/lcd-backlight/max_brightness 100
    write /dev/cpuset/foreground/cpus 0-2,4-5
    write /dev/cpuset/foreground/boost/cpus 4-5
    write /dev/cpuset/top-app/cpus 0-5
    write /sys/module/lazyplug/parameters/nr_possible_cores 6

# Gaming
on property:persist.spectrum.profile=3
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 302400
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load 75
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay 0
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate 40000
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq 960000
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_slack -1
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads 80 384000:33 460800:25 600000:50 672000:65 787200:70 864000:85 960000:90 1248000:92
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time 50000
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/boost 1
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/align_windows 0
    write /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis 166667
    write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor interactive
    write /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq 633600
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load 90
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay 0
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate 20000
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq 1440000
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_slack -1
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads 74 768000:73 864000:64 960000:80 1248000:61 1344000:69 1440000:64 1536000:74 1632000:69 1689600:67 1824000:72
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time 30000
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/boost 1
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/align_windows 0
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_migration_notif 1
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_sched_load 1
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis 20000
    write /sys/devices/system/cpu/cpu4/cpufreq/interactive/boostpulse_duration 80000
    write /sys/module/cpu_boost/parameters/input_boost_enabled 1
    write /sys/module/cpu_boost/parameters/input_boost_freq "0:1248000 1:1248000 2:1248000 3:1248000 4:0 5:0 6:0 7:0"
    write /sys/module/cpu_boost/parameters/boost_ms 80
    write /sys/module/cpu_boost/parameters/input_boost_ms 420
    write /sys/module/msm_performance/parameters/touchboost 0
    write /sys/class/leds/lcd-backlight/max_brightness 255
    write /sys/class/kgsl/kgsl-3d0/devfreq/governor msm-adreno-tz
    write /sys/module/adreno_idler/parameters/adreno_idler_active 0
    write /dev/cpuset/foreground/cpus 0-2,4-7
    write /dev/cpuset/foreground/boost/cpus 4-7
    write /dev/cpuset/top-app/cpus 0-7
    write /sys/module/lazyplug/parameters/nr_possible_cores 8
Recompile and your ready to go!

Some tips for profiles:
  • Make sure all profiles tweak the same parameters. Parameters don't get reset, when profile changes, so you have to make sure to change them back.
  • Not all profiles have to be complex! You could have one profile for your kernel and just use spectrum for minor tweaks
The Following 39 Users Say Thank You to frap129 For This Useful Post: [ View ]
4th May 2017, 09:38 PM |#3  
frap129's Avatar
OP Recognized Developer
Thanks Meter: 3,187
 
Donate to Me
More
Spectrum injector
Spectrum Injector is a new method of adding spectrum support to your kernel! If the kernel you're running doesn't support Spectrum, you can add support without modifying it by flashing the spectrum injector zip. If the kernel does support Spectrum, flashing the zip will overwrite it and allow you to create your own profiles without decompiling the boot.img.

NOTE: These profiles are empty by default! You must customize them for them to do anything.

How to:
To create your profiles, you only need to modify the files located in /sdcard/Spectrum/profiles/ on your device.
These profiles are like ramdisk files, they accept commands of the format:
Code:
write /path/to/file value-to-set
along with all bash commands included in android such as
  • echo
  • chmod
  • chown
  • cp
  • mv
  • setprop

Once you have created your own custom profiles, you can apply them with the Spectrum app. Feel free to share your creations with other users, but remember, I'm not responsible for poorly written profiles that harm your device.

Download:https://www.androidfilehost.com/?fid=745425885120749066
The Following 9 Users Say Thank You to frap129 For This Useful Post: [ View ]
4th May 2017, 09:51 PM |#4  
p70shooter's Avatar
Senior Member
Thanks Meter: 1,623
 
More
Noice, thanks
4th May 2017, 10:48 PM |#5  
frap129's Avatar
OP Recognized Developer
Thanks Meter: 3,187
 
Donate to Me
More
Quote:
Originally Posted by p70shooter

Noice, thanks

The Following 4 Users Say Thank You to frap129 For This Useful Post: [ View ]
5th May 2017, 12:09 AM |#6  
Senior Member
Thanks Meter: 37
 
More
Testing spectrum, sadly I'm not able to add the quicktile. It disappears before I can drag it onto my active QT...
5th May 2017, 12:55 AM |#7  
The Flash's Avatar
Forum Moderator / Recognized Developer
Flag Mesa, AZ
Thanks Meter: 32,076
 
More
Quote:
Originally Posted by Augustin79

Testing spectrum, sadly I'm not able to add the quicktile. It disappears before I can drag it onto my active QT...

That's a Nougat issue. Adding more columns to your QS should be a temp fix.
The Following User Says Thank You to The Flash For This Useful Post: [ View ]
5th May 2017, 12:59 AM |#8  
Senior Member
Thanks Meter: 37
 
More
Quote:
Originally Posted by The Flash

That's a Nougat issue. Adding more columns to your QS should be a temp fix.

Ah, of course! Thanks
5th May 2017, 01:39 AM |#9  
frap129's Avatar
OP Recognized Developer
Thanks Meter: 3,187
 
Donate to Me
More
Quote:
Originally Posted by Augustin79

Ah, of course! Thanks

Wow @The Flash as faster at support than me for my own app. Guess thats how he got his name
The Following 14 Users Say Thank You to frap129 For This Useful Post: [ View ]
5th May 2017, 02:20 AM |#10  
krasCGQ's Avatar
Recognized Contributor
Flag Kendari, Indonesia
Thanks Meter: 2,308
 
More
Looks promising, but I'm awful at tuning kernel

Sent from my Redmi 3 using XDA Labs
5th May 2017, 02:30 AM |#11  
The Flash's Avatar
Forum Moderator / Recognized Developer
Flag Mesa, AZ
Thanks Meter: 32,076
 
More
Quote:
Originally Posted by frap129

Wow @The Flash as faster at support than me for my own app. Guess thats how he got his name



Quote:
Originally Posted by krasCGQ

Looks promising, but I'm awful at tuning kernel

Sent from my Redmi 3 using XDA Labs

One thing that helped me a lot was just learning what the tunables actually do: https://android.googlesource.com/ker...ernors.txt#222

That documentation is a bit dense but can help a BUNCH when tweaking the governor. I'm always available to help with learning about tunables
The Following 8 Users Say Thank You to The Flash For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes