No Fan Control under Windows causes 70 deg C CPU and GPU

Hi All,

I've seen this issue raised a few times, but never properly addressed. Before the MacOS faithful post any replies, please try actually using Windows under Boot Camp for more than 30~60 minutes. Boot Camp is fine if you install it, boot in Windows for a few minutes novelty value and then restart in MacOS. But if you seriously run Windows for more than half an hour you'll have a mini-stove for frying eggs or boiling water instead of a notebook.

From what I've read online, 2007's "Input Remapper" successfully controlled the fans on that year's MacBooks, but it doesn't work with the late 2008 aluminum unibody MacBook that I have.

The only successful work-around I have is to boot into MacOS, use smcFanControl to ramp up the fans to 5000rpm, then restart in Windows. Adds 5~10 minutes to the boot time, but I haven't found any way to natively control the fans in Windows.

What are other Boot Camp users out there doing to keep their notebook usably cool?

Edit: BTW This problem remains even after applying the recent EFI update 1.3 and SMC update 1.2.

Message was edited by: peterjmacbook

MacBook, Windows Vista

Posted on Dec 25, 2008 4:48 AM

Reply
33 replies

Dec 25, 2008 11:17 PM in response to The hatter

I've emailed both the author of SpeedFan and the author of Input Remapper, and I offered to be the first user to pay a donation via PayPal to either author if they can add late model MacBook fan control to their apps.

From what I read however the problem may be intractable: 99.9% of Windows PCs use BIOS but MacBooks use EFI. Vista doesn't have EFI hooks in it and it may be impossible for a Vista app to directly control the fans through the EFI. When SpeedFan launches the diagnostics report several that several hardware registers "appear to be read only" - I suspect they are the registers required for fan control and are somehow one-way owing to the EFI/BIOS layer provided by Boot Camp.

I think it's up to Apple to take notice of this issue and provide a fix in Boot Camp.

Message was edited by: peterjmacbook

Jan 12, 2009 3:31 PM in response to peterjmacbook

Two or three other people that seem to know the Mac and thermal sensors really well. First on my list, author of Hardware Monitor has a lot of indepth experience and contacts. Second, author of SmcFanControl 2.1.3.1. Both are OS X utilities.

I doubt hooks are needed to EFI but may need to know more about how Macs use System Management Control (SMC) or something.

I agree on $10 (or more) as case may be.

Jan 23, 2009 9:27 PM in response to Paul2070

I have the same problem with my new 15" MacBook Pro.
It really ***** that bootcamp is totally unusable.
Fans just don't spin up under any conditions, and things get hot until everything crashes.
Tried everything and its a no-go.
Didn't somebody boot into windows even once before this laptop was approved and shipped?
(why would apple care about windows? because they advertise and produce BootCamp)
I have submitted a bug/defect report on BugTracker.
Only Apple can fix this issue, and I hope new drivers show up very soon.

Jan 28, 2009 9:49 AM in response to Paul2070

Have to post an update regarding my problems.
I heavily tested with graphics intensive tasks (3dMark, GuildWars, LOTRO), and found out that even though my temps reached 101°C it was not the cause of freezes and crashes. XP would eventually start the fans, slow but they do spin up just as you think the whole thing is going up in flames.
It was me using the trackpad that caused corruption, audio pops and crashes.
USB mouse worked fine, as long as I did not touch the trackpad.
Trackpad drivers from Apple are corrupting audio and video, all of which you can test by running HD video from quicktime/apple.com and moving a cursor using a trackpad (hint: audio would pop, channels would go mute, and audio eventually is gone).

Apr 2, 2009 1:08 AM in response to vanjab

Your mouse might be the case for you.... however, not having any fan control in windows is still the cause for my crashes. The upper left portion of the case becomes untouchable due to the heat. Just by touch I can usually predict when it will crash.

This is ridiculous.

The fans do remember their setting if you were previously booted up in OSX and using SMCFanControl. But this is still not a great solution. You're either stuck with a noisy laptop, or a laptop that gets too hot.

PLEASE APPLE FIX THIS!

Perhaps when my macbook explodes I can get another with the Protection Plan.

Apr 8, 2009 8:52 PM in response to peterjmacbook

You might try this from another angle.

Windows has an enormous number of services running in the background. Reduce these to a minimum and you reduce the heat.

My prior notebook had a 512 RAM maximum. When I discovered how to SAFELY eliminate graphics candy, security nags, indexing, (there are many many more - name your own personal poisons) and bloated antivirus & firewall, my machine had longer battery life, used less RAM, less page-filing, faster boots, and much lower temps.

It is a long process to acquire ALL these skills, but worth it. Kind of fun, too. Start with Black Viper's web page and move to any "tweaking Vista" items in Google.

I gave up on Vista, myself, but I still use a tweaked XP (& love it...)

Just an idea - Cheers

http://www.blackviper.com/WinVista/supertweaks.htm

Message was edited by: NA Smith

Apr 30, 2009 2:09 AM in response to peterjmacbook

Hi, friends:

I got my own program which a dedicated fan controller. It been tested on my new Mac Mini early 2009 (Windows XP). And my source code is open. Everybody should use this to build up a nice GUI program.

NOTE: The program is only a proof of concept. So it only works but lack of functionalities.

1. The program need GIVEIO device driver support. You can get it by install speedfan. Or you can download the standalone package from anywhere.
2. It is a console command line program. Not easy to use, but easy for script. You can add temperature sensor detect function in it.
3. How to get the 'key' definitions of Apple SMC. Please install smcFanControl under OSX. There is a console program in /Application/smcFanControl.app/Contents/Resource/Source. It named 'smc'. Use the command line 'smc -l' to get all 'Key' definitions.
4. For the Apple SMC programming, please refer to Linux Kernel applesmc.c which a kernel extension. It is nice program to communicate with SMC under Linux. The code should help you and me.

BTW: Sorry for my poor English. I am from China. If you got better idea, please email me: iam.liuzhong@gmail.com

[codebox]
#include "stdlib.h"
#include "windows.h"
//Console inp and out functions
#include "conio.h"

#define APPLESMC DATAPORT 0x300
/* command/status port used by Apple SMC */
#define APPLESMC CMDPORT 0x304

#define APPLESMC STATUSMASK 0x0f
#define APPLESMC READCMD 0x10
#define APPLESMC WRITECMD 0x11
#define APPLESMC GET_KEY_BY_INDEXCMD 0x12
#define APPLESMC GET_KEY_TYPECMD 0x13

SC_HANDLE hSCMan = NULL;
BOOL IsWinNT = FALSE;
BOOL IsDriverLoaded = FALSE;

// Return Value // Meaning
enum { DRIVER ALREADYINSTALLED=100, //100 Driver is already Installed
DRIVER INSTALLSUCCESS, //101
DRIVER INSTALLFAILURE, //102
DRIVER ALREADYUNINSTALLED, //103
DRIVER UNINSTALLSUCCESS, //104
DRIVER UNINSTALLFAILURE, //105
DRIVER NOTINSTALLED, //106
DRIVER ALREADYSTARTED, //107
DRIVER INUSE
};

// SCM & GIVEIO control
BOOL InitSCM()
{
if ((hSCMan = OpenSCManager(NULL, NULL,SC MANAGER_ALLACCESS)) == NULL)
{
printf("ERROR: Can't connect to Service Control Manager.\n");
return FALSE;
}
return TRUE;
}

BOOL ShutDownSCM(SC_HANDLE hSCMan)
{
return CloseServiceHandle(hSCMan);
}

DWORD DriverInstall(LPSTR lpPath, LPSTR lpDriver)
{
BOOL dwStatus = 0;
SC_HANDLE hService = NULL;

// add to service control manager's database
if ((hService = CreateService(hSCMan,
lpDriver,
lpDriver,
SERVICE ALLACCESS,
SERVICE KERNELDRIVER,
SERVICE DEMANDSTART,
SERVICE ERRORNORMAL,
lpPath, NULL, NULL, NULL, NULL, NULL)) == NULL)
dwStatus = GetLastError();
else
CloseServiceHandle(hService);

return dwStatus;
}

DWORD DriverRemove(LPSTR lpDriver)
{
BOOL dwStatus = 0;
SC_HANDLE hService = NULL;

// get a handle to the service
if ((hService = OpenService(hSCMan, lpDriver, SERVICE ALLACCESS)) != NULL)
{
// remove the driver
if (!DeleteService(hService)) dwStatus = GetLastError();
}
else dwStatus = GetLastError();

if (hService != NULL) CloseServiceHandle(hService);

return dwStatus;
}

///////////////////////////////////////////////////////////////
// FUNC: GetDriverStatus
// DESC: Returns a Bool; 0 -> GiveIO Driver NOT loaded
// 1 -> GiveIO Driver LOADED
///////////////////////////////////////////////////////////////

int GetDriverStatus()
{
return IsDriverLoaded;
}

BOOL AttachDrv()
{
HANDLE h;

h = CreateFile("\\\\.\\giveio", GENERIC_READ, 0, NULL,OPEN EXISTING,FILE_ATTRIBUTENORMAL, NULL);
if(h == INVALID HANDLEVALUE)
{
printf("ERROR: Couldn't access giveio device.\n");
return FALSE;
}
CloseHandle(h);
return TRUE;
}

