-
Notifications
You must be signed in to change notification settings - Fork 145
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
Add BlueToolFixup #12
Conversation
dfu-util can be used to perform a dfu update in user-space. It has been confirmed to work on hardware using Apple's own dfu files. Eg. For BCM943602CS with Product ID 0x8290:
BrcmPatchRAM supports zhx format which is just a zlib compressed version of dfu. There is a de-compressor available in BrcmPatchRAM/BrcmFirmwareStore.cpp. Perhaps dfu-util can be integrated into BlueToolFixup to perform a dfu update? |
Thanks for commenting - this is really my first delve into Bluetooth on hackintoshes (and I've barely scratched the surface), so I didn't know about this. As far as I know, you can't call userspace binaries from kernelspace - so you wouldn't be able to run
Considering this, from my point of view I think it's more worthwhile to keep maintaining BrcmPatchRAM. Feel free to chime in with your thoughts. |
Not sure why I got a kp during kext loading for both CI and manual build w/ latest Lilu. Quite weird. Maybe it's better to separate it into a new project? https://github.com/acidanthera/SidecarFixup is a good base for that. You will need After patching the |
As for moving to a separate project, in my opinion, no. Too many of them already. I will let this one stay for a short while and then merge. If you attach the KP it may help. |
@headkaze How does this work with Monterey when IOBluetoothFamily.kext has no Plugins folder inside it anymore? |
Fixed in e97233a, I fixed it locally but then forgot to push my changes. 🤦
True, but frankly given that it appears that it only works for Broadcom so far, I don't think it's a big deal to just leave it here. The code is completely independent anyway so it can be used with other vendors.
Make sure you don't have the injector enabled. Besides that, I don't see any reason for longer boot times. @headkaze, it looks like I misinterpreted what you were saying. If you're referring to this dfu-util, it says it doesn't work on PatchRAM devices, so it wouldn't really be helpful. In that case, I don't think patching |
Thank you! It works with BCM20702A0 (ASUS BT-400). |
I was just giving an example of how dfu-util can upload firmware. But as @dhinakg has mentioned this only works for non-PatchRAM devices anyway so it's useless.
Yes you're right I forgot about that. So it makes more sense to port BrcmPatchRAM into a new user mode tool instead. |
Thanks for this great work! Just a quick question, is there a suggested loading order for BlueToolFixup? Should it load prior to |
It does not depend on anything in BrcmPatchRAM - so anywhere under Lilu is fine. However, do not use However, Intel has yet to work for anyone who has tested (as far as I know), so unless you're using this as a base for more research into fixing Bluetooth, it'll likely not be very helpful for you. |
Sorry for mistype. What I really tried to say is Brcmfirmwaredata and brcmram3 kexts. Only god know why I typed IntelBluetooth. But you still answered clearly. Thank you so much |
Sorry @dhinakg, for information only. Are you working on this point?
Thanks for all your work |
after update ti beta 10 bluetooth not work |
Does anyone have BCM94352Z chipset working with Bluetooth? I installed the BlueToolFixup but it seems that the firmware is not loaded. System Info is showing: Bluetooth Controller: |
Exact same report here.
|
Alright, found the issue has been fixed. For @buyddy, checking this PR the vendor check is an issue and a BrcmPatchRAM release 2.6.1 is planned for the next few days to deal with maniacs who want Monterey from day one as @vit9696 replied. Which is your case and mine. TLDR: Use this early BrcmPatchRAM3 2.6.1 release for now Bluetooth seems to need some more work but at least makes the BCM94352Z usable now |
I had same problem with BCM_4350C2. 2.6.1 fixes the issue! PS: Sorry to report again, after powering off and left some hours. I turned on the machine again and Bluetooth is still on, but it can't find any device. PPS: Another release works: https://github.com/dortania/build-repo/releases/download/BrcmPatchRAM-44c3025/BrcmPatchRAM-2.6.1-RELEASE.zip |
I had problems with only bluetooth with BCM943224PCIEBT2 using 2.6.1. |
Same case as what I'm experiencing. Even for the same case, making bluetooth in windows is not active. I hope to be active again in the future |
BlueToolFixup v2.6.1 fixes the Bluetooth availability, I can now connect my Airpods Pro, but it is unusable. After 1 minute of music playback the audio gets more and more distorted until it just dies with crackling noises. Anybody experiencing this issue? Bluetooth Chipset: 0b05:1868 - ASUSTek Computer, Inc. (Qualcomm Atheros QCA61x4A Bluetooth 4.1) |
after using |
I just tried 2.6.1 with BT-400 on Monterey 12.0.1 with OC and it didnt work... I added these under kernel section of the config.plist: I am using a real MacBookPro7,1 with internal usb physically disabled. what do I have to do to troubleshoot this? |
what did you exaclty use to make i work? |
Update: I found a trick to make the Airpods somehow work (although the audio isn't that great as there are subtle crackles from time to time). Basically all I have to do is:
The trick only works while the Airpods are connected. Upon disconnect the steps 1 to 6 need to be repeated again. Update 2: |
thanks man, i am using bcn943602cdp also has the same problem while connecting to airpods pro. thanks |
No new solution unfortunately. I pretty much stopped using my Airpods, even the solution I give isn't good - it's really hard to stabilize the audio (sometimes it just takes forever), then from time to time you can hear some crackling, and if you play different audio sources at once the problem sometimes comes back on its own. :( The new Apple kext (or maybe the kext patch) just doesn't work properly for our bluetooth hardware. The problem seems to be audio desynchronization/delay slowly introduced when audio is played, something is not ticking right. I'm suspecting it could be triggered from RAM or CPU speed, but I haven't verified it, but that is not the core of the issue, the core of the issue is just the new kext(s). I think you are the first person to ever report having that same issue. |
i tried both of my airpods 2 and airpods pro. all have the same issue. |
BlueToolFixup.kext 2.6.1 is working for me in Monterey 12.2 with OC 0.7.7 on a GA-Z170X Designare with an ASUS BT400 USB adapter. Completely stable with AirPods Pro. All I did was drag in the one kext and add it to my config.plist and it worked after rebooting. |
Hey @wmjlxl, you should try to upgrade to OpenCore to 0.7.8 and upgrade all your kexts. I just did, I'm on macOS 12.2.1 and it seems the issue is now gone (I'm using the latest BlueToolFixup.kext too). :) Don't ask me what was originally causing the issue, because I have no clue. :| |
Good evening Anyone going through the same situation? in the system information appears: |
System: T480s with BCM94352z (This one is a Lenovo branded unit with A key which I then cut a slot to make A+E). My only issue that is that I cannot toggle on the Bluetooth if I toggle it off. Requires a reboot. Sleep and wake does not toggle it back on but if it always one, sleep wake is not an issue. Can this be fixed? |
I faced the same problem on my Macbook Air with Monterey 12.6.6 and BCM94360CS2 onboard. I turned off bluetooth and now can't turn it on. Wi-fi is ok. Removing card and boot laptop without it has no luck. I don't know what to do. Is any sense in replacing module? |
BlueToolFixup forces
BlueTool
to skip attempting a firmware update, allowing for some Broadcom¹ chipsets² to work on Monterey. It also properly sets the transport.As Monterey is a beta, this is still a work in progress, and may break. Changes in
bluetoothd
,BlueTool
, or other parts of the Bluetooth stack may require more work for Bluetooth to continue working.Reviewer notes:
User notes:
BrcmBluetoothInjector
in Monterey. As detailed in [BrcmPatchRam] macOS Monterey BT issues bugtracker#1669, parts of the Bluetooth stack have changed from kernel-space to user-space. The kext thatBrcmBluetoothInjector
adds personalities for is now a dummy kext that attaches toIOResources
(instead of the USB device) and does nothing.BrcmBluetoothInjector
in Monterey will cause a stall. No replacement is needed asbluetoothd
does not hardcode device IDs and instead uses the device class.MaxKernel
to20.99.99
.Special thanks to @vit9696 for helping me track down the cause, find a fix, and integrate this into a Lilu plugin.
¹ BlueToolFixup solely patches
BlueTool
's firmware update check currently. More work appears to be needed for Intel Bluetooth.² Not many have been tested currently, and not all features (Continuity) have been tested. This is obviously not required on cards pulled from a Mac, and on cards that are completely native and do not need BrcmPatchRAM (ie. BCM94360NG).
Technical Notes:
In Monterey,
bluetoothd
identifies and opens the BluetoothIOUSBDevice
. It will then send an XPC message toBlueTool
, another daemon used for updating firmware, to run its internal script. In its internal script,BlueTool
will attempt to update the firmware, if necessary. However, on non-native chipsets,BlueTool
fails to find firmware for the chipset:BlueTool
then return10
as the result in the XPC reply back.bluetoothd
terminates, as this is a non-zero value.launchd
will then restartbluetoothd
, and the cycle continues.To skip the firmware update check,
BlueTool
checks for the existence of/etc/bluetool/SkipBluetoothAutomaticFirmwareUpdate
. This could be manually created, but we replace it with/System/Library/CoreServices/boot.efi
, so manually creating it is not needed, and so Bluetooth can work in recovery. Sinceboot.efi
should always exist, the firmware update check will always be skipped, and since the existence of the file is checked, not the contents, there are no issues with replacing the original string with this.However, for this to work properly, the transport must also be properly set (otherwise, the file will be ignored). To determine the transport,
BlueTool
(and alsobluetoothd
) looks for atransport-encoding
property on a registry entry named eitherbluetooth
ormarconi-bt
. The value of this property determines the transport:0
for USB,3
for UART, or7
for PCIe. Therefore, we settransport-encoding
to00000000
(type data) and rename ourselves tobluetooth
.BlueTool
will then find our registry entry, get the transport, check for the existence of the skip firmware file, skip the firmware update, and then finish and reply with a result of0
tobluetoothd
.bluetoothd
will then continue and Bluetooth should work.Other notes:
bluetoothd
detects the chipset as an external dongle:This can be overridden in NVRAM - set
bluetoothHostControllerSwitchBehavior
tonever
. However, this may break System Information and System Preferences.Turning off Bluetooth breaks Bluetooth (you cannot turn it back on). More research is needed to fix this.