Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got SD Card Working on SP4 #2

Closed
billabongbruno opened this issue Sep 8, 2022 · 55 comments
Closed

Got SD Card Working on SP4 #2

billabongbruno opened this issue Sep 8, 2022 · 55 comments
Labels
enhancement New feature or request

Comments

@billabongbruno
Copy link

Hey, there.

First of all, I just want to thank you for all of your hard work.
This post is not an issue, just a contribution.

I got the SD Card working by using my "USBMap.kext" instead of your "USBPorts.kext" and by using my edited version of "GenericCardReaderFriend.kext".

I have tried your EFI with these fixes from my previous EFI and this mix/match seems to work perfectly, as I have not seen anything broken.

I can attach the files here, if you want.

Just a quick side note:
Connecting and reconnecting the keyboard works great on my previous EFI.
If you want me to share that as well, I can do that too, so you can have a look.

Everything was working with my build, apart from the touchpad, which, although allowing gestures, was not recognized as a trackpad per se when I used the 6.2 version of BigSurface.

With 3.0 BigSurface version, it worked great.

Also the battery and all that.

Let me know if you want me to share anything.

@billabongbruno
Copy link
Author

EDIT:

Apparently, by replacing your "ACPIKeyboard.kext" with my custom one, even keyboard "hot swapping" seems to be working flawelessly now.

Again, let me know if you want these files, so I can upload them to you here.

@billabongbruno
Copy link
Author

EDIT 2:

Dual Boot DOES work with Windows, provided you use "refindplus".

I've never had any luck booting Windows using OpenCore, so I just chainload OC silently and refindplus is my main launcher.
Highly customizable.

Let me know if I can chime in on that for you as well.

Cheers.

@balopez83
Copy link
Owner

Hi @billabongbruno Yes; please send your files and I will take a look at them to see what the differences are and integrate them.

Can you list what you changed in the kexts that made the SD card and hot swapping work?

I am currently working on an updated EFI that allows for the hot swapping and resume of keyboard use after sleep though haven't yet isolated why it seems to be fixed yet. I haven't uploaded the revisions yet since it needs to be tested a bit more to ensure its fully stable.

I have used refind before and it is pretty good software though didn't know there was a new refindplus. I will have to look into it. As for OC dual booting. I am actually pretty confident what is preventing Windows from booting though I am not in a hurry to fix it before resolving the last few bugs in the EFI. Basically, the issues with OC and Windows are almost always caused by the SSDT-XOSI.aml and associated patches. With the SP4/Book there are significantly more patches that are likely also causing ACPI problems for Windows. When I have some time I will add the needed fixes though it usually complicates the aml files and makes it harder to debug issues.

@balopez83 balopez83 added the enhancement New feature or request label Sep 9, 2022
@billabongbruno
Copy link
Author

MacOS_Enhancements.zip

Hey there, @balopez83 , once again.
As per your request, I am now attaching what you asked and a few more things, which I will explain further.

Hopefully my Kexts help you debug the Keyboard issue.

Yeah, refindplus is a great piece of software.
I can also attach a working copy of the latest review already configured by me to be the most optimized possible.

Also regarding that, as well as the extra files I'm including...
Your build, which is nearly perfect, does not boot unless Verbose mode is activated.
If I try to boot without Verbose, it kernel panics and just reboots over and over again.

I have tried everything to fix this, apart from fiddling with XOSI.
My old build did work without Verbose activated, but I can't figure out what is different right now, sadly.

Regarding my changes to USBMap, RealTekCardReaderFriend and ACPIKeyboard, I did them about 2 years ago and sadly I didn't keep track of what I changed regarding the original files then.

I do remember that getting the SD Card to work was a bit of a pain, but I edited the PID and VID and eventually got it to work.

Regarding ACPIKeyboard I remember that I set something like IOACPIFamily rather than whatever it was.

USBMap was just set a long time ago.

I have had very little time to debug things, as work is crazy right now.

I hope I can help in any way and I am volunteering to test out anything you want.

Just to conclude and so you can keep track, here is what I include in the .zip that I am attaching:

1 - ACPIKeyboard.kext ; RealteakCardReaderFriend.kext ; USBMap.kext --> In order to try and fix the SD Card issue, as well as the Keyboard hot swapping issue;

2 - My SSDT-GPI0.aml and SSDT-XOSI.aml so you can compare them to yours and see if there is anything of help to you;

3 - A copy of the error message that MacOS produced after trying (and failing) to boot WITHOUT Verbose.

Best regards,
Bruno.

@billabongbruno
Copy link
Author

billabongbruno commented Sep 9, 2022

EDIT 1:

I don't know if you want to try another approach or not, but I can share my old EFI folder, which had everything worked flawlessly, apart from the trackpad not being recognized as one after:

1 - Disabling SSDT-ALS0.aml;
2 - Enabling SSDT-SURFACE.aml;
3 - Installing BigSurface's 6.2 Kext.

It might be a different approach to your work, seeing as there is only one thing to fix, but I don't want to overstep here.

Let me know if you want that.

Best regards,
Bruno.

@balopez83
Copy link
Owner

balopez83 commented Sep 9, 2022

EFI.zip

This is my current EFI that appears to have the ability to hot plug the keyboard and will reactivate the keyboard after closing and going to sleep.

It has verbose off and is working for me though I also am not entirely sure why it works or doesn't though I suspect it has to do with the UEFI>Output section of the config.plist where you choose the "text renderer", console mode, and resolution.

I have noticed that in some situations the keyboard may still not be detected when hot plugged but removing and reattaching again seems to make it work. I believe the keyboard issue is related to the USB port power settings and perhaps a need for macOS to need a few extra seconds to detect it. In most cases the keyboard comes alive within 5 seconds of reattaching.

The biggest thing I have noticed with the remaining issues are related to ACPI. When using a fully edited DSDT everything works flawless but when using SSDT's only and limited renames problems crop up. With OC SSDT's only are the preferred method and is the only way to get Windows support with OC.

I haven't yet compared your files with mine but will do that now. If you have time though go ahead and test the EFI attached here and let me know if it works for you and especially if the keyboard hot plugging works.

As for the SD card, your comment about the PID/VID gave me an idea. I think I can add either a device rename to match the stock Realtek card identified in the regular Realtek card kext. This way the kext can be updated without needing to edit every time. I will look into it but worse case it might just make sense to integrate your modded one and roll from there.

Thanks for the assist with this. I know there are quite a few Surface Pro 4 projects out there but wanted to create something that brought everything together and included touch support.

Next big thing I want to fix is true deep sleep support. I know it should be possible but need to figure out what the missing code is so it can be supported. Had another computer that literally was missing S3 and S4 code in the DSDT and simply adding the correct code as an SSDT fixed sleep. Hopefully its something really simple like that though I am sure its more complicated. The Surface DSDT is kinda a mess so it may be awhile. If you have any ideas there please let me know.

If you want to send your previous EFI as well I am happy to take a look and compare to see what may be missing. Could you clarify when you mentioned that everything was working except the trackpad? Did you have the touch support too? Did you use a DSDT or just SSDT's?

[EDIT] This also includes support for UEFI secure boot. You must add the key included in the EFI folder. Turning on UEFI secure boot will force the key installation process.

[EDIT 2] Make sure you Cold Boot the surface after swapping to the linked EFI. If you don't you will most certainly have things not working. If battery indication or anything else isn't working even after cold booting then do the following: Restart, then at the OC boot selector press the space bar and "CleanNVRAM"; once complete, click "reset device" and let it reboot. It will now forget which boot option is default but should boot to macOS and everything should be working.

If you boot this EFI and it boot loops at the Apple logo as you experienced before; press and hold the volume down and power button until the computer forces a shutdown and then try turning the computer on again. With any luck it will boot.

[EDIT 3] This EFI won't have anything but the model identifier in the config.plist. Make sure to add your own serial information or generate random ones before booting with it or that could cause boot issues.

@billabongbruno
Copy link
Author

EFI_SP4_OC_0.8.3_billabongruno.zip

Hey there, again.

I see your EFI.zip.
I'm going to try it out now and provide feedback ASAP.

Regarding the verbose boot, I see where you're getting at, but I seem to recall doing a quick compare and having those arguments in line with yours (in my old EFI), but nonetheless, I may be wrong and thus, I will be trying your EFI now.

Regarding the hit-and-miss keyboard hot swapping, to be fair, I sometimes have issues with it even with Windows, Kali, Ubuntu or even ChromeOS (I use all of these and MacOS as well through the use of refindplus), so if that were to happen to me under MacOS, I would most likely just brush it off and try again. It seems to be iffy, regardless of the OS. Cleaning the contacts with IPA both on the keyboard itself and on the Surface seemed to help with this.

I am glad that all of the mambo-jambo that I wrote you were able to come up with a possible solution / enhancement.
Truly glad.

You are most welcome. I also enjoy having things fully working and as seemless as possible, as well as aesthetically pleasing (hence my refindplus configured in the way that it is). I do realize that there are numerous projects, but out of all of them, yours seems to be the most promising.

Regarding deep sleep, I believe my old EFI had deep sleep working perfectly. Since I'm attaching it, you can have a look.

