Skip to content

FreeBSD support - AACP protocol working via native L2CAP #528

@cl45h

Description

@cl45h

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 0x1001 via FreeBSD's native PF_BLUETOOTH / BLUETOOTH_PROTO_L2CAP socket 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions