qzed / pbpctrl

Control Google Pixel Buds Pro from the Linux command line.
Apache License 2.0
58 stars 2 forks source link

Doesn't work on A-Series #6

Open bgiesing opened 11 months ago

bgiesing commented 11 months ago

"Might or might not work on other Pixel Buds devices."

I own a Pixel Buds A-Series and the device isn't auto detected. Trying manually by providing the Bluetooth address and running any command throws a connection error:

pbpctrl --device 0C:C4:13:0B:39:11 show hardware
2023-08-01T12:36:55.947792Z  WARN pbpctrl::bt: connecting to profile failed, trying again (1/3) error=Error { kind: NotAvailable, message: "br-connection-profile-unavailable" }
2023-08-01T12:36:56.949647Z  WARN pbpctrl::bt: connecting to profile failed, trying again (2/3) error=Error { kind: NotAvailable, message: "br-connection-profile-unavailable" }
2023-08-01T12:36:57.951226Z  WARN pbpctrl::bt: connecting to profile failed, trying again (3/3) error=Error { kind: NotAvailable, message: "br-connection-profile-unavailable" }
Error: Bluetooth operation not available: br-connection-profile-unavailable

Anything I can provide to try and make A-Series work?

qzed commented 11 months ago

The error means that it can't find the maestro bluetooth profile on the device. It might be possible that it uses another profile, or it might use another communication protocol. Can you run through the following steps and post the output (note: this assumes that you've already paired the buds)?

In particular, it should output some UUIDs, one for each supported profile.

bgiesing commented 11 months ago
[Brandon's Pixel Buds]# info
Device 0C:C4:13:0B:39:11 (public)
    Name: Brandon's Pixel Buds
    Alias: Brandon's Pixel Buds
    Class: 0x00240404
    Icon: audio-headset
    Paired: yes
    Trusted: yes
    Blocked: no
    Connected: yes
    LegacyPairing: no
    UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
    UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
    UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
    UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
    UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
    UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
    UUID: Vendor specific           (3a046f6d-24d2-7655-6534-0d7ecb759709)
    UUID: Vendor specific           (81c2e72a-0591-443e-a1ff-05f988593351)
    UUID: Vendor specific           (df21fe2c-2515-4fdb-8886-f12c4d67927c)
    UUID: Vendor specific           (f8d1fbe4-7966-4334-8024-ff96c9330e15)
    Modalias: bluetooth:v00E0p3003d0001
    Battery Percentage: 0x64 (100)
qzed commented 10 months ago

Sorry for the delay. From what I can tell it looks like it uses a slightly different protocol.

Here are the vendor-specific UUIDs that I'm seeing on my device:

And unfortunately, the MAESTRO APP one is the only one this program currently supports, whereas I guess that the A-Series ones use UUID 3a046f6d-24d2-7655-6534-0d7ecb759709 for settings. You could try replacing the UUID with that one here, but I assume that this isn't going to work (IIRC it looks like it doesn't use pigweed rpc).

If that doesn't work, you'd have to reverse-engineer the protocol. I haven't looked in detail, but if I remember correctly at least some parts (structs and enums for the setting data) seemed to be the same (or largely the same) across protocols. So I guess you should be able to at least reuse some parts.

bgiesing commented 10 months ago

Just tried swapping the UUID and yeah, every command seems to throw an error that it can't read the data so likely it's a different protocol:

WARN maestro::hdlc::codec: error decoding data: UnexpectedData
qzed commented 10 months ago

Correct, that means that it doesn't understand the data being received. You could try to log the data it receives and see if you can make some sense of that. You can also pull the settings app from your device and decompile it (see e.g. https://www.ragingrock.com/AndroidAppRE/, I've used jadx for that) and see if you can figure something out with both the app and the data.