webOS Nation Forums >  webOS apps and software >  webOS development > Stable(?) CPU Frequency Scaling App Here
Stable(?) CPU Frequency Scaling App Here

  Reply
 
LinkBack Thread Tools Display Modes
Old 07/12/2009, 08:56 AM   #41 (permalink)
Member
 
Join Date: Apr 2008
Posts: 259
Likes Received: 0
Thanks: 8
Thanked 64 Times in 30 Posts
Default

Quote:
Originally Posted by clipcarl View Post
I've been playing around with Pandora and unfortunately it's really easy to get it to skip-- even when running at full speed and beyond. I'm really starting to think the problem is with Pandora because it really can't handle even the smallest bit of latency in its scheduling. For now, running with these options seems best (all one line):
exec /opt/sbin/cpuspeed -i 1 -M 500000 -a /sys/devices/platform/lcd.0/panel_state -A 10 -D -C -r -p 10 55
But it still skips occasionally with the screen off.

Looking at the kernel used on the Pre it's really surprising some of the choices Palm made. For example CONFIG_HZ is set to 100 and CONFIG_PREEMPT is not enabled. Both of those settings would have a negative impact on multimedia applications (like Pandora) as well general interactiveness and the GUI. Makes me wonder if Palm has anyone for them that actually knows about Linux! I'm definitely going to figure out how to install a new kernel soon just so I can see how much improvement a different kernel will make.
I had always suspected that preemption was not enabled in the kernel but I had never actually tried to confirm this. I'm surprised too...turning it on ought to give a very significant improvement in UI responsiveness.

Last edited by xcomputerman; 07/12/2009 at 08:57 AM. Reason: Quoted the wrong msg. Heh.
xcomputerman is offline   Reply With Quote
Old 07/12/2009, 11:48 AM   #42 (permalink)
Member
 
Join Date: Jan 2005
Location: Bay Area, CA
Posts: 950
Likes Received: 4
Thanks: 89
Thanked 492 Times in 94 Posts
Default

Quote:
Originally Posted by jauderho View Post
@VitViper - You can only run *1* of the 2 options. CPU scaling or SmartReflex.

That said, I just uploaded patches to the gitorious repo for either method. See pre dev wiki: Applying Patches about how to use patches...
...
I wouldn't put either of those on gitorious yet. Both are known to crash a large percentage of Pres (but not all) and cause other problems as well (video artifacts).

The (different) method we are discussing on this thread seems a bit more stable (does not seem to occasionally crash the Pre) but there are music playback issues when streaming over bluetooth with scaling enabled and the jury is still out on just how much battery life CPU scaling gains on this platform.
clipcarl is offline   Reply With Quote
Old 07/12/2009, 06:51 PM   #43 (permalink)
Member
 
Join Date: Jan 2005
Location: Bay Area, CA
Posts: 950
Likes Received: 4
Thanks: 89
Thanked 492 Times in 94 Posts
Default

OK, so I spent the day rebuilding the kernel and playing with various options. First CONFIG_PREEMPT causes problems where some of the drivers complain loudly in dmesg. Changing CONFIG_HZ from 100 (by changing the timer source to the 32KHz timer) causes the Pre to not boot so it looks like we are stuck with things the way they are. Maybe a newer kernel or updated drivers might change things. I'm still playing with some other things so I haven't quite given up on a more optimized kernel yet.
clipcarl is offline   Reply With Quote
Old 07/13/2009, 01:43 AM   #44 (permalink)
Member
 
Join Date: Jul 2009
Posts: 102
Likes Received: 0
Thanks: 0
Thanked 15 Times in 11 Posts
Default

Quote:
Originally Posted by jauderho View Post
@VitViper - You can only run *1* of the 2 options. CPU scaling or SmartReflex.
My understanding is carl's cpuspeed is userspace cpu-scaling, so it's actually option #3. And being user space I turned on smartflex just for the SNG factor to see what would happen.
VitViper is offline   Reply With Quote
Old 07/13/2009, 04:27 PM   #45 (permalink)
Member
 
