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

Fix LE devices not working on Ventura #446

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qhuyduong
Copy link

@qhuyduong qhuyduong commented Jun 18, 2023

Look like starting from Ventura, the bluetooth daemon expects an LE PHY Update Complete event to be triggered from the controller before starting the connection to LE devices (e.g: Logitech MX Master 3S mouse).
For Broadcom cards, that event is triggered automatically on new connection (attached the screenshot of PacketLogger on Macbook Air M1).

image

However for Intel ones, that event is not sent by the firmware, so pairing these devices will stuck.

One of the solution is to fake the LE PHY Update Complete event by issuing an extra LE command and modify its response.

Tested on macOS Ventura 13.4 with Intel® Wi-Fi 6 AX200 and Logitech MX Master 3S.

Fixes #51 #418 #419 #421 #444

P/S: I'm quite new for Lilu and macOS SDK, so I belive there should be a cleaner way to do this, such faking the event without the need to sending another command. Recommendations are welcome.

Look like starting from Ventura, the bluetooth daemon expects an
LE PHY Update Complete event to be triggered from the controller
before starting the connection. However for Intel cards, that event
is not sent by the firmware, so we can fake it by issuing an extra
LE command and modify its response.
@@ -185,12 +214,15 @@ IOReturn CIntelBTPatcher::newHostDeviceRequest(void *that, IOService *provider,
writeHCIDescriptor->complete();
const char *randAddressDump = _hexDumpHCIData((uint8_t *)randomAddressHci, 9);
if (randAddressDump) {
SYSLOG(DRV_NAME, "[PATCH] Sending Random Address HCI %lld %s", ret, randAddressDump);
SYSLOG(DRV_NAME, "[PATCH] Sending Random Address HCI %d %s", ret, randAddressDump);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix build warning

IOFree((void *)randAddressDump, 9 * 3 + 1);
}
_randomAddressInit = true;
SYSLOG(DRV_NAME, "[PATCH] Resend LE SCAN PARAM HCI %lld", ret);
SYSLOG(DRV_NAME, "[PATCH] Resend LE SCAN PARAM HCI %d", ret);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix build warning

@Lorys89
Copy link

Lorys89 commented Jun 18, 2023

@zxystd work with this pr
Screenshot 2023-06-18 alle 18 53 50

@qhuyduong qhuyduong changed the title Fix LE device not working on Ventura Fix LE devices not working on Ventura Jun 18, 2023
@Lorys89
Copy link

Lorys89 commented Jun 18, 2023

and work for sonoma
Screenshot 2023-06-18 alle 19 18 04

@lsvih
Copy link

lsvih commented Jun 20, 2023

I finally get my NIZ keyboard BLE working! Thank you so much!

image

@williambj1
Copy link
Contributor

Hi, sorry for the late reply. Code for patching asyncIORequest and initPipeRequest were deleted recently since they caused panic when waking up from sleep for some systems. This PR seemed to add them back, is it possible to achieve the same goal without patching those two functions?

@mackonsti
Copy link

Hi @williambj1 until we wait for the feedback from @qhuyduong can we not restrict this commit to Ventura?
So far, myself included, there haven't been reports of kernel panics. Perhaps the re-write of the BT stack in macOS allow this hack to be implemented safely? What do you think?

@mackonsti
Copy link

Hi @williambj1 it doesn't seem that @qhuyduong saw your previous message, is it still safe to use such code patching in the kext? I am on Ventura and thankfully I have had no kernel panics (but with low BTLE use, admittedly). Thanks!

@Lorys89
Copy link

Lorys89 commented Jul 2, 2023

I use it on ventura and sonoma and I have not found kp, and I always have keyboard and mouse Logitech connected in bt

@mackonsti
Copy link

Hi @williambj1 it seems I had an OS crash or kernel panic out of nowhere, without changing/adding anything all this time -- when the Intel NUC that I use woke from sleep (or something). There are 2 panic files that I detected in /Library/Logs/DiagnosticReports/ but these seem to be in JSON format and not visible anywhere in Console.app. Do you have the means to read them and see if our Intel BT kext here, is causing this? I am using the fork by @qhuyduong:

Kernel-2023-07-04-014613.panic.txt

contents.panic.txt

(please remove the txt extension)

Unfortunately, I am not using this parameter in OpenCore in a permanent way 😞 So not sure if these panic files can offer much information.

<key>boot-args</key>
<string>keepsyms=1</string>

What tool or Terminal command do you use to check this type of files? I cannot find any reference anywhere.
Thank you.

@dungnguyen2703
Copy link

dungnguyen2703 commented Jul 13, 2023

I have mini pc with Intel AX200. I try to use kext from release v2.2.0 and my bluetooth doesn't work. I try kext from this commit. It doesn't work too. Could you please help me to identify the problem

Screenshot 2023-07-13 at 10 08 22
Screenshot 2023-07-13 at 10 09 25
Screenshot 2023-07-13 at 10 11 08

@Zyvoxi
Copy link

Zyvoxi commented Jul 16, 2023

I have mini pc with Intel AX200. I try to use kext from release v2.2.0 and my bluetooth doesn't work. I try kext from this commit. It doesn't work too. Could you please help me to identify the problem

Screenshot 2023-07-13 at 10 08 22 Screenshot 2023-07-13 at 10 09 25 Screenshot 2023-07-13 at 10 11 08

I have the same problem.

@Kaisar870
Copy link

and work for sonoma Screenshot 2023-06-18 alle 19 18 04

hi there, i have asus z390e which is with bluetooth 5. my Bluetooth working properly except mx master3, is there any solution? this showing on the list but not connected. thank you!
Screenshot 2023-07-23 at 3 57 08 PM

@Kaisar870
Copy link

and work for sonoma Screenshot 2023-06-18 alle 19 18 04

hi there, i have asus z390e which is with bluetooth 5. my Bluetooth working properly except mx master3, is there any solution? this showing on the list but not connected. thank you! Screenshot 2023-07-23 at 3 57 08 PM

finally it worked! thanks for the good work!
Screenshot 2023-07-23 at 4 12 16 PM

@mackonsti
Copy link

finally it worked! thanks for the good work!

Please @Kaisar870 tell us exactly what you did, what you used, your macOS, setup, OpenCore and specific config settings, please. Your comment will be more helpful for others, like that. Thank you.

@Kaisar870
Copy link

Kaisar870 commented Jul 24, 2023

finally it worked! thanks for the good work!

Please @Kaisar870 tell us exactly what you did, what you used, your macOS, setup, OpenCore and specific config settings, please. Your comment will be more helpful for others, like that. Thank you.

hi there,
my setup is
Asus Z390E, i9900k, 32GB RAM, Redeon Pro W6600, SN850X 1TB SSD (OS Installed-macOS Sonomo), Samsung 980 Pro 2 TB ( Use Only as a storage, since this ssd have issues with boot, die under heavy load etc.) Opencore version 0.9.4.
this thread specific for LE devices like Logitech MX Master 3 or MX Keys. If you you want to make [hackintosh] please follow this instructions, (https://dortania.github.io/OpenCore-Install-Guide/) or if you have connectivity issues like intel wifi or bluetooth just follow this (https://dortania.github.io/OpenCore-Install-Guide/ktext.html#wifi-and-bluetooth). Please do lem me know specific issues you're experiencing.

@simanho88
Copy link

image

I have dell xps9570 with Intel AX210 and dell mouse MS7421W. mouse not work with kext 2.3.0 from public release. I tried to use kext from this commit and my bluetooth mouse work fine. thank for this great work.

@lsvih
Copy link

lsvih commented Sep 10, 2023

Feedback: After prolonged use, from the release of this patch up until now, my hackintosh has not experienced any crashes due to this kext.

@Lelik1x
Copy link

Lelik1x commented Sep 19, 2023

image I have dell xps9570 with Intel AX210 and dell mouse MS7421W. mouse not work with kext 2.3.0 from public release. I tried to use kext from this commit and my bluetooth mouse work fine. thank for this great work.

Please tell me where to download the kext from this commit?
mx keys and mx master 3s don't work for me either on ax210 please send me a working kext

@Lorys89
Copy link

Lorys89 commented Sep 19, 2023

image I have dell xps9570 with Intel AX210 and dell mouse MS7421W. mouse not work with kext 2.3.0 from public release. I tried to use kext from this commit and my bluetooth mouse work fine. thank for this great work.

Please tell me where to download the kext from this commit? mx keys and mx master 3s don't work for me either on ax210 please send me a working kext

Get bluetooth kext from my repo https://github.com/Lorys89/Intel-NUC8-Hackintosh

@ctopher7
Copy link

ctopher7 commented Sep 20, 2023

image I have dell xps9570 with Intel AX210 and dell mouse MS7421W. mouse not work with kext 2.3.0 from public release. I tried to use kext from this commit and my bluetooth mouse work fine. thank for this great work.

Please tell me where to download the kext from this commit? mx keys and mx master 3s don't work for me either on ax210 please send me a working kext

Get bluetooth kext from my repo https://github.com/Lorys89/Intel-NUC8-Hackintosh

still not working for me
Screenshot 2023-09-20 at 08 29 44

intel ac9260 laptop, ventura 13.5.2, openCore 0.9.5
my config.plist already updated and I have reorder the kexts based on your config.plist (BluetoolFixup,IntelBTPatcher,IntelBluetoothFirmware)

it is connected, but the indicator on the mouse still on pairing mode (blipping fast)

@Lelik1x
Copy link

Lelik1x commented Sep 20, 2023

image I have dell xps9570 with Intel AX210 and dell mouse MS7421W. mouse not work with kext 2.3.0 from public release. I tried to use kext from this commit and my bluetooth mouse work fine. thank for this great work.

Please tell me where to download the kext from this commit? mx keys and mx master 3s don't work for me either on ax210 please send me a working kext

Get bluetooth kext from my repo https://github.com/Lorys89/Intel-NUC8-Hackintosh

Not working for me

intel ax210, ventura 13.5.2, OpenCore 0.9.3 I updated my config.plist based on yours and changed the order of the files (BluetoolFixup, IntelBTPatcher,IntelBluetoothFirmware) My mx keys and mx master 3s still do not work as before.
20230920_090719.jpg

@ctopher7
Copy link

image I have dell xps9570 with Intel AX210 and dell mouse MS7421W. mouse not work with kext 2.3.0 from public release. I tried to use kext from this commit and my bluetooth mouse work fine. thank for this great work.

Please tell me where to download the kext from this commit? mx keys and mx master 3s don't work for me either on ax210 please send me a working kext

Get bluetooth kext from my repo https://github.com/Lorys89/Intel-NUC8-Hackintosh

Not working for me

intel ax210, ventura 13.5.2, OpenCore 0.9.3 I updated my config.plist based on yours and changed the order of the files (BluetoolFixup, IntelBTPatcher,IntelBluetoothFirmware) My mx keys and mx master 3s still do not work as before. 20230920_090719.jpg

weirdly my logitech mouses (pebble, vertical) could not connect with my hackintosh. 2 of them do not have any problems when connecting to windows PC.

but now my logitech keyboard connected via bluetooth to my hackintosh

@Harry2336
Copy link

我的蓝牙正常了,感谢大佬 image

怎么解决的啊兄弟

@marcsvg
Copy link

marcsvg commented Nov 15, 2023

Here are the kext just compiled https://github.com/Lorys89/IntelBluetoothFirmware/suites/16367616296/artifacts/934935709

image thank you very much! everything worked

I have an MX Keys Mini, and I'm using the most current version of Kext, but I can't connect in any way, could anyone help me? could you help @Lorys89 ?

@yflwz
Copy link

yflwz commented Dec 3, 2023

image image image Download and update the new driver above, but Bluetooth still doesn’t work properly.

@Zephon-H
Copy link

Zephon-H commented Jan 7, 2024

It can't be used for my redmibook pro 15 s(AX210). It shows connected to my bluetooth mouse but doesn't actually work.
image
image

@phucho2306
Copy link

don't work in z690i ultra plus ddr4 (AX411). Loading icon that disappears after clicking the button connect.

@prcmelo
Copy link

prcmelo commented Jan 22, 2024

@Lorys89 Thank you so much! Your kext version made my MX Keys and MX Anywhere 3 to work again!

@MVRL70
Copy link

MVRL70 commented Jan 23, 2024

Hello, everyone. I can’t get my HP240 mouse to function on Ventura or Sonoma. Have tried different kexts versions. Is there a workaround ? Thanks !

@tuancuong92
Copy link

@qhuyduong bạn tuyệt vời bạn 10 điểm!!! Mình fix dc lỗi bluetooth trên bản hackintosh của mình rồi :D/

@prcmelo
Copy link

prcmelo commented Feb 28, 2024

For me, Version 2.4.0, (as the official 2.3.0 Release), is a no go to my Logitech MX Series, (keyboard and mouse). I had to revert to the @Lorys89 version, (2.3.0), to make them work again.

Edit: Using macOS Sonoma 14.3.1

@laris
Copy link

laris commented Mar 27, 2024

For me, Version 2.4.0, (as the official 2.3.0 Release), is a no go to my Logitech MX Series, (keyboard and mouse). I had to revert to the @Lorys89 version, (2.3.0), to make them work again.

Edit: Using macOS Sonoma 14.3.1

+1 Sonoma v14.4.1 + Lorys89's version
#51 (comment)

@HenriqueBarroso
Copy link

Same here. Ventura + @Lorys89 version works for my MX Master 3S.

@MVRL70
Copy link

MVRL70 commented Apr 23, 2024

Hello, everyone. I'd like to test this IntelBTPatcher/IntelBTPatcher.cpp in my setup. What should I do ? My problem is getting the HP240 mouse to connect. Thanks.

@koechian
Copy link

@MVRL70 Get the compiled files from here. Then follow the instructions from OpenIntelWireless but using the files you got from this PR.

@MVRL70
Copy link

MVRL70 commented Apr 29, 2024

@MVRL70 Get the compiled files from here. Then follow the instructions from OpenIntelWireless but using the files you got from this PR.

Thanks, koetchian, but no success. Tried release and debug.

@kidxiang
Copy link

kidxiang commented Jun 3, 2024

@MVRL70 Get the compiled files from here. Then follow the instructions from OpenIntelWireless but using the files you got from this PR.

It works, thanks so much!

@captain-spaghetti
Copy link

Here are the kext just compiled https://github.com/Lorys89/IntelBluetoothFirmware/suites/16367616296/artifacts/934935709

Link seems to have expired, can you re-upload?

@Lorys89
Copy link

Lorys89 commented Jun 27, 2024

Here are the kext just compiled https://github.com/Lorys89/IntelBluetoothFirmware/suites/16367616296/artifacts/934935709

Link seems to have expired, can you re-upload?

Yes and it is compatible with macOS beta 15 sequoia
https://github.com/Lorys89/IntelBluetoothFirmware/releases/download/2.5.0/IntelBluetoothFirmware-2.5.0-RELEASE.zip

@captain-spaghetti
Copy link

captain-spaghetti commented Jun 30, 2024

Here are the kext just compiled https://github.com/Lorys89/IntelBluetoothFirmware/suites/16367616296/artifacts/934935709

Link seems to have expired, can you re-upload?

Yes and it is compatible with macOS beta 15 sequoia https://github.com/Lorys89/IntelBluetoothFirmware/releases/download/2.5.0/IntelBluetoothFirmware-2.5.0-RELEASE.zip

Thanks for that.

Unfortunately doesn't seem to fix the issue for me. My Logitech MX Craft keyboard briefly shows as connected in the bluetooth panel, but the keyboard doesn't recognize the connection, then it is dropped by MacOS a few seconds later.

@Lorys89
Copy link

Lorys89 commented Jun 30, 2024

What model of wifi card? On which version of macos?
I tested on 9560,ax200,ax201,ax210,ax211.

@captain-spaghetti
Copy link

captain-spaghetti commented Jun 30, 2024

What model of wifi card? On which version of macos? I tested on 9560,ax200,ax201,ax210,ax211.

I'm assuming you mean bluetooth card?
For some reason, when I check System Report, the chipset shows up as 'Third Party Dongle'. However I'm using the native bluetooth card that's on my motherboard, Asus TUF Gaming z690-PLUS D5. I can't remember the exact bluetooth chipset from memory, and it's hard to find the info online.

I'm using MacOS Ventura 13.6.6

@Xarth-Mai
Copy link

image Can‘t connect to my Xbox Gamepad
  • AX210
  • Sonoma 14.5
  • Opencore 1.0.1
  • IntelBTPatcher.kext & IntelBluetoothFirmware.kext V2.5.0(Form This PR)
  • BlueToolFixup.kext V2.6.9

I have tried Ventura with same EFI, also not success
I have tried Monterey,it works

@misaki1301
Copy link

misaki1301 commented Aug 31, 2024

I want to comment that I was having issues with my Airpods Pro 2 related to the sound, but with this fix now every sound issue has been partially fixed, congrats for the patch :)

@pexcn
Copy link

pexcn commented Sep 9, 2024

Thank you, my microsoft bluetooth mouse is finally connected to bluetooth, on Sonoma.

Hello @zxystd, are there any plans to merge this PR?

@sleepppwalker
Copy link

It can't be used for my redmibook pro 15 s(AX210). It shows connected to my bluetooth mouse but doesn't actually work. image image

Same thing, I can’t connect my razer basilisk x. did you manage to solve this problem?

@stevezhengshiqi
Copy link
Contributor

This PR seems mostly the reverse of 350e3a7.

@hugonascimento
Copy link

Here are the kext just compiled https://github.com/Lorys89/IntelBluetoothFirmware/suites/16367616296/artifacts/934935709

Link seems to have expired, can you re-upload?

Yes and it is compatible with macOS beta 15 sequoia https://github.com/Lorys89/IntelBluetoothFirmware/releases/download/2.5.0/IntelBluetoothFirmware-2.5.0-RELEASE.zip

Did you get the LE on the Sequoia?
MX Keys won't connect again :(

@mackonsti
Copy link

mackonsti commented Nov 30, 2024

Hi @zxystd any updates on your review? Would you accept this fix? Or reject it?
Thanks in advance for your update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Compatibility issue with Bluetooth 4.x devices