maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] QCPUFreq - modify your maximum CPU speed (https://talk.maemo.org/showthread.php?t=56757)

direx 2010-06-21 14:50

[Announce] QCPUFreq - modify your maximum CPU speed
 
QCPUFreq

QCPUFreq is a GUI for the kernel's cpufreq interface. It allows you to adjust your CPU's maximum speed.
This prevents the CPU from working at full speed when you don't need it (e.g when running emulators) which enables you to save more battery power.

It should work with vanilla and custom kernels so both normal users and overclockers could benefit from the application.

If you are using a power kernel you can also use QCPUFreq for overclocking!

Maintainer wanted

Requirements:
  • N900 with at least PR 1.2
  • no dependencies :)

Features:
  • finger-friendly UI
  • completely "optified"
  • portrait mode support (kinda useless, but hey: "portrait mode on the N900" :) )
  • support for overclocking and underclocking
  • support for saving current settings as default (only on power kernel)
  • support for loading voltage presets (only on power kernel, extras-devel version)

When you can expect to save power:
  • Running games/emulators which cause your CPU to run at full speed when it is really not required
  • SmartReflex should save a little power in all cases

Known limitations:
  • Maximum frequency reverts to default after:
    • rebooting the device
    • making or recieving a call
  • Settings are lost after reboot - this is intentional so users do not screw up their device. If you are using a power kernel you can however save your settings in the QCPUFreq menu.
  • On vanilla kernels the temperature may be inaccurate
  • Setting the frequency to the lowest value (250 MHz on vanilla kernel) causes the scaling governor to scale up to the second scaling step (500 MHz on vanilla kernel).
  • Sometimes the CPU frequency jumps above the maximum frequency defined in QCPUFreq. The scaling governor will eventuelly notice it (after ~1 sec.) and lower the frequency again. This is a kernel issue and QCPUFreq does not have any influence on this behavior.

I'd appreciate any user input ;)

Screenshot:
http://a.imageshack.us/img214/9153/s...0080114184.png



Download:
Get QCPUFreq from extras-testing.

chemist 2010-06-22 10:03

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Please don't get me wrong but where is the point in limiting the maximum frequency? Improving the CPU scaling management would be much better than having someone decide by himself... to give you a reasonable example, 12 cycles with scaling from 250 to 500MHz@100% do use more power than scaling from 250 to 600MHz@100% for 10 cycles so why limit it to 500MHz? I don't know what is the exact case but steps need to be reasonable and not feeling well. To run a CPU at less frequency is only a good idea to save power as long as there is no higher frequency available that uses less power for the same work.

BLIZZARD 2010-06-22 10:14

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
I find that app very helpfull and thanks a lot for creating it:), keeping n900 at 600mhz kills the cpu, i would like to test it with emulators that always run on 600mhz.

direx 2010-06-22 12:05

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Quote:

Originally Posted by chemist (Post 724719)
to give you a reasonable example, 12 cycles with scaling from 250 to 500MHz@100% do use more power than scaling from 250 to 600MHz@100% for 10 cycles so why limit it to 500MHz?

I agree with you that limiting the maximum frequency is not always the best choice - especially when you really need computing power.

But as BLIZZARD pointed out correctly there are many apps which cause frequency upscaling to 600MHz when it is really not necessary (which is the case with many games).
And since CMOS power consumption is linear to the frequency you can certainly save battery power in such cases (always on 500MHz is better than always on 600MHz).

Of course it would be desirable to improve the actual frequency scaling code itself, but I do not have the time to deal with kernel-level stuff and I also want to stick with vanilla kernels.

BTW: overclockers might like this app in the summer. When it's 35C outside they probably don't want their N900s running at 1.3 GHz ;)


- Dan

haj 2010-06-22 12:08

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
It doesn't kill the CPU.. I have been playing OpenDune on my N900 for like 24 hours the last 14 days, always keeping the CPU at 900MHz, no problems..

The CPU is being worn out faster yes... But that should'nt be a problem unless you want your N900 to live for +2-3 years.

direx 2010-06-23 15:50

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
QCPUFreq 0.2 is now available in extras-testing. I would appreciate any suggestions and comments.

Testers welcome!

Flandry 2010-06-23 16:18

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
For those interested in the premise of this utility, you can save a lot more power by undervolting and it's very easy to do so.

http://wiki.maemo.org/Kernel_Power

If you use the "Ideal" profile and find it stable on your device, you can combine it with this app (or just set the frequencies yourself) for much more significant power saving.

SallyJane 2010-06-23 19:29

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Flandry, sounds as though you are speaking from personal experience.....I'm keen to try this (time to dip toes into the overclocking waters methinks).

Care to quantify your power savings ? ;)

Flandry 2010-06-23 21:22

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Quote:

Originally Posted by SallyJane (Post 726739)
Flandry, sounds as though you are speaking from personal experience.....I'm keen to try this (time to dip toes into the overclocking waters methinks).

Care to quantify your power savings ? ;)

Well, you called my bluff. ;) I have only theoretical numbers but in principle lowering the voltage can save a lot more power than underclocking because it's a quadratic vs. linear effect--and you don't give up any performance. The only limitation is the CPU/SoC of your N900, which means a (very) small risk of needing to flash and restore a backup if your FS gets corrupted while you test. It seems like the vast majority of N900s can handle Ideal.

My goal was to overclock while keeping within the power envelope of the stock settings. By using Ideal settings and changing the min and max to 250 and 810, i was able to do that. At all clock speeds except 810 MHz the CPU power consumption is less than with stock settings at 600. If i decrease the max to 600, it's only 63% stock at 600. At 500 MHz, Ideal settings have 66% the dynamic power of stock.

I used numbers from this: http://wiki.maemo.org/Overclocking

Note that i don't expect the method in this thread nor undervolting to make a significant difference in overall N900 battery life unless the user is regularly pegging the CPU at max (emulators, mostly): the radios, screen, etc. all consume power, too.

Bec 2010-06-24 11:37

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Adding an oveclocking option would be evn more usefull. I don't see a point inhaving an underclocking setting only.

And as Flandry said, undervolting rocks :p. I undervolted my laptop with no issues so perhaps adding, in later versions the ability to set voltages for every 50mhz would rock.

Flandry 2010-06-24 14:30

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Quote:

Originally Posted by Bec (Post 727496)
Adding an oveclocking option would be evn more usefull. I don't see a point inhaving an underclocking setting only.

And as Flandry said, undervolting rocks :p. I undervolted my laptop with no issues so perhaps adding, in later versions the ability to set voltages for every 50mhz would rock.

He's trying to provide a simple solution for those who don't want to install a new kernel, so i don't know that those are options.

Bec 2010-06-24 14:35

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Well it could look something like:

250mhz... 0.5v
400mhz...1.0v
600mhz...1.5v

And the end user would be able to toggle the voltage while also limiting the clock so he can test the stability.

Overclocking works if a custom kernel is installed so this option could be made to unlock itself for custom kernel users alone IMHO.

ndi 2010-06-24 17:23

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Wouldn't overclocking settings simply do nothing for stock kernel?

Spotfist 2010-06-24 17:43

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Awesome app! As previouse people have said it would work will for game, prdoom hammers the cpu and therefore the battery, cranking this down a tad would defo help with battery life.

Bec has a great idea with the voltage options too, would be awesome to have a nice easy setting for both that give the best results for battery and stability, sometimes i have a meeting that could last the entire day with traveling on top and in these cases one would just need a phone, no internet, email or anything like that, would be awesome to set the cpu and voltage to a position where the battery will provide loads of life ;)

question, can I easily crash my phone with this app?

ndi 2010-06-24 18:44

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
By lowering top speed, no. With the custom kernel and upping speed/lowering voltage, yes.

direx 2010-06-27 09:25

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Version 0.3 is now in extras-testing. Please test it and place your vote!


About the feature requests:
I would like to implement features such as voltage control but I do not want to use a modified kernel on my device. If someone with a modified kernel is able to contribute I would be happy to give him access to the source repository!

Bec 2010-06-27 09:30

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Voting is such a mess... where is it?

A direct link perhaps?

Thanks

direx 2010-06-27 09:36

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Quote:

Originally Posted by Bec (Post 731056)
A direct link perhaps?

extras-testing package view

Be sure to test before you vote, though ;)

xuggs 2010-06-27 09:52

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Tested and it works quite well so far. Just a question what exactly does SmartReflex do when enabled?

direx 2010-06-27 10:08

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Quote:

Originally Posted by xuggs (Post 731074)
Just a question what exactly does SmartReflex do when enabled?

