You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AAP Definitions.md
+31-16Lines changed: 31 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,23 @@
2
2
3
3
AAP runs on top of L2CAP, with a PSM of 0x1001 or 4097.
4
4
5
-
# Handshake
5
+
## Handshake
6
+
6
7
This packet is necessary to establish a connection with the AirPods. Or else, the AirPods will not respond to any packets.
7
8
8
9
```plaintext
9
10
00 00 04 00 01 00 02 00 00 00 00 00 00 00 00 00
10
11
```
11
12
12
-
# Setting specific features for AirPods Pro 2
13
+
##Setting specific features for AirPods Pro 2
13
14
14
15
> *may work for airpods 4 anc also, not tested*
15
16
16
-
Since apple likes to wall off some features behind specific OS versions, and apple silicon devices, some packets are necessary to enable these features.
17
+
Since apple likes to wall off some features behind specific OS versions, and apple silicon devices, some packets are
18
+
necessary to enable these features.
17
19
18
-
I captured the following packet only accidentally, because Apple being Apple decided to hide *this* and *the handshake* from packetlogger, but sometimes it shows up.
20
+
I captured the following packet only accidentally, because Apple being Apple decided to hide *this* and *the
21
+
handshake* from packetlogger, but sometimes it shows up.
19
22
20
23
*Captured using PacketLogger on an Intel Mac running macOS Sequoia 15.0.1*
21
24
```plaintext
@@ -24,11 +27,13 @@ I captured the following packet only accidentally, because Apple being Apple dec
24
27
25
28
This packet enables conversational awareness when playing audio. (CA works without this packet only when no audio is playing)
26
29
27
-
It also enables the Adaptive Transparency feature. (We can set Adaptive Transparency, but it doesn't respond with the same packet See [Noise Cancellation](#changing-noise-control))
30
+
It also enables the Adaptive Transparency feature. (We can set Adaptive Transparency, but it doesn't respond with the
31
+
same packet See [Noise Cancellation](#changing-noise-control))
28
32
29
-
# Requesting notifications
33
+
##Requesting notifications
30
34
31
-
This packet is necessary to receive notifications from the AirPods like ear detection, noise control mode, conversational awareness, battery status, etc.
35
+
This packet is necessary to receive notifications from the AirPods like ear detection, noise control mode,
36
+
conversational awareness, battery status, etc.
32
37
33
38
*Captured using PacketLogger on an Intel Mac running macOS Sequoia 15.0.1*
34
39
```plaintext
@@ -41,7 +46,7 @@ This packet also works.
41
46
04 00 04 00 0F 00 FF FF FF FF
42
47
```
43
48
44
-
# Notifications
49
+
##Notifications
45
50
46
51
## Battery
47
52
@@ -92,7 +97,8 @@ Example packet from AirPods Pro 2
92
97
93
98
## Noise Control
94
99
95
-
The AirPods Pro 2 send noise control packets when the noise control mode is changed (either by a stem long press or by the connected device, see [Changing noise control](#changing-noise-control)). The packet format is as follows:
100
+
The AirPods Pro 2 send noise control packets when the noise control mode is changed (either by a stem long press or
101
+
by the connected device, see [Changing noise control](#changing-noise-control)). The packet format is as follows:
96
102
97
103
```plaintext
98
104
04 00 04 00 09 00 0D [mode] 00 00 00
@@ -108,11 +114,13 @@ The AirPods Pro 2 send noise control packets when the noise control mode is chan
108
114
## Ear Detection
109
115
110
116
AirPods send ear detection packets when the ear detection status changes. The packet format is as follows:
117
+
111
118
```plaintext
112
119
04 00 04 00 06 00 [primary pod] [secondary pod]
113
120
```
114
121
115
-
If primary is removed, mic will be changed and the secondary will be the new primary, so the primary will be the one in the ear, and the packet will be sent again.
122
+
If primary is removed, mic will be changed and the secondary will be the new primary, so the primary will be the one
123
+
in the ear, and the packet will be sent again.
116
124
117
125
| Pod Status | Byte value |
118
126
|------------|------------|
@@ -134,9 +142,11 @@ AirPods send conversational awareness packets when the person wearing them start
134
142
| 03 | Person Stopped Speaking; increase volume back to normal |
After requesting notifications, the AirPods send a packet indicating the current state of Conversational Awareness (CA). This packet is only sent once after notifications are requested, not when the CA state is changed.
148
+
After requesting notifications, the AirPods send a packet indicating the current state of Conversational Awareness
149
+
(CA). This packet is only sent once after notifications are requested, not when the CA state is changed.
140
150
141
151
The packet format is:
142
152
@@ -150,9 +160,11 @@ The packet format is:
150
160
- Any other value — Unknown/undetermined state
151
161
152
162
**Example:**
163
+
153
164
```plaintext
154
165
04 00 04 00 09 00 28 01 00 00 00
155
166
```
167
+
156
168
Here, `01` at the 8th byte (offset 7) means CA is enabled.
157
169
158
170
## Metadata
@@ -166,7 +178,7 @@ This packet contains device information like name, model number, etc. The packet
166
178
The strings are null-terminated UTF-8 strings in the following order:
167
179
168
180
1. Bluetooth advertising name (varies in length)
169
-
2. Model number
181
+
2. Model number
170
182
3. Manufacturer
171
183
4. Serial number
172
184
5. Firmware version
@@ -180,15 +192,16 @@ The strings are null-terminated UTF-8 strings in the following order:
The packet contains device identification and version information followed by some encrypted data whose format is not known.
187
200
```
188
201
189
-
# Writing to the AirPods
202
+
##Writing to the AirPods
190
203
191
-
## Changing Noise Control
204
+
###Changing Noise Control
192
205
193
206
We can send a packet to change the noise control mode. The packet format is as follows:
194
207
@@ -205,7 +218,8 @@ We can send a packet to change the noise control mode. The packet format is as f
205
218
206
219
The airpods will respond with the same packet after the mode has been changed.
207
220
208
-
> But if your airpods support Adaptive Transparency, and you haven't sent that [special packet](#setting-specific-features-for-airpods-pro-2) to enable it, the airpods will respond with the same packet but with a different mode (like 0x02).
221
+
> But if your airpods support Adaptive Transparency, and you haven't sent that [special packet](#setting-specific-features-for-airpods-pro-2)
222
+
to enable it, the airpods will respond with the same packet but with a different mode (like 0x02).
209
223
210
224
## Renaming AirPods
211
225
@@ -217,7 +231,8 @@ We can send a packet to rename the AirPods. The packet format is as follows:
217
231
218
232
## Toggle case charging sounds
219
233
220
-
> *This feature is only for cases with a speaker, i.e. the AirPods Pro 2 and the new AirPods 4. Tested only on AirPods Pro 2*
234
+
> *This feature is only for cases with a speaker, i.e. the AirPods Pro 2 and the new AirPods 4. Tested only on
235
+
AirPods Pro 2*
221
236
222
237
We can send a packet to toggle if sounds should be played when the case is connected to a charger. The packet format is as follows:
Copy file name to clipboardExpand all lines: README.md
+58-18Lines changed: 58 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,10 @@
2
2
3
3
## What is LibrePods?
4
4
5
-
LibrePods unlocks Apple's exclusive AirPods features on non-Apple devices. Get access to noise control modes, adaptive transparency, ear detection, hearing aid, customized transparency mode, battery status, and more - all the premium features you paid for but Apple locked to their ecosystem.
5
+
Troubleshooting
6
+
LibrePods unlocks Apple's exclusive AirPods features on non-Apple devices. Get access to noise control modes,
7
+
adaptive transparency, ear detection, hearing aid, customized transparency mode, battery status, and more - all the
8
+
premium features you paid for but Apple locked to their ecosystem.
6
9
7
10
## Device Compatibility
8
11
@@ -13,12 +16,15 @@ LibrePods unlocks Apple's exclusive AirPods features on non-Apple devices. Get a
| ⚠️ | Other AirPods models | Basic features (battery status, ear detection) should work |
15
18
16
-
Most features should work with any AirPods. Currently, I've only got AirPods Pro 2 to test with. But, I believe the protocol remains the same for all other AirPods (based on analysis of the bluetooth stack on macOS).
19
+
Most features should work with any AirPods. Currently, I've only got AirPods Pro 2 to test with. But, I believe the
20
+
protocol remains the same for all other AirPods (based on analysis of the bluetooth stack on macOS).
17
21
18
22
## Key Features
19
23
20
-
-**Noise Control Modes**: Easily switch between noise control modes without having to reach out to your AirPods to long press
21
-
-**Ear Detection**: Controls your music automatically when you put your AirPods in or take them out, and switch to phone speaker when you take them out
24
+
-**Noise Control Modes**: Easily switch between noise control modes without having to reach out to your AirPods to
25
+
long press
26
+
-**Ear Detection**: Controls your music automatically when you put your AirPods in or take them out, and switch to
27
+
phone speaker when you take them out
22
28
-**Battery Status**: Accurate battery levels
23
29
-**Head Gestures**: Answer calls just by nodding your head
24
30
-**Conversational Awareness**: Volume automatically lowers when you speak
@@ -36,7 +42,20 @@ Most features should work with any AirPods. Currently, I've only got AirPods Pro
36
42
## Platform Support
37
43
38
44
### Linux
39
-
for the old version see the [Linux README](/linux/README.md). (doesn't have many features, maintainer didn't have time to work on it)
45
+
46
+
#### How are you install librepods on Linux?
47
+
48
+
First, you need to clone the entire Git repository. After this, create a build folder inside `linux/`**not in the
49
+
root of the repository.**
50
+
51
+
Once the folder structure is prepared, run CMake inside the build directory, pointing to the `CMakeLists.txt` file
52
+
located in the `linux` folder.
53
+
54
+
Next, compile the generated Makefiles created by the previous step. After the compilation finishes, you should have a
55
+
`librepods` executable. Running this file completes the setup and starts LibrePods.
56
+
57
+
If you need more help, check the [Linux README](/linux/README.md), which provides a more detailed,
58
+
copy-and-paste-ready instruction. (doesn't have many features, maintainer didn't have time to work on it)
40
59
41
60
new version in development ([#241](https://github.com/kavishdevar/librepods/pull/241))
If you are using ColorOS/OxygenOS 16, you don't need root except for customizing transparency mode, setting up hearing aid, and use Bluetooth Multipoint. Changing ANC, conversational awareness, ear detection, and other customizations will work without root. For everyone else:
83
+
If you are using ColorOS/OxygenOS 16, you don't need root except for customizing transparency mode, setting up
84
+
hearing aid, and use Bluetooth Multipoint. Changing ANC, conversational awareness, ear detection, and other
85
+
customizations will work without root. For everyone else:
65
86
66
87
> [!CAUTION]
67
-
> **You must have a rooted device with Xposed to use LibrePods on Android.** This is due to a [bug in the Android Bluetooth stack](https://issuetracker.google.com/issues/371713238). Please upvote the issue by clicking the '+1' icon on the IssueTracker page. I don't know a fix for Android versions <13 either. So, this needs a phone running A13+.
68
-
>
88
+
> **You must have a rooted device with Xposed to use LibrePods on Android.** This is due to a [bug in the Android
89
+
Bluetooth stack](https://issuetracker.google.com/issues/371713238). Please upvote the issue by clicking the '+1' icon
90
+
on the IssueTracker page. I don't know a fix for Android versions <13 either. So, this needs a phone running A13+.
91
+
>
69
92
> There are **no exceptions** to the root requirement until Google/your OEM figures out a fix.
70
93
71
-
Until then, you must xposed. I used to provide a non-xposed method too, where the module used overlayfs to replace the bluetooth library with a locally patched one, but that was broken due to how various devices handled overlayfs and a patched library. With xposed, you can also enable the DID hook enabling a few extra features.
94
+
Until then, you must xposed. I used to provide a non-xposed method too, where the module used overlayfs to replace
95
+
the bluetooth library with a locally patched one, but that was broken due to how various devices handled overlayfs
96
+
and a patched library. With xposed, you can also enable the DID hook enabling a few extra features.
72
97
73
98
## Changing VendorID in the DID profile to that of Apple
74
99
75
100
Turns out, if you change the VendorID in DID Profile to that of Apple, you get access to several special features!
76
101
77
-
You can do this on Linux by editing the DeviceID in `/etc/bluetooth/main.conf`. Add this line to the config file `DeviceID = bluetooth:004C:0000:0000`. For android you can enable the `act as Apple device` setting in the app's settings.
102
+
You can do this on Linux by editing the DeviceID in `/etc/bluetooth/main.conf`. Add this line to the config file
103
+
`DeviceID = bluetooth:004C:0000:0000`. For android you can enable the `act as Apple device` setting in the app's settings.
78
104
79
105
### Multi-device Connectivity
80
106
81
-
Upto two devices can be simultaneously connected to AirPods, for audio and control both. Seamless connection switching. The same notification shows up on Apple device when Android takes over the AirPods as if it were an Apple device ("Move to iPhone"). Android also shows a popup when the other device takes over.
107
+
Upto two devices can be simultaneously connected to AirPods, for audio and control both. Seamless connection
108
+
switching. The same notification shows up on Apple device when Android takes over the AirPods as if it were an Apple
109
+
device ("Move to iPhone"). Android also shows a popup when the other device takes over.
82
110
83
111
### Accessibility Settings and Hearing Aid
84
112
85
-
Accessibility settings like customizing transparency mode (amplification, balance, tone, conversation boost, and ambient noise reduction), and loud sound reduction can be configured.
113
+
Accessibility settings like customizing transparency mode (amplification, balance, tone, conversation boost, and
114
+
ambient noise reduction), and loud sound reduction can be configured.
86
115
87
-
All hearing aid customizations can be done from Android (linux soon), including setting the audiogram result. The app doesn't provide a way to take a hearing test because it requires much more precision. It is much better to use an already available audiogram result.
116
+
All hearing aid customizations can be done from Android (linux soon), including setting the audiogram result. The app
117
+
doesn't provide a way to take a hearing test because it requires much more precision. It is much better to use an
118
+
already available audiogram result.
88
119
89
120
#### A few notes
90
121
91
-
- Due to recent AirPods' firmware upgrades, you must enable `Off listening mode` to switch to `Off`. This is because in this mode, loud sounds are not reduced.
122
+
- Due to recent AirPods' firmware upgrades, you must enable `Off listening mode` to switch to `Off`. This is because
123
+
in this mode, loud sounds are not reduced.
92
124
93
-
- If you have take both AirPods out, the app will automatically switch to the phone speaker. But, Android might keep on trying to connect to the AirPods because the phone is still connected to them, just the A2DP profile is not connected. The app tries to disconnect the A2DP profile as soon as it detects that Android has connected again if they're not in the ear.
125
+
- If you have take both AirPods out, the app will automatically switch to the phone speaker. But, Android might keep
126
+
on trying to connect to the AirPods because the phone is still connected to them, just the A2DP profile is not
127
+
connected. The app tries to disconnect the A2DP profile as soon as it detects that Android has connected again if
128
+
they're not in the ear.
94
129
95
-
- When renaming your AirPods through the app, you'll need to re-pair them with your phone for the name change to take effect. This is a limitation of how Bluetooth device naming works on Android.
130
+
- When renaming your AirPods through the app, you'll need to re-pair them with your phone for the name change to take
131
+
effect. This is a limitation of how Bluetooth device naming works on Android.
96
132
97
-
- If you want the AirPods icon and battery status to show in Android Settings app, install the app as a system app by using the root module.
133
+
- If you want the AirPods icon and battery status to show in Android Settings app, install the app as a system app by
134
+
using the root module.
98
135
99
136
## Supporters
100
137
101
138
A huge thank you to everyone supporting the project!
139
+
102
140
-@davdroman
103
141
-@tedsalmon
104
142
-@wiless
@@ -107,6 +145,7 @@ A huge thank you to everyone supporting the project!
107
145
-@ressiwage
108
146
109
147
## Special thanks
148
+
110
149
-@tyalie for making the first documentation on the protocol! ([tyalie/AAP-Protocol-Definition](https://github.com/tyalie/AAP-Protocol-Defintion))
111
150
-@rithvikvibhu and folks over at lagrangepoint for helping with the hearing aid feature ([gist](https://gist.github.com/rithvikvibhu/45e24bbe5ade30125f152383daf07016))
112
151
-@devnoname120 for helping with the first root patch
@@ -141,4 +180,5 @@ GNU General Public License for more details.
141
180
You should have received a copy of the GNU General Public License
142
181
along with this program. If not, see <https://www.gnu.org/licenses/>.
143
182
144
-
All trademarks, logos, and brand names are the property of their respective owners. Use of them does not imply any affiliation with or endorsement by them. All AirPods images, symbols, and the SF Pro font are the property of Apple Inc.
183
+
All trademarks, logos, and brand names are the property of their respective owners. Use of them does not imply any
184
+
affiliation with or endorsement by them. All AirPods images, symbols, and the SF Pro font are the property of Apple Inc.
0 commit comments