Regarding the trackpad issue:
So, as I stated, my old EFI was perfect, with everything running and using BigSurface.kext Version 3.0.
Then along came touchscreen support and I decided to give BigSurface.kext Version 6.2 (BSK 6.2) a go.
Everything still works great, apart from the touchpad, which now (after doing the steps I mentioned in my previous comment), now only has very basic functionality. It works as a mouse, basically. I lost gestures (the pinch thingies and all that) and now does not register under Touchpad (or Trackpad) under MacOS settings. It reports that no touchpad / trackpad is available.

You ask if I touch support before. I absolutely did. Flawlessly.
Just not after updating to BSK 6.2 anymore.

I used both DSDT and SSDT.
I am attaching it, so you can have a look at it, even though it might be somewhat underoptimized.

Regarding your 3 EDITS:
I will proceed accordingly, then.
I always perform similar procedures, but it doesn't hurt to point out the how-to.
I appreciate that.
Regarding the SMBIOS info, I know what you're talking about. I also took the liberty of editing out my info in the EFI I am attaching.

I will give it a go now and provide feedback ASAP.

Again, thank you for all your hard work.
I just hope I can help, if even in the least.

Best regards,
Bruno.

@billabongbruno
Copy link
Author

EDIT 1:

Well, everything seems to be working perfectly now, with your latest EFI, apart from the SD Card.
I have tried everything, apart from deep sleep.

@billabongbruno
Copy link
Author

EDIT 2:

I got SD Card working again without breaking anything else (apparently) by:

1 - Disabling your following kexts:
RealtekCardReader.kext
RealtekCardReaderFriend.kext
USBPorts.kext (was already disabled)
USBToolBox.kext
UTBMap.kext

2 - Adding and enabling:
USBMap.kext
GenericCardReaderFriend.kext
(Both of which I added here earlier)

It doesn't seem to break any functionality whatsoever, but only time will tell.
I don't know if my USBMap.kext is of any use to you or not, but for this particular issue it works.

So, even though you are light-years away from me in terms of Hackintosh knowledge, I hope it sheds some light on any underlying issues (which you pretty much erradicated altogether).

Talk soon, I hope.

Best regards,
Bruno.

@balopez83
Copy link
Owner

Well @billabongbruno it looks like the SD card slot is even easier to get running. So it looks like the SP4 SD card slot is supported natively by macOS. All that is actually needed to get it running is your USBmap.kext file.

In addition you still should keep the other kexts that you previously disabled, disabled. Additionally, you should now disable the genericcardreaderfriend.kext.

I am going to regenerate a new usb mapping that supports the SP4 and Book but for now usbmap kext should work just fine.

next up, deep sleep.

@billabongbruno
Copy link
Author

@balopez83 , happy to know that it's all coming together.

Very well, then, I will try disabling GenericCardReaderFriend.kext and see how that works out.

Glad to know that the USBMap.kext helped, if even just a little bit.

As for deep sleep, maybe my DSDT.aml may help with that?
If not, let me know what I can do to try and figure it out with you.

Best regards,
Bruno.

@billabongbruno
Copy link
Author

EDIT 1:

Yep, SD Card still works even after having disabled GenericCardReaderFriend.kext.

Awesome.
Thank you.

@balopez83
Copy link
Owner

I should be posting a new release soon with all the changes. Looks like the USB mapping can't be combined with the Surface Book without causing failed boot up. While they have the same map the ports are classified different. Going forward I will need to split the Config.plist files. Oh well but at least progress is being made.

I will compare your DSDT with a stock one and see what patches you have to see about that deep sleep support. Just so I am clear on it, your device fully sleeps and turns off the USB ports, touch, etc., when using your old EFI?

@billabongbruno
Copy link
Author

Hey there.

Good to know a new release is coming up soon, even though it sucks that you have to branch out the config.plist files.
Maybe it can be sorted in a next iteration?

Ok, so regarding my DSDT:
Deep sleep worked when I was using BigSurface.kext Version 3.0, which did NOT support touch (on the screen).
I did not try deep sleep with BigSurface.kext Version 6.2.

But back when I was using BigSurface.kext Version 3.0, the only thing that woke up the device while under MacOS was the power button, if I am not mistaken.
I have been through so many iterations of my EFI that I don't even remember anymore nor am I sure that the DSDT that I sent you suffered any change when I was trying to fix the Hardware buttons.

Hopefully I didn't change it and deep sleep is still working in it.

I need to check my backups if that one is the wrong version.

Also, on a side note, I took the liberty of updating AppleALC.kext to the latest version, as well as HibernationFixUp.kext too.
Both of these were one version behind the latest.

I have upgraded to OpenCore 0.8.4 with some minor personal adjustments to the config.plist.

It's all working great.

@balopez83
Copy link
Owner

