[MOD] SS4N1 - ScreenState for Nexus One (2011-05-25)

Search This thread

ch33kybutt

Retired Recognized Developer
Oct 25, 2008
635
812
I've tried a lot of performance-boosting and battery-saving mods, but none of them worked well together. It was a case of exclusive-OR, i.e. either set only for performance-boost OR only for battery-saving.

So I adapted 2 existing scripts (screenstate_scaling and battery tweak) and came up with SS4N1, which combines the best of both worlds ... performance-boost whenever I use my N1, and battery-saving whenever my N1 is idle.

SS4N1 : ScreenState for Nexus One

  • auto-switch the following settings based on screen-state (AWAKE/SLEEPING)
    • virtual memory
    • cpufreq governor
    • cpu scheduler
    • undervoltage
  • performance tweaks on startup
    • dialer optimization
    • remount partitions with noatime
    • storage/IO tuning
    • UI/homescreen optimization
    • network performance tuning
  • ability to enable/disable any or all of the above features

  • adapted from screenstate_scaling (FloHimself@xda) & battery tweak (collin_ph@xda)

ROMs

Only tested for CM7 & MIUI, but should work with other AOSP ROMs that provide init.local.rc capability.

How to check ROM:
- Open adb shell or terminal session
- Type cat /init.rc | grep init.local.rc
- If no result, then your ROM is unsuitable for SS4N1
- If result is import /system/etc/init.local.rc or similar, then ROM is suitable
Kernels

SS4N1 has been available for a while now on IntersectRaven's kernel thread. Thanks again to IntersectRaven for letting me bum off his thread until now :). Should also work with other N1 kernels by Redstar, Pershoot, Wildmonks and Cayniarb (Tiamat).
I'm using SS4N1 now with bbedward's Savaged-Zen kernel for Evo, as I compiled this awesome kernel for N1 with -0fast optimization using an experimental GCC 4.7.0 toolchain. Check below for download link.

Excerpt on overclocking from wildmonk ...
"Most users should be able to handle 1152MHz without any problems but some won't on 1190MHz. You'll know when your CPU can't handle a certain speed if you start to experience a sudden decrease in performance, lag, force closes, and spontaneous reboots."
How to enable SS4N1

Via adb shell or terminal session

SS4N1 is initially DISABLED by default. You must start an ADB shell or Terminal session then run the configuration script: sscfg
> Choose [1] Enable SS4N1
> Follow on-screen instructions to customize (refer to screenshots below)
> Exit with [6] *** Apply changes and exit ***
> Check logcat for SS4N1 entrie
s

Via CKZTools SS4N1 GUI by zyr3x
CKZTools : ScreenState Gui for Nexus One

DOWNLOADS from my mediafire site

[MOD/SCRIPT] SS4N1

[KERNEL] Savaged-Zen for N1
(2.6.38.8, 128-1190, BFS/CFS, SWAP, NOOP, HAVS, AXI, HW3D)
Code:
#include <std_disclaimer.h>
/*
 * Your warranty is now void.
 *
 * I am not responsible for bricked devices, dead SD cards, thermonuclear war,
 * or you getting fired because the alarm app failed. Please do some research if
 * you have any concerns about features included in these ROMs, mods & kernels
 * before flashing! YOU are choosing to make these modifications, and if you 
 * point the finger at me for messing up your device, I will laugh at you.
 */
 

Attachments

  • 01.jpg
    01.jpg
    47.4 KB · Views: 3,941
  • 02.jpg
    02.jpg
    45.5 KB · Views: 3,490
  • 03.jpg
    03.jpg
    59.9 KB · Views: 2,829
  • 04.jpg
    04.jpg
    58.3 KB · Views: 2,498
  • 05.jpg
    05.jpg
    57.5 KB · Views: 2,327
  • 06.jpg
    06.jpg
    48.7 KB · Views: 2,146
  • 07.jpg
    07.jpg
    43 KB · Views: 2,096
  • 08.jpg
    08.jpg
    40.4 KB · Views: 2,151
Last edited:

ch33kybutt

Retired Recognized Developer
Oct 25, 2008
635
812
Changelog for SS4N1

# ===============
# SS4N1 changelog
# ===============
# Initial
# + port script from Spica to N1
#
# 20110329
# + added SD Card Speed Fix in TWEAK_STORAGE section
#
# 20110403
# + changed deprecated oom_adj to oom_score_adj for MAX_PHONE function and sscfg
#
# 20110403A
# + added auto-check of kernel version for oom-killer parameter for MAX_PHONE function and sscfg
# + updated check for cpufreq up_threshold for Auto Switch function
#
# 20110404
# + changed from init.d script to init.local.rc service to fix "hung-on-X" when not running dt-a2sd
#
# 20110505
# + modified to apply UV for Hybrid-AVS (Tiamat, SavagedZen, new-IR) and Customizable-AVS (old-IR)
#
# 20110519
# + added option for new interactiveX governor
# + removed tweaks for TCP/IP redirects
#
# 20110525
# + disabled dewonkifier feature in all preset profiles (thx 2 jyxent!)
# + tuned preset profiles to more conservative undervolt values
# + added option to display HAVS Min & Max VDD levels (CPU voltage table)
# + added option to display misc information (CPU info, kernel version, etc)
 
Last edited:
  • Like
Reactions: wind0zer

sir*mez

Senior Member
Nov 7, 2007
1,400
310
NYC
Yes finally! Thank you for bringing your expertise here! The all-in-one script perfect for everything! I've been a fan of this script for a long time now!
 
Last edited:

ch33kybutt

Retired Recognized Developer
Oct 25, 2008
635
812
What gains have you seen with this mod?
That's the thing about this mod, it's ultimately up to the user to decide what type of profile they want. I put no stock in so-called benchmarks but UI is smooth and lag-free (especially with BFS kernel) whenever I use it and I get less than 1% battery decrease per hour overnight when phone is idle (from 100% to 96% in 7 hours).
 

terente0081

Senior Member
Sep 21, 2008
74
11
42
Bucharest
Thanks ch33kybutt, it was about time you started your own thread for this great script! I've been using it since it's first incarnation, on MIUI alone with great success. Battery life is better, phone runs very smooth and the best thing is that you can set a different CPU governor for AWAKE/SLEEP modes plus all those tweaks.
I'd like more control over the audio volume, I feel as it's not loud enough; is it possible to add a tweakable audio boost function? Something that would make the ringtones ring louder?
 

ch33kybutt

Retired Recognized Developer
Oct 25, 2008
635
812
Audioboost is built into the kernel upon compiling. But I think there's a volume hack app floating around the dev section that you can use.
 

uoY_redruM

Senior Member
May 1, 2010
3,469
1,941
Longwood, FL
ch33ky, are the settings in picture 8 your optimal settings?

I'm not 100% confident in making my own settings yet and I'd like to use that as a guide.

I actually set mine to whatever your first picture shows but before saving I realized picture 8 had different settings and since I flashed your kernel as well I figured I'd try out your settings..
 

ch33kybutt

Retired Recognized Developer
Oct 25, 2008
635
812
ch33ky, are the settings in picture 8 your optimal settings?

I'm not 100% confident in making my own settings yet and I'd like to use that as a guide.

I actually set mine to whatever your first picture shows but before saving I realized picture 8 had different settings and since I flashed your kernel as well I figured I'd try out your settings..
I'm actually using the settings in pic 2 right now.
 

ch33kybutt

Retired Recognized Developer
Oct 25, 2008
635
812
How are they working for you? Picture8 settings are causing a pretty bad delay when loading multiple web pages at once and when typing it is falling WAY behind me. I have to stop every few seconds and let it catch up.
That's probably because you're using SavagedZen governor in awake-mode. SavagedZen cpu governor is more attuned to battery-savings than performance-boost. Try switching to interactive governor instead.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 14
    I've tried a lot of performance-boosting and battery-saving mods, but none of them worked well together. It was a case of exclusive-OR, i.e. either set only for performance-boost OR only for battery-saving.

    So I adapted 2 existing scripts (screenstate_scaling and battery tweak) and came up with SS4N1, which combines the best of both worlds ... performance-boost whenever I use my N1, and battery-saving whenever my N1 is idle.

    SS4N1 : ScreenState for Nexus One

    • auto-switch the following settings based on screen-state (AWAKE/SLEEPING)
      • virtual memory
      • cpufreq governor
      • cpu scheduler
      • undervoltage
    • performance tweaks on startup
      • dialer optimization
      • remount partitions with noatime
      • storage/IO tuning
      • UI/homescreen optimization
      • network performance tuning
    • ability to enable/disable any or all of the above features

    • adapted from screenstate_scaling (FloHimself@xda) & battery tweak (collin_ph@xda)

    ROMs

    Only tested for CM7 & MIUI, but should work with other AOSP ROMs that provide init.local.rc capability.

    How to check ROM:
    - Open adb shell or terminal session
    - Type cat /init.rc | grep init.local.rc
    - If no result, then your ROM is unsuitable for SS4N1
    - If result is import /system/etc/init.local.rc or similar, then ROM is suitable
    Kernels

    SS4N1 has been available for a while now on IntersectRaven's kernel thread. Thanks again to IntersectRaven for letting me bum off his thread until now :). Should also work with other N1 kernels by Redstar, Pershoot, Wildmonks and Cayniarb (Tiamat).
    I'm using SS4N1 now with bbedward's Savaged-Zen kernel for Evo, as I compiled this awesome kernel for N1 with -0fast optimization using an experimental GCC 4.7.0 toolchain. Check below for download link.

    Excerpt on overclocking from wildmonk ...
    "Most users should be able to handle 1152MHz without any problems but some won't on 1190MHz. You'll know when your CPU can't handle a certain speed if you start to experience a sudden decrease in performance, lag, force closes, and spontaneous reboots."
    How to enable SS4N1

    Via adb shell or terminal session

    SS4N1 is initially DISABLED by default. You must start an ADB shell or Terminal session then run the configuration script: sscfg
    > Choose [1] Enable SS4N1
    > Follow on-screen instructions to customize (refer to screenshots below)
    > Exit with [6] *** Apply changes and exit ***
    > Check logcat for SS4N1 entrie
    s

    Via CKZTools SS4N1 GUI by zyr3x
    CKZTools : ScreenState Gui for Nexus One

    DOWNLOADS from my mediafire site

    [MOD/SCRIPT] SS4N1

    [KERNEL] Savaged-Zen for N1
    (2.6.38.8, 128-1190, BFS/CFS, SWAP, NOOP, HAVS, AXI, HW3D)
    Code:
    #include <std_disclaimer.h>
    /*
     * Your warranty is now void.
     *
     * I am not responsible for bricked devices, dead SD cards, thermonuclear war,
     * or you getting fired because the alarm app failed. Please do some research if
     * you have any concerns about features included in these ROMs, mods & kernels
     * before flashing! YOU are choosing to make these modifications, and if you 
     * point the finger at me for messing up your device, I will laugh at you.
     */
    2
    @ch33kybutt:
    I was using SS4N1 for a while now. Works realy well!
    But last week, I also started using your kernel.
    Totally awesome!
    My nexus runs super smooth and has the best battery life ever.
    Yesterday I lost 30% in 24 hours!
    You should start a kernel thread ;-)
    Thanks! But all credit for the kernel should go to the Savaged-Zen team, I just optimize and compile it. But you're right, the SZ kernel is awesome, so awesome that it probably does deserve it's own thread. If I can find the time, I'll try to get around to creating one ...
    1
    Changelog for SS4N1

    # ===============
    # SS4N1 changelog
    # ===============
    # Initial
    # + port script from Spica to N1
    #
    # 20110329
    # + added SD Card Speed Fix in TWEAK_STORAGE section
    #
    # 20110403
    # + changed deprecated oom_adj to oom_score_adj for MAX_PHONE function and sscfg
    #
    # 20110403A
    # + added auto-check of kernel version for oom-killer parameter for MAX_PHONE function and sscfg
    # + updated check for cpufreq up_threshold for Auto Switch function
    #
    # 20110404
    # + changed from init.d script to init.local.rc service to fix "hung-on-X" when not running dt-a2sd
    #
    # 20110505
    # + modified to apply UV for Hybrid-AVS (Tiamat, SavagedZen, new-IR) and Customizable-AVS (old-IR)
    #
    # 20110519
    # + added option for new interactiveX governor
    # + removed tweaks for TCP/IP redirects
    #
    # 20110525
    # + disabled dewonkifier feature in all preset profiles (thx 2 jyxent!)
    # + tuned preset profiles to more conservative undervolt values
    # + added option to display HAVS Min & Max VDD levels (CPU voltage table)
    # + added option to display misc information (CPU info, kernel version, etc)
    1
    Yes finally! Thank you for bringing your expertise here!
    You're most welcome! Not sure if I have the time to update this thread regularly, but I'll try my best as always.
    1
    ss4n1 is great and I have been using it for a while now. Thanks a lot ch33kybutt.

    However is there any possibility of moving the config folder from /sdcard/ss4n1 to /sdcard/Android/data/ss4n1 or maybe /sdcard/.ss4n1 (to mark it as hidden)? It's not a folder that needs to be accessed regularly and nobody likes SD card clutter.