OpenPods
OpenPods copied to clipboard
Ideas for new features
Loving the app so far, thanks for your efforts.
Here's a small wish-list of features that I've seen on other play store apps so I'm fairly certain they're all possible although how difficult I can't say...
- Overlayed battery indicator on case open
- In your always-on notification battery indicator add a toggle for airpod pro features (Noise Cancellation, Transparency mode and Off). I know you can long press on the Airpod Pros to toggle between NC and Transparency mode but just OFF seems to be an impossible state to gain access to without software help, here's how it's shown to iOS users.
- Rebinding of multi-clicks. I've seen other apps that allow you to rebind what happens when you click once/twice/three times, etc...
- Ear Detection: When you take out either Airpod, any music/media playing on the device will pause and restart when you put the Airpod back in.
This is possible but a lot of work because a lot of reverse engineering is required. You would have to analyze the communication between iPhones and AirPods and find out which messages are used for that.
I don't have an iPhone but I suspect it would be easier to analyze the communications between these other Android apps and the Airpods to find out how they've done it.
If you can tell me how to capture and log these comms I'll bite the bullet and buy a few of these apps.
I suspect the case opening one would be easier though as simply opening the case should transmit a signal that isn't normally sent and can be isolated with repeated openings.
Once that signal is found, the data the overlay is showing is just battery and charge status which you already have access to so not too much more complexity beyond finding out how to make an android app overlay globally over other apps.
On Sat, Feb 1, 2020, 1:43 PM Dominik [email protected] wrote:
This is possible but a lot of work because a lot of reverse engineering is required. You would have to analyze the communication between iPhones and AirPods and find out which messages are used for that.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/adolfintel/OpenPods/issues/58?email_source=notifications&email_token=AF6SYTD7M4VOF7HIHYWOXADRAW7EVA5CNFSM4KOUWHIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKRD2YQ#issuecomment-581057890, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF6SYTDQOROCERTY4QMA5YLRAW7EVANCNFSM4KOUWHIA .
As @Domi04151309 said, all this is possible but requires extensive reverse engineering. I don't have the skills required to do it, but I'll leave this issue open in case someone wants to work on the project.
Toggling between the different states seems to be sent in an l2cap packet. Using PacketLogger and this github project (AirControl) on macOS. The payload that it sends is in the form 04 00 04 00 09 00 0D XX 00 00 00 where XX can be 01 for off, 02 for ANC, and 03 for transparency
Since this issue is now being used to track new feature requests I updated my original comment with a to include "Ear Detection".
It seems to be rather simple in how it works, when you take out either earbud an l2cap packet will be sent by the Airpod at which point an iPhone or OSX daemon would issue a pause media command to the OS. The opposite happens when you put the removed Airpod back in.
Take out Airpod: [ 04 00 04 00 06 00 00 01 ]
(Length: 0x0008 (08))
Put in Airpod: [ 04 00 04 00 06 00 00 00 ]
(Length: 0x0008 (08))
I can also confirm @emeyer1 findings for the mode toggling (xCode's PacketLogger is very useful for this kind of thing).
I looked into this a little and it seems like though the actual signalling is straightforward, the l2cap communication happens across a dynamically-allocated channel. Looking at the bluetooth logs, the host sends a l2cap echo with a message body that includes the host channel id on bytes 6 and 7. The airpods respond with a message with the device channel id on bytes 4 and 5.
There's an api call(sendL2CAPEchoRequest) on iOS to do this, but not on Android, so I'm not sure it's possible at the moment to negotiate the channel id.
Quick question Is there anyway I can use OpenPods without GPS location sorry for being a pain
@Username123456765645 unfortunately no. Airpods send their status via bluetooth low energy (BLE), Android requires apps to have location permission for that.
If you're worried about privacy, don't be, the app has no internet access and you can read the source code if you don't trust me.
AirPods Pro and AirPods Gen2 has the AAP server. Does anyone know what is it? Apple has Apple Accessory Protocol for their iPods family but i am not sure that apple use it for airpods.
I managed to reverse engineer the ear detection and. Will commit when I finish to implement it
@Electric1447 well done, congratulations! :tada:
@Electric1447 I've looked into ear detection based on your commits, it seems we can only do ear detection when a beacon is sent to us, and it can take a long time, correct ?
@Electric1447 I've looked into ear detection based on your commits, it seems we can only do ear detection when a beacon is sent to us, and it can take a long time, correct ?
Yes
Is there any progress made in the last 1 year ? Im curious as I'm willing to contribute.
@schweppes-0x No, but contributions are welcome
Why has that stopped. It's a project full of potential..
Why has that stopped. It's a project full of potential..
There is no reason, reverse engineering is hard and I no longer have my airpods so someone else will have to do it.
Denis was able to get the data using wire https://twitter.com/ttdennis/status/1249975453219258374?s=20
But I have no idea on what protocol the iPhone and AirPods communicate using Bluetooth. I tried to get this data from Linux machine where i have access to each layer of Bluetooth stack
Take out Airpod: [ 04 00 04 00 06 00 00 01 ] (Length: 0x0008 (08)) Put in Airpod: [ 04 00 04 00 06 00 00 00 ] (Length: 0x0008 (08))
But i got nothing.
Now there are fake AirPods pro on the market that work like original ones in everything except BLE, they send wrong BLE packets (not the same as original), but iPhone still recognize battery level right.
Maybe the Chinese Internet has some more detailed information.
If anyone has experience with Bluetooth stack on mac, I will be glad for your help. I have no experience with mac at all, I have no idea where to start. (Except for AirControl which was mentioned above)
I found a way to check the exact amount of battery and control ANC in AirPods and implemented it in Windows. (https://github.com/bho3538/Airpods-Windows-Control)
It can work by sending a special packet at the Bluetooth L2CAP level to the connected AirPod (psm: 0x1001). It was implemented by referring to the article at https://github.com/tyalie/AAP-Protocol-Defintion and Mac OS PacketLogger
I wanted to add this feature and contribute to the OpenPods project, so I tried Bluetooth L2CAP connection on Android, but it failed. The API (createInsecureL2capChannel) officially provided by Google supports only BLE L2CAP communication and does not seem to support classic Bluetooth L2CAP. (I may be wrong as this is my first time developing Android)
Does anyone know how to do Bluetooth L2CAP communication on Android?
@bho3538 No. I already make this for Steam Deck couple month ago, but for Android I did not find a way
@steam3d that's too bad...
@bho3538 I am working on Windows. I researched AirPods Gen 2, AirPods 3, AirPods Pro, AirPods Pro 2 and AirPods Max and most of the features work on Linux and trying to port them on Windows.