Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
fancontrol for applesmc on macbook pro 7.1 (mid 2010)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
cbaabc
n00b
n00b


Joined: 06 Aug 2010
Posts: 7

PostPosted: Tue Nov 23, 2010 12:30 am    Post subject: fancontrol for applesmc on macbook pro 7.1 (mid 2010) Reply with quote

Hello,

I have a problem with my fancontrols on my macbook pro. The fan increases its speed not until the cpu temp gets really high(>70°C). The applesmc module seems to hold the fan at the minimum of 2000 rpm for most of the time. I try to solve this with a script, which raises the minimum speed if the temperature is rising.

The fan can take 2000-6200 rpm, but I raise the minimum from 2000 (<=50°C) up to 5000 (>=80°C) and leave the rest as it is, so that the automatic temperature control still works for higher temperatures.

My question now is: is my solution good enough or could this harm more than it helps?
And maybe someone can look over the script, as i havn't any experience with this.

The script:
Code:
#!/bin/bash

# AUTOMATIC VALUES BELOW, DON`T EDIT

# FAN SPEED
FAN1_SPEED_MIN=2000
FAN1_SPEED_MAX=5000

# dynamic values
while [ 1 ]; do

# CPU TEMPS
CPU_TEMP0=`cat /sys/devices/platform/coretemp.0/temp1_input`
CPU_TEMP1=`cat /sys/devices/platform/coretemp.1/temp1_input`
CPU_TEMP=`expr "(" $CPU_TEMP0 + $CPU_TEMP1 ")" "/" 2000`

# calculate
FAN_SPEED=`expr "(" $CPU_TEMP "-" 30 ")" "*" 100`

# don`t go below min limit
if [ "$FAN_SPEED" -le "$FAN1_SPEED_MIN" ]; then
FAN_SPEED=$FAN1_SPEED_MIN;
fi

# don`t go above max limit
if [ "$FAN_SPEED" -gt "$FAN1_SPEED_MAX" ]; then
FAN_SPEED=$FAN1_SPEED_MAX;
fi

# only write if speed has changed
if [ "$FAN_SPEED" != "$FAN_SPEED_OLD" ]; then
#echo $CPU_TEMP $FAN_SPEED
echo $FAN_SPEED > /sys/devices/platform/applesmc.768/fan1_min
fi

# store old speed
FAN_SPEED_OLD=$FAN_SPEED;

sleep 15
done


EDIT: I don't know if any other information could help, but i will provide them if necessary.
Back to top
View user's profile Send private message
phoenix juice
n00b
n00b


Joined: 09 Nov 2010
Posts: 37

PostPosted: Tue Nov 23, 2010 6:56 am    Post subject: Reply with quote

here are some other scripts you may use as reference:

https://wiki.ubuntu.com/MacBookPro/SantaRosaFanControl

read the entire post because several examples exist.
https://bbs.archlinux.org/viewtopic.php?id=64457

I use the ubuntu wiki as a reference. I didn't find much on sensors, but it might help you with other issues.
https://help.ubuntu.com/community/MacBookPro7-1/Lucid#Sensors
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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