LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-21-2008, 09:51 PM   #1
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194
Which program or module controls fan speed?


How do I figure out what program or module is controlling the cpu fan speed in my computer?

I have some problems with fan speeds, so I'd like to look at the program documentation or even source code. But I don't know what program or module is doing that job.

I saw some post about probing for sensors and tried that and it told me what module to enable to be able to read the sensors now identified (in KSensors) as "it8716 sensors". I would expect the fan control on the motherboard to be fairly closely associated with the fan sensors, so that "it8716" ought to be a good hint at what kind of fan control I have. But I don't know how to use that hint.

There is a problem, that I think is a BIOS flaw, causing the CPU fan to sometimes fail to start. The computer is in a cold room and before Linux starts the BIOS is in control of the fan, and starting cold I think the BIOS aims for an impossibly low fan speed. Once it is failing to start, the fan needs full power to actually start. The CPU needs to get quite hot before whatever controls the fan provides full power. It would be much better if whatever manages that in Linux checked the fan speed as soon as the sensor module was loaded and if the speed was below some minimum immediately give it full power, then back off the power after the speed is up.

I think the motherboard controlled case fan also allows software speed control, but the BIOS doesn't control it. Maybe I'm wrong, but if I'm right, I'd like to enable that control. Now that fan is always at 3000 RPM and is too loud at that speed and moving far more air than it needs to.
 
Old 02-22-2008, 11:45 PM   #2
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,247
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
a quick apropos query reveals the answers

Code:
default@debianetch:/~$ apropos fan
fancontrol (8)       - automated software based fan speed regulation
pwmconfig (8)        - tests the PWM outputs of sensors and configures fancontrol

a starting point at least.. I'm sure you can find info on usage now that you know what to search for..
 
Old 02-23-2008, 08:03 AM   #3
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Original Poster
Rep: Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194
When I try that, it respond
Code:
fan: nothing appropriate.
So I assumed I didn't have those installed. But
Code:
apt-file search fancontrol
told me it is in lm-sensors, which is installed. I wonder what is wrong with apropos, but "man fancontrol" gives me some info I'll dig through when I have time later. Thanks for the starting point.
 
Old 02-23-2008, 02:02 PM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Original Poster
Rep: Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194
I'm pretty sure that fancontrol isn't the thing controlling the CPU fan. Maybe I should try to figure out how to make it control the other fan, but first I'd really like to know what is controlling the CPU fan.

fancontrol creates a file /var/run/fancontrol.pid so you can communicate with it while its running. But that file was never created, so fancontrol wasn't run, but something is controlling the CPU fan.

Earlier, I didn't know whether anything was controlling the CPU speed, so I installed cpufreqd (misunderstanding its description and thinking it would report info about what was controlling CPU speed). It deinstalled the thing that was controlling CPU speed, so nothing was. Realizing that had happened, I checked its Dependencies tab in Synaptic and saw cpufreqd conflicts with cpudyn and powernowd. So I tried installing each of those, but neither of those turned out to be the thing that had been controlling CPU speed. I booted up the liveCD and did comparisons between what was running there and what was running on the installed copy and finally figured out powersaved was the thing cpufreqd had deinstalled. powersaved's dependecies conflict with each of those other three, but each of the other three say they only conflict with each other, not with powersaved (sure would be nice if synaptic reflected the conflicts is such cases).

Anyway, I'm worried about doing something similar and breaking the partial fan control that is working now if I try to use something like fancontrol before finding the program doing the work now.

I think powersaved can control fans, but its man pages are totally uninformative. Based on something on the man page its page linked to, I tried
Code:
powersave get-fan-info -F
I didn't really understand what that is supposed to do, but it reported
Code:
No fan devices available.
so I think it isn't controlling the CPU fan.

