You are not logged in.
Pages: 1
Ok, so what I'm interested in is automatically changing the cpu clock after <n> minutes and putting the clock back to "performance" governor when the mouse or keyboard is touched. Yes, I have tried the cpufrequtils and its ondemand governor with p4-clockmod (Celeron M inside) and it works ok, but not the way I want it. It is dynamic, but it's too fast. It changes clock immediately. What I want is to be able to automatically change it after 30mins, and put it back on to 1700MHz when the mouse or keyboard activity is present. So that's something like a screensaver from xset.
I would want it to execute this after <n> minutes:
echo <some_cpu_clock> > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed(p4-clockmod will already be loaded at boot)
Any ideas? ![]()
Last edited by archman-cro (2010-05-10 16:09:18)
Offline
To implement this in a clean way you'll have to use X's idle time - but it probably won't be fun.
May I ask how ondemand reducing the frequency when there is no load presents a problem?
What exactly is your use case?
Offline
Ondemand is a problem for me cause when I stop working something, it automatically in a second drops the clock to the minimum, and when I want to do something after 10 seconds or so, I experience a slowdown when the clock is "rasing up", so that governor isn't really good for me. If you understand what i'm saying... ![]()
So, basically, I want something "less responsive" in terms of clock changes. Ondemand ones are too prompt for me. ![]()
Any further ideas about what you mentioned (X)?
Btw, found this code to determine the idle time from xscreensaver, but it only reports 6 ms max, dunno why...
http://coderrr.wordpress.com/2008/04/20 … e-in-unix/
Last edited by archman-cro (2010-05-10 11:32:58)
Offline
@archman-cro:
Actually, the program is alright. The 6 ms is the time that's elapsed between the XScreenSaverQueryInfo() function call key press (the enter after "./idle").
You could include a sleep() to circumvent this issue making the code look like:
#include <X11/extensions/scrnsaver.h>
main() {
XScreenSaverInfo *info = XScreenSaverAllocInfo();
Display *display = XOpenDisplay(0);
sleep(5);
XScreenSaverQueryInfo(display, DefaultRootWindow(display), info);
printf("%u ms\n", info->idle);
}Now do the same while waiting the 5 seconds but do not press any keys or move the mouse during that time. It will report ~5000 ms as expected.
Offline
My thoughts: cpufreq isn't too fast, it's too *slow*... Can't you set it so that it changes to the desired frequency faster? I know I did that one or two years ago when I used p4-clockmod. You only have to change one value in /sys/devices/system/cpu/cpufreq/cpu0/ or something like that.
Offline
I don't know. It was too fast on my machine. I was getting slowdowns all the time.
Offline
Pages: 1