librepods icon indicating copy to clipboard operation
librepods copied to clipboard

linux/rust: AirPods Pro 2 UI works but logs repeated “Expected AirPodsInformation … got something else” and IRK errors

Open kkin1995 opened this issue 1 month ago • 5 comments

Summary

On Ubuntu 24.04.3 with AirPods Pro 2, the Rust Linux client works (noise control, ANC, conversation awareness toggles etc.), but the logs show repeated errors such as:

Expected AirPodsInformation for device <MAC>, got something else

Device information is not AirPods for adding LE IRK / LE encryption key

UI behaviour appears correct, but these errors suggest some state mismatch between the AACP device info and the UI/device registry.

Environment:

OS: Ubuntu 24.04.3 LTS x86_64
Kernel: 6.14.0-35-generic
DE: GNOME 46.0
WM: Mutter
Theme: Yaru [GTK2/3]
CPU: 12th Gen Intel i7-12650H
GPU: Intel Alder Lake-P GT1 [UHD Graphics]
GPU: NVIDIA GeForce RTX 3050 Mobile

LibrePods:

  • Branch: linux/rust
  • Built with: cargo build --release in linux-rust/
  • Run with: RUST_LOG=librepods=info ./target/release/librepods

Device:

  • AirPods Pro 2 (A3047/A3048 class)
  • Connected via GNOME Bluetooth, used as audio output

Steps to reproduce:

  • Boot Ubuntu, ensure Bluetooth is on.
  • Open AirPods case, put both buds in ears.
  • In GNOME Bluetooth, connect the AirPods Pro.
  • Start the Rust client:
RUST_LOG=librepods=info ./target/release/librepods

The app finds the already-connected AirPods and initialises AACP:

Found connected AirPods: AirPods Pro, initializing.
Creating new AirPodsDevice for AC:07:75:D5:90:F3
AACPManager connecting to ... PSM 0x1001...
L2CAP connection established ...
  • Click the device in the left sidebar (it initially shows as the MAC address).
  • The main pane now shows the full AirPods view (Name, Listening Mode, Personalized Volume, Conversation Awareness, Off Listening Mode).
  • Change Listening Mode between Off / Noise Cancellation / Transparency / Adaptive etc.
  • Toggle Personalized Volume, Conversation Awareness, and Off Listening Mode.

Expected behaviour:

  • UI shows AirPods controls and sends AACP commands.
  • Logs show corresponding Received Control Command: ListeningMode, value: X etc.
  • No persistent errors about AirPodsInformation or LE keys once the device is successfully initialised.

Actual behaviour:

  • Functionally everything works:
    • Noise control mode changes are audible.
    • Personalized volume / Conversation awareness toggles work.
    • Tray menu controls also work and update logs accordingly.
  • But the log is filled with errors whenever the device is selected or settings are changed:
[INFO  librepods::bluetooth::aacp] Received Battery Info: [BatteryInfo { component: Right, level: 99, status: NotCharging }, BatteryInfo { component: Left, level: 99, status: NotCharging }, BatteryInfo { component: Case, level: 0, status: Disconnected }]
[ERROR librepods::ui::airpods] Expected AirPodsInformation for device AC:07:75:D5:90:F3, got something else
[ERROR librepods::ui::airpods] Expected AirPodsInformation for device AC:07:75:D5:90:F3, got something else
...
[INFO  librepods::bluetooth::aacp] Received Control Command: ListeningMode, value: 02
[ERROR librepods::ui::airpods] Expected AirPodsInformation for device AC:07:75:D5:90:F3, got something else
  • On startup (after deleting ~/.local/share/librepods/devices.json), IRK / ENC key handling also logs:
[INFO  librepods::bluetooth::aacp] Received Proximity Keys Response: [(1, "..."), (4, "...")]
[ERROR librepods::bluetooth::aacp] Device information is not AirPods for adding LE IRK.
[ERROR librepods::bluetooth::aacp] Device information is not AirPods for adding LE encryption key.

So AACP initialisation and control commands succeed, but some internal structure used by the UI and LE key store seems to be DeviceInformation::Other() instead of DeviceInformation::AirPods() for this MAC.

Additional observation – case battery level:

Case battery reporting looks a bit odd:

With both buds in ear:

BatteryInfo { component: Case, level: 0, status: Disconnected }

With one bud in the case (lid open):

BatteryInfo { component: Left,  level: 97, status: NotCharging }
BatteryInfo { component: Right, level: 97, status: Charging }
BatteryInfo { component: Case,  level: 255, status: Disconnected }

So the buds’ levels and statuses are correct, but the case reports status: Disconnected with level: 255, which looks like a sentinel “no reading” value. Not sure if the UI intends to special-case 255 here.

kkin1995 avatar Nov 20 '25 08:11 kkin1995

could you please check if ~/.local/share/librepods/devices.json is populated with serial numbers, model number etc.?

kavishdevar avatar Nov 20 '25 08:11 kavishdevar

I checked ~/.local/share/librepods/devices.json after a fresh run (with the file deleted beforehand), and it’s not populated with serial/model info.

Current contents:

{"AC:07:75:D5:90:F3":{"name":"AC:07:75:D5:90:F3","type_":"AirPods","information":null}}

So:

name is set to the MAC,

type_ is "AirPods",

but information is null (no serials/model/firmware etc.).

However, the AACP side clearly receives a full AirPodsInformation struct on startup. With:

[INFO  librepods::bluetooth::aacp] Received Information: AirPodsInformation {
    name: "AirPods Pro",
    model_number: "A3047",
    manufacturer: "Apple Inc.",
    serial_number: "GX0GW6DK9V",
    version1: "81.2675000075000000.6082",
    version2: "81.2675000075000000.6082",
    hardware_revision: "1.0.0",
    updater_identifier: "com.apple.accessory.updater.app.71",
    left_serial_number: "H3MN10ZT26JY",
    right_serial_number: "H3KN18HR26K0",
    version3: "8454480",
    le_keys: AirPodsLEKeys { irk: "", enc_key: "" }
}

Immediately after that I see:

[INFO  librepods::bluetooth::aacp] Received Proximity Keys Response: [(1, "368d2b4f714606a5a81f2f3ef1709023"), (4, "b645985d72d6b645816b030ee9fc4285")]
[ERROR librepods::bluetooth::aacp] Device information is not AirPods for adding LE IRK.
[ERROR librepods::bluetooth::aacp] Device information is not AirPods for adding LE encryption key.

and, when interacting with the UI:

[ERROR librepods::ui::airpods] Expected AirPodsInformation for device AC:07:75:D5:90:F3, got something else

If it helps, I’m happy to run a build with extra logging around whatever is responsible for writing information into the registry / devices.json for this MAC.

kkin1995 avatar Nov 20 '25 09:11 kkin1995

That's weird- I tried in replicating that, but it just works for me! I'll get back if I discover what's wrong.

Here's what it saves, btw:

{"28:2D:XX:XX:XX":{"name":"Kavish’s AirPods Pro","type_":"AirPods","information":{"kind":"AirPods","data":{"name":"Kavish’s AirPods Pro","model_number":"A3048","manufacturer":"Apple Inc.","serial_number":"----","version1":"81.2675000075000000.6082","version2":"81.2675000075000000.6082","hardware_revision":"1.0.0","updater_identifier":"com.apple.accessory.updater.app.71","left_serial_number":"----","right_serial_number":"----","version3":"8454480","le_keys":{"irk":"----","enc_key":"----"}}}}}

kavishdevar avatar Nov 20 '25 20:11 kavishdevar

Similar issue with AirPods Pro 1st gen (A2084). Interestingly enough, the transparency control works fine (noise cancellation) as well as ear detection.

LevSky22 avatar Nov 22 '25 22:11 LevSky22

Similar issue with AirPods Pro 1st gen (A2084). Interestingly enough, the transparency control works fine (noise cancellation) as well as ear detection.

Do the controls work fine from the tray or the window? Ear detection and other things works separately anyway.

kavishdevar avatar Nov 24 '25 04:11 kavishdevar