Page 23 of 27 FirstFirst ... 132122232425 ... LastLast
Results 221 to 230 of 269

Thread: Macbook (5,1) hotter in linux than in OSX

  1. #221
    Join Date
    Nov 2009
    Beans
    49

    Re: Macbook (5,1) hotter in linux than in OSX

    hi all, I am completely new to linux and there are so many codes here...

    can anyone be kind and point me which post here should I follow to get my MBP 5.1 cool?

    many thanks

  2. #222
    Join Date
    Jan 2008
    Location
    Netherlands
    Beans
    2,930
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Macbook (5,1) hotter in linux than in OSX


  3. #223
    Join Date
    Oct 2009
    Beans
    1

    Re: Karmic Update?

    Quote Originally Posted by Nikos.Alexandris View Post
    Here is mine using Karmic on MBP5,1: it's great == is & feels cooler!

    Regards
    Yep I agree. Also MBP5.3 is great.

  4. #224
    Join Date
    Nov 2009
    Beans
    10

    Re: Macbook (5,1) hotter in linux than in OSX

    Do you have the applesmc-dkms package installed? Please start from there, and if the problem exists, I will help you solve this.

  5. #225
    Join Date
    Nov 2009
    Beans
    49

    Re: Macbook (5,1) hotter in linux than in OSX

    Quote Originally Posted by hitman9211 View Post
    Do you have the applesmc-dkms package installed? Please start from there, and if the problem exists, I will help you solve this.
    it said:
    Couldn't find package applesmc-dkms

  6. #226
    Join Date
    Jan 2008
    Location
    Netherlands
    Beans
    2,930
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Macbook (5,1) hotter in linux than in OSX

    you probably didn't add the mactel repository to your sources.list...

    https://wiki.ubuntu.com/MactelSupportTeam/PPA

  7. #227
    Join Date
    Dec 2009
    Beans
    3

    Re: Macbook (5,1) hotter in linux than in OSX

    Quote Originally Posted by linuxopjemac View Post
    you probably didn't add the mactel repository to your sources.list...

    https://wiki.ubuntu.com/MactelSupportTeam/PPA
    Actually, running Karmic on a 5,2 MBP, the applesmc-dkms package hasn't been pushed up yet. It's available in the older repositories, though. Any thoughts on whether or not it's worth a try?

    I'd like to have better fan control as well. Right now I'm staring at 20 different temp1 through temp20 sensors with no real idea what any of them refer to. Plus, it doesn't seem like the fan's are spinning up or spinning down automatically at all - the CPU temperature got up to 80c before I slapped the fans up to high speed manually - that ain't cool at all. Any suggestions on how to better manage this would be most welcome.

    For those following along from home, right now the MBP 5,2+Karmic combination is proving quite capable in all avenues except for the temperature/fan control (which is an important one!). Wireless, backlight control, keyboard backlight are all working. I have not yet tested sound or BT, though.
    Last edited by Gambit-; December 3rd, 2009 at 04:07 AM.

  8. #228
    Join Date
    Jan 2009
    Beans
    314
    Distro
    Ubuntu Development Release

    Re: Macbook (5,1) hotter in linux than in OSX

    The applesmc-dkms package in the mactel repo is older than the code included in the Karmic Linux kernel so there would be no point in building packages for Karmic - the applesmc module in the Karmic kernel is the latest version.

  9. #229
    Join Date
    Dec 2009
    Beans
    3

    Re: Macbook (5,1) hotter in linux than in OSX

    Quote Originally Posted by alexmurray View Post
    The applesmc-dkms package in the mactel repo is older than the code included in the Karmic Linux kernel so there would be no point in building packages for Karmic - the applesmc module in the Karmic kernel is the latest version.
    That's good to know, thanks alexmurray!

    I've added a bunch of details regarding what a MBP 5,2's temperature sensors track on the wiki at https://help.ubuntu.com/community/Ma...5-1_5-2/Karmic. Still no solution in place for responding to the temperature change and intelligently controlling the fan.

  10. #230
    Join Date
    Nov 2005
    Beans
    60

    Re: Macbook (5,1) hotter in linux than in OSX

    Quote Originally Posted by Gambit- View Post
    That's good to know, thanks alexmurray!

    I've added a bunch of details regarding what a MBP 5,2's temperature sensors track on the wiki at https://help.ubuntu.com/community/Ma...5-1_5-2/Karmic. Still no solution in place for responding to the temperature change and intelligently controlling the fan.
    I used the fancontrol daemon posted a few pages ago, and it's controlling my fans beautifully.

    I modified it to use both fans (fan #2 only when things get really hot - not sure I'm totally happy with this).

    Note that I'm running kernel 2.6.32.

    Here's the modified source. Use at your own risk. If your computer melts or the fans drill a hole in your MBP and spin around the room demolishing your priceless Monets, well, you are on your own.

    Code:
    #!/usr/bin/python
    # This program is public domain - Use at your own risk :)
    # Copyright 2009 by Matt Ryanczak
    #
    # I wrote this script for my macbook because I could not find anything else that worked very well.
    # The algorithm used to control the fan speed was inspired by a shell script written by Nick Barcet
    # His script (for the macbook pro) can be found here: https://wiki.ubuntu.com/MacBookPro/SantaRosaFanControl
    
    import sys, os
    import time
    import os
    import syslog
    
    # Tweak these numbers to adjust the sensitivity of the fans
    MaxTemp = 72
    MinTemp = 46
    
    # These number are tweakable as well but note that 6500 is the highest setting for the fan.
    MaxFanSpeed = 6600
    # I add 100 to this value before setting the fan speed in the code below. This works better IMHO
    MinFanSpeed = 1600
    
    # Set to 1 for logging to syslog. Set to 0 for none (fatal errors still get logged)
    # At least on my system (Karmic Alpha 3) you must enable UDP logging in /etc/rsyslog.conf
    # to see log messages from this program. Other distro's python may log to /dev/log.
    # A better way to see what is going on with your tempurature and fans is to install lm-sensors
    # then you can run 'watch sensors' to see temps and fan speed
    DebugLogging = 0
    
    # Daemon spawning function from python cookbook
    def daemonize (stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'):
        # Perform first fork.
        try:
            pid = os.fork( )
            if pid > 0:
                sys.exit(0) # Exit first parent.
        except OSError, e:
            sys.stderr.write("fork #1 failed: (%d) %sn" % (e.errno, e.strerror))
            sys.exit(1)
        # Decouple from parent environment.
        os.chdir("/")
        os.umask(0)
        os.setsid( )
        # Perform second fork.
        try:
            pid = os.fork( )
            if pid > 0:
                sys.exit(0) # Exit second parent.
        except OSError, e:
            sys.stderr.write("fork #2 failed: (%d) %sn" % (e.errno, e.strerror))
            sys.exit(1)
        # The process is now daemonized, redirect standard file descriptors.
        for f in sys.stdout, sys.stderr: f.flush( )
        si = file(stdin, 'r')
        so = file(stdout, 'a+')
        se = file(stderr, 'a+', 0)
        os.dup2(si.fileno( ), sys.stdin.fileno( ))
        os.dup2(so.fileno( ), sys.stdout.fileno( ))
        os.dup2(se.fileno( ), sys.stderr.fileno( ))
    
    # Check to make sure the applesmc module is loaded 
    if (os.path.exists("/sys/devices/platform/applesmc.768") == 0):
       sys.stderr.write("Fatal Error: /sys/devices/platform/applesmc.768 does not exist!\nIs the applesmc module loaded?\n")
       sys.exit()
    
    syslog.openlog("mb-fancontrol")
    
    # Function to set the fan speed
    def setFanSpeed(Fan, FanSpeed, MinFanSpeed):
        try:
            if (FanSpeed < MinFanSpeed):
               FanSpeed = MinFanSpeed
            FanSpeedSysFn = '/sys/devices/platform/applesmc.768/fan%s_min' % Fan
            FanSpeedSys = open(FanSpeedSysFn, 'w+')
            if (DebugLogging == 1):
                syslog.syslog(syslog.LOG_NOTICE,'Setting %d fan speed to: %s' % (Fan, FanSpeed))
            FanSpeedSys.write(FanSpeed) 
            FanSpeedSys.close()
        except IOError:
            syslog.syslog(syslog.LOG_ERR,'Fatal Error: Cannot open: /sys/devices/platform/applesmc.768/fan1_min. Is the applesmc module loaded?')
        return 1
    
    # Function to set the fan speed
    def SetFanSpeed (FanSpeed, MinFanSpeed):
        setFanSpeed(1, FanSpeed, MinFanSpeed)
        if int(FanSpeed) < 3600:
            MinFanSpeed = "0"
            FanSpeed = "0"
        setFanSpeed(2, FanSpeed, MinFanSpeed)
        return 1
    
    # Set the initial fan speed to MinFanSpeed
    SetFanSpeed(str(MinFanSpeed), str(MinFanSpeed))
    
    # Fork the daemon process
    daemonize()
    
    Temp5InputFn = '/sys/devices/platform/applesmc.768/temp5_input'
    Temp8InputFn = '/sys/devices/platform/applesmc.768/temp8_input'
    Temp14InputFn = '/sys/devices/platform/applesmc.768/temp14_input'
    
    syslog.syslog(syslog.LOG_NOTICE,'Starting')
    
    while True:
        try:
            Temp5Input = open(Temp5InputFn)
            Temp5 = int(Temp5Input.read())
            Temp5Input.close()
            Temp8Input = open(Temp8InputFn)
            Temp8 = int(Temp8Input.read())
            Temp8Input.close() 
            Temp14Input = open(Temp14InputFn)
            Temp14 = int(Temp14Input.read())
            Temp14Input.close()
        except IOError:
            syslog.syslog(syslog.LOG_ERR,'Error opening temperature sensors. Is the applesmc module loaded?')
            continue
        AverageTemp = ((Temp5 + Temp8 + Temp14)/3)
        if (DebugLogging == 1):
            syslog.syslog(syslog.LOG_NOTICE,'Average Temperature: (%s %s %s) %s' % (Temp5, Temp8, Temp14, float(AverageTemp)/1000))
        if (AverageTemp > (MaxTemp * 1000)):
            SetFanSpeed(str(MaxFanSpeed), str(MinFanSpeed))
            syslog.syslog(syslog.LOG_NOTICE,'Getting too hot! Setting fan speed to: %s' % (MaxFanSpeed))
        elif (AverageTemp <= (MinTemp * 1000)):
            SetFanSpeed("0", "0")
        else:
            FanSpeed = (((AverageTemp - (MinTemp * 1000)) * (6000 / (MaxTemp - MinTemp)) / 1000))
            SetFanSpeed(str(FanSpeed), str(MinFanSpeed))
        time.sleep(5)
    Last edited by Sloth; December 6th, 2009 at 09:46 PM. Reason: Update Code to use correct sensors

Page 23 of 27 FirstFirst ... 132122232425 ... LastLast

Tags for this Thread

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
  •