[MOD][Updated 6.2.12]Dual Core Mod v2.1 - Screen Profiles, Auto Tweak, and more!

Search This thread

-viperboy-

Inactive Recognized Developer
Jun 24, 2007
7,836
12,992
PA
Hello everybody, I was asked to bring this mod over from the EVO 4G LTE section and since the One X and One S use the same file I am modifying, both devices will get it :) This is also untested on the One X and One S, so please let me know if you encounter any issues, but it should work! This will ONLY work on phones with the Qualcomm S4 chipset, not the Tegra chipset!

This is a mod that should give you better performance by forcing cpu1 (second core) to run more, depending on the zip you flash below. The system will handle how it scales and the dcmhelper script will modify some parameters if you choose that zip. Some people on the EVO 3D felt that it gave them better battery life, some didn't. Some thought the performance was much better, some didn't. This is just something else for you guys to play with and see what works best for you :) Here are the details:

=============== How was this done? ===============

It was pretty easy, instead of modifying the kernel itself, I just modified /system/etc/init.qcom.post_boot.sh. It already sets extra parameters for the CPU and system shortly after boot. Here are the lines that I added:

Code:
echo 1 > /sys/devices/system/cpu/cpu1/online
chmod 444 /sys/devices/system/cpu/cpu1/online

What this does is it tells cpu1 to come online and then changes the permissions so user read-only so that it can't be overridden. This will be applied on every boot.

You can also verify this is working by any number of apps, but I find SystemPanel to be the best. They have a free lite version. Just download and tap on the top right where the CPU info is. You will the the CPUs changing, when it goes grey it's offline (which you won't see when using the Dual Core Mod).

aLogcat will also show you everything DCM is doing. Just apply a filter in aLogcat called DCM and it will tell you in detail what is going on.

If you want a little bit less info or want to use adb, just type su and then dcmlog and you will see what the 2nd core is doing exactly. This is updated every 1/4 second for extremely accurate results.


=============== Requirements ===============
  • Custom recovery
  • Root access (to write to /system)



=============== How to Flash ===============
  • Download the mod below and place on your internal_sdcard or sdcard (doesn't matter, just remember where you put it!)
  • Go into Settings > Power > Fast Boot and uncheck that.
  • Turn the phone off. Once off, press and hold the Volume Down + Power Button until you reach the white bootloader screen
  • Choose "RECOVERY" (volume down and up to move, power to select)
  • Choose "Install" and locate the mod wherever you put it. NOTE: If you don't see it, make sure that either internal_sdcard or sdcard is mounted. This can be done via the "Mount" button at the main menu of TWRP. Be sure that either internal_sdcard or sdcard is checked!
  • Wait until the install is finished and then tap "Reboot to System"



=============== Dual Core Mod v2.1 (flash over any existing version) ===============
Updated dcmhelper
  • Fixed issues with cpu1 turning off when screen on
  • Fixed issues with cpu1 turning on when screen off
  • Added double check for cpu1 off when screen off
  • Added logging to logcat

Updated init.qcomm.post_boot.sh
  • Set perms of 444 on hotplug file, regardless of dcmhelper present or not
Other
  • Added /system/bin/dcmlog (type su then dcmlog from terminal or adb) - Tells you current cpu1 status [0 = off, 1 = on]


=============== Dual Core Mod v2 (flash over v1) ===============
  • MANY new options!
  • Added "Screen Profiles" and "Auto Tweak" script option (all located in one configurable file - /system/bin/dcmhelper) - see 2nd post for more info
  • Added "Memory Optimization" option - see 2nd post for more info
  • Support AT&T HTC One X
  • Support T-Mobile One S
  • "All-in-One" .zips - all devices supported via 1 .zip file (thanks to a very smart updater-script I wrote :D)

=============== Dual Core Mod v1 ===============
  • Initial release



=============== Explanation of Mods===============
All DCMs have memory optimizations!
  • Dual Core Mod - Full time cpu1 on
  • Dual Core Mod Plus - cpu1 on when screen on, cpu1 off when screen off
  • Dual Core Mod Ultimate - Same as Plus but governor is tweaked for more performance when screen on, more battery life when screen off.




=============== Credits ===============
  • Freeza for doing this on the EVO 3D where I got the idea from
  • rohandhruva, remedy1419, and ewalk4866 for EXTENSIVE testing to fix issues and make DCM better


It has been asked to make it easier to donate for people using Tapatalk, so here are the links...

Donate to -viperboy-
http://bit.ly/n7sB9g
 
Last edited:

-viperboy-

Inactive Recognized Developer
Jun 24, 2007
7,836
12,992
PA
More Info

=============== How are all supported phones in 1 zip per file? ===============
I wrote a custom updater-script that will identify your device and automatically give you the right file needed. Just like magic :D


=============== How can I monitor the 2nd core? ===============
You can also verify this is working by any number of apps, but I find SystemPanel to be the best. They have a free lite version. Just download and tap on the top right where the CPU info is. You will the the CPUs changing, when it goes grey it's offline (which you won't see when using the Dual Core Mod).

