Guest lee89b Posted April 28, 2011 Report Posted April 28, 2011 (edited) I wonder how can I change the cpu governer and the clock speed permanently e.g. having smartass governer at max clock speed of 710mhz, without the need of app such as setcpu etc? I understand that it is more convenient to use such app as oppose to changing the file system etc, but I found having these extra apps launching at startup slows down the startup process a bit. And I don't use the profiles anyway. Currently on SS rls5 gen1 Cheers. Edited April 28, 2011 by lee89b
Guest Jetba Posted April 28, 2011 Report Posted April 28, 2011 i dont think there is. cm7 has build-in, but ss doesnt have.
Guest lee89b Posted April 28, 2011 Report Posted April 28, 2011 as in when the ss rls2 or 3 was released, it was overclocked as default to 652mhz with smartass governer. something like that. Does it involve works that only developers-level can change?
Guest Len Ash Posted April 28, 2011 Report Posted April 28, 2011 (edited) I wonder how can I change the cpu governer and the clock speed permanently e.g. having smartass governer at max clock speed of 710mhz, without the need of app such as setcpu etc? I understand that it is more convenient to use such app as oppose to changing the file system etc, but I found having these extra apps launching at startup slows down the startup process a bit. And I don't use the profiles anyway. Currently on SS rls5 gen1 Cheers. PROVIDING the kernel hasn't been hacked too much... Normally, the CPU limits are prescribed in /bin/userinit.sh thus: (The min CPU freq is set to 122.88MHz, the max is 600MHz in this example) # Cpu min frequency echo 122880 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq #echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # Cpu max frequency #echo 480000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 652800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 672000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 691200 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 710400 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 729600 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 748800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 768000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 787200 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 806400 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq Whilst the scaling governor is described and set in /etc/init.qcom.post_boot.sh thus: for a stock ROM (the scaling governor is ondemand, the CPU load sampling rate is 0.5sec, the lowest CPU freq is 245.76MHz, the CPU will ramp to fmax when the CPU load exceeds 90%) echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold echo 30 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/down_differential echo 500000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq or for a lower "idle" CPU frequency (the scaling governor is ondemand, the CPU fmin is now 122.88MHz) echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor #echo "smartass" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold echo 30 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/down_differential echo 500000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate #echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq echo 122880 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq So by carefully commenting the two files in or out, and staying within limits, you should be able to set the scaling governor type (including conservative etc), the min and max frequency of the CPU and the scaling profile. You will need a "setCPU" type app to monitor the effect until you have the settings you want and can actually read and act on them as required. You can have some serious fun with this... I do. Edited April 28, 2011 by Len Ash
Guest lee89b Posted April 28, 2011 Report Posted April 28, 2011 PROVIDING the kernel hasn't been hacked too much... Normally, the CPU limits are prescribed in /bin/userinit.sh thus: (The min CPU freq is set to 122.88MHz, the max is 600MHz in this example) # Cpu min frequency echo 122880 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq #echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # Cpu max frequency #echo 480000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 652800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 672000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 691200 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 710400 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 729600 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 748800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 768000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 787200 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #echo 806400 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq Whilst the scaling governor is described and set in /etc/init.qcom.post_boot.sh thus: for a stock ROM (the scaling governor is ondemand, the sampling rate is 0.5sec, the lowest CPU freq is 245.76MHz, the CPU will ramp to fmax when the CPU load exceeds 90%) echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold echo 30 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/down_differential echo 500000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq or for a lower "idle" CPU frequency (the scaling governor is ondemand, the CPU fmin is now 122.88MHz) echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor #echo "smartass" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold echo 30 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/down_differential echo 500000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate #echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq echo 122880 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq So by carefully commenting the two files in or out, and staying within limits, you should be able to set the scaling governor type (including conservative etc), the min and max frequency of the CPU and the scaling profile. You will need a "setCPU" type app to monitor the effect until you have the settings you want and can actually read and act on them as required. You can have some serious fun with this... I do. Cheers LanceH I'll try this carefully. FYI I'm using your remixed ss rls5 :mellow: Thanks very much!!
Guest Len Ash Posted April 28, 2011 Report Posted April 28, 2011 (edited) Cheers LanceH I'll try this carefully. FYI I'm using your remixed ss rls5 :mellow: Thanks very much!! Take care... don't go mad with the max freq. Far better to work up slowly. It takes patience. I tend to temporarily use set CPU or similar to get the result I want (to really test battery life and behaviour takes ages) and then replicate the results in the 2 files and bin the app. Some ROMs are not suitable. I think SS5 is OK (Gen 1 certainly) Edited April 28, 2011 by Len Ash
Guest Len Ash Posted April 28, 2011 Report Posted April 28, 2011 (edited) To emulate kk's original, but using the ondemand governor rather than the smartass, I would try: userinit.sh # Cpu min frequency echo 122880 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # Cpu max frequency echo 652800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq (you can keep the whole range of frequencies and just comment them out if preferred, of course) and for the post_boot.sh: echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold echo 30 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/down_differential echo 500000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate echo 122880 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq EDIT If anyone can point me to the docs that cover "down_differential", please do. My Debian forum prescence hasn't helped either! Edited April 28, 2011 by Len Ash
Guest lee89b Posted April 28, 2011 Report Posted April 28, 2011 Mr LanceH, This is briliant! exactly what I need. I appreciate your help so much. Max overclocking isn't my goal, but I'll probably play around it. From there, is it possible to change the voltage of the cpu i.e. for undervolting? or does that involved deeper kernel related stuff? Thanks
Guest Len Ash Posted April 28, 2011 Report Posted April 28, 2011 Mr LanceH, This is briliant! exactly what I need. I appreciate your help so much. Max overclocking isn't my goal, but I'll probably play around it. From there, is it possible to change the voltage of the cpu i.e. for undervolting? or does that involved deeper kernel related stuff? Thanks Kernel.... for another day!
Guest lee89b Posted April 29, 2011 Report Posted April 29, 2011 Kernel.... for another day! LOL! :mellow: yeah I'll play with clock speed for now. You da man!
Guest Spies Posted May 9, 2011 Report Posted May 9, 2011 (edited) Lance thank you for this informative post, one question though, how would you apply these changes to a zip so I don't have to use terminal to echo the lines into the files? I got it, its the init boot you mention - doh! Edited May 9, 2011 by Spies
Guest unrandomsam Posted May 9, 2011 Report Posted May 9, 2011 No reason you cannot just change it in the kernel config if you want.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now