It allows you to save more power :). Although Nokia disabled parts of it on PR 1.2 (due to instabilities) this settings should in theory still extend your battery life a little bit.

If you are interested in what SR exactly does: there is some interesting documentation available at the TI website.

Quote from Texas Instruments:
Quote:

  • Dynamically adjusts transistor performance versus leakage,
  • Dynamically lowers voltages for idle memory bank


jbw89 2010-06-27 11:03

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
myn crashes 5 secondes after i run it it set it to 1000mhz an boom Reboot
deleting it:P i'll go to xterminal next time

direx 2010-06-27 13:17

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Quote:

Originally Posted by jbw89 (Post 731158)
myn crashes 5 secondes after i run it it set it to 1000mhz an boom Reboot

That's kinda bad. I'm sure this is a kernel issue, though. How du you normally set your device to 1GHz?

I do not have any experiences with overclocking but I can imagine that you cannot overclock your device by only setting a new "maxfreq". As I said earlier it would probably be good if someone could assist me in the overclocking part.

BTW: actually QCPUFreq's original intention was "underclocking" on vanilla kernels :)

ndi 2010-06-27 17:14

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Quote:

Originally Posted by jbw89 (Post 731158)
myn crashes 5 secondes after i run it it set it to 1000mhz an boom Reboot
deleting it:P i'll go to xterminal next time

You should really go through documentation before pushing the device at twice the original intended speed.

Have a look at voltage, for starters.

c:drive 2010-06-28 07:06

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
it would be luvly if i can able to change min freq. same as maximum(500 900 MHz is what i need) using this apps,hope u do it in next update.

NOMOS 2010-06-28 08:41

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
I have no experience with this but when I use QCPUFreq and set the max CPU speed to 800, I do see speeds of up to 800 in Conky. Does this mean I can overclock the device with this app? Or is it fooling Conky?

direx 2010-06-28 12:38

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Quote:

Originally Posted by c:drive (Post 732244)
it would be luvly if i can able to change min freq.

I personally do not see the point in changing the minimum frequency. QCPUFreq's intention is to save battery power and you won't save any battery power if your CPU only scales down to 500MHz instead of 250MHz.

Quote:

Originally Posted by NOMOS (Post 732311)
Does this mean I can overclock the device with this app?

If you are using the power kernel you should be able to overclock the device with this app (of course you somehow have to configure the voltages before - I do not know how to do that). And I guess if 800MHz is a choice for you in QCPUFreq you have already set up your power kernel correctly :)

2disbetter 2010-06-28 12:53

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
direx,

So does your application change the default values, and do these value remain after closing the app? or do the app need to remain open for the changes to last?

I ask becuase I changed my max setting to 250mhz and closed the app. Was running Conky in the background to just verify changes. Thought it worked but came back after some browsing to discover the frequency jumped to 500MHz.

Is this just a fluke? How are you verifying that your app is actually changing the paramters on the clock speed?

2d

direx 2010-06-28 13:54

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Quote:

Originally Posted by 2disbetter (Post 732590)
direx,
So does your application change the default values, and do these value remain after closing the app?

You can close the application and the settings should be saved until you reboot the device or plug/unplug the charger.

Quote:

Originally Posted by 2disbetter (Post 732590)
How are you verifying that your app is actually changing the paramters on the clock speed?

The easiest way: play a CPU-intensive game (like Bounce Evolution) and log on to your device using SSH. While playing the game issue this command:
Code:

cat /proc/cpuinfo |grep -i bogomips
and watch the speed of your CPU.

However 250 MHz seems to be a very low speed. I just noticed that for some reason the frequency goes up one level if you set minspeed=maxspeed. If you'd set your maxspeed to 250MHz then your CPU will effectively use 500MHz (the next step on the scaling scale) as maxfreq. This is very strange - maybe it's a kernel bug (or feature :) ).

I guess I am going to remove the lowest scaling step (250MHz on vanilla kernel) in the next version as it might confuse people.

ndi 2010-06-28 16:18

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Hi. :)

Enhancement request here: could you translate the raw temperature value? I almost had a heart attack. Other similar apps do this, so it shouldn't be too hard, it displays 57 or so usually (58?) which I understand is about 37C?

I assume it's already on the list, but JIC.

direx 2010-06-28 17:58

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Quote:

Originally Posted by ndi (Post 732853)
Enhancement request here: could you translate the raw temperature value?

OK, I understand. I should have warned you that this is a raw value :)

I have one problem, though. There are two possible temperature values and both do not seem quite correct:
  • temp1_input ("17" on my N900 -> way too low)
  • temp1_input_raw ("44" on my N900 -> a bit too high, but seems OK)

I chose to display the raw value as this value could possibly be a real CPU temperature in Celsius. But I guess you are right that this should not be the *actual* temperature which is why I did not put a unit behind the value in the UI.

If anyone could provide a formula how to calculate the real temperature from temp1_input or temp1_input_raw I would be happy to implement the requested feature.

direx 2010-06-29 13:55

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
I investigated the temperature thing a little bit further and I made these changes:

On vanilla kernels the temperature raw value is still being used. On power kernels I use /sys/class/power_supply/bq27200-0/temp as a temerature source, which should be more accurate. Unfortunately this is not possible on vanilla kernels.

SallyJane 2010-06-30 08:17

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Very briefly - I am seriously impressed with the improvements this simple app is making to my battery life (CPU settings 125-500, Smart Reflex disabled).

I had tried the power users kernel (Ideal settings) linked by Flandry, and was surprised and disappointed to see my battery life worsen noticeably with that.

I'll keep an eye on Battery Graph for the next couple of days and see how it goes.

KOJAN 2010-06-30 10:53

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
1 Attachment(s)
Please convert temperature to celsius like this

Flandry 2010-06-30 14:34

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Quote:

Originally Posted by SallyJane (Post 735063)
Very briefly - I am seriously impressed with the improvements this simple app is making to my battery life (CPU settings 125-500, Smart Reflex disabled).

I had tried the power users kernel (Ideal settings) linked by Flandry, and was surprised and disappointed to see my battery life worsen noticeably with that.

I'll keep an eye on Battery Graph for the next couple of days and see how it goes.

Battery Graph showed higher consumption using Ideal settings?

FYI the general consensus about 125 MHz is that it actually reduces battery life with well-behaved applications due to the slower race-to-idle (presumably why Nokia didn't use it).

The best explanation that fits with both of your observations is that you have something installed and running that doesn't let the processor sleep much (see e.g. http://talk.maemo.org/showthread.php?t=29284). Have you got some kind of CPU load monitor running to check for the culprit?

direx 2010-06-30 14:58

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Quote:

Originally Posted by KOJAN (Post 735247)
Please convert temperature to celsius like this

OK thanks. That would mean:
Code:

real = (31/54)*raw
Can somebody confirm that this formula is correct and that real/raw is linear?

gsever 2010-06-30 15:10

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Is this app equivalent to Gnome's CPU Scaling monitor?

ndi 2010-06-30 15:27

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
How does CPUFreqUI do it? It seemed to give a real temp. Can't tell if accurate.

Also, I left it there, idle, at room temperature for an hour. At 28 ambient, it shows 47 (raw). By formula, it should say 27 ambient, which is likely true, I get 27.8-28 on all sensors in here. Also, it jumped to 48 fairly quickly after opening app, so it was likely 47-48 for 27.8-28 degrees.

KOJAN 2010-06-30 15:42

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Quote:

Originally Posted by direx (Post 735506)
OK thanks. That would mean:
Code:

real = (31/54)*raw
Can somebody confirm that this formula is correct and that real/raw is linear?

I confirm this formula

SallyJane 2010-06-30 16:10

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
Flandry

Regularly checking Conky (if that's reliable enough ?) showed no rogue processes running.

No placebo either - I was surprised (given how happy many people have been with power kernel) but both Battery Eye and the DCEW showing output of lshal pointed to my battery dropping off a cliff on Ideal. No reboots though.

And my battery life on day 2 of QCPUFreq alone is noticeably, actually measurably better ( 68% now after 12 hours use, as opposed to 40 odd percent on stock and 30 odd percent on ideal ) .

I can't explain it, but there.

Overall my little N900 has been exceptionally well-behaved on both software and hardware fronts. I'm quite content to sit back and enjoy my newfound lease on battery life for now ;)

somekeystrokes 2010-06-30 16:17

Re: [Announce] QCPUFreq - save battery power by adjusting your maximum CPU speed
 
its a wonderful effort no doubt. but id like to say tht if the settings are reverted on every call...thn it makes it a little unusable.
coz u cnt set it again and again after every call!


All times are GMT. The time now is 22:44.

vBulletin® Version 3.8.8