aLogcat will also show you everything DCM is doing. Just apply a filter in aLogcat called DCM and it will tell you in detail what is going on.

If you want a little bit less info or want to use adb, just type su and then dcmlog and you will see what the 2nd core is doing exactly. This is updated every 1/4 second for extremely accurate results.

=============== What are the "Memory Optimizations?" ===============
The optimizations I made are the same that I have made in viperROM. They are as follows:

echo "0,4,6,8,14,15" > /sys/module/lowmemorykiller/parameters/adj
echo "2560,4096,6144,7680,8704,10240" > /sys/module/lowmemorykiller/parameters/minfree

This will allow better multitasking and should eliminate any issues with apps being killed off very easily.


=============== What are the "Screen Profiles?" ===============
The screen profiles are part of a custom script, located in /system/bin/dcmhelper. Once flashed, this .zip runs in the background to monitor screen state (uses hardly any power). When you choose a .zip with this in it, the phone won't just leave the second core always running - it will turn it off when the screen is off and on when the screen is on. This is done via this code here:

while : ; do
awake=`cat /sys/power/wait_for_fb_wake`
if [ $awake = "awake" ]; then
echo 1 > /sys/devices/system/cpu/cpu1/online
awake=
fi

sleep=`cat /sys/power/wait_for_fb_wake`
if [ $sleep= "sleeping" ]; then
echo 0 > /sys/devices/system/cpu/cpu1/online
sleep=
fi

Pretty simple and straightforward :)


=============== What is the "Auto Tweaking Script?" ===============
The auto tweaking script is the second part of a /system/bin/dcmhelper. This part of the script will set certain governor settings based on the screen being off or on. In the viperROM version, the screen on settings are the same as in the ROM. In the other versions, the screen on settings are more set for performance. I intentionally kept the same settings in the viperROM version to make sure you get as close to the same battery life as unmodified viperROM. Here is a code snipit (from the non-viperROM version) that shows what the settings are:

ondemand_sampling_rate_awake=40000
ondemand_up_threshold_awake=80
ondemand_down_differential_awake=12
ondemand_sampling_down_factor_awake=3

ondemand_sampling_rate_sleep=80000
ondemand_up_threshold_sleep=95
ondemand_down_differential_sleep=5
ondemand_sampling_down_factor_sleep=1

Long story short, when awake, it will check if the CPU needs to increase speed faster and in bigger steps. When asleep, it will wait longer before polling the CPU to scale up and it will take a more gradual approach to scaling up. However, you shouldn't experience any lockscreen lag.


=============== Long Term Goals for Dual Core Mod ===============
  • Config file and script for users to set their own settings
  • Profiles for battery
  • Set max freq when screen off (will affect virtuous_oc daemon in viperROM, still working on that)
 
Last edited:

plakers

Senior Member
Apr 26, 2011
478
106
Lyon
Any feedback about theses scripts (the "full one" w ith screen+memory+tweaks) on our lovely One S stock/CM9 ? It seems to be a very good option while waiting the OneS sources!

Good Job, will test it soon
 

snwman

Senior Member
Dec 31, 2011
605
88
Would these mods have any effect on custom roms like Lee Droid's and torxx
 

plakers

Senior Member
Apr 26, 2011
478
106
Lyon
Would these mods have any effect on custom roms like Lee Droid's and torxx

I took a look at the scripts... It should be compatible with Stock (and derivated ROMs like LeeDroid & so on), as on CM9/AOSP ones. The scripts seems to affect on low-level files (/proc) related to the chipset, so the affected files should be present on both Stock/AOSP ones.

I'm under CM9 for now, but a Stock feedback can confirm this? You? :)
 

plakers

Senior Member
Apr 26, 2011
478
106
Lyon
EDIT: lol sorry, didn't see it was a flashable zip

So, flashed the ZIP, but cpu1 never comes online... The script disables it permanently? I expected a cpu1-offline under a load factor, and goes online over another load factor.
 
Last edited:

-viperboy-

Inactive Recognized Developer
Jun 24, 2007
7,836
12,992
PA
EDIT: lol sorry, didn't see it was a flashable zip

So, flashed the ZIP, but cpu1 never comes online... The script disables it permanently? I expected a cpu1-offline under a load factor, and goes online over another load factor.

The One X guys seem to be having issues as well, it's hit or miss. Of course, I don't have issues in my testing lol what file did you use?
 
  • Like
Reactions: avetny

avetny

Senior Member
Jul 16, 2010
5,771
1,844
Private Island.
by linpack bench I can say 204 (and up) is stable score now.

in quadro bench:

before cpu score is 8486.
after cpu score is 8732.

so it's working.

Regards !
 
Last edited:

Closed Source Project

Senior Member
Mar 31, 2012
1,214
355
The Windy City, Chicago, Illinois
Thanks very much for this mod, going to try it out right now. Some questions on my part: (1) can this put any long-term additional stress on the cpu by forcing it to work more? (2) If a ROM is updated, does the script need to be flashed again after flashing the ROM? Again, thanks a lot; will try it out now and report my findings on the LeeDroid ROM.
 

-viperboy-

Inactive Recognized Developer
Jun 24, 2007
7,836
12,992
PA
Thanks very much for this mod, going to try it out right now. Some questions on my part: (1) can this put any long-term additional stress on the cpu by forcing it to work more? (2) If a ROM is updated, does the script need to be flashed again after flashing the ROM? Again, thanks a lot; will try it out now and report my findings on the LeeDroid ROM.

No, no added stress and yes, you will likely have to reflash after a ROM update since most ROMs wipe /system where this script is located.
 

Closed Source Project

Senior Member
Mar 31, 2012
1,214
355
The Windy City, Chicago, Illinois
The script installed fine and my ROM booted up nice and fast. I will now do benchmarks and other daily tasks while observing my battery life and report back with my final findings in a few hours. So far seems good.

I am on LeeDroid's latest with the full script installed (tweak scrip+mem opt+screen prof).
 
Last edited:

el_smurfo

Senior Member
Oct 21, 2009
3,955
1,316
How did you come about those minfree values? Do you know offhand how the numbers in your script compare to those used by the minfree manager app (i.e. MFM uses MB, are your numbers in KB?)
 

Closed Source Project

Senior Member
Mar 31, 2012
1,214
355
The Windy City, Chicago, Illinois
My results: Battery seems to be better, yet performance is not so much. Both Quadrant and Antutu benchmarks show slightly lower scores than what I got right before flashing the mod. The difference is very minimal, just curious as to why it would be lacking ever so slightly. The general UI seems just as snappy as before.

Is there an app to view exactly what the CPU is doing and how many cores are running? If so, please share! Thanks.
 

-viperboy-

Inactive Recognized Developer
Jun 24, 2007
7,836
12,992
PA
My results: Battery seems to be better, yet performance is not so much. Both Quadrant and Antutu benchmarks show slightly lower scores than what I got right before flashing the mod. The difference is very minimal, just curious as to why it would be lacking ever so slightly. The general UI seems just as snappy as before.

Is there an app to view exactly what the CPU is doing and how many cores are running? If so, please share! Thanks.

Working with some people in IRC to improve everything. And yes, SystemPanel Lite, as said in the OP :p
 

plakers

Senior Member
Apr 26, 2011
478
106
Lyon
The One X guys seem to be having issues as well, it's hit or miss. Of course, I don't have issues in my testing lol what file did you use?

I used the modV2 with CPU/RAM/Tweaks, the full one.
Dual Core Mod v2 w/ Screen Profiles AND Auto Tweaking Script AND Memory Optimizations

