Difference between revisions of "Fan speed control (Italiano)"

From ArchWiki
Jump to: navigation, search
(use i18n template)
(Copiato quasi in blocco da pag. int.)
Line 2: Line 2:
 
{{i18n|Fan Speed Control}}
 
{{i18n|Fan Speed Control}}
  
Controllare la velocità (e il rumore!) della ventola della tua CPU è facile!
+
Controllare la velocità (e il rumore!) della ventola della CPU è facile!
  
'''Questo può rovinare il tuo hardware. La ventola della CPU serve per raffreddarla e in questa guida verrà spenta per un paio di secondi. Se non sei preparato a questo, non farlo!'''
+
'''Ciò che segue potrebbe danneggiare il proprio hardware. La ventola della CPU serve per raffreddarla e in questa guida verrà spenta per un paio di secondi. Se non si è preparati a questo, non farlo!'''
  
  
 
=== lm-sensors ===
 
=== lm-sensors ===
  
Per prima cosa, devi sistemare lm-sensors. È spiegato [[Lm_sensors|qui]]e]]
+
Per prima cosa, bisogna configurare lm-sensors. È spiegato [[Lm_sensors|qui]].
  
Una volta che hai lm-sensors installato, dovresti avere delle letture con 'sensors'.
+
Una volta installato lm-sensors, si possono ottenere delle letture con "sensors".
  
 
<pre>$ sensors
 
<pre>$ sensors
w83627hf-isa-0290
+
coretemp-isa-0000
 
Adapter: ISA adapter
 
Adapter: ISA adapter
VCore 1:   +1.14 V (min = +0.00 V, max = +4.08 V)            
+
Core 0:     +29.0°C (high = +76.0°C, crit = +100.0°C)
VCore 2:   +2.67 V (min = +0.00 V, max = +4.08 V)            
+
 
+3.3V:     +3.39 V (min = +2.82 V, max = +3.79 V)            
+
coretemp-isa-0001
+5V:       +5.19 V (min = +3.47 V, max = +0.40 V)       ALARM  
+
Adapter: ISA adapter
+12V:     +12.40 V  (min = +12.95 V, max =  +7.96 V)       ALARM 
+
Core 1:     +29.0°C (high = +76.0°C, crit = +100.0°C)
-12V:     -7.01 V  (min =  +1.78 V, max = -10.63 V)       ALARM 
+
 
-5V:      -3.84 V  (min =  -7.66 V, max =  +2.29 V)            
+
coretemp-isa-0002
V5SB:     +5.75 V  (min =  +0.08 V, max =  +0.54 V)       ALARM 
+
Adapter: ISA adapter
VBat:     +3.10 V  (min =  +0.54 V, max =  +0.13 V)       ALARM 
+
Core 2:      +31.0°C (high = +76.0°C, crit = +100.0°C)
fan1:    2428 RPM  (min =    0 RPM, div = 4)                   
+
 
fan2:        0 RPM  (min = 1630 RPM, div = 4)             ALARM 
+
coretemp-isa-0003
fan3:    2191 RPM  (min = 6367 RPM, div = 4)              ALARM 
+
Adapter: ISA adapter
temp1:      +38°C (high =   +20°C, hyst =   +68°C)   sensor = thermistor          
+
Core 3:      +29.0°C (high = +76.0°C, crit = +100.0°C)   
temp2:     +39.5°C (high =   +65°C, hyst =   +60°C)  sensor = diode         
+
 
temp3:    +38.0°C  (high =  +65°C, hyst =  +60°C)  sensor = thermistor          (beep)
+
it8718-isa-0290
vid:      +0.000 V  (VRM Version 2.4)
+
Adapter: ISA adapter
alarms: 
+
Vcc:        +1.14 V  (min = +0.00 V, max =  +4.08 V)  
beep_enable:
+
VTT:         +2.08 V  (min =  +0.00 V, max = +4.08 V)  
          Sound alarm enabled''
+
+3.3V:      +3.33 V  (min =  +0.00 V, max =  +4.08 V)  
 +
NB Vcore:   +0.03 V  (min =  +0.00 V, max =  +4.08 V)  
 +
