librepods-org / librepods-org/librepods
FreeBSD support - AACP protocol working via native L2CAP
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 29.9k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
FreeBSD Support
I got the AACP protocol working natively on FreeBSD 15.0-RELEASE using direct L2CAP sockets over the netgraph Bluetooth stack. Wrote a small C tool (airpods-ctl) that handles the handshake and can control ANC modes, read battery status, ear detection, and device info.
Working features:
- ANC control (off / on / transparency / adaptive)
- Conversational Awareness toggle
- Battery level readout (left, right, case)
- Ear detection state
- Device metadata (name, model, firmware)
- Raw packet send/receive
Implementation:
- Connects to PSM
0x1001via FreeBSD's nativePF_BLUETOOTH/BLUETOOTH_PROTO_L2CAPsocket API - Performs the AACP handshake and sends control packets
- No BlueZ or DBus dependency - uses FreeBSD's netgraph Bluetooth stack with blued as the pairing daemon
- Tested with AirPods Pro (1st gen), Realtek RTL8761BU USB adapter
Code: https://github.com/cl45h/freebsd-airpods
The protocol layer from LibrePods (airpods_packets.h) was used as reference for packet formats and opcodes. The FreeBSD implementation is pure C with no dependencies beyond libbluetooth.
Would you be interested in a PR adding FreeBSD as a supported platform? The main changes would be an alternative Bluetooth backend that uses raw L2CAP sockets instead of Qt's Bluetooth module (which wraps BlueZ on Linux).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing Qt Bluetooth backend and comparing its responsibilities with the referenced airpods_packets.h and external freebsd-airpods tool. Done means a reviewed FreeBSD backend is integrated and provides the listed AACP controls, battery, detection, metadata, and raw packet features.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- networking, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100