Uploaded image for project: 'Funtoo Linux'
  1. Funtoo Linux
  2. FL-12281

[net-kit] Defaults changed in `net-wireless/bluez`, leading to different behavior

    • Icon: Hardware Support Hardware Support
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • None
    • Hide
      1. Build a kernel without UHID support; reboot with it
      2. Install `>=bluez-5.73` (things were broken after rebooting with those versions)
      3. Edit `/etc/bluetooth/input.conf` and set `UserspaceHID=true` to force it on
      4. Attempt to pair a device... any device... like a keyboard, or a speaker, or a game controller.
      5. Frown sadly as your computer disobeys you :( :( :(
      Show
      1. Build a kernel without UHID support; reboot with it 2. Install `>=bluez-5.73` (things were broken after rebooting with those versions) 3. Edit `/etc/bluetooth/input.conf` and set `UserspaceHID=true` to force it on 4. Attempt to pair a device... any device... like a keyboard, or a speaker, or a game controller. 5. Frown sadly as your computer disobeys you :( :( :(

      Unsure of where to put this, so choosing Hardware Support.  This isn't really a Funtoo bug; but I want to document it somewhere in case it helps someone else.

      I rebooted a bunch of computers a few days ago.  On two machines, Bluetooth devices no longer connected!  On another machine, everything seemed to work as normal!  Perplexingly (but also very usefully), the problem went with the computer, not with the Bluetooth hardware:  I swapped the controllers between machines and observed the same behavior.

      Turns out that the problem was related to my kernel config.  On the affected machines, the `UHID` module (for userspace HID support) was not enabled, and it was enabled the working machine.

      The kernel config did not change in this regard — I had rebooted with a new kernel based on the old config, but went back to the old kernel on one machine to verify whether the problem was present.  Problem still occurred!

      Symptoms include the following log messages, for me in `/var/log/daemon.log`:

      ```
      bluetoothd[4756]: profiles/input/device.c:input_device_register() bt_uhid_new_default: failed 
      bluetoothd[4756]: src/service.c:service_probe() input-hid profile probe failed for <hwaddr redacted> 
      bluetoothd[4756]: profiles/input/device.c:input_device_register() bt_uhid_new_default: failed 
      bluetoothd[4756]: src/service.c:service_probe() input-hid profile probe failed for <hwaddr redacted> 
      bluetoothd[4756]: profiles/input/device.c:input_device_register() bt_uhid_new_default: failed 
      bluetoothd[4756]: src/service.c:service_probe() input-hid profile probe failed for <hwaddr redacted>
      bluetoothd[4756]: Failed to set mode: Not Supported (0x0c)
      bluetoothd[4756]: Failed to clear UUIDs: Failed (0x03) 
      ```

      Finding a "fix" pointed to the real solution of enabling the UHID module.  In `/etc/bluetooth/input.conf` there's an option to force UHID on or off; turning it off made my devices work and left messages in the logs about HDIP.  From there it was easy to find the difference.

      ```
      # Enable HID protocol handling in userspace input profile 
      # Defaults to true (Use UHID instead of kernel HIDP) 
      UserspaceHID=false 
      ```

      I expect that UHID works just fine with the supported `debian-sources` config, but will verify its presence.  Let this be a lesson to you, gentle reader:  Custom kernels can cause crap.

      Now, on to the real cause!  Something must have changed upstream, because this same kernel, with an unmodified `/etc/bluetooth/*` and the same devices, worked just fine since December. To close this story, we need to know whether the default changed in `bluez` upstream; there have been two releases in the relevant time period.

            Unassigned Unassigned
            cuantar cuantar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: