Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting the fans on an iBook G4
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
cocozz
Apprentice
Apprentice


Joined: 31 Jul 2004
Posts: 160

PostPosted: Tue Nov 08, 2005 10:56 pm    Post subject: Setting the fans on an iBook G4 Reply with quote

Hello,

I'm trying to set the fan's velocity on my new iBook G4, I have searched all the net but I didnt found anything to set them.
The problem is that I heard a much more the fan on Linux than I hear it on Mac OS X. So I need to set the limit temperature when the fan will be switched on.

Im unable to change it in /sys/proc/devices/temperatures/

Is it possible to do it ?


Thanks,
Greets
_________________
Soy tu amigo, amigo .
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Wed Nov 09, 2005 4:01 am    Post subject: Reply with quote

Make sure you have the THERM_ADT746X module in your kernel. When loading this module, you can set the thresholds for the temperature.
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
Cenrim
Tux's lil' helper
Tux's lil' helper


Joined: 04 Dec 2004
Posts: 142
Location: Germany

PostPosted: Wed Nov 09, 2005 2:53 pm    Post subject: Reply with quote

when you've got adt746x in your kernel you can set the temperatures at which the fan starts (integer +50°C CPU / +70°C GPU) in limit_adjust and in specified_fan_speed the speed the fan starts at. I don't know if the acceleration of the fan is linear or whatever...
hmm... I could use my kernel logs and gnuplot to ... :D
*ehem*
when I restart my iBook G4 (12"/1.2GHz) after playing WarCraft3 in OSX the temperature of the CPU is still at 57°C and the fan was during playing at 7000rpm max (judged from the noise)
the std for the linux kernel is to start the fan at 50°C with a speed of 64 which is around 5000rpm
my cpu is clocked to full speed with around 90% idle at 48 to 50 degree, so the fan kicks in everytime you do something and goes up to full speed (10k rpm) in no time

with
Code:
# echo 6 >> /sys/devices/temperatures/limit_adjust
# echo 48 >> /sys/devices/temperatures/specified_fan_speed

you can set the temperature limit to 56°C/76°C and the fan starts with ~~3500rpm

when you're using adt746x as a module you can do is with module parameters, since I got it compiled in I got no clue about this ^^
Back to top
View user's profile Send private message
emerald
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2005
Posts: 113

PostPosted: Sat Nov 12, 2005 9:34 pm    Post subject: Reply with quote

i created a small patch to better change the settings for the fan, it simply was too noisy, it's better to start the fan low speed at a low temperature ans speed up at much higher temperature difference than just 8 degree as in the original driver
the values you set the driver to are not being checked in the patch, so you better be sure what to set ;)
my settings are
Code:
options therm_adt746x fan_speed=5 limit_adjust=20 maximum_difference=25 step_hysteresis=2 verbose=0

with normal usage the fan may start low speed but almost impossible to hear, with compiling the fan goes up to 6000 rpm or so, so it's possible to hear but not so noisy than 10000 rpm
watching dvd or divx/xvid hardly makes the fan getting noisy
i lowered the standard fan start temperature to 40 degree since somehow negative values for limit_adjust seem not to work so whether you change the maximum difference or raise the start temperature by using limit_adjust
the maximum values (default_limit_chip) are taken from the standard values of the ibook sensor limits without the therm module
to set the maximum_difference higher than the maximum chip spec is not really recommendable

params:
fan_speed is the minimum fan speed when the fan start temperature is reached
limit_adjust raises the fan start temperature to 40 degree plus this value
maximum_difference sets the temperature difference for the fan to reach maximum speed (10000 rpm) not really useful to set higher than 50~60
step_hysteresis sets the number of degree the temperature has to change for the fan speed to get adjusted, not useful to set higher than 3 or 4

links to patch
kernel 2.6.23
http://www.liji.de/patches/kernel/2.6.23/therm_adt746x.patch
kernel 2.6.24
http://www.liji.de/patches/kernel/2.6.24/therm_adt746x.patch

[edit: correct links]

emerald
_________________
Knowledge is scary....

... running Gentoo Linux ...
... and Windows in a 'small corner'(C) - i.e. vmware - :D ...
System Profile

Don't open the Red Door !


