Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Modified fancontrol script for ACPI only systems
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
mbar
Veteran
Veteran


Joined: 19 Jan 2005
Posts: 1990
Location: Poland

PostPosted: Sun Nov 27, 2005 6:11 pm    Post subject: Modified fancontrol script for ACPI only systems Reply with quote

If you have a motherboard without hw sensors (or lm_sensors show only BS, like on my ECS 760GX-M mobo, its IT87 CPU temp input isn't connected to the chip and floats) and want to use pwmcontrol to dynamically set fan speeds to low when CPU has low temperature, you cannot simply use "fancontrol" script form lm_sensors. But you might get lucky and have ACPI support, showing actual thermal zone(s) temerature(s). This is often the case with laptops, and with my cheapo ECS 760GX-M: its CPU temp sensor is active only in ACPI subsystem. But it has no BIOS fan control (Cool&Quiet). Here's what I did to enable ACPI temp monitoring instead of using b0rked IT87 sensors:

- copy /usr/sbin/fancontrol to /usr/sbin/acpifancontrol
- modify lines:
Code:
# main function
function UpdateFanSpeeds {
   let fcvcount=0
   while (( $fcvcount < ${#AFCPWM[@]} )) # go through all pwm outputs
   do
      #hopefully shorter vars will improve readability:
      pwmo=${AFCPWM[$fcvcount]}
      tsens=${AFCTEMP[$fcvcount]}
      fan=${AFCFAN[$fcvcount]}
      mint=${AFCMINTEMP[$fcvcount]}
      maxt=${AFCMAXTEMP[$fcvcount]}
      minsa=${AFCMINSTART[$fcvcount]}
      minso=${AFCMINSTOP[$fcvcount]}
      
      tval=`cat ${tsens}`
      if [ $? -ne 0 ]
      then
         echo "Error reading temperature from $DIR/$tsens"
         restorefans
      fi
      tval=`echo ${tval} |cut -d' ' -f3 |cut -d'.' -f1`
      if [ "$SYSFS" = "1" ]
      then
         let tval="$tval / 1000"
      fi

      pwmpval=`cat ${pwmo}`
      if [ $? -ne 0 ]
      then
         echo "Error reading PWM value from $DIR/$pwmo"
         restorefans
      fi
      pwmpval=`echo ${pwmpval} | cut -d' ' -f1`


to:

Code:

# main function
function UpdateFanSpeeds {
   let fcvcount=0
   while (( $fcvcount < ${#AFCPWM[@]} )) # go through all pwm outputs
   do
      #hopefully shorter vars will improve readability:
      pwmo=${AFCPWM[$fcvcount]}
      tsens=${AFCTEMP[$fcvcount]}
      fan=${AFCFAN[$fcvcount]}
      mint=${AFCMINTEMP[$fcvcount]}
      maxt=${AFCMAXTEMP[$fcvcount]}
      minsa=${AFCMINSTART[$fcvcount]}
      minso=${AFCMINSTOP[$fcvcount]}
      
      tval=`cat /proc/acpi/thermal_zone/THRM/temperature`
      if [ $? -ne 0 ]
      then
         echo "Error reading temperature from $DIR/$tsens"
         restorefans
      fi
      tval=`echo ${tval} |cut -d' ' -f2 |cut -d'.' -f1`

      pwmpval=`cat ${pwmo}`
      if [ $? -ne 0 ]
      then
         echo "Error reading PWM value from $DIR/$pwmo"
         restorefans
      fi
      pwmpval=`echo ${pwmpval} | cut -d' ' -f1`


PLS check your /proc/acpi, you may have something else instead of /proc/acpi/thermal_zone/THRM/temperature. This is valid for my ECS board.
- then use "pwmconfig" and generate valid /etc/fancontrol config file
- start /usr/sbin/acpifancontrol &
- enjoy the silence when idle and full fan speed when CPU is heavily crunching numbers :)

This is quick and dirty hack, anyone fancy to do it more sane way?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum