Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Ubuntu 11.10 AMD64 on my Toshiba laptop (L505D-S5965). After I boot into the OS, my fan works perfectly being mostly quiet. Recently, I noticed that whenever I resume from system suspension, my fan starts to become noisy. This happens consistently without any programs or processes running at all. It will keep being noisy until I reboot my computer, then it goes back to normal. When the fan is noisy, the CPU temperature is 53°C, which is not hot at all. I've tried booting with pcie_aspm=force in the GRUB options file, but that did not work. Is there a fix?

share|improve this question

This is a known bug in Ubuntu, dating back to 2006 :
Bug #77370 : Laptop Fan always on after resume from suspend to RAM.

The above is a very long thread going on for 6 years, concluding that this problem happens on some kernel versions, but not on all.

Some solutions were listed, going from unplug/replug the power cord to creating a script to run after resume to stop the fan.

The script in question is created as file /etc/pm/sleep.d/99fancontrol (remember to chmod 755) :

#!/bin/sh
#
# Stop the fan.
# Source: https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.17/+bug/77370

case "$1" in
 hibernate|suspend)
  # Stopping is not required.
  ;;
 thaw|resume)
# In background.
   ( sleep 10 ; echo -n "0" > /sys/devices/virtual/thermal/cooling_device1/cur_state ) &

  ;;
 *) exit $NA
  ;;
esac
share|improve this answer
    
I've tried using this script and I can verify that it is changing cur_state to 0, bit it is still not working. I have 4 cooling_devices and all of their cur_states are set to zero. I tried re-plugging the power cable and I can't really afford to downgrade the kernel version. I have noticed that the fan kicks on at almost exactly 90 seconds after I resume it from suspension. – enderskill Feb 28 '12 at 19:54
    
Are all cur_states zero after the fan kicks in? If not, what happens if you change the sleep to more than 90 seconds? – harrymc Feb 28 '12 at 19:57
    
I don't know how to change the sleep time. The fan kicks on quite a while after everything is reloaded. – enderskill Feb 28 '12 at 20:00
    
All curr_states are zero after the fan kicks in. – enderskill Feb 28 '12 at 20:24
    
So the above script does not fit your kernel. See in my linked thread if answers #48 and #46 work better, as they orient on the files /proc/acpi/fan/FAN?/state or /proc/acpi/fan/*. As I don't use Ubuntu, I cannot test this myself. – harrymc Feb 29 '12 at 8:15

First, make sure what service is governing your fans. It might be "fancontrol", but in a laptop it might be another one.

Install the hibernate package. Try "hibernate-ram" and "hibernate-disk" commands. If the problem persist, edit "ususpend-disk.conf" and/or "ususpend-ram.conf" and add the line "RestartServices foo", being "foo" the name of the service is governing your fans. In my system I have "RestartServices fancontrol" in "ususpend-disk.conf", but in your system it might be another service.

share|improve this answer

You may try to configure the Fan Speed based on Temperatures. Here's how to do it

(Please note this example was a translation of an old blog article from me in french for Ubuntu Karmic Koala... Hope my "prose" is readable in english!)

Fan Monitoring and Control

In a Terminal enter: pwmconfig and follow these steps

EXAMPLE:

1) First step: pwmconfig search for Power Waves Monitors

Found the following devices:
hwmon0/device is w83697hf

Found the following PWM controls:
hwmon0/device/pwm1
hwmon0/device/pwm2

Giving the fans some time to reach full speed…
Found the following fan sensors:
hwmon0/device/fan1_input     current speed: 0 … skipping!
hwmon0/device/fan2_input     current speed: 4326 RPM

2) Second Step:

pwmconfig check if there is a correlation a PWM control and a fan by trying to stop it. By confirming to pwmconfig the fan is actually stopped this associate pwmconfig to a specific fan.

Testing pwm control hwmon0/device/pwm1 …
hwmon0/device/fan2_input … speed was 4326 now 4326
no correlation

{If pwmconfig do not detect such fan it ask you to confirm…}

No correlations were detected.
There is either no fan connected to the output of hwmon0/device/pwm1,
or the connected fan has no rpm-signal connected to one of the tested fan sensors.

Did you see/hear a fan stopping during the above test (n)? n

{Here pwmconfig check the next pwm control…}

Testing pwm control hwmon0/device/pwm2 …
hwmon0/device/fan2_input … speed was 4326 now 0
It appears that fan hwmon0/device/fan2_input
is controlled by pwm hwmon0/device/pwm2

{Here pwmconfig has found the correlation and keep it in the configuration file /etc/fancontrol}

3) Third step: it's also possible to set the pwmconfig variables

Minimal Temperature detected by the sensor: MINTEMP Maximal Temperature detected by the sensor: MAXTEMP Minimal Temperature for Fan startup: MINSTART Minimal Temperature for Fan Stop: MINSTOP

