View Single Post
  #146 (permalink)  
Old 05-26-2011, 03:25 PM
mchaos's Avatar
mchaos
Lurker
Offline
 
Join Date: May 2011
Posts: 10
Reputation: 0
mchaos is a n00b
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: [Kernel] Ziggy471 MECHA BETA Kernel UPDATED 3 May 11

Quote:
Originally Posted by wraithdu View Post
I think I found a bit of a bug. For some reason, I can't disable a specific freq from an init.d startup script. I started using the script in place of SetCPU, but had to fall back to running the freq disable part on-demand after each boot. Here's the script that doesn't work:

Code:
#!/system/bin/sh

echo "smartass" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "122880" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo "1036800" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/user_freqs
#this next line does nothing on boot
#if i manually run this script post-boot, it works correctly
#and disables the 184320 freq
echo 184320 > /sys/devices/system/cpu/cpu0/cpufreq/user_freqs
I don't think this is a bug per say. What every Ziggy did to accomplish this is some sort of program or script. When you run it with 1 it disables everything out side of the policy. When the command is introduced, it runs what ever he wrote to do the job. You are essentially running a command with a function. After that line runs, it goes to the next line without pause because it has already set what ever script or program into action. So it jumps to the line where you want to disable a particular freq and because what every is working to disable freqs outside the policy is going, it supersedes that final line.

Normally this wouldn't be a problem because the initial command would be completed quickly, but because its running at start up and under load, things are multitasking very quickly and things slow down and they overlap.

IMO you have 2 solutions. Ad a sleep in there for a second or 2, or you can disable each freq individually as opposed to using the 1 switch to automatically do it for you.

I wouldn't call it a bug. I would call it a timing issue.

For the heck of it, make it sleep for 2 seconds before running that last string and see if the problem goes away.

But honestly, weather you use the 1 switch or you write a line for each freq you would like to disable its going to take the same amount of time. Using the 1 switch probably runs some code that does the same thing as writing each line in a script. You might as well just write a line for each freq. You would never notice a time difference, and you would never have to see it after unless you would like to change it.

I just wrote out each line in mine. At the time I was toying with a script that would do it for you. Still have it on the back burner. But what it would do is ask you what you want to set your min and max, and then if you wanted to disable all other freqs, and if there were any other freqs you would like to disable, and then it would automatically generate the script and dump it into the init.d folder for you. Was really just doing it for fun. If I ever do write it I will post it up.

the previous script I tossed up is great for quick toggling of freqs when you are trying to figure out where you want to run your TB.

Last edited by mchaos; 05-26-2011 at 03:31 PM.
Reply With Quote