Last edited by emerald on Fri Jan 18, 2008 5:21 pm; edited 2 times in total
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1554
Location: Germany

PostPosted: Sun Jan 06, 2008 4:49 pm    Post subject: Reply with quote

Has this patch gone to the kernel module or would it be possible? Configuring a hysteresis would be helpful.

BTW: I noticed that setting limit_adjust to very low level like "-15" is activating another fan which is usually stopped all the time. Is there a way to access this fan's settings?
/sys/module/therm_adt746x/parameters/ only shows single fan settings and there is also
/sys/devices/temperatures/sensor1_fan_speed
but no
/sys/devices/temperatures/sensor2_fan_speed.
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67,2G|amd64:HP EliteBook 8560w,i7-2620M,16G|Acer Z5610 (Core2QuadQ8200),8G|amd64-prefix:OpenSuse|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Lila-Theme
Back to top
View user's profile Send private message
emerald
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2005
Posts: 113

PostPosted: Fri Jan 18, 2008 5:21 pm    Post subject: Reply with quote

this patch never went to the kernel
_________________
Knowledge is scary....

... running Gentoo Linux ...
... and Windows in a 'small corner'(C) - i.e. vmware - :D ...
System Profile

Don't open the Red Door !
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1554
Location: Germany

PostPosted: Sat Feb 02, 2008 11:22 am    Post subject: tempmonitor.sh Reply with quote

Hello emerald.
So what does your patch actually change, just adding maximum_difference= ?
Do you have any idea how to activate the second fan?

I wrote a small temperature monitor:
tempmonitor.sh:
#!/bin/bash

if [ "$1" = "" ]
        then INTERVAL="3"
        else INTERVAL=$1
fi

nice -n 10 watch -n $INTERVAL -td '
        printf "Fan speed:\t%s \t Limit:\t%s \t\t Specified speed:\t%s\n\n"\
                                "`cat /sys/devices/temperatures/sensor1_fan_speed`"\
                                "`cat /sys/devices/temperatures/limit_adjust`"\
                                "`cat /sys/devices/temperatures/specified_fan_speed`" &&\
        cat /sys/devices/temperatures/sensor1_location                                                                                                                  &&\
        echo "--------------"                                                                                                                                           &&\
        printf "Temperature:\t%s \t\t Limit:\t%s\n" "`cat /sys/devices/temperatures/sensor1_temperature`" "`cat /sys/devices/temperatures/sensor1_limit`"               &&\
        echo ""                                                                                                                                                         &&\
        cat /sys/devices/temperatures/sensor2_location                                                                                                                  &&\
        echo "--------------"                                                                                                                                           &&\
        printf "Temperature:\t%s \t\t Limit:\t%s\n" "`cat /sys/devices/temperatures/sensor2_temperature`" "`cat /sys/devices/temperatures/sensor2_limit`"
        '

So currently (idle) it looks like this:
./tempmonitor.sh:
Fan speed:      50 (0 rpm)       Limit: 6                Specified speed:       16

CPU BOTTOMSIDE
--------------
Temperature:    58               Limit: 56

PWR SUPPLY BOTTOMSIDE
--------------
Temperature:    58               Limit: 76

The difference between sensor1 and sensor2 limit is always 20 and fan2 will never start if not decreasing limit with '-10':
Code:
# cat /sys/devices/temperatures/sensor[12]_limit
56
76

_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67,2G|amd64:HP EliteBook 8560w,i7-2620M,16G|Acer Z5610 (Core2QuadQ8200),8G|amd64-prefix:OpenSuse|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Lila-Theme
Back to top
View user's profile Send private message
emerald
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2005
Posts: 113

PostPosted: Sat Feb 02, 2008 12:36 pm    Post subject: Reply with quote

The patch adds the maximum difference, the original driver varies the fan speed within 8 degree, the maximum difference lets you specify which temperature difference is allowed between minimum and maximum temperature. the hysteresis is variable, defaults to 2 degree celcius.
The minimum Temperature the fan will start is set to 40 degree for sensor1 and 60 degree for sensor 2. The limit_adjust changes the limits (up) for the fan to start (in 2.6.16 kernels only positive limit was possible, don't know if it was changed later).
I actually don't know of any second fan inside the iBook and i also don't know any way to access that possible one separately.
The difference between sensor1 and sensor 2 is set to 20 degree in the patch too, the original difference was same or even higher, the hardware-default ist 9 degree but 92 for sensor1 and 101 for sensor2 (in the 12" iBook G4 1333 MHz).
Where is the second fan located ? How do you even recognize the second fan to be turned on with the other one running at 10k rpm ?
_________________
Knowledge is scary....

... running Gentoo Linux ...
... and Windows in a 'small corner'(C) - i.e. vmware - :D ...
System Profile

Don't open the Red Door !
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1554
Location: Germany

PostPosted: Sat Feb 02, 2008 2:01 pm    Post subject: Reply with quote

I understand that adding maximum_difference and a hysteresis is useful. Sometimes the fan is switching low and fast continuously (hysteresis needed) while the maximum difference of the original module is fine for me. I will consider that patch eventhough I don't like too much patching when upgrading the kernel (most time patches are updated later or not maintained at all for later kernels). For the old iBook I still need Cedrics patches to have some control about the fan there.

40 degree for sensor1 sounds a bit strange for the PowerBook, maybe ok for the iBook. 50 degree is quite low, at 60 degree it begins to feel quite hot at the metal surface.

Ok, I'm talking about the PowerBook5,8. There you can hear the second fan clearly when setting limit to '-10' (works with gentoo-sources-2.6.23). Considering the noise the cpu fan is on the left and the second fan on the right upside. Once opened the PBook for upgrades I think I've seen it, can't remember.
I think it is controlled by the sensor2
Code:
# cat /sys/devices/temperatures/sensor2_*
76
PWR SUPPLY BOTTOMSIDE
57
..but with usual settings it's never activated. Running two fans with half speed seems to be more efficient and less noisy in my eyes.

Since you are versed with the therm_adt746x module, can you see a way to control both sensor settings separately?
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67,2G|amd64:HP EliteBook 8560w,i7-2620M,16G|Acer Z5610 (Core2QuadQ8200),8G|amd64-prefix:OpenSuse|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Lila-Theme
Back to top
View user's profile Send private message
emerald
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2005
Posts: 113

PostPosted: Sat Feb 02, 2008 3:15 pm    Post subject: Reply with quote

Code:

dirks@aki /sys/devices/temperatures> cat sensor[12]_location
CPU BOTTOMSIDE
GPU BOTTOMSIDE

that's for the iBook
Code:

dirks@aki /sys/devices/temperatures> cat /proc/cpuinfo
processor       : 0
cpu             : 7447A, altivec supported
clock           : 1333.333000MHz
revision        : 0.2 (pvr 8003 0102)
bogomips        : 73.47
timebase        : 18432000
platform        : PowerMac
machine         : PowerBook6,7
motherboard     : PowerBook6,7 MacRISC3 Power Macintosh
detected as     : 287 (iBook G4)
pmac flags      : 0000001b
L2 cache        : 512K unified
pmac-generation : NewWorld


I don't have another one so i could never test anything else.
But, it shouldn't be too hard to make the sensor limits independent and settable via module parameter :)
The only fan i could hear was the one top-center, below the display, it's possible the iBook doesn't habe more than this one.
I'll change the module and post a patch soon.
_________________
Knowledge is scary....

... running Gentoo Linux ...
... and Windows in a 'small corner'(C) - i.e. vmware - :D ...
System Profile

Don't open the Red Door !
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1554
Location: Germany

PostPosted: Fri Dec 26, 2008 10:38 pm    Post subject: Reply with quote

I'm not sure if even MacOSX is using both fans.
But does anyone know if there's a way to set the second sensor/fan? Would it be accessible by rewriting the module?
2.6.26-gentoo-r1:
# ls /sys/devices/temperatures/
bus@          power/             sensor1_location     sensor2_location     subsystem@
devspec       sensor1_fan_speed  sensor1_temperature  sensor2_temperature  uevent
limit_adjust  sensor1_limit      sensor2_limit        specified_fan_speed

_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67,2G|amd64:HP EliteBook 8560w,i7-2620M,16G|Acer Z5610 (Core2QuadQ8200),8G|amd64-prefix:OpenSuse|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Lila-Theme
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC 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