VDRAM:       +2.13 V  (min =  +0.00 V, max =  +4.08 V)  
 +
fan1:        690 RPM  (min =   10 RPM)
 +
temp1:      +37.5°C (low  = +129.5°C, high = +129.5°C) sensor = thermistor
 +
temp2:       +25.0°C (low  = +127.0°C, high = +127.0°C) sensor = thermal diode
 
</pre>
 
</pre>
  
 
If your output does not display an RPM for your CPU fan, and you are positive it is running, you need to increase the fan divisor. If your fan speed is shown and higher than 0, skip the next step.
 
If your output does not display an RPM for your CPU fan, and you are positive it is running, you need to increase the fan divisor. If your fan speed is shown and higher than 0, skip the next step.
'''
 
Increasing fan_div:'''
 
  
The first line of the sensors output is the chipset your motherboard uses to read the speeds/temps/voltages. Make a backup first:
+
====Increasing fan_div====
Code:
+
  
<pre>cp /etc/sensors.conf /etc/sensors.conf_original</pre>
+
The first line of the sensors output is the chipset your motherboard uses to read the speeds/temps/voltages.  
  
Edit the /etc/sensors.conf file as root
+
Create your libsensors configuration file by copying the default libsensors' configuration file to /etc/sensors.d/
  
<pre>nano /etc/sensors.conf</pre>
+
<pre>sudo cp /etc/sensors3.conf /etc/sensors.d/sensors.conf</pre>
  
and look up your exact chipset. The names all look alike, so make sure the one you are editing is yours. Add the line fanX_div 4 near the start of your chipset config. Replace the X with the number of your CPU fan's, for me that was 2. You have to figure out for yourself which one it is, but it's probably 1, 2 or 3.
+
Now edit /etc/sensors.d/sensors.conf
 +
 
 +
<pre>sudo nano /etc/sensors.d/sensors.conf</pre>
 +
 
 +
and look up your exact chipset. A few chipset names are similar, so make sure the one you are editing is yours. Add the line 'set fanX_div 4' near the start of your chipset config, replacing X with the number of CPU fans your system has.
  
 
Save, and run:
 
Save, and run:
Line 58: Line 64:
 
which will reload the sensors.conf's set variables.
 
which will reload the sensors.conf's set variables.
 
Run sensors again and check if there is an RPM readout. If not, increase the divisor to 8, 16 or 32. YMMV!
 
Run sensors again and check if there is an RPM readout. If not, increase the divisor to 8, 16 or 32. YMMV!
 
You can safely ignore anything that's not fanX_div. I would advise you to leave the other default settings as they are.
 
  
 
=== pwmconfig ===
 
=== pwmconfig ===
 +
 +
(If you are a very cool hacker, you might want to skip this section and write /etc/fancontrol by your own, which also saves you from hearing all your fans at full speed)
  
 
Once you have lm sensors properly configured, run pwmconfig to test and configure speed control of your fans:
 
Once you have lm sensors properly configured, run pwmconfig to test and configure speed control of your fans:
Line 68: Line 74:
 
Follow the instructions in pwmconfig to set up basic speeds.
 
Follow the instructions in pwmconfig to set up basic speeds.
  
The default configuration options should create a new file, <tt>/etc/fancontrol</tt>.   
+
The default configuration options should create a new file, {{Codeline|/etc/fancontrol}}.   
  
 
Follow the instructions in pwmconfig to set up speeds.
 
Follow the instructions in pwmconfig to set up speeds.
Line 74: Line 80:
 
==== Tweaking ====
 
==== Tweaking ====
  
<strong>Second warning:</strong> Some of the steps outlined below describe how to tweak fan speeds.  Before doing this be sure you have a low cpu load and are comfortable playing around.  If at any time during tweaking you notice the CPU temperature start to rise dramatically, do a <tt>echo "255" > /sys/class/hwmon/hwmon0/device/pwm1</tt> to spin up the fan all the way until things cool down.  Basically, you should know what your doing before fooling with the configuration file
+
<strong>Second warning:</strong> Some of the steps outlined below describe how to tweak fan speeds.  Before doing this be sure you have a low cpu load and are comfortable playing around.  If at any time during tweaking you notice the CPU temperature start to rise dramatically, do a {{Codeline|echo "255" > /sys/class/hwmon/hwmon0/device/pwm1}} to spin up the fan all the way until things cool down.  Basically, you should know what you're doing before fooling with the configuration file.
  