If you receive a message like: "File /var/run/fancontrol.pid exists." his typically means that the fancontrol deamon is running.You should stop it before running pwmconfig. If you are certain that fancontrol is not running, then you can delete /var/run/fancontrol.pid manually.

4) Fourth Step: run this command "fancontrol stop" then "pwmconfig" which give you an output like this:

Select fan output to configure, or other action:
1) hwmon0/device/pwm2  3) Just quit          5) Show configuration
2) Change INTERVAL     4) Save and quit
select (1-n): 1

4.1 {Here I choose "1": the pwm control corresponding to the sensor in use}

Devices:
hwmon0/device is w83697hf

Current temperature readings are as follows:
hwmon0/device/temp1_input    30
hwmon0/device/temp2_input    57

Select a temperature sensor as source for hwmon0/device/pwm2:
1) hwmon0/device/temp1_input
2) hwmon0/device/temp2_input
3) None (Do not affect this PWM output)
select (1-n): 2

4.2 {Here I choose "2": le contrôle pwm control corresponding to the active sensor}

Enter the low temperature (degree C)
below which the fan should spin at minimum speed (0): 38

4.3 {Here I choose "38": the lower temperature under which the Fan speed is at minimum }

Enter the high temperature (degree C)
over which the fan should spin at maximum speed (60): 48

4.5 {Here I choose "48": the temperature over which the Fan speed is at maximum }

Enter the minimum PWM value (0-255)
at which the fan STARTS spinning (press t to test) (150): t

4.6 {Here I choose "t": to try and enter "y" when the maximal pwm value = Fan startup }

Now we increase the PWM value in 10-unit-steps.
Let the fan stop completely, then press return until the
fan starts spinning. Then enter ‘y’.
We will use this value +20 as the starting speed.
Setting hwmon0/device/pwm2 to 10…
Setting hwmon0/device/pwm2 to 20…
Setting hwmon0/device/pwm2 to 30…
Setting hwmon0/device/pwm2 to 40…
Setting hwmon0/device/pwm2 to 50…
Setting hwmon0/device/pwm2 to 60…  y
OK, using 60

Enter the minimum PWM value (0-255)
at which the fan STOPS spinning (press t to test) (100): t

4.7 {Here I choose "t": to try and enter "y" when the pwm minimal value = Fan stop}

Now we decrease the PWM value in 10-unit-steps.
Let the fan reach full speed, then press return until the
fan stops spinning. Then enter ‘y’.
We will use this value +20 as the minimum speed.
Setting hwmon0/device/pwm2 to 245…
Setting hwmon0/device/pwm2 to 235…
Setting hwmon0/device/pwm2 to 225…
Setting hwmon0/device/pwm2 to 215…
Setting hwmon0/device/pwm2 to 205…
Setting hwmon0/device/pwm2 to 195…
Setting hwmon0/device/pwm2 to 185…
Setting hwmon0/device/pwm2 to 175…
Setting hwmon0/device/pwm2 to 165…
Setting hwmon0/device/pwm2 to 155…
Setting hwmon0/device/pwm2 to 145…
Setting hwmon0/device/pwm2 to 135…
Setting hwmon0/device/pwm2 to 125…
Setting hwmon0/device/pwm2 to 115…
Setting hwmon0/device/pwm2 to 105…
Setting hwmon0/device/pwm2 to 95…
Setting hwmon0/device/pwm2 to 85…
Setting hwmon0/device/pwm2 to 75…
Setting hwmon0/device/pwm2 to 65…
Setting hwmon0/device/pwm2 to 55…
Setting hwmon0/device/pwm2 to 45…  y
OK, using 45

4.8 {Finally enter the minimum and maximum pwm values… }

Enter the PWM value (0-45) to use when the temperature
is below the low temperature limit (0): 24

Enter the PWM value (45-255) to use when the temperature
is over the high temperature limit (255): 255

==>> Note these values may be later ajusted to fit your needs...

==>> Don't forget to save the configuration!

Select fan output to configure, or other action:
1) hwmon0/device/pwm2  3) Just quit          5) Show configuration
2) Change INTERVAL     4) Save and quit
select (1-n): **4**

Done! :)

Hope this help keeping your fans less noisy! Let us know. :)

share|improve this answer
    
Unfortunately, any command using pwmconfig fails with There are no pwm-capable sensor modules installed. – enderskill Mar 5 '12 at 22:47
    
Check in Synaptic to install the packets related to pwmconfig... :) – climenole Mar 5 '12 at 23:16
    
What source has the extra pwmconfig packets? – enderskill Mar 6 '12 at 2:33
    
For Ubuntu you need to install a package called lm-sensors. It's available in Ubuntu's main repository. – climenole Mar 6 '12 at 13:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .