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

And should it also work with the pairing of the xiaomi mi 11 lite 5g ne smartphone? That in the past was wrong.

@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

@IVORRY
Copy link

IVORRY 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

@Lelik1x
Copy link

Lelik1x commented Sep 20, 2023

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

image
thank you very much! everything worked

@ctopher7
Copy link

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

this works man!! for me, I am excluding the intelBluetoothInjector, I used bluetoolfixup v2.6.8 instead
thanks a lot

@Lelik1x
Copy link

Lelik1x commented Sep 20, 2023

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

when I type quickly on the keyboard, it turns out that letters are skipped and in general the keyboard works as if it slows down, please tell me how to fix it? there was no such suspension on the native module from broadcom, where the keyboard prints quickly and does not skip letters.

@Lorys89
Copy link

Lorys89 commented Sep 21, 2023

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

when I type quickly on the keyboard, it turns out that letters are skipped and in general the keyboard works as if it slows down, please tell me how to fix it? there was no such suspension on the native module from broadcom, where the keyboard prints quickly and does not skip letters.

Solution 1: Write slowly 🙈
Solution 2: Wait for the dev to read your comment and consider if it is possible to fix it

@hugonascimento
Copy link

MX Keys keyboard does not connect to Sonoma :(
WiFi/Bluetooth Intel 9560
USB configured as internal
Other devices work correctly. :)
Any solution available?

@Lorys89
Copy link

Lorys89 commented Sep 30, 2023

MX Keys keyboard does not connect to Sonoma :( WiFi/Bluetooth Intel 9560 USB configured as internal Other devices work correctly. :) Any solution available?

My keyboard mx keys connects great to sonoma with bt. I use the kext I posted above.

@mackonsti
Copy link

mackonsti commented Oct 1, 2023

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?

@williambj1 would you consider this fix only for Ventura?

For some reason @qhuyduong never came back to us with a reply 😞 and closing this ticket would be great progress, after so many weeks.

Thank you 🙏

EDIT: @Lorys89 would this kext be needed only on NUC8 BTLE chipsets? What about newer BTLE controllers like e.g. AX201, would your kext work there, respectively?

@koechian
Copy link

@Lorys89, @qhuyduong Got this working today on Ventura on an Intel AX200 card. Both the Microsoft Designer Keyboard and Microsoft Ergonomic Mouse are working fine. Thanks for your work.

image

@Lorys89
Copy link

Lorys89 commented Oct 28, 2023

I'm just a tester, but the dev was good at fixing it.

@mackonsti
Copy link

Hi @Lorys89 why don't you suggest your fix to @williambj1 so that this can be integrated officially in the kext, even if it is only for Ventura?

Did you recompile your kext with latest codebase @Lorys89 ? Thanks

@koechian
Copy link

@Lorys89 @qhuyduong While the issue with pairing was fixed after using the compiled Kext from this PR, I am unable to automatically pair the devices after they sleep or on boot. I have to 'Forget' the device, then pair it again in order to use them.

image

  • I have no option in Settings to connect to the device once it has disconnected after sleeping.

@ctopher7 Do your devices automatically connect on boot or after sleep (ie: The Mouse/Keyboard itself goes to sleep) after using BluetoolFixup v2.6.8?

@503580622
Copy link

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

@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

@phucho236
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.

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