Glad to hear its all working well. Yeah need to update everything but figured I would try and work out some last minute stuff before doing so. Cleaning up the SSDT's now and getting rid of some patches that I don't believe are needed anymore.

@billabongbruno
Copy link
Author

Yeah, it's super smooth.

Oh, I see.
Hopefully not too much work for you.

Also, on a quick unrelated note...
Do you think it would be possible for you to help me out on another MacOS project?
It's regarding Bluetooth on Monterey 12.4+ (which worked fine on 12.3.1), but not anymore.
It's an Intel AC9560. I have Wifi, but I can't get Bluetooth to work, even using the latest kexts and BlueToolFixUp.kext as per the instructions.

Apparently I need a new ACPI patch for it, but I can't, for the life of me, figure it out.

@balopez83
Copy link
Owner

sure, I can take a look at it. Send me what you want me to look at.

@billabongbruno
Copy link
Author

sure, I can take a look at it. Send me what you want me to look at.

I really appreciate that.
I will zip it and send it right away, then.

Thank you so much.

@billabongbruno
Copy link
Author

billabongbruno commented Sep 10, 2022

EDIT 1:

Apparently, I can't attach it here, because it exceeds 25Mb.

I have therefore uploaded it to a publicly shared folder on my GoogleDrive.

Here is the link:
https://drive.google.com/file/d/1HTMMwxj2bJuqj-yMkwwkKog6gC_FFdqD/view?usp=sharing

As a reference, the laptop in question is:

Acer Nitro 5 AN-515-52
The Wifi / Bluetooth card is an Intel AC-9560.

Again, I can't thank you enough for this.

Best regards,
Bruno.

@billabongbruno
Copy link
Author

@billabongbruno
Copy link
Author

EDIT 3:

I had previously also figured some things out with BigSadan regarding USB and remembered that I had seen issues about sleep.

I believe that it was this thread that shed some light on the matter:

bigsadan/surface-pro-4-hackintosh#19

@balopez83
Copy link
Owner

EDIT 2:

And I have indeed followed these instructions to the letter:

https://openintelwireless.github.io/IntelBluetoothFirmware/FAQ.html#what-additional-steps-should-i-do-to-make-bluetooth-work-on-macos-monterey-and-newer

So I took a quick look at your EFI, kexts, and ssdt's and at first glance things seem ok so need to dig a little deeper. I wasn't seeing anything about SSDT edits so curious where you saw it? Also, is there any chance that the latest version broke something that needs to be fixed with an update to the kexts themselves?

Is there a specific part of the SSDTs/config/kexts that you believe are probably causing the issues?

@balopez83
Copy link
Owner

EDIT 3:

I had previously also figured some things out with BigSadan regarding USB and remembered that I had seen issues about sleep.

I believe that it was this thread that shed some light on the matter:

bigsadan/surface-pro-4-hackintosh#19

I took a look at this before as well and tried these changes but unfortunately it didn't seem to have much effect on sleep. It seems like it goes into only the dark wake mode where it shuts many things off but still runs the USB ports and background tasks. I was able to get it to go to sleep but it then transitions to fully off and restarts once you open the keyboard or hit the power button. I can't figure out how to have it stay in sleep and wake normally.

@billabongbruno
Copy link
Author

EDIT 2:
And I have indeed followed these instructions to the letter:
https://openintelwireless.github.io/IntelBluetoothFirmware/FAQ.html#what-additional-steps-should-i-do-to-make-bluetooth-work-on-macos-monterey-and-newer

So I took a quick look at your EFI, kexts, and ssdt's and at first glance things seem ok so need to dig a little deeper. I wasn't seeing anything about SSDT edits so curious where you saw it? Also, is there any chance that the latest version broke something that needs to be fixed with an update to the kexts themselves?

Is there a specific part of the SSDTs/config/kexts that you believe are probably causing the issues?

Hey there.

I really appreciate you taking the time to do so.

Well, as I said, it was all working great using MacOS up to 12.3.1.

After (and including) 12.4, it just stopped.
Apparently, it is a known issue because Apple changed the way they handle Bluetooth and as such, the OpenIntelWireless guide was updated to include the fixes.

However, these fixes don't work for everyone.
Including changing the model, which I did.

Some people report it's working, but a lot report that it doesn't.

Even with the latest kexts.
I read somewhere that a new ACPI patch needs to be added.

As an extra piece of info, it seems to map the BT module, but then, under MacOS, the address just shows as NULL, as if no firmware had been injected, which it should have been.

I am at a complete loss.

@billabongbruno
Copy link
Author

EDIT 3:
I had previously also figured some things out with BigSadan regarding USB and remembered that I had seen issues about sleep.
I believe that it was this thread that shed some light on the matter:
bigsadan/surface-pro-4-hackintosh#19

