[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, here 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 :) Please note: If you are on viperROM, please choose one of the viperROM .zips! There are no memory optimization .zips for viperROM since that is already done in the ROM! 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 ===============
  • HTCdev Unlock (Choose "All Other Supported Models" and follow all the directions, including driver install)
  • Custom recovery - I would recommend TWRP since it doesn't have the /misc issue anymore



=============== 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:

Kidromulous

Senior Member
Feb 1, 2011
1,106
298
Durham N.C.
My quadrants were not dramatically different but the performance increase is insane. Dont see how this won't drain battery thought

Sent from my EVO using Tapatalk 2
 

flex360

Senior Member
Sep 22, 2010
4,520
6,815
one thing i notice so far is the phone sleeps phenomenally well

1hr and 45minutes off the charger with little to no use
and the battery is still at 100 ^_^

edit:

i got a 1% drop in 2 hours and 8 minutes of very light usage
not bad at all
 
Last edited:

ryanalan82

Senior Member
Oct 4, 2008
1,134
379
Nor really sure how to take this. Quadrants are 5200, roughly the same, but some 3d is smoother. I not sure yet whether to keep DC or not, but this will really make more of a difference when heavily o/c'd. Can't wait to push this to hopefully 2GHz.

Swyped from my eVo
 

94tbird

Senior Member
Jun 19, 2007
979
173
will this affect battery life, both how long the charge lasts, as well as the physical life of the battery?

Does the phone get any hotter since both cores are running?

If this enables the second core to be run but scales its use, how is this different than the stock way? Does the stock way not scale the use of the second core as well? or is the second core completely disabled?
 

Kidromulous

Senior Member
Feb 1, 2011
1,106
298
Durham N.C.
will this affect battery life, both how long the charge lasts, as well as the physical life of the battery?

Does the phone get any hotter since both cores are running?

If this enables the second core to be run but scales its use, how is this different than the stock way? Does the stock way not scale the use of the second core as well? or is the second core completely disabled?

I've seen maybe a slight increase in drain when the screen is on however this mod caused zero extra heat for me. I'm keeping it for now

Sent from my EVO using Tapatalk 2
 

94tbird

Senior Member
Jun 19, 2007
979
173
I've seen maybe a slight increase in drain when the screen is on however this mod caused zero extra heat for me. I'm keeping it for now

Sent from my EVO using Tapatalk 2

It hasnt been out long enough for the LTE folks really to make an actual difference. I was hoping to hear from maybe Evo 3d people who switched to lte and see their thoughts on it if they used it on the 3d.
 

Kidromulous

Senior Member
Feb 1, 2011
1,106
298
Durham N.C.
It hasnt been out long enough for the LTE folks really to make an actual difference. I was hoping to hear from maybe Evo 3d people who switched to lte and see their thoughts on it if they used it on the 3d.

I am one of the people who used it on the 3d. It doesn't cause the phone to heat up i put the phone through its paces etc. The performance increase was almost immediately noticeable for me just like with the 3d.

Sent from my EVO using Tapatalk 2
 

wasnt

Senior Member
Dec 10, 2010
162
12
So awesome to see Viperboy has the EVO LTE. Happily running Redline on my 3vo, can't wait to see what he churns out on the LTE. :D
 

_MetalHead_

Senior Member
Jun 30, 2010
6,763
2,747
Portland
If I wanted to do this to my One X, can I just add those two lines in manually? Does anything need to be removed from the script? Is there a specific location that I need to add them or can I just toss them in as the last lines in the file? TIA.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 37
    Hello everybody, here 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 :) Please note: If you are on viperROM, please choose one of the viperROM .zips! There are no memory optimization .zips for viperROM since that is already done in the ROM! 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 ===============
    • HTCdev Unlock (Choose "All Other Supported Models" and follow all the directions, including driver install)
    • Custom recovery - I would recommend TWRP since it doesn't have the /misc issue anymore



    =============== 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
    8
    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)
    7
    I tried the oc module last night and here is what would happen when I would manually insmod:

    Code:
    "root@android:/ # insmod /data/local/krait_oc.ko
    insmod: init_module '/data/local/krait_oc.ko' failed (Exec format error)"

    Took a look at the dmesg, got this:

    Code:
    "krait_oc: disagrees about version of symbol module_layout"

    Hex edited the vermagic number to match our kernel. Kernel info:

    Code:
    "root@android:/ # uname -a
    Linux localhost 3.0.8-01360-g3fd0422 #1 SMP PREEMPT Sat Apr 28 05:10:07 CST 2012 armv7l GNU/Linux"

    The part we care about is "3.0.8-01360-g3fd0422" since that is different from the One X and other phones. Saved after my changes, tried again. Same errors both places. From here, I am not sure what to do. I have reached out to Mike (coolbho3000, dev of setcpu who made the mod) for further help. I will update you guys here when I know something more :)
    6

    Lemme test it manually. You bastards, making me do extra work when I'm trying to work on something else lol I will report back shortly :)
    5
    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 :)