acidanthera / bugtracker

Acidanthera Bugtracker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BrcmPatchRam] macOS Monterey BT issues

dreamwhite opened this issue · comments

Hi there,
first of all thank you so much for 2021.06 release planning. Everything works flawlessly on my side.
I'm opening this issue to keep track of the changes to BrcmPatchRAM (and possibly other kexts like Lilu) behaviour on macOS 12 Monterey.

Today I installed macOS Monterey 12.0 (21A5248p) on my laptop and noticed that the installer hangs if BrcmPatchRAM kexts are injected. Disabling them from config.plist makes the boot proceed.

I have a DW1830 (BCM943602BAED 14e4:43ba) and I'm currently using the following kexts for the bluetooth compatibility on macOS Big Sur 11.4 (20F71):

  • BrcmBluetoothInjector (required from macOS 10.15 Catalina and newer)
  • BrcmPatchRAM3 (paired with the injector)
  • BrcmFirmwareData (as I'm injecting the kexts via OC)

As I wrote above, if those kexts are injected and I try to boot macOS 12 Beta, the boot process hangs.

Is there any chance that my card (as well as the other cards which require BrcmPatchRAM for BT compatibility) will work on macOS 12?
I'll attach as soon as possible OpenCore 0.7.0 DEBUG logs both with and without BrcmPatchRAM kexts injected. Please tell me if you require any other logs, and eventually how to obtain them.
Regards
dreamwhite

As wrote above, here you are the logs obtained with the following boot-args: -v debug=0x100 keepsyms=1 -lilubetaall -liludbg liludump=120:

opencore-2021-06-07-222721.txt
Lilu_1.5.3_21.0.txt
Let me know your thoughts on that, and eventually how can I help you.
dreamwhite

It not plug-in Lilu.

commented

Seems to be a firmware loading issue.

BrcmPatchRAM works as intended and fw is loaded. You can verify it by rebooting from Windows with the injector only. 3rd-party BT cards seem to have issues for lack of some ingredients from customized fw. I wonder if Intel BT works in Monterey.

commented

BrcmPatchRAM works as intended and fw is loaded. You can verify it by rebooting from Windows with the injector only. 3rd-party BT cards seem to have issues for lack of some ingredients from customized fw. I wonder if Intel BT works in Monterey.

It works as intended in BigSur and below, but something with the loading the firmware has changed in Monterey. I can get BrcmPatchRAM3 loaded but the BrcmFirmwareData and BrcmBluetoothInjector kext do not work in Monterey.

I can get BrcmPatchRAM3 loaded but the BrcmFirmwareData and BrcmBluetoothInjector kext do not work in Monterey.

BrcmBluetoothInjector is a binaryless kext that matches additional non-native hardware IDs and won't show up in ioreg or kextstat.

For firmware loading, the device can hold loaded firmware after a warm reboot. This trick is widely used before BrcmPatchRAM is developed.

Compared to Big Sur, IOBluetoothFamily adds more methods on ACPI operations for UART module, i.e. torvalds/linux@4c33162 . The log indicates that the driver tries to access those methods while native Bluetooth cards don't have such process. I guess there is a whitelist for native USB Bluetooth IDs and all other devices will took the UART approach and then fail.

I'll try to reply to everyone:

@Andrey1970AppleLife: It not plug-in Lilu.

Oh, my bad. I thought that Lilu could help somehow 😅

@Pavo-IM: Seems to be a firmware loading issue.
@zhen-zen : BrcmPatchRAM works as intended and fw is loaded. You can verify it by rebooting from Windows with the injector only. 3rd-party BT cards seem to have issues for lack of some ingredients from customized fw. I wonder if Intel BT works in Monterey.
I don't have Windows on my computer, but I have a working Arch Linux installation and bluetooth works fine without installing any kind of external drivers (fyi I'm using brcmfmac kernel module). Is this still valid or should I install Windows somewhere and eventually report back? Eventually what should I check on Windows?

Anyways thank you so much for replying and have a great day

I don't have Windows on my computer, but I have a working Arch Linux installation and bluetooth works fine without installing any kind of external drivers (fyi I'm using brcmfmac kernel module). Is this still valid or should I install Windows somewhere and eventually report back? Eventually what should I check on Windows?