I took a look at this before as well and tried these changes but unfortunately it didn't seem to have much effect on sleep. It seems like it goes into only the dark wake mode where it shuts many things off but still runs the USB ports and background tasks. I was able to get it to go to sleep but it then transitions to fully off and restarts once you open the keyboard or hit the power button. I can't figure out how to have it stay in sleep and wake normally.

I see.
Well, I can't say much about S3 at this point, I would need to investigate further.
I don't know if Monterey is breaking some stuff that worked on BigSur (which might be the case).

A good example of this is the laptop I have (which we discussed just now).
In BigSur, it all worked fine.

Come Monterey, if I reboot or shutdown normally, it leaves my keyboard and touchpad in a bad state and I can't operate it to choose my boot entry in RefindPlus nor OpenCore.
I have to use an external mouse or force shutdown (hold power button down) to be able to use either touchpad or keyboard again.

It's weird.
A known issue that exists in Monterey that conflicts with certain BIOSes, which is my case, sadly.

Monterey seems poorly optimized.

@balopez83
Copy link
Owner

Hi @billabongbruno , So I am trying to think of possible options that might be causing the error you're getting with bluetooth. One thing that comes to mind is patching of the kexts to recognize your card assuming its not already listed in the kext's plist?

The other thing that stands out is your system product name being iMac. I know you said you changed your information but I believe it being set as an iMac would actually be more harmful than helpful. Something along the lines of MacBookPro 15,1 would likely be a better fit in addition to working power management.

I am not sure if it will help here but perhaps try enabling the "ExtendBTFeatureFlags" quirk in the "kernel" section.

Can you send me a clean (not patched) DSDT from your computer? I suspect that you could be right about an SSDT patch though it might be something that can be bypassed with a device patch in the Config.plist instead. Can you export your PCI-e list from Hackintool as well and send that? If you can find the information you mentioned regarding a possible SSDT patch for this issue, that could help as well.

I have an 11th gen computer with intel wifi and bluetooth as well that I am updating to Monterey now and will see if I experience the same issue you have. That may help me figure out how to resolve it on yours. I don't use it for macOS much cause the graphics are not supported on 11th gen and up though keep it installed just in case my main hacks go down and need to make some edits and fixes.

@billabongbruno
Copy link
Author

ACER_NITRO_5_AN-515-52_INTEL_AC-9560-BT_DSDT_billabongbruno.zip

Hey again.

Ok, so regarding the first part, the model is listed and supported in the kext (explicitly), so that might not be the issue.
Yeah, I realize that the model is regarding a desktop rather than a laptop, but I just figured I would try it out.
I used to have MacBookPro 16,1, I believe.

I did not in fact try to use the "ExtendBTFeaturesFlags" quirk, tho.
I'll give it a shot when I am using it.

Regarding the DSDT, I found a copy of both an original and a patched one on my Google Drive, but there are 2 years old and I stopped importing the DSDT for quite some time now.
I am attaching them, in any case.

I can't export the PCI-e list at this moment, but as soon as I get back home (not for a few days), I will be sure to dump it and attach it here.

To be fair, it's working more as a desktop than anything else.
It's beefy, I've upgraded some stuff and does the job of replacing (for now) a desktop.

I once needed to jailbreak my iPad Mini 3 and the Linux distros of checkRa1n weren't working anymore, so I had to start Hackintoshing just so I could jailbreak the damn thing again (tethered jailbreak).

lol

It's Ok if I can't get BT to work, but as I'm sure you guessed it by now, it really itches me not having it set up properly.
lol

Anyway, I'm attaching the DSDTs.

If need by, I will dump it again when I have access to it.

Hope it helps in your investigation.

Best regards,
Bruno.

@billabongbruno
Copy link
Author

@billabongbruno
Copy link
Author

ACER_billabongbruno.zip

EDIT 2:

Ok, so I have asked for someone to perform the tasks for me, with me on the phone (via videocall).
lol

I am attaching a fresh copy of my clean DSDT.aml and also the PCI-E Devices list obtained using Hackintool.

I also asked for the order of the kexts to be switched, but it didn't work.

@balopez83
Copy link
Owner

Haven't yet looked at your DSDT but here is where I am at with it:

I updated my computer to Monterey 12.6 and as expected bluetooth stopped working. I dug through some of the links you sent and came across one mentioning USB ports. It seems on some computers the USB ports fail to map and in some cases it can impact bluetooth. Can you determine if your computer still shows the USB ports mapped? On my computer it no longer shows the USB ports mapped. The EFI uses an SSDT to map instead of kext however it seems to have failed to stay mapped.