And only first core is active :(...
 

-viperboy-

Inactive Recognized Developer
Jun 24, 2007
7,836
12,992
PA
I used the modV2 with CPU/RAM/Tweaks, the full one.
Dual Core Mod v2 w/ Screen Profiles AND Auto Tweaking Script AND Memory Optimizations

And only first core is active :(...

I have a fantastic group of testers, we got this sorted out. Just going over the final small details now, but I will have all new builds up in 30-60 mins :) confirmed working!
 

-viperboy-

Inactive Recognized Developer
Jun 24, 2007
7,836
12,992
PA
Updated to v2.1! Much, much improved thanks to my 3 great testers rohandhruva, remedy1419, and ewalk4866 for testing numerous builds and spending hours making sure this is as bulletproof as possible. Please see the OP for full changelog. A few other notes about v2.1:

  • I dropped a few of the versions because there were hardly any downloads on it. The "3 in 1" had literally 10 times the amount of downloads as some of the other versions. Based on this, memory optimizations are included in all builds. The naming scheme has changed as well, info in the OP.
  • Please use aLogcat if you want to view everything DCM is doing. Just apply a filter in aLogcat called DCM and it will tell you in detail what is going on. If you want a little bit less info or want to use adb, just type su and then dcmlog and you will see what the 2nd core is doing exactly. This is updated every 1/4 second for extremely accurate results.
  • Battery life should be very good on Ultimate because of the settings I have set. If for some reason you can verify that the mod isn't working by using what I said above, please let me know. I have verified with numerous people that it works, so it could be a minor issue in the flashable .zip. I'm not anticipating any issues, but anything can happen.

Enjoy :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 35
    Hello everybody, I was asked to bring this mod over from the EVO 4G LTE section and since the One X and One S use the same file I am modifying, both devices will get it :) This is also untested on the One X and One S, so please let me know if you encounter any issues, but it should work! This will ONLY work on phones with the Qualcomm S4 chipset, not the Tegra chipset!

    This is a mod that should give you better performance by forcing cpu1 (second core) to run more, depending on the zip you flash below. The system will handle how it scales and the dcmhelper script will modify some parameters if you choose that zip. Some people on the EVO 3D felt that it gave them better battery life, some didn't. Some thought the performance was much better, some didn't. This is just something else for you guys to play with and see what works best for you :) Here are the details:

    =============== How was this done? ===============

    It was pretty easy, instead of modifying the kernel itself, I just modified /system/etc/init.qcom.post_boot.sh. It already sets extra parameters for the CPU and system shortly after boot. Here are the lines that I added:

    Code:
    echo 1 > /sys/devices/system/cpu/cpu1/online
    chmod 444 /sys/devices/system/cpu/cpu1/online

    What this does is it tells cpu1 to come online and then changes the permissions so user read-only so that it can't be overridden. This will be applied on every boot.

    You can also verify this is working by any number of apps, but I find SystemPanel to be the best. They have a free lite version. Just download and tap on the top right where the CPU info is. You will the the CPUs changing, when it goes grey it's offline (which you won't see when using the Dual Core Mod).

    aLogcat will also show you everything DCM is doing. Just apply a filter in aLogcat called DCM and it will tell you in detail what is going on.

    If you want a little bit less info or want to use adb, just type su and then dcmlog and you will see what the 2nd core is doing exactly. This is updated every 1/4 second for extremely accurate results.


    =============== Requirements ===============
    • Custom recovery
    • Root access (to write to /system)



    =============== How to Flash ===============
    • Download the mod below and place on your internal_sdcard or sdcard (doesn't matter, just remember where you put it!)
    • Go into Settings > Power > Fast Boot and uncheck that.
    • Turn the phone off. Once off, press and hold the Volume Down + Power Button until you reach the white bootloader screen
    • Choose "RECOVERY" (volume down and up to move, power to select)
    • Choose "Install" and locate the mod wherever you put it. NOTE: If you don't see it, make sure that either internal_sdcard or sdcard is mounted. This can be done via the "Mount" button at the main menu of TWRP. Be sure that either internal_sdcard or sdcard is checked!
    • Wait until the install is finished and then tap "Reboot to System"



    =============== Dual Core Mod v2.1 (flash over any existing version) ===============
    Updated dcmhelper
    • Fixed issues with cpu1 turning off when screen on
    • Fixed issues with cpu1 turning on when screen off
    • Added double check for cpu1 off when screen off
    • Added logging to logcat

    Updated init.qcomm.post_boot.sh
    • Set perms of 444 on hotplug file, regardless of dcmhelper present or not
    Other
    • Added /system/bin/dcmlog (type su then dcmlog from terminal or adb) - Tells you current cpu1 status [0 = off, 1 = on]


    =============== Dual Core Mod v2 (flash over v1) ===============
    • MANY new options!
    • Added "Screen Profiles" and "Auto Tweak" script option (all located in one configurable file - /system/bin/dcmhelper) - see 2nd post for more info
    • Added "Memory Optimization" option - see 2nd post for more info
    • Support AT&T HTC One X
    • Support T-Mobile One S
    • "All-in-One" .zips - all devices supported via 1 .zip file (thanks to a very smart updater-script I wrote :D)

    =============== Dual Core Mod v1 ===============
    • Initial release



    =============== Explanation of Mods===============
    All DCMs have memory optimizations!
    • Dual Core Mod - Full time cpu1 on
    • Dual Core Mod Plus - cpu1 on when screen on, cpu1 off when screen off
    • Dual Core Mod Ultimate - Same as Plus but governor is tweaked for more performance when screen on, more battery life when screen off.




    =============== Credits ===============
    • Freeza for doing this on the EVO 3D where I got the idea from
    • rohandhruva, remedy1419, and ewalk4866 for EXTENSIVE testing to fix issues and make DCM better


    It has been asked to make it easier to donate for people using Tapatalk, so here are the links...

    Donate to -viperboy-
    http://bit.ly/n7sB9g
    7
    Here you go. Please hit thanks!

    http://db.tt/g1xozzmh

    Sent from my MIUI powered one s

    If I helped you in any way please hit thanks!
    5
    More Info

    =============== How are all supported phones in 1 zip per file? ===============
    I wrote a custom updater-script that will identify your device and automatically give you the right file needed. Just like magic :D


    =============== How can I monitor the 2nd core? ===============
    You can also verify this is working by any number of apps, but I find SystemPanel to be the best. They have a free lite version. Just download and tap on the top right where the CPU info is. You will the the CPUs changing, when it goes grey it's offline (which you won't see when using the Dual Core Mod).

    aLogcat will also show you everything DCM is doing. Just apply a filter in aLogcat called DCM and it will tell you in detail what is going on.

    If you want a little bit less info or want to use adb, just type su and then dcmlog and you will see what the 2nd core is doing exactly. This is updated every 1/4 second for extremely accurate results.

    =============== What are the "Memory Optimizations?" ===============
    The optimizations I made are the same that I have made in viperROM. They are as follows:

    echo "0,4,6,8,14,15" > /sys/module/lowmemorykiller/parameters/adj
    echo "2560,4096,6144,7680,8704,10240" > /sys/module/lowmemorykiller/parameters/minfree

    This will allow better multitasking and should eliminate any issues with apps being killed off very easily.


    =============== What are the "Screen Profiles?" ===============
    The screen profiles are part of a custom script, located in /system/bin/dcmhelper. Once flashed, this .zip runs in the background to monitor screen state (uses hardly any power). When you choose a .zip with this in it, the phone won't just leave the second core always running - it will turn it off when the screen is off and on when the screen is on. This is done via this code here:

    while : ; do
    awake=`cat /sys/power/wait_for_fb_wake`
    if [ $awake = "awake" ]; then
    echo 1 > /sys/devices/system/cpu/cpu1/online
    awake=
    fi

    sleep=`cat /sys/power/wait_for_fb_wake`
    if [ $sleep= "sleeping" ]; then
    echo 0 > /sys/devices/system/cpu/cpu1/online
    sleep=
    fi

    Pretty simple and straightforward :)


    =============== What is the "Auto Tweaking Script?" ===============
    The auto tweaking script is the second part of a /system/bin/dcmhelper. This part of the script will set certain governor settings based on the screen being off or on. In the viperROM version, the screen on settings are the same as in the ROM. In the other versions, the screen on settings are more set for performance. I intentionally kept the same settings in the viperROM version to make sure you get as close to the same battery life as unmodified viperROM. Here is a code snipit (from the non-viperROM version) that shows what the settings are:

    ondemand_sampling_rate_awake=40000
    ondemand_up_threshold_awake=80
    ondemand_down_differential_awake=12
    ondemand_sampling_down_factor_awake=3

    ondemand_sampling_rate_sleep=80000
    ondemand_up_threshold_sleep=95
    ondemand_down_differential_sleep=5
    ondemand_sampling_down_factor_sleep=1

    Long story short, when awake, it will check if the CPU needs to increase speed faster and in bigger steps. When asleep, it will wait longer before polling the CPU to scale up and it will take a more gradual approach to scaling up. However, you shouldn't experience any lockscreen lag.


    =============== Long Term Goals for Dual Core Mod ===============
    • Config file and script for users to set their own settings
    • Profiles for battery
    • Set max freq when screen off (will affect virtuous_oc daemon in viperROM, still working on that)
    5
    Thanks...i'm waiting for the v3....it's amazing your work!

    Ah, thanks :)

    I'm pushing it off for a little bit, only because there is a major flaw in that I never designed it to work with anything but ondemand. I wanna get that fixed and I'm running a custom kernel so I can make it work for damn near every governor. It just takes a lot of time, cause I have to come up with a better config file, make dcm work with it, update viperdaemon, etc. Lots and lots of work.

    Sent from my EVO using Tapatalk 2
    4
    Honestly, I don't even have the files anymore when I changed computers lol anyone have them?

    here is the ultimate 2.1 http://goo.im/devs/kevinrocksman/Developerfiles/viperboy/Dual_Core_Mod_Ultimate_v2.1.zip