Page 1 of 36 12345611 ... LastLast
Results 1 to 20 of 703
  1.    #1  
    I think I may have a stable and effective solution to allow CPU frequency scaling. I am looking for volunteers to test my solution. A zip file with a binary and start script for the Pre is attached to this message.

    On Linux, there have been historically two ways to do automatic CPU frequency scaling. One is to use an in-kernel governor like "ondemand" and another is to use a userspace application. Clearly, the ondemand governor is causing stability problems for many people and an alternative solution is needed.

    Another problem is the issue of video artifacts when CPU scaling is active.

    My solution is to use a carefully tuned CPU scaling userspace application and to tell it to only scale the CPU when the screen is off. The rationale is that when the screen is on you are actively using the Pre and probably want speed and responsiveness. When the screen is off the Pre is idle and you probably do not care if the Pre is clocked down to a slow speed. Also, because when the screen is on the Pre is not scaling, there are no video artifacts. When the Pre is idle it is clocked down to a slow speed and therefore should theoretically use less power and improve battery life.

    This program should be safe and bug free. It does not do anything the CPU and chipset were not designed to do. The program has been in use in many Linux systems for several years and there has never been a report of any damage done to a CPU or system because of it. Also, I and many others have been using it on the Pre for some time now and it has proven to be very stable and reliable even when used to run the Pre at faster than standard clock speeds.

    However, you use this at your own risk. You may only use the program if you agree that I, this forum, and all persons except yourself are not responsible for any problems you may have. Also, be aware that while the CPU and chipset in the Pre may be designed to run at up to 600MHz that does not mean that the thermal design characteristics of the Pre can handle more than the stock 500MHz speed. If you choose to run the Pre at 550MHz or 600MHz by modifying the program's startup script the risk is yours alone.

    To Use:
    I'm borrowing quite a bit from as4life's post. Thanks! Steps in monospace bold font are commands that should be typed in at the root shell command prompt:

    1. Root your Pre, install optware and enable Secure Shell access so you can get to a root shell prompt. You could also use the "novaterm" program to get to the root shell prompt if you have the SDK. See the WebOS Internals Wiki for instructions. Reboot your Pre after doing this.
    2. Make sure you delete all previous CPU scaling programs you may have tried as well as SmartReflex before applying. Reboot your phone after removing them. If you never done any of this you don't have to worry about this step.
    3. Download the "cpuspeed.zip" attached to this post to your computer.
    4. Unzip the "cpuspeed.zip" file on your computer. You should now have two new files: "cpuspeed" and "cet-cpuspeed" .
    5. Put your Pre in USB Drive mode and move both the "cpuspeed" and the "cet-cpuspeed" files to the main directory of the Pre.
    6. Get out of USB mode and get to a root shell prompt (see step #1). The following commands must be run as the "root" user. If you use the "sudo" method you must prepend "sudo " (without the quotes) to these commands.
    7. mkdir -p /opt/sbin
    8. cp /media/internal/cpuspeed /opt/sbin/
    9. chmod +x /opt/sbin/cpuspeed
    10. mount / -oremount,rw
    11. cp /media/internal/cet-cpuspeed /etc/event.d/
    12. sync
    13. reboot

    Then if you wish to try some of the different settings discussed in this thread you should edit the /etc/event.d/cet-cpuspeed file so that the "exec" line matches what's in the post.

    If you do not understand these directions please do not attempt to install this program at this time. Please wait for an easier to install version.

    Please do not attempt to use this program with SmartFlex at this time. One thing at a time.

    Please post back here with your results. Please post any battery life (or other) changes measured and your testing methodology. Some people have reported that WebOS update 1.1 seems to have negatively impacted battery life. If you have upgraded to 1.1 be sure to retest your battery life again without CPUSpeed.

    When enough time has passed and I am satisfied that it works as properly and as safely as possible for the Palm Pre I will then update the wiki myself. Please do not add this to the wiki for me.

    Thanks,
    Carl
    Attached Files Attached Files
    Last edited by clipcarl; 07/26/2009 at 01:41 AM.
  2. sgtkwol's Avatar
    Posts
    51 Posts
    Global Posts
    56 Global Posts
    #2  
    Sounds good, no offense to you, but I'm not brave enough to try it. Plus I wouldn't be very good at helping to find bugs, if there are any.
  3.    #3  
    Quote Originally Posted by sgtkwol View Post
    Sounds good, no offense to you, but I'm not brave enough to try it. Plus I wouldn't be very good at helping to find bugs, if there are any.
    Thanks, but it was not necessary to post saying that you won't be helping.

    EVERYONE: Please only comment in this thread if you can help test or add useful information! Thank you!
  4. #4  
    Installing now.... Let's see if this actually helps battery life! Will post back after trial..
  5. wprater's Avatar
    Posts
    240 Posts
    Global Posts
    251 Global Posts
    #5  
    I've been testing now.. having strange hard resets when closing the lid. It also erases everything in the wallpapers and ringtones folder. Highly doubt its because of your program, but wanted to throw it out there because its happened twice after I've installed it.
  6. #6  
    I'm no wuss... installing now, I'll let you know how it goes
    Just waiting for the day my Pre has contacts grouping, and a "speed dial" for text messaging
  7.    #7  
    Quote Originally Posted by wprater View Post
    I've been testing now.. having strange hard resets when closing the lid. It also erases everything in the wallpapers and ringtones folder. Highly doubt its because of your program, but wanted to throw it out there because its happened twice after I've installed it.
    No, I don't think that would be related to CPU scaling.

    The resets sound a lot like the battery issue that some folks are having. Did you try stabilizing it with some paper? If your Pre is resetting your /media/internal (USB drive) partition may have gotten messed up (happened to me once way back on my first Pre). Try connecting to your computer in USB mode, copying all the files off the drive, reformatting it (make sure to use VFAT) then copy all the files back. That worked for me when I was having trouble with files disappearing. Alternatively, you could use WebOS Doctor but it'd be even more of a pain getting your info back on.
  8. wprater's Avatar
    Posts
    240 Posts
    Global Posts
    251 Global Posts
    #8  
    Quote Originally Posted by clipcarl View Post
    No, I don't think that would be related to CPU scaling.

    The resets sound a lot like the battery issue that some folks are having. Did you try stabilizing it with some paper? If your Pre is resetting your /media/internal (USB drive) partition may have gotten messed up (happened to me once way back on my first Pre). Try connecting to your computer in USB mode, copying all the files off the drive, reformatting it (make sure to use VFAT) then copy all the files back. That worked for me when I was having trouble with files disappearing. Alternatively, you could use WebOS Doctor but it'd be even more of a pain getting your info back on.
    Yeah.. battery seems fine, but I've heard of that issue. I just finished web doctor.. I'll out everything back and continue to test for you. Thanks.
  9.    #9  
    Quote Originally Posted by wprater View Post
    I've been testing now.. having strange hard resets when closing the lid. It also erases everything in the wallpapers and ringtones folder. Highly doubt its because of your program, but wanted to throw it out there because its happened twice after I've installed it.
    You haven't modified the script to increase the CPU speed to above 500MHz have you?

    Also are you absolutely sure you completely removed any other scaling hacks you may have installed and especially SmartReflex?
  10. #10  
    Also, for what its worth I bumped the cpu speed up to 600... going for broke on this one
    Just waiting for the day my Pre has contacts grouping, and a "speed dial" for text messaging
  11. wprater's Avatar
    Posts
    240 Posts
    Global Posts
    251 Global Posts
    #11  
    Quote Originally Posted by clipcarl View Post
    You haven't modified the script to increase the CPU speed to above 500MHz have you?

    Also are you absolutely sure you completely removed any other scaling hacks you may have installed and especially SmartReflex?
    yes, I confirmed that smartflex was off and the freq is at 500. However, I did have my phone at 600 for a full day and a long 50min phone call yesterday. Hope that did not do any damage.
  12. #12  
    It seems to be perfectly stable for me, which is more than I can say about any other method. The Music app seems to be working with absolutely no issue either with the screen off, through the speaker, A2DP, or headphones. Pandora works over headphones and speaker, but does stutter occasionally over A2DP with the screen off (and I can confirm it's because of this because as soon as I turn the screen on, it stops.) Otherwise though, it's working great.

    Also, not sure if this matters, but this testing was done using a Wifi internet connection.

    I haven't checked to see how much battery it's conserving though, but I'm sure it'll help a ton.
  13.    #13  
    Great to hear it's working well for you! Thank you for your help testing.

    For Pandora please try adding " -p 50 75" to the end of the the "exec" line in the cet-cpuspeed file and see if it helps. The line should look like this (all on one line):
    exec /opt/sbin/cpuspeed -i 10 -M 500000 -a /sys/devices/platform/lcd.0/panel_state -A 10 -D -C -r -p 50 75

    Yes, the real question on the Pre is how much power CPU scaling will save. It's not necessarily a given that it will save a huge amount.

    Quote Originally Posted by jhoff80 View Post
    It seems to be perfectly stable for me, which is more than I can say about any other method. The Music app seems to be working with absolutely no issue either with the screen off, through the speaker, A2DP, or headphones. Pandora works over headphones and speaker, but does stutter occasionally over A2DP with the screen off (and I can confirm it's because of this because as soon as I turn the screen on, it stops.) Otherwise though, it's working great.

    Also, not sure if this matters, but this testing was done using a Wifi internet connection.

    I haven't checked to see how much battery it's conserving though, but I'm sure it'll help a ton.
    Last edited by clipcarl; 07/11/2009 at 12:47 PM.
  14. #14  
    I would install and test this but I also have the fear that it will negatively impact Pandora performance once the screen shuts off. Thanks though, OP. A great start.
  15.    #15  
    Can anyone else confirm that Pandora stutters for them occasionally with the screen off streaming over bluetooth? If so please post here to let me know and try adding " -p 50 75" to the end of the the "exec" line in the cet-cpuspeed file and see if it helps. The line should look like this (all on one line):

    exec /opt/sbin/cpuspeed -i 10 -M 500000 -a /sys/devices/platform/lcd.0/panel_state -A 10 -D -C -r -p 50 75
  16. #16  
    Why would it negatively impact performance with Pandora? Isn't this dynamic scaling like on desktop processors, or is the frequency being set at a fixed value?
  17.    #17  
    Quote Originally Posted by matt olenik View Post
    Why would it negatively impact performance with Pandora? Isn't this dynamic scaling like on desktop processors, or is the frequency being set at a fixed value?
    It is being dynamically scaled exactly the same as desktop processors (in fact this is the same program used to scale desktop and laptop processors in some Linux distributions). However if Pandora has fast swings in processor usage and too small buffers it could outrun the scaling algorithm and cause an audible dropout. I'm asking for feedback on this so that the algorithm can be tuned if necessary to eliminate the problem.
  18. #18  
    Been running it since yesterday and haven't had any performance or stability issues. Rarely use pandora but it seemed to work with and without the screen on. Battery doesn't seem much better or worse yet, but I was using the phone pretty heavily yesterday. I'm about to head to work now with a full battery.
    So far, everything seems a lot stabler than the other methods talked about on the wiki.
  19.    #19  
    jhoff80, could you also try changing the "-i 10" to "-i 2" and see if that helps? Thanks!
  20. #20  
    The -p 50 75 change did help the playback issues in Pandora. However, it also seems to have mostly kept the processor from going to the 125mHz clockspeed, even when the Pre has no cards open.

    600000 0
    550000 771
    500000 46648
    250000 4207
    125000 209

    ... When I closed Pandora and therefore had no more cards open, the time for 500mHz was more like 30000 so it definitely is not being quite as aggressive as I'd like for when the Pre is idle.

    -i 2 modification instead is more aggressive in the scaling again, it spends much more time in 250mHz and 125mHz when idle, but does still seem to have the skip/ stuttering.

    Honestly, for my personal use anyway, when I'm using A2DP, the Pre is generally on the Touchstone anyway, so the screen is on and therefore wouldn't be an issue for me, so it works fine enough now. For those who might use A2DP headphones though, I could see it being an issue.
    Last edited by jhoff80; 07/11/2009 at 01:45 PM.
Page 1 of 36 12345611 ... LastLast

Posting Permissions