Not sure if this is the solution but figured I would bring it up. I need to fix mine to see if that resolves things or not.

@billabongbruno
Copy link
Author

billabongbruno commented Sep 13, 2022

Yeah, I saw that too.
By using USBInjectAll.kext they got BT working, but lost other funcionalities.

I do believe mine remained mapped, but I will need to investigate further.

Which tool and log file would you like me to use in order to check this for you?

@billabongbruno
Copy link
Author

USB Ports.zip

EDIT 1:

So, out of nowhere, Bluetooth worked ONCE, but only once.
I lost that ability immediately after a new reboot.

The person who is remotely using my ACER used ChromeOS, rebooted into MacOS as per my instructions and Bluetooth was working normally.
I instructed them to edit the config.plist to a more suitable model again (MacBookPro15,1) (and all according serials) and reboot.

After that I lost BT funcionality again.
Even after having reverted back to the previous setup.

It was a fluke, but it leads me to believe that the issue might reside in the order of which the kexts are loaded and / or a simple timing issue.

Anyway, I have attached what you asked.

Hope it helps in sorting this issue.

Best regards,
Bruno.

@billabongbruno
Copy link
Author

EDIT 2:

Ok, so very weird behavior:

First I tried remapping USB using USBToolBox and also UTBMap.kext, which didn't work.

And then:

1 - After manually turning on Bluetooth in the status bar on top and staying on MacOS for about 10 minutes, the laptop was rebooted into a Linux Distro (Kali Linux);

2 - After leaving Kali, the laptop was rebooted once more;

3 - After reboot, booted into MacOS, but instead of immediately entering the password, a timeout of around 10 seconds was given;

4 - Bluetooth was working;

5 - Rebooted into MacOS again;

6 - Bluetooth was working;

7 - Rebooted into all the other OSes (Kali, Ubuntu, Windows, ChromeOS) and then back to MacOS;

8 - Bluetooth was working;

9 - COLD BOOTED (shutdown from ALL OSes);

10 - Bluetooth was working;

11 - HARD BOOTED (pressed and held down the power Key) and rebooted into MacOS;

12 - Bluetooth was working.

The only times Bluetooth failed to work was when the timeout before entering the password was not met, which is super weird.

NOTE:
1 - Force enabled Bluetooth in the status bar, even when it didn't work;
2 - Updated Airportitlwm.kext to 2.2.0 (Pre-release Alpha);
3 - Kept the iMac details in the SMBIOS;
4 - Enabled the BTExtended feature;
5 - Order of the kexts is InteBTPatcher --> IntelBTFirmware --> BlueToolFixUp.

How is this simple timeout before entering password making any difference?

@balopez83
Copy link
Owner

Sorry for the delay getting back to you. Its been a crazy week with work.
I suspect its working due to firmware remaining loaded in memory. I know you mentioned that it still worked after a cold boot but perhaps that may have something to do with when more than even the order in which your kexts are loading.

Similar to how the BigSurface kexts needed to have the IOprobescore number increased to ensure they load later I might recommend the same with the bluetooth kexts. I am not sure if it needs to be done to all, some, or just one of the kexts so you will have to play around with it BUT your delaying log-in makes me thing it MIGHT help. Then again it might do nothing at all but its just a guess. In the BigSurface kexts I think only one of them needed the IOProbescore increased and I think they increased it to 9,999 but I am writing from memory so you will have to double check. You should find and be able to edit it in the plist inside each kext and sub kext.

Hope that helps a little.

Unrelated I found some information that might help get a slightly deeper sleep on the Surface Pro 4 but it appears like S3 sleep may not actually be possible as its a hardware limitation. Instead there may be a way to imitate something like the active standby feature the Surface uses in Windows.

On another note, are you experiencing random crashes or freezes on Monterey? I think I need to do a deeper dive in the ACPI to make sure I am not missing needed patches as I don't remember having these issues back when I used a fully patched DSDT. Unfortunately the Surface DSDT is really a mess and not sure if its really even possible to have a stable system without a full DSDT patch

@billabongbruno
Copy link
Author

Hey there.

No worries, my week is being very busy too.

Well, I just read up on what you wrote, but...
Alas, it stopped working even before I read what you said.

It's back to not working again.
I have no idea what to do, honestly.

Regarding the Surface, well, that's interesting, in fact.
I have absolutely no issues with Monterey, to be honest.
It's as stable as any other OS I have, so I don't think any DSDT patching is in fact required.
At least not on my end.

Also, on an unrelated note, I found some things regarding the Linux driver for the integrated Wifi / BT.
I might start a bounty with some developers just to get that working as well, if at all possible.
A port from Linux, even if spoofing some other card, would be great.
lol

@balopez83
Copy link
Owner

Well not sure if it helps but there was an Avastar kext that was supposed to get bluetooth working apparently back in the day. Still no wifi but could be a start at least. I have not been able to get it to work but let me dig around in my files and see if I can find it. I think it was designed for the Surface Pro 1 & 2 though so maybe with some modifications it could work with the Pro 3-6

@balopez83
Copy link
Owner

Here we go. This is the Avastar kext. Can't remember even where I found it but maybe it might help.
Avastar.kext.zip

@billabongbruno
Copy link
Author

Here we go. This is the Avastar kext. Can't remember even where I found it but maybe it might help. Avastar.kext.zip

Thank you.

I'll see what I can do with this.
Will report back if I have any progress.

@billabongbruno
Copy link
Author

EDIT 1:

By the way, I opened an issue (more like a suggestion) on the creator of BigSurface's GitHub.

You can follow up on it here:
Xiashangning/BigSurface#65

@balopez83
Copy link
Owner

Hi @billabongbruno just thought I would let you know I just posted a massive update in the releases section as release version 4.0.

This should fix almost all issues on the Surface Pro 4.

Any luck with your other stuff?

@billabongbruno
Copy link
Author

Hi @billabongbruno just thought I would let you know I just posted a massive update in the releases section as release version 4.0.

This should fix almost all issues on the Surface Pro 4.

Any luck with your other stuff?

Hey there.

Yeah, I had already starred and followed your project.
I got an e-mail notification, but I just got the opportunity to reply.

In the meantime, I saw that version 4.1 was released as well, so obviously I'm gonna give that one a try.

No, so far no luck with the Avastar thingy nor the sleep issue.

Regarding the other laptop, sadly no advance.

@balopez83
Copy link
Owner

Ah good to know. Sorry you haven't had any progress on the bluetooth for your other machine. I am not entirely sure what the deal is and have not been able to fix it on my other machine either.

I am still experiencing an issue where the computer will freeze at the time the computer attempts to sleep. Basically the screen stays on but everything is frozen and it then has to be turned off forcefully. can you tell me if your computer freezes at all around the time it is set to go to sleep? Can you also tell me if your computer freezes when you access the screensaver menu? Also what version of macOS are you using?

I can't quite tell if I messed something up but if so both version 4.0 & 4.1 will be impacted. I will prob roll back to an old version and see if the issues exist still.

@billabongbruno
Copy link
Author

Hey there.

Yeah, I have no idea what to with Bluetooth on my other laptop.
I guess I'll either just NOT have Bluetooth from now on or just hope that the kexts evolve in such a manner that sort this issue out.

I am not experiencing any freeze whatsoever...
I did make some modifications to the config.plist, though.
But I believe it wasn't anything major.

I can send you my EFI (with the SMBIOS info edited out), if you want.

It's based on your 4.1 release.

I am currently on version 12.6 of MacOS.

@balopez83
Copy link
Owner

Yeah I am not sure yet what is going on with the Bluetooth yet but if I figure it out on mine I will let you know.

As for the weird freezing issue, I think it has to do with the type cover "port" but not exactly sure why. Can you tell me if your computer freezes at all when you remove the type cover? Also, what version of the Type Cover do you have? keys close together means original version and space between them means newer version. Alcantara type is I think even newer.

Go ahead and send me just your config.plist if your computer isn't freezing when you detach your keyboard. If it does freeze then don't worry about sending anything.

@billabongbruno
Copy link
Author

Hey again.

I appreciate you letting me know if you happen to solve it.
I will obviously, do the same.

Regarding my Surface Pro 4, I have the original version of the keyboard and it does not freeze at all.
I will eventually need to buy an Alcantara version or just apply some sort of vynil wrap around this one, as it is peeling off from use, but other than that, it works perfectly.

I am attaching more than my config.plist.

I'm attaching my full EFI folder.

Give it a try with your SMBIOS info, to see if the issue remains.

If it does, now you know that it is your keyboard.
If not, you can then compare things from there.

Keep in mind that I do not use Secure Boot at all, so my EFI is very minimal, which is what I always aim for.
I also do not load a lot of the drivers you were loading, as I use RefindPlus to load other stuff (OpenCore is chainloaded from RefindPlus).
EFI_SP4_OC_0.8.4_2022-09-19_billabongbruno.zip

@billabongbruno
Copy link
Author

EDIT 1:

I am attaching a photo of my Type Cover, for you to compare.

IMG_20220919_174148

@balopez83
Copy link
Owner

Thanks for sending all of that. It looks like I may have messed up my USB ACPI code or something cause after rolling back everything is stable again. I re-implemented some new ACPI changes to clean up the code for Windows booting so there are not ghost devices showing errors in the Device Manager and now everything seems to be running perfect.

