-
Notifications
You must be signed in to change notification settings - Fork 50
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
Documenting vendor specific HCI commands on macOS #85
Comments
Status update:
|
Hi all, I did a bit of reverse engineering to find more commands 🎉 On startup, Internally, Here are the results:
These were commands I observed when enabling/disabling Bluetooth, connecting AirPods, a Bose headset, tethering with an iPhone, Apple Magic Keyboard and Magic Trackpad. It might be worth to invest more time on static reversing of In case anyone wants to reproduce this with different peripherals or log Bluetooth packets along with system log messages to get more insights into what functionality these packets might implement, here are the scripts I used: asahi-bt-hooks.zip |
Edit: I just realised 2-3 more commands being used when suspending the M1 and logging for a longer time, so I added these to the list above, such as |
Took me a while to get back to this, thanks a lot for all the reverse engineering work Jiska, it's quite crazy how many Apple-specific features this firmware has.. I've opened an issue with BlueZ to figure out how we can integrate those vendor specific commands: bluez/bluez#722 |
macOS sends a bunch of custom (vendor defined) HCI commands to the Broadcom bluetooth chip. Some of them appear to affect things like audio latency, some appear to be setting up AWDL/continuity things.
The commands are from a 2020 M1 Macbook Pro, would be interesting to see if they are the same on other models. They can be snooped on macOS using "PacketLogger" from the XCode Development tools.
Here's a list of the vendor specific commands (listed as
hcitool cmd
to quickly try them):commands during controller init sequence
commands after connecting an a2dp sink
commands after starting to play on a2dp sink
commands after ending audio stream a2dp sink
commands after disconnecting an a2dp sink
commands after connecting magic keyboard or mouse
Nothing special seems to happen on disconnecting magic keyboard or mouse.
The different kinds of OCFs seen are
Mostly relevant to us is the 0x057 "set ACL priority" command, as that fixes audio choppiness during BT scans or connection requests. Also the 0x0e2 command that sets the num of buffers to queue before transmitting seems interesting from a latency standpoint.
The text was updated successfully, but these errors were encountered: