Question about Pete file in BB 1.0

Discussion in 'Bugless' started by BigMcGuire, May 14, 2010.

  1. BigMcGuire

    BigMcGuire Active Member

    Joined:
    Dec 13, 2009
    Messages:
    1,040
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Los Angeles, California
    Ratings:
    +2
    Is it safe to modify the pete file to have the scaling_min_freq to 125000?
     
  2. pdroid

    pdroid Silver Member

    Joined:
    Mar 4, 2010
    Messages:
    2,252
    Likes Received:
    7
    Trophy Points:
    103
    Location:
    Philly
    Ratings:
    +7
    You could, if the kernel you're running supports it - but I believe the newest bekit kernels don't.
     
  3. BigMcGuire

    BigMcGuire Active Member

    Joined:
    Dec 13, 2009
    Messages:
    1,040
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Los Angeles, California
    Ratings:
    +2
    I'm using the BEKIT7X1000LV kernel.
     
  4. Se7enLC

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +0
    Only if it's supported in the kernel. I believe the 125Mhz frequency step is only in the 600Mhz kernel, and I know it's not in the 800Mhz.

    To check what frequencies your kernel has available:
    Code:
    cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    
    To set a max frequency manually:
    Code:
    echo "125000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
    
    To check to see what the current max frequency is (to see if the change was accepted):
    Code:
    cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
    
    To see the current frequency:
    Code:
    cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
    
    As a side note, I have heard a number of times that a minimum speed of 125Mhz is too slow for the droid to be able to wake up in time to answer a call. I've actually had problems with 250Mhz as well, but YMMV. I would highly suggest testing it out before setting it there for good, and make sure you NEVER set the maximum frequency below 400Mhz or so, or it won't even be responsive enough to turn the speed back up.
     
  5. pdroid

    pdroid Silver Member

    Joined:
    Mar 4, 2010
    Messages:
    2,252
    Likes Received:
    7
    Trophy Points:
    103
    Location:
    Philly
    Ratings:
    +7
    Pretty sure only the stock kernel (that comes with BB) supports 125, all the rest have 250 as their min freq.

    I'm assuming Pete posted the 0.8.3 kernels (the latest).

    edit: ah, Se7enLC beat me to it. but yes, I found 250 to be too slow, never mind 125. 400 is probably the best usable minimum.
     
  6. Se7enLC

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +0
    My own random musing (not to derail/hijack the thread):

    I wonder if it's possible to intercept an incoming call early on and have it force the CPU to ramp up?

    Example - When my phone starts to ring, first I'll hear it vibrate, then I hear the ringtone, then the screen turns on and gives me the option to answer. Sometimes it will be 4-5 seconds before I have the option of answering, even.

    Obviously *something* in the software is aware that there's an incoming call. If you were to attach an action to that that forced the CPU to ramp up to 600, maybe it would happen faster than waiting for the frequency scaling governor to do it.
     
  7. BigMcGuire

    BigMcGuire Active Member

    Joined:
    Dec 13, 2009
    Messages:
    1,040
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Los Angeles, California
    Ratings:
    +2
    Many thanks for the help and info on this. I'm loving the standby battery life from the 250 downclocking. But like you guys, I've noticed it takes the phone 2-5 seconds to give me an accept call slide. Didn't occur to me to think it was the downclocking. Very interesting indeed. Makes me want to set min_freq to 400 now, lol.
     
  8. pdroid

    pdroid Silver Member

    Joined:
    Mar 4, 2010
    Messages:
    2,252
    Likes Received:
    7
    Trophy Points:
    103
    Location:
    Philly
    Ratings:
    +7
    To be honest, I don't think you'll see that big a hit in battery life at 400 min.
     
  9. Se7enLC

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +0
    Since we already hijacked the thread, here's some useful information about cpu frequency scaling in linux:
    Linux Kernel Documentation :: cpu-freq : governors.txt

    The important things to note are the difference between ondemand and conservative governors. ondemand will automatically ramp up to scaling_max_freq if more speed is required, and then slowly ramp down. conservative will slowly ramp up AND down. When it needs more/less CPU, it will just go one step at a time.

    sampling_rate is how often the governor will check cpu usage. It's actually a period, not a rate. A larger value will be slower to notice a change, but a smaller value will spend more battery power checking cpu usage often.

    up_threshold is how much cpu utilization (percentage) there needs to be in order to warrant a jump in CPU speed.

    down_threshold is how much cpu utilization (percentage) to trigger a drop in speed. (conservative only)

    There's a lot of room for tweaking these settings. If it's not jumping to a normal speed fast enough, you can make the sampling_rate more frequent (smaller), or change the up_threshold to require less cpu load to prompt the jump. If you want more battery life, you can set it to use the conservative governor or change the up_threshold or down_threshold to be less likely to jump up and more likely to drop down.

    The pete script sets the sampling_rate to 32000us (32ms) and the up_threshold to be 50%. I believe the SetCPU defaults are 250000us (250ms) and 80%. I'm not sure what the defaults are if you don't run SetCPU or the pete script, but I'm pretty sure it won't even do scaling at all on its own (it will just sit at the default speed, which I think is max speed).
     
    #9 Se7enLC, May 14, 2010
    Last edited: May 14, 2010