Page 2 of 11 FirstFirst 1234 ... LastLast
Results 11 to 20 of 101

Thread: [RFC] Fan control for mactel-support repo

  1. #11
    Join Date
    Aug 2009
    Location
    D.C. U.S.A.
    Beans
    26
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: [RFC] Fan control for mactel-support repo

    I wrote a python daemon that works for me. I am using a 13 inch macbook pro 7,1 .

    This daemon only works with the 13 inch though because it expects only one fan to be present. I used to use it on a plain (non-pro) macbook 13 inch and it worked fine there. It is pretty self explanatory to tweak in regards to how sensitive it is to heat but if you have questions feel free to pm me.

    You find the script and some instructions here:

    http://planetfoo.org/blog/2009/11/13...trol-in-linux/

  2. #12
    Join Date
    Jul 2010
    Location
    California
    Beans
    15
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [RFC] Fan control for mactel-support repo

    Quote Originally Posted by SwedishWings View Post
    I wrote a C daemon that does the job, at least for me on Lucid and MacBook Pro 5,1. Please try it out and give me feed back.

    See the README file.

    /Mike
    just installed on my MPB 6,2. ill be giving you a full professional review *sarcasm* on whatever comes of it. as of now, its working great. youda man

    question: which temp output is it monitoring?

    currently i have my system set to monitor the gpu, and TPCD (not sure what it is, but its hot lol)
    Last edited by furok23; August 25th, 2010 at 03:22 AM.

  3. #13
    Join Date
    Aug 2010
    Location
    Germany
    Beans
    80
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [RFC] Fan control for mactel-support repo

    Just had a look at your code it looks pretty cool - will try it out later.

    Even so using average temperature is probably not quite as effective as we should really monitor the sensors near the CPU and Graphics card. As those will give a better idea of the relevant temperatures.

    At least for MBP 6,2 it looks like the two to watch are temp7_input and temp11_input.

    If we work together we may be able to figure out the relevant sensors for different MacBooks.

    Also is there a particular reason why you set the min fan speed to 0 since OSX seems to keep both running at 2000 even when idle.


    Last edited by dngfng; August 25th, 2010 at 08:11 AM.
    15" MacBook Pro 6,2 (i7) - rEFIt Triple Boot OS X, Win 7, Ubuntu 10.04
    How to Dual/Triple boot Apple Flavoured Products
    Fan control handled by SwedishWings macfanctl


  4. #14
    Join Date
    Oct 2008
    Beans
    171
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: [RFC] Fan control for mactel-support repo

    Thanks for trying it out =D

    It takes average on all sensors it can find, hence the narrow span of temperatures set in /etc/macfanctl.conf.

    The idea to use all sensors come from from a fan control program i use on OSX, that is working great for me. Another advantage is that the program become quite generic and don't need specific configuration for different versions of MacBook. However, I'm happy to rewrite it to use specific sensors if it does not work properly for you.

    The reason that i set min fan speed to 0 is that it really has no effect on operation when i tested it. Try it out. I think you reach the same conclusion.

    And of course, feel free to mod the code, and send it back to me for merging if you want! This was a Q&D hack, so there is room for improvements =D

    Cheers!

    /Mike


    EDIT: For reference, please compare your readings with mine below (macfanctl run with -d). Here the fan starts to run after 45 seconds (each line is 5 seconds). I live in a hot place, Philippines, and at the this time it's about 32C in my condo.

    Code:
    mike@mike-laptop:~$ head -n 30 /var/log/macfanctl.log 
    Number of sensors found: 20
    Parameters: temp_floor: 43, temp_ceiling: 48, fan_min: 0
    Speed: 0, Avg temp: 40.1
    Speed: 0, Avg temp: 40.3
    Speed: 0, Avg temp: 40.7
    Speed: 0, Avg temp: 41.0
    Speed: 0, Avg temp: 41.5
    Speed: 0, Avg temp: 41.8
    Speed: 0, Avg temp: 42.2
    Speed: 0, Avg temp: 42.5
    Speed: 0, Avg temp: 42.9
    Speed: 201, Avg temp: 43.2
    Speed: 588, Avg temp: 43.5
    Speed: 930, Avg temp: 43.8
    Speed: 1581, Avg temp: 44.3
    Speed: 1751, Avg temp: 44.4
    Speed: 1751, Avg temp: 44.4
    Speed: 1766, Avg temp: 44.4
    Speed: 1953, Avg temp: 44.6
    Speed: 2448, Avg temp: 45.0
    Speed: 2046, Avg temp: 44.7
    Speed: 2030, Avg temp: 44.6
    Speed: 1937, Avg temp: 44.6
    Speed: 1921, Avg temp: 44.5
    Speed: 2014, Avg temp: 44.6
    Speed: 2030, Avg temp: 44.6
    Speed: 2076, Avg temp: 44.7
    Speed: 2278, Avg temp: 44.8
    Speed: 2231, Avg temp: 44.8
    Speed: 2185, Avg temp: 44.8
    Last edited by SwedishWings; August 25th, 2010 at 10:10 AM.
    Some scientists claim that hydrogen, because it is so plentiful, is the basic building block of the universe. I dispute that. I say there is more stupidity than hydrogen, and that is the basic building block of the universe.
    -- Frank Zappa

  5. #15
    Join Date
    Aug 2010
    Location
    Germany
    Beans
    80
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [RFC] Fan control for mactel-support repo

    Cool - will try it out as it is.

    As I said I do like the code.

    I am just a tad worried that their may be some applications that are only CPU or GPU intensive thus one requiring more cooling then the other.

    Will post my output once I get home and around to running the daemon.
    Last edited by dngfng; August 25th, 2010 at 10:29 AM.
    15" MacBook Pro 6,2 (i7) - rEFIt Triple Boot OS X, Win 7, Ubuntu 10.04
    How to Dual/Triple boot Apple Flavoured Products
    Fan control handled by SwedishWings macfanctl


  6. #16
    Join Date
    Oct 2008
    Beans
    171
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: [RFC] Fan control for mactel-support repo

    Quote Originally Posted by dngfng View Post
    I am just a tad worried that their may be some applications that are only CPU or GPU intensive thus one requiring more cooling then the other.
    Good point to check this. I tried a full backup with tar and bzip2 compression. It took the daemon about 20 seconds to get the fan to full speed. I don't know of an GPU intensive app that don't load the CPU. Any suggestions?
    Some scientists claim that hydrogen, because it is so plentiful, is the basic building block of the universe. I dispute that. I say there is more stupidity than hydrogen, and that is the basic building block of the universe.
    -- Frank Zappa

  7. #17
    Join Date
    Aug 2010
    Location
    Germany
    Beans
    80
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [RFC] Fan control for mactel-support repo

    Quote Originally Posted by SwedishWings View Post
    Good point to check this. I tried a full backup with tar and bzip2 compression. It took the daemon about 20 seconds to get the fan to full speed. I don't know of an GPU intensive app that don't load the CPU. Any suggestions?
    folding@home gpu verison - should proably do the trick. Also it may be intresting to get running log outputs (maybe in a differnt file) of the tempretures measured by the different sensors so we can spot the hotspots.

    http://www.overclock.net/overclock-n...2-folding.html

    hmm - even so that only runs vie wine ...
    15" MacBook Pro 6,2 (i7) - rEFIt Triple Boot OS X, Win 7, Ubuntu 10.04
    How to Dual/Triple boot Apple Flavoured Products
    Fan control handled by SwedishWings macfanctl


  8. #18
    Join Date
    Oct 2008
    Beans
    171
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: [RFC] Fan control for mactel-support repo

    I found this in the source of applesmc:

    Code:
     86 static const char *temperature_sensors_sets[][41] = {
     87 /* Set 0: Macbook Pro */
     88         { "TA0P", "TB0T", "TC0D", "TC0P", "TG0H", "TG0P", "TG0T", "Th0H",
     89           "Th1H", "Tm0P", "Ts0P", "Ts1P", NULL },
     90 /* Set 1: Macbook2 set */
     91         { "TB0T", "TC0D", "TC0P", "TM0P", "TN0P", "TN1P", "TTF0", "Th0H",
     92           "Th0S", "Th1H", NULL },
     93 /* Set 2: Macbook set */
     94         { "TB0T", "TC0D", "TC0P", "TM0P", "TN0P", "TN1P", "Th0H", "Th0S",
     95           "Th1H", "Ts0P", NULL },
     96 /* Set 3: Macmini set */
     97         { "TC0D", "TC0P", NULL },
     98 /* Set 4: Mac Pro (2 x Quad-Core) */
     99         { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", "TC0C", "TC0D", "TC0P",
    100           "TC1C", "TC1D", "TC2C", "TC2D", "TC3C", "TC3D", "THTG", "TH0P",
    101           "TH1P", "TH2P", "TH3P", "TMAP", "TMAS", "TMBS", "TM0P", "TM0S",
    102           "TM1P", "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", "TM8S", "TM9P",
    103           "TM9S", "TN0H", "TS0C", NULL },
    104 /* Set 5: iMac */
    105         { "TC0D", "TA0P", "TG0P", "TG0D", "TG0H", "TH0P", "Tm0P", "TO0P",
    106           "Tp0C", NULL },
    107 /* Set 6: Macbook3 set */
    108         { "TB0T", "TC0D", "TC0P", "TM0P", "TN0P", "TTF0", "TW0P", "Th0H",
    109           "Th0S", "Th1H", NULL },
    110 /* Set 7: Macbook Air */
    111         { "TB0T", "TB1S", "TB1T", "TB2S", "TB2T", "TC0D", "TC0P", "TCFP",
    112           "TTF0", "TW0P", "Th0H", "Tp0P", "TpFP", "Ts0P", "Ts0S", NULL },
    113 /* Set 8: Macbook Pro 4,1 (Penryn) */
    114         { "TB0T", "TC0D", "TC0P", "TG0D", "TG0H", "TTF0", "TW0P", "Th0H",
    115           "Th1H", "Th2H", "Tm0P", "Ts0P", NULL },
    116 /* Set 9: Macbook Pro 3,1 (Santa Rosa) */
    117         { "TALP", "TB0T", "TC0D", "TC0P", "TG0D", "TG0H", "TTF0", "TW0P",
    118           "Th0H", "Th1H", "Th2H", "Tm0P", "Ts0P", NULL },
    119 /* Set 10: iMac 5,1 */
    120         { "TA0P", "TC0D", "TC0P", "TG0D", "TH0P", "TO0P", "Tm0P", NULL },
    121 /* Set 11: Macbook 5,1 */
    122         { "TB0T", "TB1T", "TB2T", "TB3T", "TC0D", "TC0P", "TN0D", "TN0P",
    123           "TTF0", "Th0H", "Th1H", "ThFH", "Ts0P", "Ts0S", NULL },
    124 /* Set 12: Macbook Pro 5,1 */
    125         { "TB0T", "TB1T", "TB2T", "TB3T", "TC0D", "TC0F", "TC0P", "TG0D",
    126           "TG0F", "TG0H", "TG0P", "TG0T", "TG1H", "TN0D", "TN0P", "TTF0",
    127           "Th2H", "Tm0P", "Ts0P", "Ts0S", NULL },
    128 /* Set 13: iMac 8,1 */
    129         { "TA0P", "TC0D", "TC0H", "TC0P", "TG0D", "TG0H", "TG0P", "TH0P",
    130           "TL0P", "TO0P", "TW0P", "Tm0P", "Tp0P", NULL },
    131 /* Set 14: iMac 6,1 */
    132         { "TA0P", "TC0D", "TC0H", "TC0P", "TG0D", "TG0H", "TG0P", "TH0P",
    133           "TO0P", "Tp0P", NULL },
    134 /* Set 15: MacBook Air 2,1 */
    135         { "TB0T", "TB1S", "TB1T", "TB2S", "TB2T", "TC0D", "TN0D", "TTF0",
    136           "TV0P", "TVFP", "TW0P", "Th0P", "Tp0P", "Tp1P", "TpFP", "Ts0P",
    137           "Ts0S", NULL },
    138 /* Set 16: Mac Pro 3,1 (2 x Quad-Core) */
    139         { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", "TC0C", "TC0D", "TC0P",
    140           "TC1C", "TC1D", "TC2C", "TC2D", "TC3C", "TC3D", "TH0P", "TH1P",
    141           "TH2P", "TH3P", "TMAP", "TMAS", "TMBS", "TM0P", "TM0S", "TM1P",
    142           "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", "TM8S", "TM9P", "TM9S",
    143           "TN0C", "TN0D", "TN0H", "TS0C", "Tp0C", "Tp1C", "Tv0S", "Tv1S",
    144           NULL },
    145 /* Set 17: iMac 9,1 */
    146         { "TA0P", "TC0D", "TC0H", "TC0P", "TG0D", "TG0H", "TH0P", "TL0P",
    147           "TN0D", "TN0H", "TN0P", "TO0P", "Tm0P", "Tp0P", NULL },
    148 /* Set 18: MacBook Pro 2,2 */
    149         { "TB0T", "TC0D", "TC0P", "TG0H", "TG0P", "TG0T", "TM0P", "TTF0",
    150           "Th0H", "Th1H", "Tm0P", "Ts0P", NULL },
    151 /* Set 19: Macbook Pro 5,3 */
    152         { "TB0T", "TB1T", "TB2T", "TB3T", "TC0D", "TC0F", "TC0P", "TG0D",
    153           "TG0F", "TG0H", "TG0P", "TG0T", "TN0D", "TN0P", "TTF0", "Th2H",
    154           "Tm0P", "Ts0P", "Ts0S", NULL },
    155 /* Set 20: MacBook Pro 5,4 */
    156         { "TB0T", "TB1T", "TB2T", "TB3T", "TC0D", "TC0F", "TC0P", "TN0D",
    157           "TN0P", "TTF0", "Th2H", "Ts0P", "Ts0S", NULL },
    158 /* Set 21: MacBook Pro 6,2 */
    159         { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", "TC0P", "TC1C", "TG0D",
    160           "TG0P", "TG0T", "TMCD", "TP0P", "TPCD", "Th1H", "Th2H", "Tm0P",
    161           "Ts0P", "Ts0S", NULL },
    162 /* Set 22: MacBook Pro 7,1 */
    163         { "TB0T", "TB1T", "TB2T", "TC0D", "TC0P", "TN0D", "TN0P", "TN0S",
    164           "TN1D", "TN1F", "TN1G", "TN1S", "Th1H", "Ts0P", "Ts0S", NULL },
    165 };
    As the daemon reads the sensors names, it would be easy to pick out the applicable sensors and use them.

    According to the key names i found here:

    Code:
     Bit   Hex      Dec    Key   Description
     ---  ------   -----   ----  ------------
      0   0x0001       1   TC0H  CPU Heatsink
      1   0x0002       2   TG0H  GPU Heatsink
      2   0x0004       4   TH0P  HDD Proximity
      3   0x0008       8   TO0P  ODD Proximity
      4   0x0010      16   Tm0P  MLB Proximity
      5   0x0020      32   TA0P  Ambient
      6   0x0040      64   Tp0P  Power Supply Proximity
      7   0x0080     128   TW0P  Wireless (Airport) Proximity
      8   0x0100     256   TC0P  CPU Proximity
      9   0x0200     512   TC0D  CPU Die
     10   0x0400    1024   TG0P  GPU Proximity
     11   0x0800    2048   TG0D  GPU Die
     12   0x1000    4096   TL0P  LCD Proximity
     13   0x2000    8192   SGTT  GPU Heatsink Throttle Threshold
    The relevant sensors would be TC0P and TG0P, which indeed maps well to temp7_input and temp11_input, when i run

    Code:
    mike@mike-laptop:~/scripts$ sensors
    coretemp-isa-0000
    Adapter: ISA adapter
    Core 0:      +50.0C  (high = +105.0C, crit = +105.0C)  
    
    coretemp-isa-0001
    Adapter: ISA adapter
    Core 1:      +50.0C  (high = +105.0C, crit = +105.0C)  
    
    applesmc-isa-0300
    Adapter: ISA adapter
    Left side  :4265 RPM  (min = 4262 RPM)
    Right side :4253 RPM  (min = 4262 RPM)
    TB0T:        +33.5C                                    
    TB1T:        +33.5C                                    
    TB2T:        +32.5C                                    
    TB3T:        +33.5C                                    
    TC0D:        +54.0C                                    
    TC0F:        +51.2C                                    
    TC0P:        +50.8C   <=== temp7_input                                 
    TG0D:        +61.0C                                    
    TG0F:        +56.2C                                    
    TG0H:        +45.2C                                    
    TG0P:        +56.0C   <=== temp11_input                                 
    TG0T:        +55.0C                                    
    TG1H:        +54.8C                                    
    TN0D:        +56.0C                                    
    TN0P:        +53.8C                                    
    TTF0:        +65.0C                                    
    Th2H:        +48.8C                                    
    Tm0P:        +54.5C                                    
    Ts0P:        +32.2C                                    
    Ts0S:        +42.8C
    I think i have enough information to use the relevant sensors. The idea would be to read the labels of the sensors and then use TC0P an TG0P. In this way, the code would be location independent (i.e not use "temp7_input" or "temp11_input"). That would make it pretty generic i hope. As a fall back if the sensor names are not found, it could revert to current average algorithm.

    However, please try it out first. If it works with the average, it feels like a more general solution.

    /Mike
    Some scientists claim that hydrogen, because it is so plentiful, is the basic building block of the universe. I dispute that. I say there is more stupidity than hydrogen, and that is the basic building block of the universe.
    -- Frank Zappa

  9. #19
    Join Date
    Aug 2010
    Location
    Germany
    Beans
    80
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [RFC] Fan control for mactel-support repo

    Looks good to me - especially having the average as a fall back.

    To make it more generic, you will also have to consider MacBooks with only one FAN

    Great stuff

    Also just had a quick look at applesmc - it looks like there is a big chunk of fan control stuff - wonder why it doesn't work/appears not to be working.
    Last edited by dngfng; August 25th, 2010 at 12:39 PM.
    15" MacBook Pro 6,2 (i7) - rEFIt Triple Boot OS X, Win 7, Ubuntu 10.04
    How to Dual/Triple boot Apple Flavoured Products
    Fan control handled by SwedishWings macfanctl


  10. #20
    Join Date
    Oct 2008
    Beans
    171
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Lightbulb Re: [RFC] Fan control for mactel-support repo

    After a bit more searching, i found this unofficial Apple document, "Apple Service Diagnostic Test Results Guide"

    All sensor names are defined. Quite valuable i think =D
    Some scientists claim that hydrogen, because it is so plentiful, is the basic building block of the universe. I dispute that. I say there is more stupidity than hydrogen, and that is the basic building block of the universe.
    -- Frank Zappa

Page 2 of 11 FirstFirst 1234 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •