Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP -viperboy-

1st June 2012, 12:35 PM   |  #1  
-viperboy-'s Avatar
OP Recognized Developer
Flag PA
Thanks Meter: 12,909
 
7,699 posts
Join Date:Joined: Jun 2007
Donate to Me
More
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:

Quote:

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


Quote:

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



Quote:

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



Quote:

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

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



Quote:

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


Quote:

=============== Downloads ===============

Dual Core Mod v2.1 Ultimate
Dual Core Mod Back to Stock


Quote:

=============== 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 by -viperboy-; 11th February 2013 at 12:50 AM.
The Following 37 Users Say Thank You to -viperboy- For This Useful Post: [ View ]
1st June 2012, 12:36 PM   |  #2  
-viperboy-'s Avatar
OP Recognized Developer
Flag PA
Thanks Meter: 12,909
 
7,699 posts
Join Date:Joined: Jun 2007
Donate to Me
More
More Info

Quote:

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


Quote:

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

Quote:

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

Quote:

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.


Quote:

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

Quote:

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


Quote:

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

Quote:

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.


Quote:

=============== 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 by -viperboy-; 2nd June 2012 at 11:30 AM.
The Following 7 Users Say Thank You to -viperboy- For This Useful Post: [ View ]
1st June 2012, 01:27 PM   |  #3  
plakers's Avatar
Senior Member
Flag Lyon
Thanks Meter: 106
 
476 posts
Join Date:Joined: Apr 2011
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
1st June 2012, 01:43 PM   |  #4  
torxx's Avatar
Senior Member
Thanks Meter: 21,651
 
8,033 posts
Join Date:Joined: Mar 2011
Donate to Me
More
Nice, good job!
1st June 2012, 02:15 PM   |  #5  
Senior Member
Thanks Meter: 83
 
567 posts
Join Date:Joined: Dec 2011
More
Would these mods have any effect on custom roms like Lee Droid's and torxx
1st June 2012, 02:29 PM   |  #6  
plakers's Avatar
Senior Member
Flag Lyon
Thanks Meter: 106
 
476 posts
Join Date:Joined: Apr 2011
Quote:
Originally Posted by snwman

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?
1st June 2012, 02:32 PM   |  #7  
Reviewers's Avatar
Senior Member
Flag New York
Thanks Meter: 1,670
 
3,047 posts
Join Date:Joined: Mar 2011
More
Thanks to me ;) Well he came here
1st June 2012, 04:06 PM   |  #8  
plakers's Avatar
Senior Member
Flag Lyon
Thanks Meter: 106
 
476 posts
Join Date:Joined: Apr 2011
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 by plakers; 1st June 2012 at 04:43 PM.
1st June 2012, 04:46 PM   |  #9  
-viperboy-'s Avatar
OP Recognized Developer
Flag PA
Thanks Meter: 12,909
 
7,699 posts
Join Date:Joined: Jun 2007
Donate to Me
More
Quote:
Originally Posted by plakers

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?
The Following User Says Thank You to -viperboy- For This Useful Post: [ View ]
1st June 2012, 07:52 PM   |  #10  
avetny's Avatar
Senior Member
Flag Private Island.
Thanks Meter: 1,606
 
5,003 posts
Join Date:Joined: Jul 2010
More
Exclamation
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 by avetny; 1st June 2012 at 07:55 PM.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes