Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,736,594 Members 52,927 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
-viperboy-
Old
(Last edited by -viperboy-; 2nd June 2012 at 10:25 AM.)
#1  
-viperboy-'s Avatar
Recognized Developer - OP
Thanks Meter 12832
Posts: 7,684
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, 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:

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


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 37 Users Say Thank You to -viperboy- For This Useful Post: [ Click to Expand ]
 
-viperboy-
Old
(Last edited by -viperboy-; 2nd June 2012 at 10:27 AM.)
#2  
-viperboy-'s Avatar
Recognized Developer - OP
Thanks Meter 12832
Posts: 7,684
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 ]
 
flex360
Old
#3  
flex360's Avatar
Senior Member
Thanks Meter 6061
Posts: 3,908
Join Date: Sep 2010
you rocking man
gonna give it a guinea pig test
 
RegnierD
Old
#4  
RegnierD's Avatar
Recognized Contributor
Thanks Meter 400
Posts: 1,580
Join Date: Sep 2010
Location: Worthington, OH
Thinning this now. Seems pretty smooth. Played a couple games real quick and everything worked well. I'll report on battery life.

Tapatalked from my shiny new HTC Evo LTE
Having problems with root/S-Off on your DInc2? Visit my help thread here!

Device: HTC One M8
ROM: Stock International
Kernel: Bundled w/rom
Recovery: Latest TWRP
Device History:
HTC Droid Incredible -> Samsung Fascinate -> LG Revolution -> HTC Droid Incredible 2 -> HTC Evo 3D -> HTC Evo 4G LTE -> Samsung Galasy S III -> Samsung Galaxy SIV -> LG Nexus 4 -> HTC One M8
 
Towleeeie9613
Old
#5  
Towleeeie9613's Avatar
Senior Member
Thanks Meter 3
Posts: 103
Join Date: Jan 2011
Trying it out now. It sounds like a good idea, so I figure why not?
LG Nexus 4 from T-Mobile
ROM:AOSPA 3+ 4.3 builds
Kernel:Franco.Kernel
Hardware:Ver. 0003
Recovery:TWRP
Samsung GSII Epic 4G Touch (brother's)
ROM:CM10.1
Kernel:CM Kernel
Recovery:CWM
htc Evo 4G (retired)
ROM:CM9
Kernel:Tiamat 4.1.0
Hardware:Ver. 0003
Recovery:Amon Ra 2.3
htc Desire CDMA (mom's)
ROM:CM 7.2
Kernel:CM Kernel
Recovery:CWM
htc Sensation (retired)
ROM:CM10
Kernel:CM Kernel
Recovery:CWM
 
ryanalan82
Old
#6  
ryanalan82's Avatar
Senior Member
Thanks Meter 187
Posts: 806
Join Date: Oct 2008
+1, flashing now. Time to start seeing what these can do.

Swyped from my eVo
eVo 4g lte, S-Off, Rooted, M4 superjelly, mount point swapper hack, TWRP 2.5.0.0, 64 GB class 6 SanDisk sd card, cpu 1.5, gpu o/c 512/320, fiops i/o scheduler,2048 sd speed, otg enabled. phone is very very full and still blazing fast! Quadrant over 7400's!
 
supers2k
Old
#7  
supers2k's Avatar
Senior Member
Thanks Meter 58
Posts: 228
Join Date: Dec 2008
Location: Chino Hills, Calif
Can you guys do this, and run quadrant I remember the evo3d would go from 2700 --> 3100 just from doing this mod.
 
-viperboy-
Old
#8  
-viperboy-'s Avatar
Recognized Developer - OP
Thanks Meter 12832
Posts: 7,684
Join Date: Jun 2007
Location: PA

 
DONATE TO ME
Quote:
Originally Posted by supers2k View Post
Can you guys do this, and run quadrant I remember the evo3d would go from 2700 --> 3100 just from doing this mod.
If someone posts Quadrant (or other benchmarks) before and afters, I will post them up here, even though I don't believe in benchmarks...
The Following 2 Users Say Thank You to -viperboy- For This Useful Post: [ Click to Expand ]
 
ticklemepinks
Old
(Last edited by ticklemepinks; 30th May 2012 at 06:48 AM.)
#9  
ticklemepinks's Avatar
Senior Member
Thanks Meter 434
Posts: 1,157
Join Date: Feb 2008
Quote:
Originally Posted by -viperboy- View Post
If someone posts Quadrant (or other benchmarks) before and afters, I will post them up here, even though I don't believe in benchmarks...
I will hold on
Edit- yay not worth posting, only a 100 better
ticklemepinks nuff said sweetie!
 
Kidromulous
Old
#10  
Kidromulous's Avatar
Senior Member
Thanks Meter 285
Posts: 1,033
Join Date: Feb 2011
Location: 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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes