You are not logged in.
Pages: 1
Hi all !
I installed Arch a few days ago on my laptop, a HP Compaq 6510b. Almost everything is ok, but I have a little problem with my fan. I installed cpufreqd for frequency scaling, it's ok. Then I wanted a daemon to control the fan according to the temperature, so I searched in the Wiki and found a guide.
I first installed lm_sensors, and it detected no sensors but the CPU core temp sensors. I went to the lm_sensors website, and seen that it can't work on Compaq computers. No sensors, nothing but core temp returned by hwmon, no voltage... So the daemon from the guide can't be used.
So I looked in /proc/acpi, and played a little with what I found in it. There are five fans displayed in /proc/acpi/ : C3C1, C3C2, C3C3, C3C4, C3C5. They can be turned on and off, and the real and only fan will change it's speed according to the "highest" fan activated, eg :
C3C1 : speed 5 (max)
C3C2 : speed 4
C3C3 : speed 3
C3C4 : speed 2
C3C5 : speed 1 (min)
So, if I turn C3C1 and C3C3 on, the fan turns at speed 5, and when I turn C3C1 off, it falls down to speed 3. I wrote a little script and made a menu on my desktop so I can set in one click the speed of the fan. Is this normal ? Or is it just due to the Compaq hardware which is not very well understood by the kernel ? In the same way, I have a thermal zone, TZ5, which indicates the fan speed. 0 °C : fan speed < level 3, 100 °C : max speed. :-/
Sooo... Does anybody knows a fan managing daemon, which could be configured to read CPU's temp and
1. Turn on / off several fans ?
or
2. Call a script for each temp value ?
I think I could also write a script doing this, and configure cron to launch it every 10s or so. What do you think ?
Last edited by Vladislav IV (2008-06-24 10:45:53)
Offline
go on!
Offline
Okay, it's done
My very first scripts under Linux, so don't hesitate to comment !
fan-level.sh is used to set the fan speed...
#!/bin/bash
dir=/proc/acpi/fan
v2=$dir/C3C4/state
v3=$dir/C3C3/state
v4=$dir/C3C2/state
v5=$dir/C3C1/state
case $1 in
2)
echo on > $v2
echo 3 > $v3
echo 3 > $v4
echo 3 > $v5
;;
3)
echo on > $v2
echo on > $v3
echo 3 > $v4
echo 3 > $v5
;;
4)
echo on > $v2
echo on > $v3
echo on > $v4
echo 3 > $v5
;;
5)
echo on > $v2
echo on > $v3
echo on > $v4
echo on > $v5
;;
*)
echo "Usage: fan-level VITESSE"
echo "Régler la vitesse du ventilateur sur VITESSE, de 2 à 5."
;;
esac... while check-temp.sh... well... checks the temp
and call fan-level.sh with the wanted speed.
#!/bin/bash
controleur=/root/fan-level.sh
seuil1=47
seuil2=55
seuil3=65
while [ 1 ]
do
t=`cat /proc/acpi/thermal_zone/TZ1/temperature | awk {'print $2'}`
if [ $t -lt $seuil1 ]; then v=2;
elif [ $t -lt $seuil2 ]; then v=3;
elif [ $t -lt $seuil3 ]; then v=4;
else v=5;
fi
# logger "t: $t °C ; v: $v/5"
$controleur $v
sleep 10
doneI just must tell cron to launch check-temp.sh every minute, the script runs for one minute (sleep 10 six times). But it seems strange to me... Well, I feel like if I used the Windows task planner to cool the CPU... Can I rely on cron to do this ? Is this safe ?
Edit : I forgot cron and wrote an infinite loop in check-temp.sh. So I just have to launch it at startup, and it does the job. But what a pity that monitoring tools can't work on Compaq's stuff !
Last edited by Vladislav IV (2008-06-25 08:56:33)
Offline
Hi all !
I installed Arch a few days ago on my laptop, a HP Compaq 6510b. Almost everything is ok, but I have a little problem with my fan. I installed cpufreqd for frequency scaling, it's ok. Then I wanted a daemon to control the fan according to the temperature, so I searched in the Wiki and found a guide.
stop! ho! what guide? The cpufreq daemon is not what you are looking for? Why not?
I first installed lm_sensors, and it detected no sensors but the CPU core temp sensors. I went to the lm_sensors website, and seen that it can't work on Compaq computers. No sensors, nothing but core temp returned by hwmon, no voltage... So the daemon from the guide can't be used.
I don't like that, I have a Compaq myself: 6710b... but can you explain what daemon you are talking about here?
Sooo... Does anybody knows a fan managing daemon, which could be configured to read CPU's temp and
1. Turn on / off several fans ?
or
2. Call a script for each temp value ?I think I could also write a script doing this, and configure cron to launch it every 10s or so. What do you think?
Does every laptop (mine?) have several fans? The reason I'm interested is that my fan is blowing like hell and I can feel parts of the bottom are quite hot. So only when I use cpufreq scaling powersave to 1ghz the fan will rest in peace.
You're script is interesting and I could go and test it, but I'd like to know a little more first.
--Ben
Offline
stop! ho! what guide? The cpufreq daemon is not what you are looking for? Why not?
Yes, I use cpufreqd for CPU scaling, it works. But after that, I wanted to control the fan given the temperature, which is another problem. Even though I set up cpufreqd to speed up the fan when the CPU's hot, it don't satisfy me. There is more sense giving this particular job to another process, which will not be ruled by the processor scaling one.
I don't like that, I have a Compaq myself: 6710b... but can you explain what daemon you are talking about here?
This guide : http://wiki.archlinux.org/index.php/Fan_control explains how to set up lm_sensors, then how to set up the fan controling system with pwmconfig.
The problem is that lm_sensors doesn't work on Compaq stuff (it doesn't detect any sensor but the core temp, but no fan speed, no voltage...), and the only way I can control the fan on my laptop is to turn on/off these five virtual fans. Look at the guide, it is written :
FCFANS= hwmon0/device/pwm1=hwmon0/device/fan1_inputThe real problem is : if I look in the devices under hwmon0, there is no fan input ! So pwmconfig can't regulate the fan speed. That's why I looked for another solution.
Also, as I looked at the thermal zones, I found the one which is supposed to control the fan :
$ cat /proc/acpi/thermal_zone/TZ0/trip_points
critical (S5): 256 C
active[0]: 82 C: devices=C3C1
active[1]: 74 C: devices=C3C2
active[2]: 66 C: devices=C3C3
active[3]: 45 C: devices=C3C4
active[4]: 30 C: devices=C3C5Given the critical temp (256 °C) I think it's the GPU sensor (but I think 256 °C is quite hot, even as critical, for that kind of GPU...). As you can see, it should increase the fan speed when this thermal sensor reach 30, 45, 66... But in fact, it's always < 50 °C, so the fan will keep turning slowly. Even if the CPU is at 65 °C
So I thought it was not stupid to speed up the fan while looking at another thermal sensor (the CPU in my case).
I think I should also improve my script to make it look at several temperatures (CPU, GPU...) and adjust the fan speed to keep cool every component.
Does every laptop (mine?) have several fans? The reason I'm interested is that my fan is blowing like hell and I can feel parts of the bottom are quite hot. So only when I use cpufreq scaling powersave to 1ghz the fan will rest in peace.
You're script is interesting and I could go and test it, but I'd like to know a little more first.
There are one or two fans, even three for the more powerful ones (with dedicated gaming 3D card), but in my case (6510b) there is only one. One physical, but under /proc/acpi/fan there are five fans, which correspond to the five speeds of the laptop's fan.
You can always install lm_sensors and a ressources monitor (I use gkrellm) to keep an eye open on all the temperatures and CPU usage. Then go under /proc/acpi/fan, and if you have four or five fans (like C3C1, C3C2, ..., C3C5), you can turn them on, one at a time, from the last to the first. You should hear your laptop's fan speed increase as you activate the different levels.
Oh, and as I said, in my case the thermal zone TZ5 is the fan speed. So don't panic if you see a thermal sensor going from 0 °C to 100 °C while you play with the fan ![]()
Offline
ok, thanks... I'm off to investigate ![]()
Offline
Pages: 1