On Thu, Jun 11, 2009 at 09:46:58AM +0200, Jan Stary wrote: > On Jun 10 12:09:26, Joachim Schipper wrote: > > On Wed, Jun 10, 2009 at 11:53:39AM +0200, Jan Stary wrote: > > > Scenario: 4.5 on MSI Wind PC, everything works. I use this machine > > > because it is relatively low-power and quiet. > > > > > > The fan rotation changes with how much the CPU is used > > > (could someone translate this into the real thing please?), > > > without me doing anything about it on the OS level. > > > > > > Unless I run something heavy, such as launching mozilla, the fan keeps > > > pretty quiet (below the level of noise that would annoy me), but still, > > > it could be quiter. Is there a way to control the fan RPM from the OS? > > > (Unsurprisingly, hw.sensors.adt0.fan0 is readonly.) > > > > This is not an answer to your query, but are you sure that turning off > > the cooling for the CPU is a good idea? It does turn on for a reason... > > > > You may want to investigate hw.setperf, which may be used to put the CPU > > in a low-power (and -performance) state. Try sysctl hw.setperf=0 (the > > lowest possible state). > > Setting hw.setperf=0 indeed lower the fan rotation, but also makes > hw.cpuspeed=191 which is almost unusable for me then ... > > My point is, there is, probably (please correct me), a table that says > "with this CPU voltage/power/temperature, rotate the fan this fast". > Where exactly is that? Can that be controlled?
I don't think there is such a table. hw.setperf can be used to reduce the cpu speed (and you don't need to set hw.setperf=0, of course; as noted above, look at hw.cpuspeed), but the fan is likely activated by CPU *temperature*. Which brings us back to my first point: you probably don't want to turn that off. You could hack something together, of course. Use apmd -C to make the CPU run as cool as possible unless it's actually used, and hack some sensorsd scripts to run apm -L and apm -C as the temperature gets too high/sufficiently low. The downside of these sensorsd scripts, of course, is that they will necessarily throttle your CPU when you're using it heavily. I use something like this to make sensorsd switch the machine to low-performance mode when it gets too hot (not related to fan speed; if left to run at 100% utilizations for long enough, this machine will get so hot that the BIOS will stop it to prevent damage to the CPU. I'd rather lose a bit of performance.) Note that this script will not take the machine out of low-power mode when it is not connected to the mains, as I might well have set low-power mode to extend battery life. Joachim sensorsd.conf: temp:high=95C:command=/etc/sensorsd.hot %l sensorsd.hot: #!/bin/sh case "$1" in below|within) if sysctl hw.sensors.acpiac0.indicator0 | grep -q On; then logger -t "$0" "CPU is cool enough, ending low-performance mode" apm -C fi ;; high) logger -t "$0" "Forcing a lower CPU speed to prevent overheating" apm -L ;; invalid|uninitialised) ;; *) echo "Unknown argument $1" >&2 exit 1 esac Joachim