BOOL AttachDIO()
{
OSVERSIONINFO osvi;
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);

IsWinNT = osvi.dwMajorVersion == 3 || osvi.dwMajorVersion == 4 || osvi.dwMajorVersion == 5 || osvi.dwMajorVersion == 6;

if(IsWinNT)
{
//Load the DirectIO Driver and attach it to this process

//try opening SCM ; if failed Bail out
if(!InitSCM()) return FALSE;

//Install the Driver
char szDrvPath[MAX_PATH];
GetSystemDirectory(szDrvPath,MAX_PATH);
lstrcat(szDrvPath,"\\Drivers\\GiveIO.sys");
DWORD dwRet = DriverInstall(szDrvPath,"giveio");

if(dwRet != 0 && dwRet != 0x00000431) //Success or already installed
{
printf("ERROR: Could not initialize GiveIO.sys Driver.\n");
return FALSE;
}

if(AttachDrv())
{
IsDriverLoaded = TRUE ;
return TRUE ; // Successful PROCESS_ATTACH
}
else
{
DriverRemove("giveio");
return FALSE;
}
}

return TRUE;
}

BOOL DetachDIO()
{
// Perform any necessary cleanup.

//if it is WinNT unload the giveIO driver
if(IsWinNT)
{
DriverRemove("giveio");
IsDriverLoaded = FALSE ;
return ShutDownSCM(hSCMan); //No Error Check :-P
}
return FALSE;
}

short OutPort( int PortAddress, int PortData )
{
short Dummy;

Dummy = (short)(_outp( PortAddress, PortData ));
return(Dummy);

}

short InPort( int PortAddress )
{
short PortData;

PortData = (short)(_inp( PortAddress ));
return( PortData );

}

int wait_status(short val)
{
unsigned int i;

val = val & APPLESMC STATUSMASK;

for (i = 0; i < 200; i++) {
if ((InPort(APPLESMC CMDPORT) & APPLESMC STATUSMASK) == val) return 0;
Sleep(10);
}

return -1;
}

static int applesmc readkey(const char* key, short* buffer, short len)
{
int i;

OutPort(APPLESMC CMDPORT, APPLESMC READCMD);
if (wait_status(0x0c)) return -1;

for (i = 0; i < 4; i++) {
OutPort(APPLESMC DATAPORT, key );
if (wait_status(0x04)) return -1;
}
OutPort(APPLESMCDATAPORT, len);
for (i = 0; i < len; i++) {
if (wait_status(0x05)) return -1;
buffer
= InPort(APPLESMC DATAPORT);
}

return 0;
}

static int applesmc writekey(const char* key, short* buffer, short len)
{
int i;

OutPort(APPLESMC CMDPORT, APPLESMC WRITECMD);
if (wait_status(0x0c)) return -1;

for (i = 0; i < 4; i++) {
OutPort(APPLESMC DATAPORT, key );
if (wait_status(0x04)) return -1;
}
OutPort(APPLESMCDATAPORT, len);
for (i = 0; i < len; i++) {
if (wait_status(0x04)) return -1;
OutPort(APPLESMCDATAPORT, buffer
);
}

return 0;
}



int main(int argc, char* argv[])
{
short speed[2];
char MINSPEED[5] = "F0Mn";
int st = 0;
AttachDIO();
st = GetDriverStatus();
printf("Driver Status: %d\n", st);
if (st != 1) return 1;

if (argc == 2) {
printf("Set the Minimal speed: %s\n", argv[1]);
st = atoi(argv[1]);
st = st * 4;
speed[0] = st >> 8;
speed[1] = st & 0x00FF;
for (int i = 0; i < 120; i++)
{
if (applesmc writekey(MINSPEED, speed, 2) == 0) break;
Sleep(1000);
}
if (i == 120) {
printf("Failed, retry again!\n");
return 1;
}
printf("Update Successful\n");
}

for (int i = 0; i < 120; i++)
{
memset(speed, 0, sizeof(speed));
if (applesmc readkey(MINSPEED, speed, 2) == 0) break;
Sleep(1000);
}
if (i == 120) {
printf("Failed, retry again!\n");
return 1;
}
st = (speed[0] * 0xFF + speed[1]) / 4;
printf("Current Minimal speed: %d\n", st);
printf("All OK!\n");
return 0;
}

[/codebox]

Usage: smc [Target minimal fan speed you like]

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

No Fan Control under Windows causes 70 deg C CPU and GPU

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.