Hi Bastien, On Thu, Sep 12, 2024 at 9:44 AM Bastien Nocera <hadess@xxxxxxxxxx> wrote: > > Hey, > > I got a report some time ago about a Kawai music keyboard's Bluetooth > MIDI interface not being usable from GNOME's Bluetooth settings: > https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/issues/154 > > The code in the Bluetooth settings always tries to pair devices, unless > it's blocklisted in our database. > > Ideally, we wouldn't need to have those devices in a database because > the device would answer that it doesn't support pairing (as in the > "pairing failed" line here: > https://gitlab.gnome.org/-/project/1617/uploads/83953481a1008b8cdbe894849ee5b3a7/gnome-bluetooth.png > ) > > and then we could retry setting up the device without pairing it. > > But the device response doesn't seem to bubble up to user-space. > > Any advices on reporting this error message all the way up to user- > space for bluez, and then gnome-bluetooth, to use? > > This is the tracking bug in the meanwhile: > https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/issues/158 Yeah, looks like smp_failure always translate the reason to HCI_ERROR_AUTH_FAILURE so this sort of error is not propagated to usespace, we also would need to add another status code to MGMT API to map it properly and then encode it as part of D-Bus Device.Pair method reply. That said, some device may respond with this code when bonding is temporarily disabled, in fact the kernel do that when bondable flag has not been enabled: if (!hci_dev_test_flag(hdev, HCI_BONDABLE) && (auth & SMP_AUTH_BONDING)) return SMP_PAIRING_NOTSUPP; So I don't think we can assume the device is never pairable, so perhaps just use Device.Connect method instead of Device.Pair when retrying, that said perhaps the device doesn't like the use of SMP_AUTH_BONDING (aka. persist keys) and instead just want to pair without bonding, this is a problem at SMP side though since it doesn't have a code to say bonding is not supported but perhaps that is intentional since peers can indicate by not setting SMP_AUTH_BONDING. > > Cheers > -- Luiz Augusto von Dentz