dortania / OpenCore-Legacy-Patcher

Experience macOS just like before
https://dortania.github.io/OpenCore-Legacy-Patcher/
Other
12.68k stars 1.2k forks source link

BCM943224 and BCM94331 2.4Ghz Network connection issues with Bluetooth #173

Closed NickP0is0n closed 3 years ago

NickP0is0n commented 3 years ago

Describe the bug When using bluetooth headphones (AirPods Pro in my example), internet is no longer working and WiFi is constantly trying to reconnect.

To Reproduce Steps to reproduce the behavior:

  1. Turn on WiFi and connect to any network
  2. Turn on Bluetooth and connect to wireless headphones
  3. Run any music

Hardware (please complete the following information): OS running: macOS Big Sur 11.2.3 Model patching: MacBookPro8,1

IORegistryExplorer output: MacBook Pro von Mykola.zip

khronokernel commented 3 years ago

Interesting, I'm able to replicate this locally as well with the BCM943224 chipset found in the MacBook7,1. Specifically in this order:

I found that disabling bluetooth, connect to network, then reenabling bluetooth works. Additionally that 5Ghz channels are unaffected by these issues (reason I had never noticed till now, as I rarely use 2.4Ghz locally). This does make sense, as Bluetooth is also on the 2.4Ghz channel and the reason it's generally recommended to avoid 2.4Ghz networks when using bluetooth devices.

Regarding a fix, would need to investigate further. Do you happen to know if this issue is exclusive to OCLP or whether other patchers experienced similar? My theory currently is that the BCM943224 and BCM94331 (MacBookPro8,1's card) have custom handling for the 2.4Ghz switching when both the bluetooth and wireless module request access, and this specific logic is solely in AirPortBrcm4360.kext. For reference, we use the native AirPortBrcmNIC.kext interface

We could reinject AirPortBrcm4360 however this comes at the cost of personal hotspot and WPA support, which tbh for such a small, easily fixable issue, I'd rather not break core functionality for the rest of the user base. This does assume that we're the only patcher affected, if not then the issue most likely lies in IOBluetoothFamily which would investigate further

NickP0is0n commented 3 years ago

I never heard reports about it, and haven't tested other patchers on my Mac. Patched Mojave and Catalina hadn't have this issue.

khronokernel commented 3 years ago

Determined the issue partially, this seems to be less related on the wifi card and more on the BCM2070 Bluetooth chipset. We were able to conclude this as the MacBookPro9,2 with the BCM94331 (same chipset as your MacBookPro8,1) do not exhibit any of these symptoms. These machines instead use the new BCM20702 chipset for bluetooth

However what macBook7,1 and MacBookPro8,1 do have in common is the BCM2070 chipset for bluetooth. Without more reports from other patchers, it's difficult to know who's the culprit in macOS though I do believe it's the IOBluetoothFamily stack. Have another developer testing their MacBook7,1 with the back ported Catalina networking to verify if they seem to experience this as well

NickP0is0n commented 3 years ago

A small update to a workaround. I tested it and it works just until any audio data starts to flow through Bluetooth right to headphones. I guess, you can replicate it in this way:

khronokernel commented 3 years ago

As found by @NickP0is0n and posted on our Discord:

sudo defaults write /Library/Preferences/com.apple.airport.bt.plist bluetoothCoexMgmt Hybrid

Closing as sufficient work around