Contribute
Register

(Req) DSDT patch for detect fan RPM on Asus laptop

Status
Not open for further replies.
Check the SSDT that has the PTID device. It can offer clues. Read the code for PTIDSensors in ACPISensors.kext (part of FakeSMC) so you understand what the PTID device does (it does not appear to be documented in the ACPI spec).

Note: HwMonitor displays "-" when a fan (tachometer) is not turning (0 RPM).

The device PTID is not on any of the SSDT tables. It's actually on the DSDT, see my attached DSDT on the first post.

By looking on another post where you helped some guy, the method that returns the RPMs is OSDD, that returns the value OSDD. But by looking at the method doesn't consult anything on LPCB.EC0.

Look:

Method (OSDD, 0, Serialized)
{
Name (OSDC, Zero)
Store (OSDG (), OSDC)
Store (OSDC, Index (OSDV, Zero))
Store (OSDG (), OSDC)
Store (OSDC, Index (OSDV, One))
Return (OSDV)
}

So, what can I do? You told the guy to add an SMCD device, and it looks almost the same like the ACER Fan patch. Can I start from there?

Cheers!
 
The device PTID is not on any of the SSDT tables. It's actually on the DSDT, see my attached DSDT on the first post.

By looking on another post where you helped some guy, the method that returns the RPMs is OSDD, that returns the value OSDD. But by looking at the method doesn't consult anything on LPCB.EC0.

Look:

Method (OSDD, 0, Serialized)
{
Name (OSDC, Zero)
Store (OSDG (), OSDC)
Store (OSDC, Index (OSDV, Zero))
Store (OSDG (), OSDC)
Store (OSDC, Index (OSDV, One))
Return (OSDV)
}

So, what can I do? You told the guy to add an SMCD device, and it looks almost the same like the ACER Fan patch. Can I start from there?

Cheers!

Take a close look at OSDD. It calls OSDG:
Code:
            Method (OSDG, 0, NotSerialized)
            {
                Return (Ones)
            }

            Method (OSDD, 0, Serialized)
            {
                Name (OSDC, Zero)
                Store (OSDG (), OSDC)
                Store (OSDC, Index (OSDV, Zero))
                Store (OSDG (), OSDC)
                Store (OSDC, Index (OSDV, One))
                Return (OSDV)
            }

As you can see, OSDG returns Ones. In other words, your PTID leaves OSDD unimplemented. The PTID device will not be useful to determine where fan RPM is provided.

You might want to investigate what GFAN is doing. And analyse what TH00 and TH01 read while the fan speed changes in RW-Everything.
 
Take a close look at OSDD. It calls OSDG:
Code:
            Method (OSDG, 0, NotSerialized)
            {
                Return (Ones)
            }

            Method (OSDD, 0, Serialized)
            {
                Name (OSDC, Zero)
                Store (OSDG (), OSDC)
                Store (OSDC, Index (OSDV, Zero))
                Store (OSDG (), OSDC)
                Store (OSDC, Index (OSDV, One))
                Return (OSDV)
            }

As you can see, OSDG returns Ones. In other words, your PTID leaves OSDD unimplemented. The PTID device will not be useful to determine where fan RPM is provided.

You might want to investigate what GFAN is doing. And analyse what TH00 and TH01 read while the fan speed changes in RW-Everything.

GFAN calls TH00 and TH01 wich in turn, by using your Asus battery patch, is the result of splitting TAH0 in two.

I tried this:

Code:
            Method (OSDG, 0, NotSerialized)
            {
                Return (Ones)
            }

            Method (OSDD, 0, Serialized)
            {
                Name (OSDC, Zero)
                Store (B1B2 (^^PCI0.LPCB.EC0.TH00, ^^PCI0.LPCB.EC0.TH01), OSDC)
                Store (OSDC, Index (OSDV, Zero))
                Store (OSDG (), OSDC)
                Store (OSDC, Index (OSDV, One))
                Return (OSDV)
            }

With no luck. I only used the index 0 because the other index is for Battery Capacity.

Cheers!

EDIT:

After digging with EC0 and RW-Everything, I'v found the values are in bytes 93 and 94 of the EC.

The method that calculates the RPMs is GFAN.

Tried doing this:

Code:
Method (OSDG, 0, NotSerialized)
            {
                Return (GFAN ())
            }

            Method (OSDD, 0, Serialized)
            {
                Name (OSDC, Zero)
                Store (OSDG (), OSDC)
                Store (OSDC, Index (OSDV, Zero))
                Store (OSDG (), OSDC)
                Store (OSDC, Index (OSDV, One))
                Return (OSDV)
            }

Still no luck. The fan is spinning at full speed and a hyphen is still present.
 
RehabMan, success!!!

I ended up deleting my PTID device. It wasn't doing anything.

I installed your ACPI Debug kext and I found out that even GFAN method wasn't running. In fact, the methods on the PTID device weren't running either. I set many debug messages and they didn't appear on the sys log.

I even tried calling GFAN from the PINI method and then I got a message on the log.

My solution was inspired from you. I used the Acer patch, but in the FAN0 method, I used the TH00 and TH01 values from ECOR (the name of my EC) and voila, success!

I didn't need (at least not right now) the other sensors nor the fan control, so I deleted the other methods because HWMonitor already detects my CPU cores temps and the thermal zone, too. Because of I already had a "Fan RPM" device from PTID, I deleted the whole device as well.

In conclusion, here's my modified SMCD device:

Code:
Device (SMCD)
    {
        Name (_HID, "MON0000")  // _HID: Hardware ID
        Method (FAN0, 0, Serialized)
        {
            Store (B1B2 (\_SB.PCI0.LPCB.EC0.TH00, \_SB.PCI0.LPCB.EC0.TH01), Local0)
            If (LEqual (Local0, 0xFF))
            {
                Store (Zero, Local0)
            }

            If (Local0)
            {
                Store (0x80, Local1)
                Store (0x02, Local2)
                Multiply (Local1, Local2, Local3)
                Multiply (Local0, Local3, Local4)
                Divide (0x03938700, Local4, Local5, Local6)
                Multiply (Local6, 0x0A, Local6)
                Store (Local6, Local0)
            }

            Return (Local0)
        }
    }


I had to modify the formula to calculate the RPM because it appeared to spin at 600 RPM aprox. So, I used the formula on GFAN method and works fine. I have the same readings like on AIDA64 on Windows 8.

I also have some conclusions on the behavior of my fan:

1. At idle and when the temps are below 50 degrees celsius, the fan turns OFF. I see a hyphen on HWMonitor. Over 50 it start spinning at about 1900 - 2200 RPM. It can even reach 3400 RPM under heavy load.
2. The previous statement of the fan turning off it's verified because I don't hear a thing on my laptop, but as soon it turns on, I hear it. It's very quiet, but I hear it.
3. On windows happens the same, but I don't think the fan turns off maybe because it always have some kind of load (I test the fan on AIDA, maybe the program running has some load and causes the fan to turn on).
4. A very strange thing happens when I restart Windows to boot on OS X. The fan starts spinning VERY LOUD and I can check that it runs at aprox 5400 RPM. By rebooting back to windows, the fan stays loud and I can confirm that speed. I have to turn off the system to reset the fan speed.

That behavior I don't remember to have experienced on Windows by playing games with Optimus enabled. I thing it started spinning loud when the laptop is hot enough, but I can't confirm it. I'll play a game or something to see that. On OS X, running Geekbench I get up to 75 degrees and the highest speed I get is 3400 RPM.

Please let me know your opinion, and thanks again for your support, you're a true DSDT master!

Cheers!
 
RehabMan, success!!!

I ended up deleting my PTID device. It wasn't doing anything.

I installed your ACPI Debug kext and I found out that even GFAN method wasn't running. In fact, the methods on the PTID device weren't running either. I set many debug messages and they didn't appear on the sys log.

I even tried calling GFAN from the PINI method and then I got a message on the log.

My solution was inspired from you. I used the Acer patch, but in the FAN0 method, I used the TH00 and TH01 values from ECOR (the name of my EC) and voila, success!

I didn't need (at least not right now) the other sensors nor the fan control, so I deleted the other methods because HWMonitor already detects my CPU cores temps and the thermal zone, too. Because of I already had a "Fan RPM" device from PTID, I deleted the whole device as well.

In conclusion, here's my modified SMCD device:

Code:
Device (SMCD)
    {
        Name (_HID, "MON0000")  // _HID: Hardware ID
        Method (FAN0, 0, Serialized)
        {
            Store (B1B2 (\_SB.PCI0.LPCB.EC0.TH00, \_SB.PCI0.LPCB.EC0.TH01), Local0)
            If (LEqual (Local0, 0xFF))
            {
                Store (Zero, Local0)
            }

            If (Local0)
            {
                Store (0x80, Local1)
                Store (0x02, Local2)
                Multiply (Local1, Local2, Local3)
                Multiply (Local0, Local3, Local4)
                Divide (0x03938700, Local4, Local5, Local6)
                Multiply (Local6, 0x0A, Local6)
                Store (Local6, Local0)
            }

            Return (Local0)
        }
    }


I had to modify the formula to calculate the RPM because it appeared to spin at 600 RPM aprox. So, I used the formula on GFAN method and works fine. I have the same readings like on AIDA64 on Windows 8.

I also have some conclusions on the behavior of my fan:

1. At idle and when the temps are below 50 degrees celsius, the fan turns OFF. I see a hyphen on HWMonitor. Over 50 it start spinning at about 1900 - 2200 RPM. It can even reach 3400 RPM under heavy load.
2. The previous statement of the fan turning off it's verified because I don't hear a thing on my laptop, but as soon it turns on, I hear it. It's very quiet, but I hear it.
3. On windows happens the same, but I don't think the fan turns off maybe because it always have some kind of load (I test the fan on AIDA, maybe the program running has some load and causes the fan to turn on).
4. A very strange thing happens when I restart Windows to boot on OS X. The fan starts spinning VERY LOUD and I can check that it runs at aprox 5400 RPM. By rebooting back to windows, the fan stays loud and I can confirm that speed. I have to turn off the system to reset the fan speed.

That behavior I don't remember to have experienced on Windows by playing games with Optimus enabled. I thing it started spinning loud when the laptop is hot enough, but I can't confirm it. I'll play a game or something to see that. On OS X, running Geekbench I get up to 75 degrees and the highest speed I get is 3400 RPM.

Please let me know your opinion, and thanks again for your support, you're a true DSDT master!

Cheers!

Looks like you're making progress. Congratulations & nice work...
 
Looks like you're making progress. Congratulations & nice work...

No, thanks to YOU for that awesome kext/patch called ACPIDebug! :)

I think it's too complicated to make a fan control to spin faster the fan. I think I'll leave it that way. I usually don't get temps so high, and the fan it's working. That's what I needed.

Cheers!
 
No, thanks to YOU for that awesome kext/patch called ACPIDebug! :)

I think it's too complicated to make a fan control to spin faster the fan. I think I'll leave it that way. I usually don't get temps so high, and the fan it's working. That's what I needed.

Cheers!

The hard part about changing the fan behavior is determining how it is controlled... Once you figure that out, writing the code to correlate fan speed with temperature is not difficult. Usually the fan control provided by the system is good enough.

BTW, if you have nvidia (or Radeon) it is worthwhile disabling it with DSDT/SSDT edits.
 
The hard part about changing the fan behavior is determining how it is controlled... Once you figure that out, writing the code to correlate fan speed with temperature is not difficult. Usually the fan control provided by the system is good enough.

BTW, if you have nvidia (or Radeon) it is worthwhile disabling it with DSDT/SSDT edits.

I already did, with PINI, and reenable it on PTS to get a proper reboot.

Cheers!
 
Hi RehabMan, Am trying to make work the FAN speed reading with HWmonitor, but am so confused editing my dsdt. I need your help with this. Thanks man.
 

Attachments

  • DSDT.aml
    42.7 KB · Views: 159
  • ssdt1.dsl
    19.8 KB · Views: 136
Hi RehabMan, Am trying to make work the FAN speed reading with HWmonitor, but am so confused editing my dsdt. I need your help with this. Thanks man.

You can see where OSDD reads the fan speed... from CFSP at _SB.PCI0.LPCB.H_EC.CFSP. You will need to find where CFSP is defined.
 
Status
Not open for further replies.
Back
Top