FuManChuu's Avatar
 
Join Date: Mar 2006
Posts: 479
Likes Received: 0
Thanks: 10
Thanked 14 Times in 12 Posts
Default

Keep up the good recompile work carl... I've also been sporting this method for several days now, and i CERTAINLY see a huge improvement in battery life in regards to leaving chat services on (gtalk/AIM)... I can easily make it full days with these services now... Couldn't before
__________________
Just waiting for the day my Pre has contacts grouping, and a "speed dial" for text messaging
FuManChuu is offline   Reply With Quote
Old 07/13/2009, 04:47 PM   #46 (permalink)
Member
 
Join Date: Jun 2009
Posts: 38
Likes Received: 0
Thanks: 13
Thanked 3 Times in 2 Posts
Default

Clipcarl, what about the conservative setting that doesn't appear on the Pre for some reason.

Could you recompile with that and try it out? From what I know (not too much), that one is used a lot on linux systems and may be another solution that is more stable, maybe not necessarily for pandora, but I'm pretty convinced that program has its own quirks...
JonVisc is offline   Reply With Quote
Old 07/13/2009, 06:04 PM   #47 (permalink)
Member
 
Join Date: Jul 2009
Posts: 102
Likes Received: 0
Thanks: 0
Thanked 15 Times in 11 Posts
Default

clipcarl:

Reporting to say that cpuspeed is stable on my Pre (smartflex was as well) since I enabled it when you originally posted this thread. I am basically passing your "stable" pandora flags, minus the option that locks the processor at max speed when the screen is on. I run 600mhz and I find that I just don't need the pre locked to max frequency when i'm using it, it's still responsive "enough". The phone doesn't get toasty this way either.
VitViper is offline   Reply With Quote
Old 07/13/2009, 06:09 PM   #48 (permalink)
Moderator
 
jbg7474's Avatar
 
Join Date: Jan 2009
Location: SW Ohio
Posts: 3,858
Likes Received: 92
Thanks: 1,019
Thanked 1,061 Times in 715 Posts
Default

Quote:
Originally Posted by VitViper View Post
clipcarl:

Reporting to say that cpuspeed is stable on my Pre (smartflex was as well) since I enabled it when you originally posted this thread. I am basically passing your "stable" pandora flags, minus the option that locks the processor at max speed when the screen is on. I run 600mhz and I find that I just don't need the pre locked to max frequency when i'm using it, it's still responsive "enough". The phone doesn't get toasty this way either.
Whoa, so you're not having the flickering video issue with scaling while the screen is on?
__________________
Palm III-->Handspring Visor-->Sony Clie PEG-NR70-->no PDA -->Palm Treo 755p-->Palm Pre-->HP Veer
jbg7474 is offline   Reply With Quote
Old 07/13/2009, 06:10 PM   #49 (permalink)
Member
 
Join Date: Jun 2009
Posts: 28
Likes Received: 0
Thanks: 0
Thanked 1 Time in 1 Post
Default

I too have been experimenting with cpuspeed aswell as smartflex, i tried it with 600 MAX / 125 MIN settings and found that it would crash often, now I'm on a 550 MAX / 250 MAX -
Code:
exec /opt/sbin/cpuspeed -i 5 -M 550000 -m 250000 -a /sys/devices/platform/lcd.0/panel_state -A 10 -C -r
these settings seem to be stable, but I havn't tested long enough to see how the battery compares to the control/just smartflex/just cpuscaling

I'm also not getting any flickering with youtube or videos on the pre, nor any issues with pandora, but I didn't test with any BT streaming so that could still be an issue
xstaticxgpx is offline   Reply With Quote
Old 07/13/2009, 06:53 PM   #50 (permalink)
Member
 
Join Date: Jun 2009
Posts: 770
Likes Received: 0
Thanks: 37
Thanked 276 Times in 83 Posts
Default

I would love to see a version of this that uses smartreflex (instead of cpu scaling), but changes the frequency from 500 --> 600 when the screen is turned on..
-mark
diomark is offline   Reply With Quote
Old 07/13/2009, 08:15 PM   #51 (permalink)
Member
 
Join Date: Jun 2009
Posts: 297
Likes Received: 0
Thanks: 5
Thanked 19 Times in 19 Posts
Default

Where is the time in state file? Just replaced my launch day pre, time to put cpu scaling back on.
__________________
Quote:
Originally Posted by NickDG View Post
Welcome to open source. Things can get bumpy. Please fasten your seat belts.
Quote:
Originally Posted by dianagr View Post
You can also swipe a counterclockwise semi-circle around the center button to go back. [Do a back gesture]
The_lane is offline   Reply With Quote
Old 07/14/2009, 09:38 AM   #52 (permalink)
Member
 
Join Date: Jul 2009
Posts: 102
Likes Received: 0
Thanks: 0
Thanked 15 Times in 11 Posts
Default

Quote:
Originally Posted by The_lane View Post
Where is the time in state file? Just replaced my launch day pre, time to put cpu scaling back on.
/sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
VitViper is offline   Reply With Quote
Old 07/14/2009, 09:41 AM   #53 (permalink)
Member
 
Join Date: Jul 2009
Posts: 102
Likes Received: 0
Thanks: 0
Thanked 15 Times in 11 Posts
Default

Quote:
Originally Posted by jbg7474 View Post
Whoa, so you're not having the flickering video issue with scaling while the screen is on?
I just checked, I get a bit of flicker. I could play with the settings some more and eliminate it, but I honestly don't use my Pre to play video often enough to really bother me. I can always switch back to SmartFlex. So far I don't see a huge difference in power consumption using cpuspeed vs smartflex.


Quote:
Originally Posted by xstaticxgpx View Post
I too have been experimenting with cpuspeed aswell as smartflex, i tried it with 600 MAX / 125 MIN settings and found that it would crash often, now I'm on a 550 MAX / 250 MAX -
Code:
exec /opt/sbin/cpuspeed -i 5 -M 550000 -m 250000 -a /sys/devices/platform/lcd.0/panel_state -A 10 -C -r
these settings seem to be stable, but I havn't tested long enough to see how the battery compares to the control/just smartflex/just cpuscaling

I'm also not getting any flickering with youtube or videos on the pre, nor any issues with pandora, but I didn't test with any BT streaming so that could still be an issue
Are you using those settings with SmartFlex enabled?
VitViper is offline   Reply With Quote
Old 07/14/2009, 09:54 AM   #54 (permalink)
Member
 
Join Date: Jul 2009
Posts: 102
Likes Received: 0
Thanks: 0
Thanked 15 Times in 11 Posts
Default

Quote:
Originally Posted by jbg7474 View Post
Whoa, so you're not having the flickering video issue with scaling while the screen is on?
exec /opt/sbin/cpuspeed -i 1 -M 600000 -r -p 60 80

With those settings, there's no flicker in YouTube anymore. It's all about fine-tuning idle status. With those settings cpu speeds ran at 500, 550 and 600mhz, without dropping lower. Soon as I turned off youtube, it went back to rocking 125mhz.
VitViper is offline   Reply With Quote
Old 07/14/2009, 10:44 AM   #55 (permalink)
Member
 
Join Date: Jul 2009
Posts: 102
Likes Received: 0
Thanks: 0
Thanked 15 Times in 11 Posts
Default

exec /opt/sbin/cpuspeed -i 10 -M 600000 -r -p 30 60

Also works well for YouTube video. Pretty much flicker-free, but not as much polling as my other option.

I prefer
exec /opt/sbin/cpuspeed -i 2 -M 600000 -r -p 55 75

It's more polling, but youtube is running great and the UI is overall more responsive. I like the fact it's not getting locked in at 600mhz when the LCD is on... To me that's a benefit. The phone gets hot at max frequency without smartflex on.
VitViper is offline   Reply With Quote
Thanked By: nowise
Old 07/14/2009, 05:58 PM   #56 (permalink)
Member
 
Join Date: Aug 2007
Location: So. Calif.
Posts: 41
Likes Received: 0
Thanks: 3
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by VitViper View Post
exec /opt/sbin/cpuspeed -i 10 -M 600000 -r -p 30 60

Also works well for YouTube video. Pretty much flicker-free, but not as much polling as my other option.

I prefer
exec /opt/sbin/cpuspeed -i 2 -M 600000 -r -p 55 75

It's more polling, but youtube is running great and the UI is overall more responsive. I like the fact it's not getting locked in at 600mhz when the LCD is on... To me that's a benefit. The phone gets hot at max frequency without smartflex on.
VitViper -
Is that the entire line in your current cet-cpuspeed script? Did you take off the -a switch to monitor the screen state file?
__________________
Palm III --> PalmVx + Omnisky --> Samsung i730 --> Treo 650 --> Samsung i760 --> AT&T Tilt --> Palm Pre
jerich007 is offline   Reply With Quote
Old 07/15/2009, 12:20 AM   #57 (permalink)
Member
 
Join Date: Jan 2005
Location: Bay Area, CA
Posts: 950
Likes Received: 4
Thanks: 89
Thanked 492 Times in 94 Posts
Default

So what's the verdict guys? Better battery life or not?

Thanks,
Carl
clipcarl is offline   Reply With Quote
Old 07/15/2009, 12:20 AM   #58 (permalink)
Member
 
Join Date: Jan 2005
Location: Bay Area, CA
Posts: 950
Likes Received: 4
Thanks: 89
Thanked 492 Times in 94 Posts
Default

So what's the verdict guys? Better battery life or not?

Thanks,
Carl
clipcarl is offline   Reply With Quote
Old 07/15/2009, 12:22 AM   #59 (permalink)
Member
 
Join Date: Jan 2005
Location: Bay Area, CA
Posts: 950
Likes Received: 4
Thanks: 89
Thanked 492 Times in 94 Posts
Default

Quote:
Originally Posted by VitViper View Post
My understanding is carl's cpuspeed is userspace cpu-scaling, so it's actually option #3. And being user space I turned on smartflex just for the SNG factor to see what would happen.
While CPUSpeed is a userspace program it essentially does the same thing as the ondemand governor. Both control the cpufreq kernel code which actually does the processor speed switching requested.
clipcarl is offline   Reply With Quote
Old 07/15/2009, 12:30 AM   #60 (permalink)
Member
 
Join Date: Jan 2005
Location: Bay Area, CA
Posts: 950
Likes Received: 4
Thanks: 89
Thanked 492 Times in 94 Posts
Default

Quote:
Originally Posted by JonVisc View Post
Clipcarl, what about the conservative setting that doesn't appear on the Pre for some reason.

Could you recompile with that and try it out? From what I know (not too much), that one is used a lot on linux systems and may be another solution that is more stable, maybe not necessarily for pandora, but I'm pretty convinced that program has its own quirks...
I ran into some issues running my on kernels on the Pre. Source code for some of the drivers is missing (such as wifi) and the two biggest things I wanted to do (increase CONFIG_HZ and turn on CONFIG_PREEMPT) both cause crash / stability issues. The best thing is probably to wait for Palm to update to a newer kernel and try again. I might try a newer kernel myself but it's likely that the huge amount of patches won't apply cleanly and it's a huge time-consuming pain having to go through WebOS doctor to reload my phone after every failed attempt.

As for the conservative governor, it really isn't going to give you much different performance than CPUSpeed and it will have some of the same limitations and the ondemand governor.
clipcarl is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0