If your want more control, you probably will need to tweak the generated configuration in order get the results you expect.  Here is a sample configuration file:
+
{{Note|On several systems, the included script may report errors as it trys to calibrate your fan to the PWM.  You may safely ignore these as errors.  The problem is that the script doesn't wait long enough before ramping up or down the PWM.}}
 +
 
 +
If you want more control, you will probably need to tweak the generated configuration.  Here is a sample configuration file:
  
 
<pre>
 
<pre>
 
INTERVAL=10
 
INTERVAL=10
 +
 +
DEVPATH=hwmon0=devices/platform/coretemp.0 hwmon2=devices/platform/w83627ehf.656
 +
DEVNAME=hwmon0=coretemp hwmon2=w83627dhg
 +
 
FCTEMPS=hwmon0/device/pwm1=hwmon0/device/temp1_input
 
FCTEMPS=hwmon0/device/pwm1=hwmon0/device/temp1_input
 
FCFANS= hwmon0/device/pwm1=hwmon0/device/fan1_input
 
FCFANS= hwmon0/device/pwm1=hwmon0/device/fan1_input
Line 92: Line 104:
 
The rest of the configuration file is split into (at least) two values per configuration option.  Each configuration option first points to a PWM device which is written to which sets the fan speed.  The second "field" is the actual value to set.  This allows you to monitor and control multiple fans and temperatures (if your pc supports it).
 
The rest of the configuration file is split into (at least) two values per configuration option.  Each configuration option first points to a PWM device which is written to which sets the fan speed.  The second "field" is the actual value to set.  This allows you to monitor and control multiple fans and temperatures (if your pc supports it).
  
* <strong>FCTEMPS</strong>: The temperature input device to read for cpu temperature.  The above example corresponds to <tt>/sys/class/hwmon/hwmon0/device/temp1_input</tt>.
+
* <strong>FCTEMPS</strong>: The temperature input device to read for cpu temperature.  The above example corresponds to {{Codeline|/sys/class/hwmon/hwmon0/device/temp1_input}}.
* <strong>FCFANS</strong>: The current fan speed, which can be read (like the temperature) in <tt>/sys/class/hwmon/hwmon0/device/fan1_input</tt>
+
* <strong>FCFANS</strong>: The current fan speed, which can be read (like the temperature) in {{Codeline|/sys/class/hwmon/hwmon0/device/fan1_input}}
 
* <strong>MINTEMP</strong>: The temperature (&deg;C) at which to <em>SHUT OFF</em> the cpu fan.  Efficicent CPU's often will not need a fan while idling.  Be sure to set this to a temperature that you <em>know</em> is safe.  Setting this to 0 is not reccommended, use a sane value.
 
* <strong>MINTEMP</strong>: The temperature (&deg;C) at which to <em>SHUT OFF</em> the cpu fan.  Efficicent CPU's often will not need a fan while idling.  Be sure to set this to a temperature that you <em>know</em> is safe.  Setting this to 0 is not reccommended, use a sane value.
 
* <strong>MAXTEMP</strong>: The temperature (&deg;C) at which to spin the fan at it's <em>MAXIMUM</em> speed.  This should be probably be set to perhaps 10 or 20 degrees (&deg;C) below your CPU's critical/shutdown temperature.  Setting it closer to MINTEMP will result in higher fan speeds overall.
 
* <strong>MAXTEMP</strong>: The temperature (&deg;C) at which to spin the fan at it's <em>MAXIMUM</em> speed.  This should be probably be set to perhaps 10 or 20 degrees (&deg;C) below your CPU's critical/shutdown temperature.  Setting it closer to MINTEMP will result in higher fan speeds overall.
* <strong>MINSTOP</strong>: The PWM value at which your fan stops spinning.  Each fan is a little different.  Power tweakers can <tt>cat</tt> different values (between 0 and 255) to <tt>/sys/class/hwmon/hwmon0/device/pwm1</tt> and then watch the cpu fan.  When it stops, use this value.
+
* <strong>MINSTOP</strong>: The PWM value at which your fan stops spinning.  Each fan is a little different.  Power tweakers can {{Codeline|cat}} different values (between 0 and 255) to {{Codeline|/sys/class/hwmon/hwmon0/device/pwm1}} and then watch the cpu fan.  When it stops, use this value.
 
* <strong>MINSTART</strong>: The PWM value at which your fan starts to spin again.  This is often a higher value than MINSTOP as more voltage is required to overcome inertia.
 
* <strong>MINSTART</strong>: The PWM value at which your fan starts to spin again.  This is often a higher value than MINSTOP as more voltage is required to overcome inertia.
 +
 +
There are also two settings fancontrol needs to verify the configuration file is still up to date. The lines start with the setting name and a equality sign, followed by groups of hwmon-class-device=setting, seperated by spaces. You need to specify each setting for each hwmon class device you use anywhere in the config, or fancontrol wont work.
 +
 +
* <strong>DEVPATH</strong>: Sets the physical device. You can determine this by executing the command
 +
readlink -f /sys/class/hwmon/<hwmon-device>/device | sed -e 's/^\/sys\///'
 +
* <strong>DEVNAME</strong>: Sets the name of the device. Try
 +
cat /sys/class/hwmon/<hwmon-device>/device/name | sed -e 's/[[:space:]=]/_/g'
  
 
=== fancontrol ===
 
=== fancontrol ===
Line 103: Line 122:
 
Try to run fancontrol:
 
Try to run fancontrol:
 
<pre>/usr/sbin/fancontrol</pre>
 
<pre>/usr/sbin/fancontrol</pre>
 +
 +
Also notice this bug: [http://bugs.archlinux.org/task/17775] (Initscript outputs FAIL when it should be DONE)
  
 
It should start up and you'll probably hear your CPU fans spin down.
 
It should start up and you'll probably hear your CPU fans spin down.
Line 112: Line 133:
  
 
For Dell Latitude/Inspiron laptops, you may want to use i8kutils/i8kmon.
 
For Dell Latitude/Inspiron laptops, you may want to use i8kutils/i8kmon.
 +
 +
=== simple bash script to fine tune fan speed ===
 +
Run this as root if you'd like to see how various pwm values translate into fan RPM.  As you can see, this script assumes that you have fancontrol running and disables it for you, then re-enables it when you're finished.  Enjoy.
 +
 +
<pre>#!/bin/bash
 +
clear
 +
 +
#################################################
 +
# change the following lines to match your system
 +
#################################################
 +
pwmcontrol=/sys/class/hwmon/hwmon4/device/pwm1
 +
fanrpmread=/sys/class/hwmon/hwmon4/device/fan1_input
 +
 +
# do not edit below this line
 +
#################################################
 +
log=`pwd`/fandata.log
 +
echo "PWM,RPM" > $log
 +
 +
echo "This script will set your PWM to values from full power down to 0 decreasing in"
 +
echo "approx 5 % steps and pausing 10 sec between steps to allow the fan RPM to catch"
 +
echo "up to the new settings.  Data are logged to ${log}"
 +
echo "which can be used to generate a graph or use as-is."
 +
 +
collectdata() {
 +
array=( 255 242 230 217 204 191 178 165 152 139 126 113 100 87 74 48 22 0 )
 +
for item in ${array[*]}
 +
do
 +
echo $item > $pwmcontrol
 +
sleep 10s
 +
rpm=`cat ${fanrpmread}`
 +
echo $item,$rpm >> $log
 +
echo "PWM: ${item} RPM: ${rpm}"
 +
done
 +
}
 +
 +
/etc/rc.d/fancontrol stop
 +
echo "1" > ${pwmcontrol}_enable
 +
 +
collectdata
 +
 +
echo "0" > ${pwmcontrol}_enable
 +
/etc/rc.d/fancontrol start</pre>

Revision as of 15:29, 12 October 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Controllare la velocità (e il rumore!) della ventola della CPU è facile!

Ciò che segue potrebbe danneggiare il proprio hardware. La ventola della CPU serve per raffreddarla e in questa guida verrà spenta per un paio di secondi. Se non si è preparati a questo, non farlo!


lm-sensors

Per prima cosa, bisogna configurare lm-sensors. È spiegato qui.

Una volta installato lm-sensors, si possono ottenere delle letture con "sensors".

$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0:      +29.0°C  (high = +76.0°C, crit = +100.0°C)  

coretemp-isa-0001
Adapter: ISA adapter
Core 1:      +29.0°C  (high = +76.0°C, crit = +100.0°C)  

coretemp-isa-0002
Adapter: ISA adapter
Core 2:      +31.0°C  (high = +76.0°C, crit = +100.0°C)  

coretemp-isa-0003
Adapter: ISA adapter
Core 3:      +29.0°C  (high = +76.0°C, crit = +100.0°C)  

it8718-isa-0290
Adapter: ISA adapter
Vcc:         +1.14 V  (min =  +0.00 V, max =  +4.08 V)   
VTT:         +2.08 V  (min =  +0.00 V, max =  +4.08 V)   
+3.3V:       +3.33 V  (min =  +0.00 V, max =  +4.08 V)   
NB Vcore:    +0.03 V  (min =  +0.00 V, max =  +4.08 V)   
VDRAM:       +2.13 V  (min =  +0.00 V, max =  +4.08 V)   
fan1:        690 RPM  (min =   10 RPM)
temp1:       +37.5°C  (low  = +129.5°C, high = +129.5°C)  sensor = thermistor
temp2:       +25.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermal diode

If your output does not display an RPM for your CPU fan, and you are positive it is running, you need to increase the fan divisor. If your fan speed is shown and higher than 0, skip the next step.

Increasing fan_div

The first line of the sensors output is the chipset your motherboard uses to read the speeds/temps/voltages.

Create your libsensors configuration file by copying the default libsensors' configuration file to /etc/sensors.d/

sudo cp /etc/sensors3.conf /etc/sensors.d/sensors.conf

Now edit /etc/sensors.d/sensors.conf

sudo nano /etc/sensors.d/sensors.conf

and look up your exact chipset. A few chipset names are similar, so make sure the one you are editing is yours. Add the line 'set fanX_div 4' near the start of your chipset config, replacing X with the number of CPU fans your system has.

Save, and run:

sudo sensors -s

which will reload the sensors.conf's set variables. Run sensors again and check if there is an RPM readout. If not, increase the divisor to 8, 16 or 32. YMMV!

pwmconfig

(If you are a very cool hacker, you might want to skip this section and write /etc/fancontrol by your own, which also saves you from hearing all your fans at full speed)

Once you have lm sensors properly configured, run pwmconfig to test and configure speed control of your fans:

pwmconfig

Follow the instructions in pwmconfig to set up basic speeds.

The default configuration options should create a new file, Template:Codeline.

Follow the instructions in pwmconfig to set up speeds.

Tweaking

Second warning: Some of the steps outlined below describe how to tweak fan speeds. Before doing this be sure you have a low cpu load and are comfortable playing around. If at any time during tweaking you notice the CPU temperature start to rise dramatically, do a Template:Codeline to spin up the fan all the way until things cool down. Basically, you should know what you're doing before fooling with the configuration file.

Note: On several systems, the included script may report errors as it trys to calibrate your fan to the PWM. You may safely ignore these as errors. The problem is that the script doesn't wait long enough before ramping up or down the PWM.

If you want more control, you will probably need to tweak the generated configuration. Here is a sample configuration file:

INTERVAL=10

DEVPATH=hwmon0=devices/platform/coretemp.0 hwmon2=devices/platform/w83627ehf.656
DEVNAME=hwmon0=coretemp hwmon2=w83627dhg

FCTEMPS=hwmon0/device/pwm1=hwmon0/device/temp1_input
FCFANS= hwmon0/device/pwm1=hwmon0/device/fan1_input
MINTEMP=hwmon0/device/pwm1=20
MAXTEMP=hwmon0/device/pwm1=55
MINSTART=hwmon0/device/pwm1=150
MINSTOP=hwmon0/device/pwm1=105
  • INTERVAL: how often the daemon should poll cpu temps and adjust fan speeds. Interval is in seconds.

The rest of the configuration file is split into (at least) two values per configuration option. Each configuration option first points to a PWM device which is written to which sets the fan speed. The second "field" is the actual value to set. This allows you to monitor and control multiple fans and temperatures (if your pc supports it).

  • FCTEMPS: The temperature input device to read for cpu temperature. The above example corresponds to Template:Codeline.
  • FCFANS: The current fan speed, which can be read (like the temperature) in Template:Codeline
  • MINTEMP: The temperature (°C) at which to SHUT OFF the cpu fan. Efficicent CPU's often will not need a fan while idling. Be sure to set this to a temperature that you know is safe. Setting this to 0 is not reccommended, use a sane value.
  • MAXTEMP: The temperature (°C) at which to spin the fan at it's MAXIMUM speed. This should be probably be set to perhaps 10 or 20 degrees (°C) below your CPU's critical/shutdown temperature. Setting it closer to MINTEMP will result in higher fan speeds overall.
  • MINSTOP: The PWM value at which your fan stops spinning. Each fan is a little different. Power tweakers can Template:Codeline different values (between 0 and 255) to Template:Codeline and then watch the cpu fan. When it stops, use this value.
  • MINSTART: The PWM value at which your fan starts to spin again. This is often a higher value than MINSTOP as more voltage is required to overcome inertia.

There are also two settings fancontrol needs to verify the configuration file is still up to date. The lines start with the setting name and a equality sign, followed by groups of hwmon-class-device=setting, seperated by spaces. You need to specify each setting for each hwmon class device you use anywhere in the config, or fancontrol wont work.

  • DEVPATH: Sets the physical device. You can determine this by executing the command
readlink -f /sys/class/hwmon/<hwmon-device>/device | sed -e 's/^\/sys\///'
  • DEVNAME: Sets the name of the device. Try
cat /sys/class/hwmon/<hwmon-device>/device/name | sed -e 's/[[:space:]=]/_/g'

fancontrol

Try to run fancontrol:

/usr/sbin/fancontrol

Also notice this bug: [1] (Initscript outputs FAIL when it should be DONE)

It should start up and you'll probably hear your CPU fans spin down.

If it's working, in order to run at boot simply add "fancontrol" to DAEMONS in /etc/rc.conf, as a fancontrol init script is now provided by default!

Most of this howto is from [Ubuntu forums] and [Ubuntu guide].

For Dell Latitude/Inspiron laptops, you may want to use i8kutils/i8kmon.

simple bash script to fine tune fan speed

Run this as root if you'd like to see how various pwm values translate into fan RPM. As you can see, this script assumes that you have fancontrol running and disables it for you, then re-enables it when you're finished. Enjoy.

#!/bin/bash
clear

#################################################
# change the following lines to match your system
#################################################
pwmcontrol=/sys/class/hwmon/hwmon4/device/pwm1
fanrpmread=/sys/class/hwmon/hwmon4/device/fan1_input

# do not edit below this line
#################################################
log=`pwd`/fandata.log
echo "PWM,RPM" > $log

echo "This script will set your PWM to values from full power down to 0 decreasing in"
echo "approx 5 % steps and pausing 10 sec between steps to allow the fan RPM to catch"
echo "up to the new settings.  Data are logged to ${log}"
echo "which can be used to generate a graph or use as-is."

collectdata() {
array=( 255 242 230 217 204 191 178 165 152 139 126 113 100 87 74 48 22 0 )
for item in ${array[*]}
do
echo $item > $pwmcontrol
sleep 10s
rpm=`cat ${fanrpmread}`
echo $item,$rpm >> $log
echo "PWM: ${item} RPM: ${rpm}"
done
}

/etc/rc.d/fancontrol stop
echo "1" > ${pwmcontrol}_enable

collectdata

echo "0" > ${pwmcontrol}_enable
/etc/rc.d/fancontrol start