Contribute
Register

Clamshell function on Surface Pro?

Status
Not open for further replies.
Joined
Jan 4, 2017
Messages
19
Motherboard
Surface Pro 2 rev. B
CPU
I5
Graphics
4400
Hello, First time posting here on tonymac,

Thanks in advance for any help, I have everything working on my dual boot windows 10, Mavericks 10.9.2, Surface pro 2 rev. B. Except I can't figure out how to get clamshell functions to work. I have read numerous forums and the ACPI specs and I am just not enough of a programmer to figure it out. My DSDT is odd in that there are two LID0 devices, one under _SB scope and the other under _SB.PCI0 the one under scope barely has anything in it and the one under _SB.PCI0 is where the patches have focused. Also, I have read the DSDT patch for laptop thread and have a functioning backlight using ACPIBacklight.kext. I have applied the ACPIPoller patch and ACPIDebugs and am running both of those kexts successfully. I get from the console a repeating message of.

ACPIDebug: "LID0._LID enter"
ACPIDebug: { "LID0._LID returning", 0x1, }

No changes when I close the lid which is really what I am after. I would like to see it sleep. It doesn't even register, cause display sleep or change the above repeating message.

Auto sleep does work, I just got it to using the current clover settings and .kexts/Patched ACPI files. I can also set the computer to sleep manually using the apple. Native PM is also in place although I don't know how optimized it is. Attatched is my ioreg and pertinent clover files. Any hints in how I can change my dsdt code to allow me to further troubleshoot this would be great. This is the final hurdle for this hack build. And now that auto sleep works and native PM is giving me much better battery performance it isn't as big of a deal but still a nice thing to have working. It could be that it just wont work with this hardware but if it does it could help all the surface pro hacks out there.

thanks,

Q
 

Attachments

  • My Files.zip
    1.4 MB · Views: 110
Hello, First time posting here on tonymac,

Thanks in advance for any help, I have everything working on my dual boot windows 10, Mavericks 10.9.2, Surface pro 2 rev. B. Except I can't figure out how to get clamshell functions to work. I have read numerous forums and the ACPI specs and I am just not enough of a programmer to figure it out. My DSDT is odd in that there are two LID0 devices, one under _SB scope and the other under _SB.PCI0 the one under scope barely has anything in it and the one under _SB.PCI0 is where the patches have focused. Also, I have read the DSDT patch for laptop thread and have a functioning backlight using ACPIBacklight.kext. I have applied the ACPIPoller patch and ACPIDebugs and am running both of those kexts successfully. I get from the console a repeating message of.

ACPIDebug: "LID0._LID enter"
ACPIDebug: { "LID0._LID returning", 0x1, }

No changes when I close the lid which is really what I am after. I would like to see it sleep. It doesn't even register, cause display sleep or change the above repeating message.

Auto sleep does work, I just got it to using the current clover settings and .kexts/Patched ACPI files. I can also set the computer to sleep manually using the apple. Native PM is also in place although I don't know how optimized it is. Attatched is my ioreg and pertinent clover files. Any hints in how I can change my dsdt code to allow me to further troubleshoot this would be great. This is the final hurdle for this hack build. And now that auto sleep works and native PM is giving me much better battery performance it isn't as big of a deal but still a nice thing to have working. It could be that it just wont work with this hardware but if it does it could help all the surface pro hacks out there.

thanks,

Q

Your _LID method just returns the value stored in LIDS. And that is just a Name (aka variable).
So... now you have to look for the places where LIDS is changed.
And you find some EC queries:
Code:
            Method (_Q36, 0, NotSerialized)  // _Qxx: EC Query
            {
                \RMDT.P1 ("EC _Q36 enter")
                Store (Zero, LIDS)
                Store (0x36, DBG8)
                Notify (LID0, 0x80)
                \RMDT.P1 ("EC _Q36 exit")
            }

            Method (_Q37, 0, NotSerialized)  // _Qxx: EC Query
            {
                \RMDT.P1 ("EC _Q37 enter")
                Store (One, LIDS)
                Store (0x37, DBG8)
                Notify (LID0, 0x80)
                \RMDT.P1 ("EC _Q37 exit")
            }

So clearly _Q36 should be called when the lid is closed (LIDS=0), and _Q37 is called when the lid is opened (LIDS=1)
(see ACPI spec for _LID return value).

Next step should be to see if the EC queries are being called...
 
So looking thru my dsdt I see that there is code for lids in the _WAK but nothing in the _PTS but maybe that is normal. When looking at where the _WAK gets its value I have to go over to my ssdt-8 where I have my brightness fix patch and others. It(dsdt) seems to want to look for clid in _SB.PCI0.IGPU.CLID however when I look at the ssdt-8 I see that there is a value CLID under _SB.PCI0.IGPU.GLID so is this where this is broken? I am not currently seeing any of the Q_36/7 where lids exists being called by ACPIDebug. Only the above repeating messages from syslog.
 
So looking thru my dsdt I see that there is code for lids in the _WAK but nothing in the _PTS but maybe that is normal. When looking at where the _WAK gets its value I have to go over to my ssdt-8 where I have my brightness fix patch and others. It(dsdt) seems to want to look for clid in _SB.PCI0.IGPU.CLID however when I look at the ssdt-8 I see that there is a value CLID under _SB.PCI0.IGPU.GLID so is this where this is broken?

All irrelevant.

I am not currently seeing any of the Q_36/7 where lids exists being called by ACPIDebug. Only the above repeating messages from syslog.

This is your main problem. It means EC queries are broken for some reason.
 
Hmm, Where do I even begin a process of fixing my EC queries? thanks :)
 
Hmm, Where do I even begin a process of fixing my EC queries? thanks :)

Probably you patched ACPI incorrectly. But that is just a guess... you didn't provide adequate information...

Attach ioreg as ZIP: http://www.tonymacx86.com/audio/58368-guide-how-make-copy-ioreg.html. Please, use the IORegistryExplorer v2.1 attached to the post! DO NOT reply with an ioreg from any other version of IORegistryExplorer.app.

Provide output (in Terminal):
Code:
kextstat|grep -y acpiplat
kextstat|grep -y appleintelcpu
kextstat|grep -y applelpc
kextstat|grep -y applehda

Attach EFI/Clover folder as ZIP (press F4 at main Clover screen before collecting). Please eliminate 'themes' directory. Provide only EFI/Clover, not the entire EFI folder.

Attach output of (in Terminal):
Code:
sudo touch /System/Library/Extensions && sudo kextcache -u /

Compress all files as ZIP. Do not use external links. Attach all files using site attachments only.
 
Appreciate your help on this
 

Attachments

  • new files.zip
    4.1 MB · Views: 137
Appreciate your help on this

You're running Mavericks 10.9.1? Why?
From where did you download Mavericks?

Lot's of problems...

ACPI is not patched correctly. Based on ACPI/origin, you should have in ACPI/patched:
DSDT.aml
SSDT.aml (ssdtPRgen.sh)
SSDT-0.aml
SSDT-1.aml
SSDT-2.aml
SSDT-3.aml
SSDT-7.aml
SSDT-8.aml

Your config.plist is corrupt. Never edit config.plist with a text editor...
And it is wrong even if you fixed the corruption.

Your Clover is very old... as are the kexts you installed.
 
I'm running 10.9.2 actually, it is working great on this hardware. I know I need to put in sorted order in config.plist I also know it is old and corrupt. I can always upgrade it now to eliminate that as a problem, but is it likely my problem? I will re run the patch and put in all the ssdts, it does appear that for whatever reason I didn't include the ssdt-01 from my original f4 dump so I will re do it and include it in patched. Then take another ioreg? I applied most(All) of the lid and debug and syntacs patches from the repository, along with the patches to get hdmi audio, battery, backlight and native pm working. I need a newer group of kexts? fakesmc etc. where do I look for those? Thanks!
 
I'm running 10.9.2 actually, it is working great on this hardware. I know I need to put in sorted order in config.plist I also know it is old and corrupt. I can always upgrade it now to eliminate that as a problem, but is it likely my problem? I will re run the patch and put in all the ssdts, it does appear that for whatever reason I didn't include the ssdt-01 from my original f4 dump so I will re do it and include it in patched. Then take another ioreg? I applied most(All) of the lid and debug and syntacs patches from the repository, along with the patches to get hdmi audio, battery, backlight and native pm working. I need a newer group of kexts? fakesmc etc. where do I look for those? Thanks!

Second time asking: From where did you download Mavericks?

You have some sort of ACPI issue/EC query issue. I point out that your ACPI is not patched correctly. Follow my ACPI patching guide.

Also, power management guide.

And Clover is ignoring your config.plist, so anything you might have in there is not being used...

If I was you, I'd start over.

For latest kexts that I use, see "Projects" link in my signature.
 
Status
Not open for further replies.
Back
Top