I asked Gemini
Sometimes Gemini gets things completely wrong
other times it might point in the right direction
See if this help
The good news is: No, you do not need to recompile the kernel. Because the kernel log explicitly shows uhid0: <vendor 0x413d product 0x553a...> attaching successfully, FreeBSD's generic Human Interface Device (HID) driver has already claimed the hardware. The fact that it isn't listed in /sys/dev/usb/usbdevs just means the text database doesn't have a friendly name string for it—but functionally, the kernel sees it perfectly fine.
The reason libinput and xinput aren't seeing it is because they typically look for evdev devices (/dev/input/event*), whereas this has attached as a raw HID node (/dev/uhid0).
You can absolutely use devd and usbhidaction to get this working. Here is how to bridge the gap.
Step 1: Read the HID Report Descriptor
Before usbhidaction can map the volume knob, you need to know exactly what signals (usages) the knob is broadcasting when you turn or press it.
Plug in the device and run:
Code:
usbhidctl -f /dev/uhid0 -r
Note: Replace uhid0 with the exact number from your dmesg if it changes.
Turn the knob clockwise, counter-clockwise, and press it down. Look at the output. You are looking for names like Consumer:Volume_Increment, Consumer:Volume_Decrement, or generic relative XY axes/buttons.
Step 2: Create the usbhidaction Configuration
Create or edit the file /usr/local/etc/usbhidaction.conf.
Based on what usbhidctl showed you, define the actions. For a standard volume knob, the configuration usually looks something like this:
Code:
# Variable/Usage Value Action
Consumer:Volume_Increment 1 mixer vol +5
Consumer:Volume_Decrement 1 mixer vol -5
Consumer:Mute 1 mixer vol toggle
(If your system uses OSS/mixer, the above commands work. If you use desktop-specific mixers like pactl for PulseAudio/PipeWire, swap the action commands accordingly, e.g., pactl set-sink-volume @DEFAULT_SINK@ +5%).
Step 3: Configure devd to Automate It
Now you can add a block to your /etc/devd.conf (or a dedicated file in /etc/devd/) using your device's specific Vendor ID (0x413d) and Product ID (0x553a).
Modify your template like this:
Code:
notify 100 {
match "system" "USB";
match "subsystem" "DEVICE";
match "type" "ATTACH";
match "vendor" "0x413d";
match "product" "0x553a";
action "/usr/bin/usbhidaction -f /dev/uhid0 -c /usr/local/etc/usbhidaction.conf";
};
Crucial Catch: In your original draft, you used $device-name inside the action statement. devd passes variables like $device-name for certain subsystem rules, but under a generic USB attach notification, it might evaluate to the generic parent ugen0.5 rather than /dev/uhid0. Hardcoding /dev/uhid0 works if it's your only extra HID device, but if you want it dynamically matched, ensure your block targets the DRIVER subsystem or use $cdev depending on your FreeBSD version layout.
After saving your devd configuration, restart the daemon to apply the changes:
Code:
sudo service devd restart
Why libinput isn't working (Alternative Route)
If you would rather have this knob act like a standard multimedia keyboard shortcut so X11/Wayland windows can natively capture it, you need the hkbd (USB HID keyboard) driver or the evdev interface to intercept it instead of generic uhid.
However, using devd + usbhidaction is the cleanest, most "FreeBSD-native" way to handle cheap, non-standard USB volume wheels without bloating your input stack.