Literally any OS with working Bluetooth works in this way, including Linux and even macOS (set maxKernel to 20.99.99 for BrcmPatchRAM, don't apply to the injector).

Literally any OS with working Bluetooth works in this way, including Linux and even macOS (set maxKernel to 20.99.99 for BrcmPatchRAM, don't apply to the injector).

Alright, so can you gently confirm me the following recap?

  • set maxKernel to 20.99.99 for BrcmPatchRAM3 and BrcmFirmwareData
  • leave BrcmBluetoothInjector untouched

If so, what kind of logs do you need? Should I attach Lilu debug log despite it still doesn't show anything relevant about BrcmPatchRAM?

commented

Here is a dump from the log using log show --last boot | grep -I brcm since log show --last boot | grep -i brcm[fp] doesn't work.
brcm_dump.txt

This is from using the latest debug version btw.

I have same issue BrcmPatchRAM3 and BrcmFirmwareData
BrcmBluetoothInjector on Moneterey 12
without these kexts booting fine macOS 12
I have Dell 1560 BRCM4352z

commented

Some more info.... In Bigsur and below the BroadcomBluetoothHostControllerUSBTransport.kext which is what the injector kext is injecting into, is located inside IOBluetoothFamily.kext/Contents/Plugins/ in Monterey BroadcomBluetoothHostControllerUSBTransport.kext is not located there anymore. Its located in System/Library/Extensions.
Screen Shot 2021-06-08 at 12 19 58 PM

commented

BroadcomBluetoothHostControllerUSBTransport IOProviderClass has changed from IOUSBHostDevice to IOResources and doesn't have the list of devices in the Info.plist like it previously did. This is why the BrcmBluetoothInjector.kext isn't working.
Screen Shot 2021-06-08 at 5 22 17 PM

@Pavo-IM what is salution to fix bluetooth for monterey 12

BroadcomBluetoothHostControllerUSBTransport IOProviderClass has changed from IOUSBHostDevice to IOResources and doesn't have the list of devices in the Info.plist like it previously did. This is why the BrcmBluetoothInjector.kext isn't working.

All of following drivers are empty:

BroadcomBluetooth20703USBTransport.kext
BroadcomBluetoothHostControllerUSBTransport.kext
CSRBluetoothHostControllerUSBTransport.kext
IOBluetoothHostControllerPCIeTransport.kext
IOBluetoothHostControllerTransport.kext
IOBluetoothHostControllerUARTTransport.kext
IOBluetoothHostControllerUSBTransport.kext
IOBluetoothPacketLogger.kext
IOBluetoothSerialManager.kext

They are all 159 KB in size and do nothing in start() (no probe() implementation).

What about intel? Doesn't that require different drivers? How would we go about that?

commented

Me2, is there any way to fix this issue now?

I'm currently doing some researches (probably in the wrong way, but hey, science b***h!) and made the following considerations:

On Big Sur 11.4 (20F71) in addition to BrcmPatchRAM kexts already mentioned in my first comment of this issue, there are only two kexts responsible of the bluetooth functioning:

  • IOBluetoothFamily.kext
  • IOBluetoothHIDDriver.kext

The first one contains the following plugins:

  • BroadcomBluetooth20703USBTransport.kext
  • BroadcomBluetoothHostControllerUSBTransport.kext
  • CSRBluetoothHostControllerUSBTransport.kext
  • CSRHIDTransitionDriver.kext
  • IOBluetoothHostControllerPCIeTransport.kext
  • IOBluetoothHostControllerTransport.kext
  • IOBluetoothHostControllerUARTTransport.kext
  • IOBluetoothHostControllerUSBTransport.kext
  • IOBluetoothPacketLogger.kext
  • IOBluetoothSerialManager.kext
  • IOBluetoothUSBDFU.kext

On macOS Monterey 12.0 (21A5248p) instead IOBluetoothFamily.kext plugins are outside of it:

  • IOBluetoothFamily.kext
  • IOBluetoothHIDDriver.kext
  • IOBluetoothHostControllerPCIeTransport.kext
  • IOBluetoothHostControllerTransport.kext
  • IOBluetoothHostControllerUARTTransport.kext
  • IOBluetoothHostControllerUSBTransport.kext
  • IOBluetoothPacketLogger.kext
  • IOBluetoothSerialManager.kext

If we exclude the common kexts between the two macOS versions we can come up with the following kexts present in Big Sur but not in Monterey:

  • BroadcomBluetooth20703USBTransport.kext
  • BroadcomBluetoothHostControllerUSBTransport.kext
  • CSRBluetoothHostControllerUSBTransport.kext
  • CSRHIDTransitionDriver.kext
  • IOBluetoothUSBDFU.kext

I don't know if those kext, properly injected, can help fixing the BT issues with Monterey, but at least on my side, I couldn't get it working even after injecting them via OC.

I attach for science purposes Big Sur and Monterey BT kexts and the output of kmutil showloaded | grep Brcm and kmutil showloaded | grep Bluetooth output both from Big Sur and Monterey

bluetooth_kexts_bug_sure_11.4_20f71.zip
bluetooth_kexts_monterey_beta1.zip

kexts_monterey.txt
kexts_bug_sure.txt

Please let me know your thoughts on that and eventually where should I deep investigate on.
Many thanks and have a nice evening

commented
  • BroadcomBluetooth20703USBTransport.kext
  • BroadcomBluetoothHostControllerUSBTransport.kext
  • CSRBluetoothHostControllerUSBTransport.kext

These are in Monterey, just not in IOBluetoothFamily.kext as plugins.

  • BroadcomBluetooth20703USBTransport.kext
  • BroadcomBluetoothHostControllerUSBTransport.kext
  • CSRBluetoothHostControllerUSBTransport.kext

These are in Monterey, just not in IOBluetoothFamily.kext as plugins.

Oh alright. Thanks for the correction. So from what I'm re-reading on this issue, the firmware injector should reimplement the device list, right?

The Bluetooth implementation in Monterey has changed significantly and no longer fits BrcmPatchRAM framework. It's not enough to just get firmware uploaded and inject a kextless driver for device ID matching.

Now Kext-based bluetooth drivers are deprecated in favor of user-space bluetoothd through AppleUSBHostInterfaceUserClient. Empty drivers with bumped version also block downgrade attempts.

Closing the issue for now unless we get breakthrough or new changes in next beta.

It is backported from iOS. I believe we have promising results with @dhinakg actually. Will see if/when we can oss them.

Does this bluetooth incompatibility issue affect also cards with Apple device-ids like the BCM94360NG and the T919 from Fenvi? Or is it just for the cards which require BrcmpatchRAM and friends?

Does this bluetooth incompatibility issue affect also cards with Apple device-ids like the BCM94360NG and the T919 from Fenvi? Or is it just for the cards which require BrcmpatchRAM and friends?

I have no issues with my BCM94360NG bluetooth (headphones are working okay + AirDrop - no issues)

See acidanthera/BrcmPatchRAM#12.

Uh thank you so much. May I gently ask you what are the steps in order to use BluetoolFixup? Should I inject it with the BrcmPatchRAM RELEASE kexts or use the project ones?
Thanks

Did anyone use BlueToolFixup.kext with openintelwireless intelbluetoothfirmware.kext and working? I have intel ax200 bluetooth and it's not working (firmware not loading) (I removed intelbluetoothinjector.kext too). If it's working for anyone, please tell what version of intelbluetoothfirmware.kext you used or please post your kext here.

commented

It seems Monterey beta 5 breaks bluetooth even with BlueToolFixup. Disclaimer: I'm using IntelBluetoothFirmware.

It seems Monterey beta 5 breaks bluetooth even with BlueToolFixup. Disclaimer: I'm using IntelBluetoothFirmware.

Seems like Bluetooth is not working on certain SMBIOS models (transport type set back to PCIe). MacbookPro15,3 is known to be problematic starting from beta 5, afaik no other models are affected so far.

It seems Monterey beta 5 breaks bluetooth even with BlueToolFixup. Disclaimer: I'm using IntelBluetoothFirmware.

Seems like Bluetooth is not working on certain SMBIOS models (transport type set back to PCIe). MacbookPro15,3 is known to be problematic starting from beta 5, afaik no other models are affected so far.

Thanks, now I got to know why my bluetooth not working. I'm also using MacbookPro15,3, I'll change it and check

commented

I'm using MacbookPro15,4 so it could be that all MacbookPro15 are affected.

I'm using MacbookPro15,4 so it could be that all MacbookPro15 are affected.

I'm using MacbookPro15,1 and it works fine. People have reported that MacbookPro15,2 works as well.

Bluetooth do not work properly on beta 5 monterey when i want to send picture or file using bluetooth on beta 5 then i m facing this issue the device does not have the necessary services
Screen Shot 2021-08-17 at 12 44 22 AM

commented

@williambj1 Thanks for the info, can confirm switching to MacbookPro15,2 works.

commented

USB Bluetooth CSR8510-A10, which cannot be driven under macos12
Uploading QQ20210929-141855.png…