Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
-viperboy-
Old
(Last edited by -viperboy-; 2nd June 2012 at 10:29 AM.)
#1  
-viperboy-'s Avatar
Recognized Developer - OP
Thanks Meter 11876
Posts: 7,464
Join Date: Jun 2007
Location: PA

 
DONATE TO ME
Smile [MOD][Updated 6.2.12]Dual Core Mod v2.1 - Screen Profiles, Auto Tweak, and 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:
=============== 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
The Following 38 Users Say Thank You to -viperboy- For This Useful Post: [ Click to Expand ]
 
-viperboy-
Old
(Last edited by -viperboy-; 2nd June 2012 at 10:29 AM.)
#2  
-viperboy-'s Avatar
Recognized Developer - OP
Thanks Meter 11876
Posts: 7,464
Join Date: Jun 2007
Location: PA

 
DONATE TO ME
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)
The Following 8 Users Say Thank You to -viperboy- For This Useful Post: [ Click to Expand ]
 
fluxgfx
Old
#3  
Senior Member
Thanks Meter 66
Posts: 620
Join Date: Jun 2011
Location: Ottawa

 
DONATE TO ME
I just downloaded the full set of mod for the device and just flashed it. Will see what happens!
Phone: Galaxy Note 2
Carrier: Bell
Root status: Rooted
Rom: Carbon
Retired devices: HDZ, Xperia Arc, Xperia Arc S, HTC One X, HTC One X+, Samsung Galaxy S. Samsung Galaxy S3, Nexus 4
 
-viperboy-
Old
#4  
-viperboy-'s Avatar
Recognized Developer - OP
Thanks Meter 11876
Posts: 7,464
Join Date: Jun 2007
Location: PA

 
DONATE TO ME
Quote:
Originally Posted by fluxgfx View Post
I just downloaded the full set of mod for the device and just flashed it. Will see what happens!
If you're just looking for a "set it and forget it", I would download Dual Core Mod v2 w/ Screen Profiles AND Auto Tweaking Script AND Memory Optimizations, personally. This should give you the best performance, battery life, and smoothness - especially since it handles the memory issue!
The Following User Says Thank You to -viperboy- For This Useful Post: [ Click to Expand ]
 
fluxgfx
Old
#5  
Senior Member
Thanks Meter 66
Posts: 620
Join Date: Jun 2011
Location: Ottawa

 
DONATE TO ME
Way ahead of you. It's already been flashed :P
Phone: Galaxy Note 2
Carrier: Bell
Root status: Rooted
Rom: Carbon
Retired devices: HDZ, Xperia Arc, Xperia Arc S, HTC One X, HTC One X+, Samsung Galaxy S. Samsung Galaxy S3, Nexus 4
 
-viperboy-
Old
#6  
-viperboy-'s Avatar
Recognized Developer - OP
Thanks Meter 11876
Posts: 7,464
Join Date: Jun 2007
Location: PA

 
DONATE TO ME
Quote:
Originally Posted by fluxgfx View Post
Way ahead of you. It's already been flashed :P
Good work! Atleast I know it worked to flash! Just double check that you have dcmhelper in /system/bin, if you'd like. But I'm sure it's there!
 
fluxgfx
Old
#7  
Senior Member
Thanks Meter 66
Posts: 620
Join Date: Jun 2011
Location: Ottawa

 
DONATE TO ME
I can confirm that it is there.

Quote:
Originally Posted by -viperboy- View Post
Good work! Atleast I know it worked to flash! Just double check that you have dcmhelper in /system/bin, if you'd like. But I'm sure it's there!
Phone: Galaxy Note 2
Carrier: Bell
Root status: Rooted
Rom: Carbon
Retired devices: HDZ, Xperia Arc, Xperia Arc S, HTC One X, HTC One X+, Samsung Galaxy S. Samsung Galaxy S3, Nexus 4
 
-viperboy-
Old
#8  
-viperboy-'s Avatar
Recognized Developer - OP
Thanks Meter 11876
Posts: 7,464
Join Date: Jun 2007
Location: PA

 
DONATE TO ME
Quote:
Originally Posted by fluxgfx View Post
I can confirm that it is there.
Great, thanks! You can use SystemPanel to check for the second core running when screen on. If you want to manually check if the core is on or off via adb (since you can manipulate the screen and still get the info you need), do this:

Code:
adb shell
cat /sys/devices/system/cpu/cpu1/online
This will read 0 if the 2nd core is off, 1 if it is on
 
corythug
Old
#9  
corythug's Avatar
Senior Member
Thanks Meter 201
Posts: 1,521
Join Date: Aug 2011
Location: PA
Will check this out soon, thanks for this. Anyone who already is toying with it, does it effect the multitasking at all. By this I mainly mean does Pandora, slacker, 8tracks etc skill skip tracks.

Maybe this doesn't even do this but that's what I thought memory management might help when I read it. Tia .

Sent from my HTC One X using Tapatalk 2
 
warri
Old
#10  
warri's Avatar
Senior Member
Thanks Meter 31
Posts: 949
Join Date: Jan 2009
Location: Jupiter

 
DONATE TO ME
Thanks for this Viper. Just flashed the Fully loaded baby. Will report on my results after some time playing wih the phone.

-Dave
Follow me on Twitter: w4rri
Hit Thanks If I was helpful

Galaxy S3 - TaskAOKP


Retired:
HTC One XL - CM10
Captivate - ICS AKOP - Glitch
HTC FUZE - ENERGY ROM -Raphael Cookie Reference

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...