[Q] Setting CPU governor to stop music clicking? - Desire Q&A, Help & Troubleshooting

I have a small question regarding setting a CPU Governor. I searched for a while but couldn't find any answer.
I am running AcesMod007-Lite, which has the cpu governor set to smartass. It seems to be okay, but especially when playing music it has some trouble, because it is trying to save too much battery. The music has a small click now and then. And i'm hoping changing the governor will help (if it won't please say so, then I can stop trying ).
So I want to change it to Interactive. This should be possible according to the ROM description (- Available Freqs: CPU interactive, smartass, powersave, ondemand, performance - by snq-)
What I tried to change it:
In recovery (after mounting system):
adb shell echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
(Here I got an error: The system can't find the specified path)
adb echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
(Same error)
adb pull /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor G:\
(This wrote a file with userspace? I changed it to interactive, then pushed it)
adb push G:\scaling_governor /sys/devices/system/cpu/cpu0/cpufreq/
(Upon reboot I checked it, and it was set back to smartass)
When the phone was on:
I tried thesame as in recovery, and got the same errors, only when using adb pull, the content of the file was "smartass".
Does anybody have an idea how to make this work?

I don't have Ace on my phone at the minute, but from what I remember I'm pretty sure there's a scaling script in the system/etc/init.d folder. Use root explorer or similar and long press, open with text editor, then change smartass to the governor you want.
Reboot the phone and it should now be using the one you selected, I hope

Use ondemand governor. Also had problems with music playing with smartass governor in other roms. After switching to ondemand they never occurred again.
Swyped from Oxygen with Transparent XDA App

@mick
Thanks! You were right. Now it automatically switches to ondemand (thanks MatDrOiD).
But for some reason the music still clicks . Should I increase the processor max freq for screen off, or does anybody know any other solutions?

I dont really know any other solution other than to ask, did you change both governors, screen on and screen off?
btw the screen off I use "min 128000" and "max 384000"
yes, try upping the max til the clicking stops

Yes I did changed them both.
My frequencies are for screenoff (in that same file):
SLEEP_GOVERNOR_FREQUENCY_MIN="245000"
SLEEP_GOVERNOR_FREQUENCY_MAX="384000"
So I think that should be okay.
Somewhere I read that it was an possible issue with every Sense HD ROM, because there was an error in the HTC code. Then it would be unsolvable.
I am going to try setting the min to 128, maybe that magically helps.

PerfectLight said:
Somewhere I read that it was an possible issue with every Sense HD ROM, because there was an error in the HTC code. Then it would be unsolvable.
Click to expand...
Click to collapse
I use insertcoin at the moment and don't notice it.
It might not be the cpu settings, I don't know what else is tweaked in the rom, but if there are other things then it could possibly be that, memory etc.
I'm pretty sure I read in the thread when I used Aces that installing setcpu would disable the scaling script. Maybe install it and see if your problem clears, nothing to lose

It has been solved! I now use a different build.prop, which seems optimized in some way.
The clicking is gone, and the entire phone seems more responsive .
Thanks for the great help!

Related

[INITSCRIPT] screenstate_scaling - switch CPU freq governor on screen state change

Attached init script changes the CPU frequency governor based on the screen state:
Code:
screen on -> interactive governor
screen off -> powersave governor
Don't use this with SetCPU!
Thanks NeoPhyTe.x360 for the idea...
Edit:
This script is released to public domain, so it can be freely used for derivative works without permission!
Good thinking!
Thanks for sharing.
do we flash this in clockwork?
bradputt said:
do we flash this in clockwork?
Click to expand...
Click to collapse
Nope, it's just a init script for the ROM devs...
but is possible to applu in a rooted phone simply copying to /systen/etc or nope? needs setcpu or works without?
thx
Awesome work you do
+10
This is supercool, we wont need to use SETCPU anymore, just flash this and enjoy super battery life, big thanks FloHimself!
bartito said:
but is possible to applu in a rooted phone simply copying to /systen/etc or nope? needs setcpu or works without?
thx
Click to expand...
Click to collapse
You can push this script to /system/etc/init.d but it has some dependencies e.g. the interactive governor, perflock disabler when you want to underclock, ...
NeoPhyTe.x360 said:
Awesome work you do
+10
Click to expand...
Click to collapse
It was your idea, so same goes to you!
ivicask said:
This is supercool, we wont need to use SETCPU anymore, just flash this and enjoy super battery life, big thanks FloHimself!
Click to expand...
Click to collapse
That's the reason we are doing it this way: make the governor switching a bit more low level without SetCPU. But remember, this is not a update.zip and not flashable from recovery...
nice work. i really appreciate this. lets hope all the devs see this
FloHimself said:
Attached init script changes the CPU frequency governor based on the screen state:
Code:
screen on -> interactive governor
screen off -> powersave governor
Don't use this with SetCPU!
Thanks NeoPhyTe.x360 for the idea...
Click to expand...
Click to collapse
Useless... Interactive governor sets low speed when idle.
sbricout said:
Useless... Interactive governor sets low speed when idle.
Click to expand...
Click to collapse
You are right, the interactive governor sets the lowest speed when idle. But idle != screen off.
sbricout said:
Useless... Interactive governor sets low speed when idle.
Click to expand...
Click to collapse
Applications and services can still ramp up the CPU speed during the screen being off, so not useless at all. Switching to the powersave governor for when the screen is off, will stop it ramping up during this time.
I modified the script abit to include frequencies for min and max.
http://linux-box.nl/~sjoer/90screenstate_scaling
sfjuocekr said:
I modified the script abit to include frequencies for min and max.
http://linux-box.nl/~sjoer/90screenstate_scaling
Click to expand...
Click to collapse
Nice, that`s something I`ve done later, too :
http://dl.dropbox.com/u/31174/android/90screenstate_scaling
Thought about extending it some more...
don't punch me, but... how can this be installed?
Kinda complicated, you`ll need a modified init.rc to run the scripts from /system/etc/init.d/ at startup, you have to push the governor modules and perflock_disabler module compiled for your kernel in /system/lib/modules/ the insmod scripts for the governors, perflock_disabler script and the script above to /system/etc/init.d/
FloHimself thank you very much for the scripts and the modules.
Is it me or is this script constantly looping with no breaks/sleeps?
I've installed Neophytes' ArauxtSense 7.1 rom and he already added this on his rom. The question is, do I have to uninstall my SetCPU now? I have my referred settings on it and don't know how to disable it. I have unchecked the "Set on Boot" but everytime I boot my device, I can see that the SetCPU is still running on the background. Any advice? Any risks when having them both?
sub0min0us said:
I've installed Neophytes' ArauxtSense 7.1 rom and he already added this on his rom. The question is, do I have to uninstall my SetCPU now? I have my referred settings on it and don't know how to disable it. I have unchecked the "Set on Boot" but everytime I boot my device, I can see that the SetCPU is still running on the background. Any advice? Any risks when having them both?
Click to expand...
Click to collapse
There shouldn't be any risks, but one of them will force its set freq, and the other one will be constantly changing it
Sent from my HTC Desire using XDA App
Thanks for clearing that out. I guess I'll have to uninstall it then not unless I install another rom. Thank you...

Still problems with Desire and blackscreen

Hi folks!
I´ve installed the latest LeeDroid with full wipe and got the problem, that the display often don´t wake up from standby. The touchscreen works, but it won´t wake up.
Then i tried to install the latest radio version and flashed/wiped again. Still the same problem.
So i tried to flash CyanogenMod7 with GAPPS, but the same error is still available. Never had that problem with original rom.
What should i try next?
What radio do you have/flashed.
Maybe try a different kernel.
Now i´ve installed radio: 5.17.05.23
Before i had installed 5.17.05.08. I got the problems with both radio versions.
Version of kernel is 2.6.37.6-cyanogenmod-g37556d9 [email protected] #1
Where can i download suitable kernel versions?
AOSP Kernels - in the developement section.
http://forum.xda-developers.com/showpost.php?p=12350779&postcount=3
Are you using any program to control CPU? You can try SetCPU and use a screen-off profile.
I didn´t use this tools before, but now i´ve installed Set CPU for root users.
I´m now in the menu and see the the profile screen-off, but i don´t know what i should configure there?! What does that tool with screen-off do?
Update:
Made a profile with screen off with 245 max/min. Enabled it!
Anything else to do?
Which kernel you would prefer for my desire gsm?
Okay, first of all - set the main frequencies.
Depends on ROM, I have 384-998 Ondemand.
Then go to profiles, click enable.
Click add profile, then select:
Profile: Screen OFF
Max: 245
Min: 128
Scaling: Ondemand (but you can play around with that)
Priority: 100
Maybe, you must adjust higher frequencies, but play around with it a little.
Profile: Screen OFF
Max: 245
Min: 245 (minimum is 245, i can´t configure it to 128)
The display bug is still available!
Set max to 368. Seems as if your desire can't handle 245/245.
Swyped from Oxygen with Transparent XDA App
Update!
Now i wiped and installed CyanogenMod7 RC1 again with Gapps. I didn´t install any other Apps, so i can be shure, that no app cause this display problem.
I can´t reproduce the problem again. I need more time for testing, but at this time it seems that there is a problem with any installed app.
Set CPU is disabled!
Update:
Problem is here again!
Now i´m testing the suggestion of Mr. MatDrOiD!
Which governor do you use?
Swyped from Oxygen with Transparent XDA App
i use "Set CPU".
It feels like, the chance my Display wake up from standby is now bit higher and better, but the problem still exists.
Heavymaxx said:
i use "Set CPU".
It feels like, the chance my Display wake up from standby is now bit higher and better, but the problem still exists.
Click to expand...
Click to collapse
No, i mean the governor, not the software. The governors are the controllers for the regulation of the cpu frequencies (how fast it increases and decreases). Most available governors are "ondemand", "performance", "powersave", "interactive" and "smartass". So what governor do you use?
According to your experiences, setcpu is probably the crux of matter.
I can't be 100% I had the same issue as you, but when I used to use CM7 or Redux I did have problems with black screens and unresponsive touchscreen (in that order respectively). Didn't happen on Sense at all.
But now I've been on Oxygen for close to two weeks and I haven't had any of those symptoms since. I think all the hacks they include in CM7 and other custom ROMS is to blame. Perhaps give Oxygen a try to rule it out, as it's an almost pure AOSP ROM. Don't run Setcpu either on it.
MatDrOiD said:
No, i mean the governor, not the software. The governors are the controllers for the regulation of the cpu frequencies (how fast it increases and decreases). Most available governors are "ondemand", "performance", "powersave", "interactive" and "smartass". So what governor do you use?
According to your experiences, setcpu is probably the crux of matter.
Click to expand...
Click to collapse
Ah ok! I use "ondemand".
I would not use SetCPU if i would have no problems. I´m testing around, BECAUSE i have problems.
@Salty: Thanks for the fish! I got the same problem on LeeDroid too. IDC what Rom i use. It should be up to date and should support App2SD+, i need more internal memory, that´s all.
Amoled Display got changed - everything works fine!
Just wanted to finish this thread with a solution!
Thanx!
**CLOSED**

SetCPU... is it needed for CM7?

I searched for answers but didn't get satisfactory results, so I wanna ask my G2 peeps.
CM7 has an OC daemon, right?
Since it does, is SetCPU still needed?
How does one configure the OC daemon with profiles for screen off, battery>50% etc etc?
I am running CM7.1
convolution said:
I searched for answers but didn't get satisfactory results, so I wanna ask my G2 peeps.
CM7 has an OC daemon, right?
Since it does, is SetCPU still needed?
How does one configure the OC daemon with profiles for screen off, battery>50% etc etc?
I am running CM7.1
Click to expand...
Click to collapse
CM7 does have an OC daemon but it does not have profile settings like SetCPU. Most feel that using profiles kills the battery faster than not using profiles as the device is having to poll the system so frequently. If you just set the min and max speeds, you'll be fine.
Sent from my HTC Vision using XDA App
Just a question though. What does ONDEMAND govenor do?
Like when the phone is not doing anything, the phone will automatically go to the minimum clockspeed, and if you are playing intense games, the phone will max out?
Does that mean when the phone is screen off, the clockspeed will be minimum?
Because the only reason I have setcpu is to set the profile so it goes to 500/200 mhz screen off...
I think the CM7 included OC/UC manager is pretty darn good. I wouldn't worry about using SetCPU it'll just interfere.
convolution said:
Just a question though. What does ONDEMAND govenor do?
Like when the phone is not doing anything, the phone will automatically go to the minimum clockspeed, and if you are playing intense games, the phone will max out?
Does that mean when the phone is screen off, the clockspeed will be minimum?
Click to expand...
Click to collapse
Yes. You can see the exact way that each governor works, but that's pretty much the case with ONDEMAND.
convolution said:
CM7 has an OC daemon, right?
Click to expand...
Click to collapse
No, there is no background process (daemon) controlling the cpu min/max.
It only applies the settings at boot, aside from that, it does nothing.
on our devices, there are three (main) files that effect the cpu overclocking:
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
writing a value to these files will make the cpu do what you want. (which is what the CM7 controls do)
You can still use SetCPU if you want... all it does is write the values to these files & the kernel handles the rest.
For example, it can be a slightly more convenient method of cranking up the max frequency if you are about to play a particularly cpu intensive game.
I also find SetCPU handy to do a quick check on the "time in state" & "memory" stats
If you want to use the SetCPU profiles, then, as OriginalGabriel pointed out, it could lead to slightly increased battery usage as SetCPU has to remain running in the background monitoring the variables.
If you don't use the profiles, then SetCPU won't consume any battery.
virtuous_oc, andrev_oc & ilwt_oc are a background process (daemon) that react to a change in screen state & write their defined settings to the above mentioned files.
The difference:
SetCPU runs in Android userspace & has to wait for the android system to send out a broadcast intent that the screen has been turned on/off before it can react & write the values to the files mentioned above.
The OC daemons do not run in userspace & detect the change in screen state at a kernel level... they will have written the values to the files well before the intent gets broadcast.
convolution said:
Just a question though. What does ONDEMAND govenor do?
Like when the phone is not doing anything, the phone will automatically go to the minimum clockspeed, and if you are playing intense games, the phone will max out?
Does that mean when the phone is screen off, the clockspeed will be minimum?
Because the only reason I have setcpu is to set the profile so it goes to 500/200 mhz screen off...
Click to expand...
Click to collapse
The governor controls how the cpu steps up or down the available frequencies based on the current load.
Each of the governors use a slightly different algorithm in how the cpu steps up or down. (within Max & Min as specified by scaling_max_freq & scaling_min_freq)
The well known governors from the mainline Linux kernel:
Ondemand: at the onset of load, jumps straight to max frequency & then steps down through the frequency table.
Conservative: steps up through the frequencies & back down.
Performance: this governor just keeps the cpu at scaling_max_freq & doesn't scale down
Powersave: this keeps the cpu at scaling_min_freq & doesn't scale up
Also, there are a number of governors that have come about from the Android community, I don't have the time right now to write about all the others that I know of... but can do at a later stage if it helps?
The important thing to note, is that unless you device is staying awake when the screen turns off, the screen off profiles are somewhat pointless, as the cpu effectively gets turned off.
Sorry bout the wall of text... am at work & typed it out in a bit of a hurry... hope it all makes sense
Its not needed but u can use it
Sent from my HTC Vision using xda premium

[Guide]Using OC/UV Beater for overclocking

This guide on how to use the OC/UV beater app that is used to control my overclock daemon that is included in some roms, and is flashable here for advanced users : http://forum.xda-developers.com/showpost.php?p=21253167&postcount=38 . If you cant find the app, unfortunately its not available in market but installable here: http://forum.xda-developers.com/showthread.php?t=1207546
First of all you need to make sure that any apps like setCpu or other overclocking apps are uninstalled not just disabled. Once this is done you need to reboot for it to take effect.
In the app you will normally have 3 tabs, these can be used to create different profiles. You can set a profile name if you like or just leave them.
You then have 6 dropdown menus for the overclock settings, 3 for each phone state. Your phone has 2 states, awake and asleep, asleep is when the phone is screen off and nothing too cpu consuming is running in the background and awake is for any other time. When you open the app for the first time the will say !set this is normal.
For each state you have a governor, min and max setting. When choosing a governor dont choose smartass as this does not work properly with the daemon (see below for why). Personally i use the normal on demand for awake and conservative for a asleep. Other governors can be used though depending on your preference.
Next you set your frequencies. Normally for minimum its safe to choose the lowest value unless you are having issues. As for the awake maximum choose what ever is the highest your phone runs stable at, or if you dont know, try out the one above your current speed. For asleep maximum either choose the minimum again or the one above (message to all kernel devs- try and enable a speed around 120mhz for maximum battery life).
Now we want to test these speeds out to see if they work, hit save, then temp activate. Now use your phone for a while, preferably trying a few intensive apps. When you are sure its stable use perm activate to set it on boot.
This should be enough for most people, but the app has a couple more features like profile switching based on battery state and ill leave you to work them out if you want as they are fairly self explanatory.
About the smartass governor: this governor was designed to switch maximum speeds based on phone state like screen on and off however the daemon does this for you if you set it correctly and will conflict with each other.
For some reason, I can't set anything except the govs (and they both show the same possibilities - there is no "conservative" for sleep) the rest just says !set and it's the only possibility there is.
Is it the app or is my problem ROM-specific?
Using TurboFire beta 6 ROM
barzhdu said:
For some reason, I can't set anything except the govs (and they both show the same possibilities - there is no "conservative" for sleep) the rest just says !set and it's the only possibility there is.
Is it the app or is my problem ROM-specific?
Using TurboFire beta 6 ROM
Click to expand...
Click to collapse
Looks like its rom specific the app is rock solid normally. I think that the daemon config has gotten messed up in the mix of roms so ill try and see what is breaking it.
I cant seem to get the 460800mhz freq stable no matter what voltage i set. Is there a way to delete that crequency from ever being used, and how?
Works like a charm altho it seems the cm7 kernel does not support UV only OC or might be just me not understanding the UI. Antway i ll play around with it alot cuz so far it seems to ne runing alot better an utilising all freq properly.
Sent from my Wildfire S using xda app-developers app

smartassv2 governor tweaks

I just spent some time doing some miscellaneous tweaks to the smartassv2 gov on the new Lionfish kernel. I am extrememly battery conscious with this tweaking as i will soon be giving this EVO to my father who has to rely on in for business. I followed the info in a few other threads and thought I had what i needed to make the correct changes so I made them. I've noticed that after the changes I've made, the cpu scaling seems to be rather erratic, meaning it never really settles at low frequency. I don't know if this is due to the stock setting of the gov as i didn't check the scaling before hand or if it has to do with my changes.
my current settings are as follows
768000= awake_ideal_freq;
245000= sleep_ideal_freq;
499200= sleep_wakeup_freq
85=max_cpu_load;
70=min_cpu_load;
38400= ramp_up_step;(left at stock)
38400= ramp_down_step;(left at stock)
10000= up_rate_us(left at Stock)
20000= down_rate_us(left at Stock)
I didn't touch the rampup/down of the scaling intervals or anything, so i don't really understand why this is happening. And sugestions out there?
shameful bump....
If you're running Sense I wouldn't recommend that low of a main clock, and honestly if your dad knows nothing of rooting I'd unroot it, leave everything stock, and let him fair with it, wouldn't want the device bugging out on him after all.
SavocaFTW is right, you are way under, just use on demand it will be just fine, if you set the evo values to low the system gets whacked out bad.
I've been using newest lionfish 1.2 and V6 supercharger with setting #8. Tried it just for kicks and its been working great for battery life. Use System Tuner Pro. Don't use Set CPU. I use ondemand 768-245. One other you thing to do is use a file manager to navigate to the system/etc folder and scroll down until you find the init.post_boot.sh file and either delete it or move it to your sd card. This is the cause of most of problems i'm sure.

Categories

Resources