Related
Many people having issues getting compcache/swap working, so here we go.
Replace the content of your userinit.sh with this code. This code was created by uwonsom and modified by yours truely and lastely by Alapapa. to see the original work click Here.
I've also attached the file ready for you to throw directly into /system/sd.
{from original post}
The current setting enables compcache with backing_swap (a physical partition). It can also be tested with linux-swap only--just comment out lines beginning with insmod, mknod, and swapon /dev/ramzswap0. Then uncomment swapon /dev/block/mmcblk0p3.
If you wish to test it out only with compcache, comment out the insmod line with backing_swap and uncomment the insmod line with disksize_kb.
{/from original post}
Code:
#!/system/bin/sh
##adb push userinit.sh /system/sd/
uname_r=`uname -r`
moddir=`find /system/modules -type d -name $uname_r`
insmod=/system/bin/insmod
$insmod $moddir/compcache/xvmalloc.ko;
#$insmod $moddir/compcache/ramzswap.ko disksize_kb=32768;
$insmod $moddir/compcache/ramzswap.ko backing_swap=/dev/block/mmcblk0p3;
mknod /dev/ramzswap0 b 253 0;
echo 20 > /proc/sys/vm/swappiness;
# Experimental settings
echo 1 > /proc/sys/vm/page-cluster; # default: 3 Changes Page clustering from 8 to 2.
echo 5 > /proc/sys/vm/laptop_mode; # default: 0 Helps keep SSD from getting worn.
echo 5000 > /proc/sys/vm/dirty_expire_centisecs; # default: 3000
echo 800 > /proc/sys/vm/dirty_writeback_centisecs; # default: 500
echo 10 > /proc/sys/vm/dirty_background_ratio; # default: 5
echo 16 > /proc/sys/vm/dirty_ratio; # default: 10
#
swapon /dev/ramzswap0;
#swapon /dev/block/mmcblk0p3;
#Over Clock CPU when in use, puts at lower freq when idol. # if you don't want it.
echo 128000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo 528000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
Edit: Thank Alapapa for the new code, will now work with all versions of CM 3.6.7 and higher!
Thanks! But it's not going to work if Cyanogen changes the kernal again.
2.6.29.6 is current... but probably not for long.
does the attached userinit come with those changes already or do u have to modd theose changes over to it
here's the code that will work if kernel version changes:
Code:
#!/system/bin/sh
##adb push userinit.sh /system/sd/
uname_r=`uname -r`
moddir=`find /system/modules -type d -name $uname_r`
insmod=/system/bin/insmod
$insmod $moddir/compcache/xvmalloc.ko;
#$insmod $moddir/compcache/ramzswap.ko disksize_kb=32768;
$insmod $moddir/compcache/ramzswap.ko backing_swap=/dev/block/mmcblk0p3;
mknod /dev/ramzswap0 b 253 0;
echo 20 > /proc/sys/vm/swappiness;
# Experimental settings
echo 1 > /proc/sys/vm/page-cluster; # default: 3 Changes Page clustering from 8 to 2.
echo 5 > /proc/sys/vm/laptop_mode; # default: 0 Helps keep SSD from getting worn.
echo 5000 > /proc/sys/vm/dirty_expire_centisecs; # default: 3000
echo 800 > /proc/sys/vm/dirty_writeback_centisecs; # default: 500
echo 10 > /proc/sys/vm/dirty_background_ratio; # default: 5
echo 16 > /proc/sys/vm/dirty_ratio; # default: 10
#
swapon /dev/ramzswap0;
#swapon /dev/block/mmcblk0p3;
#Over Clock CPU when in use, puts at lower freq when idol. # if you don't want it.
echo 128000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo 528000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
thanks Alapapa, changed the script uptop and the one attached to your modifed script.
Denkai said:
thanks Alapapa, changed the script uptop and the one attached to your modifed script.
Click to expand...
Click to collapse
De nada...I got the kernel version magic from some thread on here at some point.
Cheers!
Denkai said:
# Experimental settings
echo 1 > /proc/sys/vm/page-cluster; # default: 3 Changes Page clustering from 8 to 2.
echo 5 > /proc/sys/vm/laptop_mode; # default: 0 Helps keep SSD from getting worn.
echo 5000 > /proc/sys/vm/dirty_expire_centisecs; # default: 3000
echo 800 > /proc/sys/vm/dirty_writeback_centisecs; # default: 500
echo 10 > /proc/sys/vm/dirty_background_ratio; # default: 5
echo 16 > /proc/sys/vm/dirty_ratio; # default: 10
#
swapon /dev/ramzswap0;
#swapon /dev/block/mmcblk0p3;
#Over Clock CPU when in use, puts at lower freq when idol. # if you don't want it.
echo 128000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo 528000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
Click to expand...
Click to collapse
Any reason for setting page cluster to 1 instead of 0, as I think i saw earlier in the thread being recommended? Have you had better performance w/ setting it to 1? Thanks
I personally haven't screwed around with the paging. you may get better, you may not.
You could do away with this line since the CPU already scales to 528MHz:
Code:
echo 528000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
Click to expand...
Click to collapse
Add the following.:
Code:
echo 200 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias; # default: 0
#echo 2000000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate; # For build <=3.9.1
"The powersave_bias parameter modifies the behavior of the ondemand governor to save more power by reducing the target frequency by a specified percentage. By default, (powersave_bias = 0), the ondemand governor selects the minimum processor frequency that can still complete a workload with minimal idle time. Doing so should result in the highest performance to power efficiency ratio. In some cases, you might prefer a greater emphasis on power efficiency than performance. In this case, set the powersave_bias parameter to a value between 1 and 1000 to reduce the target frequency by one-thousandth of that value. For example, set powersave_bias to 100 for a one-tenth reduction in target frequency. In this case, if the governor chooses a target frequency of 2 GHz (with powersave_bias = 100), the governor instead will request 1.8GHz – a one-tenth reduction. If 1.8 GHz is an exact match with an available hardware frequency (listed in the scaling_available_freq parameter), the processor is set to this frequency. If 1.8 GHz is not available, the processor fluctuates between the closest available upper and lower frequencies for an average frequency of 1.8 GHz."
If you notice lag, I would set it to 150; 100 was not much of a benefit. 250 will give you longer battery life for sure, but anything over that could result in major lag.
I pushed the file to /system/sd
I run cmd #free and there's 0 under swap
I run cmd #cat /proc/ramzswap and get an error
When I look in /system/sd the userinit.sh file is in lost+found... Did I do something wrong?
bhilgeman said:
I pushed the file to /system/sd
I run cmd #free and there's 0 under swap
I run cmd #cat /proc/ramzswap and get an error
When I look in /system/sd the userinit.sh file is in lost+found... Did I do something wrong?
Click to expand...
Click to collapse
Yeah same here (except my userinit.sh is not being moved to lost+found).
I ensured the permissions were fine... what am I doing wrong?
runderekrun said:
Yeah same here (except my userinit.sh is not being moved to lost+found).
I ensured the permissions were fine... what am I doing wrong?
Click to expand...
Click to collapse
Did you execute it or reboot? Just putting it there does nothing by itself.
In a shell, just do /system/sd/userinit.sh
What happens?
ttabbal said:
Did you execute it or reboot? Just putting it there does nothing by itself.
In a shell, just do /system/sd/userinit.sh
What happens?
Click to expand...
Click to collapse
you should not have to execute it.
ttabbal said:
Did you execute it or reboot? Just putting it there does nothing by itself.
In a shell, just do /system/sd/userinit.sh
What happens?
Click to expand...
Click to collapse
uwonsum said:
you should not have to execute it.
Click to expand...
Click to collapse
Yeah I thought Cyanogen's roms would auto-run userinit.sh?
Anyway trying to manually run it just throws up errors.
Is this correct for a linux swap partition?
I was unsure about lines
$insmod $moddir/compcache/xvmalloc.ko;
$insmod $moddir/compcache/ramzswap.ko
Does the $ mean i do not comment them out?
Code:
#!/system/bin/sh
## adb push userinit.sh /system/sd
#insmod /system/modules/lib/modules/2.6.29-cm/compcache/xvmalloc.ko;
#insmod /system/modules/lib/modules/2.6.29-cm/compcache/ramzswap.ko disksize_kb=32768;
#insmod /system/modules/lib/modules/2.6.29-cm/compcache/ramzswap.ko memlimit_kb=32768
#backing_swap=/dev/block/mmcblk0p3;
#insmod /system/modules/lib/modules/2.6.29-cm/compcache/ramzswap.ko
#backing_swap=/dev/block/mmcblk0p3;
#mknod /dev/ramzswap0 b 253 0;
echo 16 > /proc/sys/vm/swappiness; # default: 60
## Experimental settings
echo 1 > /proc/sys/vm/page-cluster; # default: 3
echo 5 > /proc/sys/vm/laptop_mode; # default: 0
echo 5000 > /proc/sys/vm/dirty_expire_centisecs; # default: 3000
echo 800 > /proc/sys/vm/dirty_writeback_centisecs; # default: 500
echo 10 > /proc/sys/vm/dirty_background_ratio; # default: 5
echo 16 > /proc/sys/vm/dirty_ratio; # default: 10
##
#swapon /dev/ramzswap0;
swapon /dev/block/mmcblk0p3;
## Additional experimental settings
echo 128000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq; # default: 245760
##
exit;
## commands to display useful system info
## **Do not uncomment**
# free
# top -m 8; displays only 8 processes
# cat /proc/swaps
# cat /proc/ramzswap0
# cat /proc/meminfo
# sysctl -a | grep vm
# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
# vmstat -d 5 -n 10
Also i am stuck at work, so not ADB for me (don't want to install drivers on work pc)
Can i do this with userinit.sh on root of card
Code:
Code:
# su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# cp /sdcard/userinit.sh /system/sd/userinit.sh
# chmod 755 /system/sd/userinit.sh
ekeefe41 said:
Is this correct for a linux swap partition?
Click to expand...
Click to collapse
Yes, and you should also comment out this backing_swap=/dev/block/mmcblk0p3;
uwonsum said:
Yes, and you should also comment out this backing_swap=/dev/block/mmcblk0p3;
Click to expand...
Click to collapse
ok, how about now ^^ i edited it
runderekrun said:
Yeah I thought Cyanogen's roms would auto-run userinit.sh?
Anyway trying to manually run it just throws up errors.
Click to expand...
Click to collapse
You have to execute it somehow. Cyanogen's roms do it on boot, that's why I said "execute OR reboot".
If you can't run it manually, it's probably not working on boot either. What errors is it throwing up?
ekeefe41 said:
ok, how about now ^^ i edited it
Click to expand...
Click to collapse
It's fine the way it is. But if you look at this thread, some of my experimental settings have been implemented into a new userinit.sh script with a user.conf file that makes things so easy where you wont ever have to touch the userinit.sh script.
Now, I have edited this new script. I corrected a line that could potentially pose a problem for people using a different kernel. I also added a few more options to the script that can be set in the user.conf file. I will post it on that thread in a few minutes.
ttabbal said:
You have to execute it somehow. Cyanogen's roms do it on boot, that's why I said "execute OR reboot".
If you can't run it manually, it's probably not working on boot either. What errors is it throwing up?
Click to expand...
Click to collapse
Sorry I missed the reboot comment.
I just don't understand it. It will not run the userinit.sh. It is saying it can't find it. If I try to run it with the wrong permissions it gives me a "Permission denied" but as soon as I chmod it too 755 it suddenly can't find the file...
I accidentally pasted the whole userinit.sh text the shell and it started working, so I have no idea whats wrong with this file. None what so ever.
This module adds to the kernel the possibility of using the 'conservative' scaling governor. It may be a little less responsive than other governors, but may also result in better battery life overall.
This is from the kernel documentation:
"The CPUfreq governor "conservative", much like the "ondemand" governor, sets the CPU depending on the current usage. It differs in behaviour in that it gracefully increases and decreases the CPU speed rather than jumping to max speed the moment there is any load on the CPU. This behaviour more suitable in a battery powered environment."
By default it will try to increase or decrease the CPU in 5% steps, and will tend to raise relatively slowly under load but decrease very quickly when idle. This means the CPU is likely to spend much more time at the lowest frequency (245MHz unless changed), but will offer the highest frequency when required for a longer period (like watching video).
The module in the attached files is compiled for the 2.6.32.15-g6a358a9 HTC kernel (released with 2.10.405.2) and the -gf9c0527 kernel (2.09.405.8).
To load, copy the module in recovery to /system/lib/modules and run:
insmod /system/lib/modules/cpufreq_conservative.ko
And to select run:
echo "conservative" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
The attached update files will either load the module only, or load and select the module (active version).
Source is unmodified from the original, and thus is GPL compliant.
Hmm, great . On leedroid , waiting for yur flashable file
Sent from LeeDroid powered by HTC Sense using XDA App!
Thanks for sharing, it's great
Thanks..will try it
with kind regards...Alex
Tested and it runs fine for me. Sure enough you can see the CPU go up and down gradually as expected if you monitor it.
I've added a version for the -gf9c0527 kernel too. 'Active' versions will select this governor if flashed - custom ROMs may override this, so check your ROM.
I have added it for version g1fc4045, .ko only
cpufreq_conservative_gd96f2c0
added for version gd96f2c0, .ko only
How about g1fc4045?
SkilletDesire said:
How about g1fc4045?
Click to expand...
Click to collapse
Here it is.
How can i make this module to work with screenstate_scaling module?
screenstate_scaling script:
Code:
#!/system/bin/sh
#
# screenstate_scaling - switch CPU frequency governor on screen state change
# by [email protected] (FloHimself) - and modded NeoPhyTe
IWCONFIG=/system/xbin/iwconfig
AWAKE_GOVERNOR="ondemand"
SLEEP_GOVERNOR="ondemand"
(while [ 1 ]
do
AWAKE=`cat /sys/power/wait_for_fb_wake`
if [ $AWAKE = "awake" ]; then
echo $AWAKE_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "998400" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "245000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo "2" > /proc/sys/vm/dirty_background_ratio
echo "5" > /proc/sys/vm/dirty_ratio
echo "3" > /proc/sys/vm/laptop_mode
echo "10000000" > /proc/sys/kernel/sched_latency_ns
echo "4000000" > /proc/sys/kernel/sched_min_granularity_ns
echo "760000" > /proc/sys/kernel/sched_wakeup_granularity_ns
echo "5150" > /proc/sys/kernel/threads-max
echo "20" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
echo "400000" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
echo "0" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias
echo "0" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load
echo "4000" > /proc/sys/vm/dirty_expire_centisecs
echo "9000" > /proc/sys/vm/dirty_writeback_centisecs
$IWCONFIG eth0 txpower 100mW
log -p i -t screenstate_scaling "*** awake ***: switching CPU frequency governor to -> $AWAKE_GOVERNOR"
AWAKE=
fi
SLEEPING=`cat /sys/power/wait_for_fb_sleep`
if [ $SLEEPING = "sleeping" ]; then
echo $SLEEP_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "245000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "245000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo "2" > /proc/sys/vm/dirty_background_ratio
echo "5" > /proc/sys/vm/dirty_ratio
echo "5" > /proc/sys/vm/laptop_mode
echo "6000000" > /proc/sys/kernel/sched_latency_ns
echo "4000000" > /proc/sys/kernel/sched_min_granularity_ns
echo "4000000" > /proc/sys/kernel/sched_wakeup_granularity_ns
echo "4096" > /proc/sys/kernel/threads-max
echo "35" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
echo "800000" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
echo "350" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias
echo "0" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load
echo "40000" > /proc/sys/vm/dirty_expire_centisecs
echo "60000" > /proc/sys/vm/dirty_writeback_centisecs
$IWCONFIG eth0 txpower 10mW
log -p i -t screenstate_scaling "*** sleeping ***: switching CPU frequency governor to -> $SLEEP_GOVERNOR"
SLEEPING=
fi
done &)
i want to make that when the phone is awake 'conservative' scaling governor will run.
Thanks.
You'd have to change AWAKE_GOVERNOR="ondemand" to "conservative". But that is a heavily hacked script and may not work ideally.
how can i test if the module is working?
Hi
I upgraded my phone to the latest OTA (FPS fix) with a vanilla ROM.
The kernel version my phone is running is: 2.6.32.15-ge2fb08e [email protected] #11
Currently from what SetCPU tells me, my only supported governors are:
ondemand, userspace and performance.
Any way for me to add conservative to my kernel for use with SetCPU?
Thanks
Sheldon
Anyone can make the mod for the 2.6.32.15-g5d39305 kernel? (AuraxTSense_7.8.1)
Thanks!
PLEASE!
or at least anyone can explain to me how do i make it myself? Thanks.
please help me make this file.
2.6.32.15-gf5a401c kernel from 2.29.405.2 update
is there conservative goverenor for 2.6.32.15-gf5a401c kernel from 2.29.405.2 official HTC Desire update ?
Tnx.
i'm running dj droid rom 2.29 based, and it has conservative.
Hey guys,
I switched from my HD2 to a Sensation, now running Energy ROM with latest bricked beta kernel and I am very pleased with it.
I want to controll the cpu by writting my own init.d script, like I did eith my hd2, but as the sensation has 2 cores I'm not quite sure what to do.
What I got so far is this:
Code:
echo 192000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 1188000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo smartassV2 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
now I have 2 quesions:
1.) Do I need to do the same for cpu1? like this:
Code:
echo 192000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 1188000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo smartassV2 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 192000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo 1188000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo smartassV2 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
2.) I found this in bricked kernel thread:
Overclocking the second CPU is currently not supported by many apps. (They can't overclock what they can't see, aSMP)
To enforce this with Bricked:
Code:
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 1782000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
CPU1 will shutdown after it is sure that it is not needed anymore. But you can also do:
Code:
echo 0 > /sys/devices/system/cpu/cpu1/online
Right after the both commands above. Then CPU1 will fall asleep.
Click to expand...
Click to collapse
what exactly does cpu1/online =1 do? can't I just set clocks and governor for cpu1 like in my code aboth or shold my script look like this:
Code:
echo 192000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 1188000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo smartassV2 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 192000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo 1188000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo smartassV2 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo 0 > /sys/devices/system/cpu/cpu1/online
thanks for your help in advance!
Alganon said:
Hey guys,
I switched from my HD2 to a Sensation, now running Energy ROM with latest bricked beta kernel and I am very pleased with it.
I want to controll the cpu by writting my own init.d script, like I did eith my hd2, but as the sensation has 2 cores I'm not quite sure what to do.
What I got so far is this:
Code:
echo 192000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 1188000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo smartassV2 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
now I have 2 quesions:
1.) Do I need to do the same for cpu1? like this:
Code:
echo 192000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 1188000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo smartassV2 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 192000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo 1188000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo smartassV2 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
2.) I found this in bricked kernel thread:
what exactly does cpu1/online =1 do? can't I just set clocks and governor for cpu1 like in my code aboth or shold my script look like this:
Code:
echo 192000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 1188000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo smartassV2 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 192000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo 1188000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo smartassV2 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo 0 > /sys/devices/system/cpu/cpu1/online
thanks for your help in advance!
Click to expand...
Click to collapse
There has been much discussion about the aSMP architecture and the fact that CPU1 will try to be off line (0) if possible and wake up when needed (1). I know someone played with:
echo 1 > /sys/devices/system/cpu/cpu1/online
followed by a (or similar chmod):
chmod 400 /sys/devices/system/cpu/cpu1/online
The latter was to try to stop the system switching it off again. TBH I don't know where that technique ended up.
Most folks just use O/C Daemon, FauxClock, SetCPU.... or even the one built into CM7.
You'd be better off asking in the Bricked or Energy forums, I'm sure folks there have tried and/or implmented something similar.
thx for the answer,
I've already postetd a link to this thread in bricked thread, but I didn't want to spam this thread with discussing something that's not kernel or rom related.
i'm fine with cpu1 being oflline when not needed. In fact I like the idea of conserving energy that way.
the quesions is, what happens when cpu1 kicks in? what scalings an governor does it use? the way I see it, the apps you mentioned, can only handle cpu0. and if cpu1 automagically uses the same settings as cpu0 I'm fine with that. But I wanted to make sure of it, so I thought the easiest way of knowing how this stuff is handled, is by writing the app/script that handles cpu myself...
Have a look at FauxClock, the sources are on Github. I use it with the Faux Kernel but I'm not certain how portable it is :-(( I'm sure I had it running when I tried the Bricked kernel, not 100% confident though.
One comment I noticed on his page was:
"- cpu1 does not want to stick. The app is doing it's job and writing the correct values, but for some reason it seems to get bumped back up to the highest frequency after a few seconds. I think this is more on the kernel side. More investigating needs to be done."
http://rootzwiki.com/topic/4550-app09-beta-snapdragon-dual-core-oc-control/
It might be of help, or then again....
I actually have this implemented in my own ROM...
What I did using dxixda's kitchen:
1) Unpack boot.img (option 20) using option "w" (kernel+ramdisk)
2) Open bootcomplete.rc and add this line to the end of the file:
Code:
for x in /system/etc/init.d/*.sh ; do /system/bin/sh $x ; done
3) Save the file
4) Recompile boot.img using option "b"
5) Flash boot.img via fastboot (fastboot flash boot boot.img)
Now you have to throw your commands in a text file and rename it to "script_name.sh", then chmod 777 the init.d folder and all the scripts within. Say, you want cpu0 to boot at 1.512GHZ.. the script will look like this:
Code:
!/system/bin/sh
echo 1512000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
Make sure that your scripts in the init.d folder have the .sh extension or this won't work!!
Hope this answers your question
thx, sounds promising. Unfornunately I'm currently on a business trip, so it might take some days before I can actually test this...
Control CPU without any custom application via Init.d :victory:
Disclaimer :
Code:
Please Note : You are solely responsible for what you do to your phone. I nor XDA are responsible for damage you may cause to your device if you mess up something
Here i present you a technique to control CPU and Dyn Fsync, Vibration on supported kernels & also Voltage.
I have attached the Init.d script you can change vdd, Turn on/off Dynamic Fsync, Change CPU Scaling levels.
Detailed Guide on how to use this is coming soon
Download the attached file rename it to just 99init no extension and save it give it 755 permission. & Restart and see i have edited this for my use and am on my personal build of Phoenix Kernel so experience and usage might change on other kernels.
Detailed Guide
echo 1 > /sys/module/rpm_resources/enable_low_power/L2_cache
echo 1 > /sys/module/rpm_resources/enable_low_power/pxo
echo 1 > /sys/module/rpm_resources/enable_low_power/vdd_dig
echo 1 > /sys/module/rpm_resources/enable_low_power/vdd_mem
echo 1 > /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled
echo 1 > /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled
echo 1 > /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled
echo 1 > /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled
echo 1 > /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/suspend_enabled
echo 1 > /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/suspend_enabled
echo 1 > /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/suspend_enabled
echo 1 > /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/suspend_enabled
echo 1 > /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled
echo 1 > /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled
echo 1 > /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/idle_enabled
echo 1 > /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/idle_enabled
echo 1 > /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled
•>> Enables suspend and sleep modules.( i think so.. :silly: )
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
•>> This tweak sets ondemand as default governor.
echo 80 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
echo 4 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
echo 80 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
echo 3 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
echo 918000 > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
echo 918000 > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
echo 80 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
•>> Sets advanced options of ondemand Gov
echo 1188000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1188000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo 384000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 384000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
•>> Sets Min/Max frequencies respectively. for both the CPU's
chown system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chown system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
chown system /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
chown system /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
chown root.system /sys/devices/system/cpu/mfreq
chmod 220 /sys/devices/system/cpu/mfreq
chown root.system /sys/devices/system/cpu/cpu1/online
chown root.system /sys/devices/system/cpu/cpu2/online
chmod 664 /sys/devices/system/cpu/cpu1/online
chmod 664 /sys/devices/system/cpu/cpu2/online
•>> Sets Permissions
echo 18 > /sys/devices/virtual/timed_output/vibrator/level
•>> Vibration Control on supported kernels, Supported in Phoenix Kernel
vdd=-62500
echo ${vdd} > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "All voltages changed by ${vdd}" > /data/local/tmp/vdd.txt
•>> Voltage Control Script, It has been set to max UV by defaule i.e. -62 mV
Note : As the Name suggests its init.d script saved in etc/init.d folder set the permission of the script to 755.
Added Detailed info
I have added detailed info on each individual script :good: , All of the above scripts have been tested on my Sony Xperia L C2104 running my personal build of Phoenix Kernel
you don't mention where to save it on the phone....
Its init.d script
getochkn said:
you don't mention where to save it on the phone....
Click to expand...
Click to collapse
Actually as the Name suggests its init.d script saved in etc/init.d folder set the permission of the script to 755.
Gonna try this!
Sent from my C2105 using XDA Premium 4 mobile app
try it
abielzuliom said:
Gonna try this!
Sent from my C2105 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Try it and report back
first we have to enable init.d dude with universal init.d app
yep
yash989 said:
first we have to enable init.d dude with universal init.d app
Click to expand...
Click to collapse
Yep if you are on a kernel that doesnt have init.d support which might be weird :silly:
I'm trying to make a script for my kernel settings on boot but can't seem to get them to apply it only applies the GPU clock, the max frequency, and voltage table. The CPU boost speeds, the go hispeed load value, and my I/o settings don't however. Is there something I'm doing wrong? At the end of the script I even have a line for it to create a text file verifying that the script ran but it in fact does not. There is no other kernel apps set to run at boot, and I've tried editing a vomertweaks zip with my settings and it won't apply either. Can anyone give me some tips?
Code:
#!/system/bin/sh
# CPU
echo 1267200 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1267200 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo 1267200 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
echo 1267200 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
# GPU
echo 330000000 > /sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/max_gpuclk
# CPU Boost
echo 1036800 > /sys/module/cpu_boost/parameters/input_boost_freq
echo 960000 > /sys/module/cpu_boost/parameters/sync_threshold
# Governor
echo 120000 > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo 97 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo 1190400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 10000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 93 > /sys/devices/system/cpu/cpufreq/interactive/target_loads
# Hotplug
echo 95 > /sys/devices/virtual/misc/mako_hotplug_control/load_threshold
# I/O Scheduler
echo row > /sys/block/mmcblk0/queue/scheduler
echo 1024 > /sys/block/mmcblk0/queue/read_ahead_kb
# Vibration
echo 20 > /sys/devices/virtual/timed_output/vibrator/vtg_level
# DISABLED:
# FSYNC System Call
#echo N > /sys/module/sync/parameters/fsync_enabled
#
# Voltage
echo "700 700 700 700 710 720 730 750 760 790 800 830 875 935 970" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
#
echo " ~ franco Tweaks Applied! ~ " > /sdcard/FKU.txt;