Something called powertweakd is also running (and created the file /var/run/powertweakd.pid and also has man pages I don't understand. Those seem to say to use gpowertweak to control it, which I tried and it responds
Code:
Error creating socket to : /var/run/powertweakd Connection refused
Anyway, dead end in all directions tried so far. I'm still looking for the answer to the question I started this thread with.
 
Old 02-23-2008, 11:29 PM   #5
asusfan
LQ Newbie
 
Registered: Feb 2008
Posts: 1

Rep: Reputation: 0
Lightbulb some first steps to get started

Try the following (the examples are for fedora distribution, kernel 2.6):

first run sensors-detect. I answered all questions for probing with yes. This should generate a file /etc/sysconfig/lm_sensors that contains the modprobe commands to load the sensor kernel drivers for your motherboard. This configuration file is "executed" during linux boot by /etc/init.d/lm_sensors

Now you can check if the fan sensors are proberly detected, by either running /etc/init.d/lm_sensors status or just sensors.
The output is like:
Code:
adt7463-i2c-0-2d
Adapter: SMBus I801 adapter at 0400
V1.5:      +0.000 V  (min =  +0.00 V, max =  +3.32 V)   
VCore:     +1.219 V  (min =  +0.00 V, max =  +2.99 V)   
V3.3:      +4.383 V  (min =  +0.00 V, max =  +4.38 V)   
V5:        +3.268 V  (min =  +0.00 V, max =  +6.64 V)   
V12:       +0.000 V  (min =  +0.00 V, max = +15.94 V)   ALARM
CPU_Fan:   2106 RPM  (min =    0 RPM)                     
GPU_Fan:   2306 RPM  (min =    0 RPM)                     
CPU Temp: +71.00C  (low  =   +38C, high =   +97C)       
Board Temp:
          +53.75C  (low  =  -127C, high =  +127C)      
GPU Temp: +57.25C  (low  =  -127C, high =  +127C)       
CPU_PWM:   135
GPU_PWM:   133
Fan3_PWM:    0
vid:      +1.708 V  (VRM Version 1.3)
You now may also edit /etc/sensors.conf, then find the section for your chip to adjust the names for your fans or set ignore fans which you don't have. After you make changes in /etc/sensors.conf you need to run sensors -s to activate it.

The next step would be to run pwmconfig that generates the configuration file for fancontrol.

However I'm stuck here because I didn't figure out yet how to set the fans to manually controlled. There is a tool on windows called Speedfan, that can do it and runs well on my laptop.

Hope it helps you to get a step further...

PS: you may also like the tool gkrellm that displays the CPU and fan status (and much more) in a fancy GUI


EDIT:
I just saw it seems there is a problem in pwmconfig but I didn't try it yet:
http://lists.lm-sensors.org/pipermai...ry/022428.html

Last edited by asusfan; 02-24-2008 at 12:28 AM.
 
Old 02-24-2008, 08:46 AM   #6
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Original Poster
Rep: Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194
Quote:
Originally Posted by asusfan View Post
first run sensors-detect. I answered all questions for probing with yes.
I think that is the program I ran to get the fan sensors working. But if it isn't, I'm worried running it may break something. I'll try to read its documentation.

Quote:
This should generate a file /etc/sysconfig/lm_sensors
I have no directory /etc/sysconfig
I wonder where Mepis puts such things.

Quote:
This configuration file is "executed" during linux boot by /etc/init.d/lm_sensors
Only /usr/bin/sensors is executed by /etc/init.d/lm_sensors. I haven't figured out yet what /usr/bin/sensors does.

Quote:
Now you can check if the fan sensors are proberly detected, by either running /etc/init.d/lm_sensors status
Actually that doesn't do anything (with the version of /etc/init.d/lm_sensors I have).
Quote:
or just sensors.
Yes, that reports all the sensor values, but I already knew other ways to see those.

Quote:
You now may also edit /etc/sensors.conf, then find the section for your chip to adjust the names for your fans or set ignore fans which you don't have.
That may need some serious research to see if the five temperatures reported are properly calibrated for the gigabyte motherboard. But at least all five are properly connected (go up and down as the real temperature goes up and down).

The two fan speeds are already properly named and apparently calibrated.

Quote:
The next step would be to run pwmconfig that generates the configuration file for fancontrol.
I'm still scared about what might break as a result of trying that (similar to what I broke for a while in CPU speed control as described earlier). Remember, something is already controlling one of my fans and it isn't fancontrol.

Edit: I ran pwmconfig (but told it not to save the results). It finds three pwm controls and two fan speed sensors. But it determines pwm2 and pwm3 control nothing. (pwm1 controls the CPU fan).
It might be right about that, but it seemed to test too fast to allow for the momentum of the fan. It did a correlation test of pwm1 with the speed of the cpu fan, and go obviously wrong results, because it didn't wait long enough for the fan to slow down as it tried each lower pwm value. At the absurd extreme it says PWM 60 gives a fan speed of 156. Actually, at any speed below 700 the fan stops working and glides slowly to a stop.
At the top end it says PWM 255 gives fan speed 2986, but elsewhere in the same run it sees the same top fan speed I get in normal use, which is 3054. So it didn't let the fan reach a stable speed when it started the correlation either.

Last edited by johnsfine; 02-24-2008 at 09:09 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
chassis fan speed control (case fan) wastingtime Linux - Hardware 12 12-02-2007 07:08 PM
CPU Fan Speed rcracer7 Linux - Hardware 7 10-25-2005 12:20 AM
howto: control CPU fan speed and Northbridge fan speed? hedpe Linux - Software 2 04-18-2005 02:18 AM
pb win fan speed stefdef Mandriva 4 11-20-2004 07:14 PM
lm_sensor and fan speed rvqbl Linux - Software 0 04-27-2004 01:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration