Show problems of enabling USBHID for modern input peripheral drivers

This thread is to show issues and link to reports from other threads, mailing lists, bugs and elsewhere of unresolved issues of enabling USBHID for newer HID drivers. Also, about potential issues of disabling UHID. This thread is based of off of Thread howto-enabling-multimedia-keys-gamepads-joysticks-for-desktop-usbhid.84464.

As of FreeBSD 14 series, and mostly for 13 series, the following is needed in /boot/loader.conf
Code:
hw.usb.usbhid.enable="1"
usbhid_load="YES"
hkbd_load="YES"

uhid can optionally be disabled from loader.conf:
Code:
uhid_load="NO"
When uhid and ukbd are disabled, hkbd is needed for it to work in single user mode: noted in PR 279953.

x11-drivers/xf86-input-evdev is needed for hkbd to work on Xorg. More details are in the how-to thread above.

When usbhid is enabled, Yubikey (webauth u2f security) has been reported to not work, and there's still an open bug report on that: Thread yubikey-security-key-u2f-help-requested.93331 & PR 265528. The PR was for FreeBSD 13.1. Yubikey relies on the hidraw(4) driver, according to Thread using-yubikey-otp-with-hid-with-yubikey-fido2-ed25519-sk-for-ssh-does-not-work-properly.88531.

According to the manpage, hidraw seems to rely on uhid rather than usbhid, which might be the culprit. Does anyone know if there's a replacement version of hidraw for USBHID, or if hidraw can be made to work with USBHID? Furthermore, hidraw(4) didn't load uhid on my computer. Also, the completely different ugold(4) HID driver needs to be tested with usbhid, as it also didn't load my already disabled uhid driver.

See if there's an update and status of: Thread mouse-in-console-with-usbhid-active.91411.

While a lot of this is covered in the How-to thread above, this is for continuation and more discussion of and links to issues with enabling usbhid and potentially disabling uhid. Also, because there's a delay on posts to that thread.
 
Is there something specific I can ask my keyboard vendor for firmware related to the volume knob? Currently that's the only thing I seemingly need usbhid for (other/older drivers don't have the knob register AudioRaiseVolume/etc). I'm thinking they could "do something" to have the knob register as different buttons?

Or perhaps a way to prevent usbhid from attaching to specific devices and automatically use another/older driver?

With hw.usb.usbhid.enable=1:

With hw.usb.usbhid.enable=0, my keyboard's volume knob (vol up/down/mute) doesn't register under xev or Xfce as keyboard shortcuts (I like using the volume knob :)). Everything else seemed fine so I'm not too sure what benefit usbhid is providing aside from the volume knob functionality.
 
With hw.usb.usbhid.enable=1:
Are U2F/FIDO and/or Solo key like YubiKey, or do they use hiddraw(4)?

You're saying when usbhid is enabled these drivers or features don't work? Also, you would rather have that functionality, bc those are essential to your needs, than have multimedia knob functionality? Also, that certain gamepads/joysticks work with uhid?

The newer driver needed for multimedia key hardware, as the older one doesn't accept multimedia keys from various keyboards universally. With the old driver, some will work, and some don't, and you could find some info searching the forums for that.

So, is what you really need, the functional use of Solo key? If so and if it's like Yubikey, I believe a replacement or improved hiddraw driver is needed for usbhid.

Also, if your joystick/gamepad driver doesn't work with usbhid, try installing one of the Xorg input drivers including xf86-input-evdev from ports.
 
Are U2F/FIDO and/or Solo key like YubiKey, or do they use hiddraw(4)?

You're saying when usbhid is enabled these drivers or features don't work? Also, you would rather have that functionality, bc those are essential to your needs, than have multimedia knob functionality? Also, that certain gamepads/joysticks work with uhid?

The newer driver needed for multimedia key hardware, as the older one doesn't accept multimedia keys from various keyboards universally. With the old driver, some will work, and some don't, and you could find some info searching the forums for that.

So, is what you really need, the functional use of Solo key? If so and if it's like Yubikey, I believe a replacement or improved hiddraw driver is needed for usbhid.

Also, if your joystick/gamepad driver doesn't work with usbhid, try installing one of the Xorg input drivers including xf86-input-evdev from ports.
Pretty sure that this is an issue with firefox.
There are u2f/fido2 key that works fine with other protocol like ssh and gpg, and can be detected with fido2-token -L . Pretty sure that I can list the key secret too.
For instance, I can list my residential keys:
fido2-token -I -c /dev/hidraw4
Enter PIN for /dev/hidraw4:
existing rk(s): 2
remaining rk(s): 8
 
Security keys are attached as HID devices. Yubikey and Solokey are brand names of these. Fido-u2f is a protocol which is commonly mentioned in FreeBSD at this time. There's a few other FIDO protocols, which some are in conjunction with w3c, FIDO and Security key companies: https://fidoalliance.org/specifications/.

My understanding is that security keys can work in conjunction with Firefox?

The hidraw driver with a non compatible USBHID driver enabled caused sleep issues on Thread sleep-resume-caveats-and-gotchas.90831 (post #16). In that case, it affected the Plasma desktop.

PR 283271 is about hidraw, ugold and possibly other HID devices which may need a replacement or upgrade, because they don't work with USBHID. This PR is mirrored in the FreeBSD mailing list for USB devices: https://lists.freebsd.org/archives/freebsd-usb/2024-December/001691.html
 
Anyone who uses ugold(8), please contribute to PR 289119. Seeing the naming convention of old USB drivers having a u at the beginning, and newer usbhid(4) drivers having an h at the beginning, it should probably be called hgold. If you don't have a Bugzilla account, you can post here.
 
Back
Top