I may play around with the Avastar kext but at this point I think this computer is about as good as its gonna get without someone with way more knowledge than I figuring out the WiFi & Bluetooth stuff.

@billabongbruno
Copy link
Author

Hey there.

No problem, I jut wanted you to have as much as a basis for comparison as possible.

Oh, I see.
I'm glad you got it all running perfect now.

Yeah, hopefully I get some replies regarding the Wifi and Bluetooth.

Also the cameras.

By the way, is 4.1 the "final" release or are you rolling out a new one, considering the changes you made?

Best regards,
Bruno.

@balopez83
Copy link
Owner

Hey @billabongbruno based on how much is finally working I will likely slow the number of releases to monthly or every couple months for OC upgrades and minor fixes. I anticipate doing one more release soon though to incorporate the final changes for Windows/Linux dual boot fixes.

Side note, I have been using an external bluetooth dongle but disconnected it and restarted macOS. Upon reboot bluetooth was working or at least appeared to be working. I suspect the avastar kext might have attached though couldn't verify. I was able to connect to a bluetooth headset however it disconnected instantly. It would keep attempting to connect and would keep disconnecting. I did edit the avastar kext to match my device ID which might have helped it to sorta work. After another reboot it stopped working and hasn't worked like that since. It seems there might be hope for internal bluetooth after all though I suspect it will be awhile before any real success comes of this.

@billabongbruno
Copy link
Author

Hey there.

Yeah, it makes sense not to be putting out releases just for the sake of it.
I don't think any additional optimizations are needed, to be honest.

Regarding your bluetooth findings, those are indeed very interesting.
Hopefully, in due time, something can be found.

Also, the creator of BigSurface Kext will not be helping out with the cameras, as he does not have the device on hands.
I wish I knew how to port the Linux code into MacOS, seeing as I have two different Linux builds running flawlessly (Kali & Ubuntu), but sadly I have no idea where to start.

Also, could you please let me know which Bluetooth dongle you are using under MacOS, so I can purchase one too?
I found a great and cheap replacement keyboard for our Surface Pro 4, but it connects via Bluetooth, so it wouldn't work under MacOS without a proper adapter and the respective Kexts.

Can you point me in the right direction, please?
(Which device to purchase and which Kexts to load)

Best regards,
Bruno.

@balopez83
Copy link
Owner

No problem.

Here is the bluetooth nano usb I am using and it works great https://a.co/d/4ul1AOR
Keep in mind that it won't work yet on Monterey for the same reason the Intel ones won't work on Monterey. I am going to include the proper kexts and fixes (I hope) in the next release.

I also figured out the crashing issues I was experiencing. It turns out I was stupid and looking everywhere but the right spot. Ironically I suspected the issue but never actually double checked.
Basically the issue is the GPU. I assume you have an i3 or i5 model which is why you didn't experience the same issues. I have the i7 model which uses a completely different GPU and so it would crash every time the GPU would need additional cores. I have fully resolved that issue and will include multiple config files now for each version (i3/i5 & i7 SP4's as well as a separate one for the Surface Book) I haven't decided but I might break out the EFI's just to make it easy on people and reduce the EFI size.

As for the porting, I would suggest reaching out to this person who was able to port the Goodix Touch screen driver from linux to macOS and it works fairly well. https://github.com/lazd/VoodooI2CGoodix

@balopez83
Copy link
Owner

This issue is getting pretty long. Do you have Discord? I might suggest you messaging me there for any further items so we can keep the issues from getting this long or off topic.

@billabongbruno
Copy link
Author

Hey there again.

So, first of all, thank you for the advice on the Bluetooth dongle.
Seeing as it it likely you will figure out the BT issue on Monterey, I'm gonna go ahead and purchase it.

Oh, I see.
I do have the i5 model, yes.
I had no idea that would be the issue.
Glad you sorted it out.

I suppose breaking the EFI's would be easier for people, indeed.
Just more work for you, sadly.

As for the porting, I will reach out to that user and see what can be done, then.

And yes, this has become a very long "issue" and very off-topic, lol.
I agree, let's change communication means.
I do have Discord, indeed.
Feel free to add me:

Bruno Santana#6367

(Yes, it does have a space between "Bruno" and "Santana" and the capital letters are those)

Feel free to close this "issue".

See you on Discord soon.

Best regards,
Bruno.

@balopez83
Copy link
Owner

Bluetooth for Broadcom devices has now been resolved. Whoo hoo lol.

I will try and push a new release later today and if not for sure this week.

@billabongbruno
Copy link
Author

billabongbruno commented Sep 27, 2022

lol

Good to know.
I will look forward for it.

Hopefully that fix is applicable to the other laptops as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants