Adding a kernel task, as the /dev/input/js0 is created by the kernel
driver (usbhid) itself. udev does not create device nodes, it just adds
additional properties, runs extra programs on the device nodes, etc.

So cases a/ vs. b/ is interesting -- in both cases you get three HID
devices, just that in the wireless USB dongle case the "hid-generic"
driver grabs them as it just sees the transceiver, while in the wired
USB case it's the "logitech" driver as it sees the devices directly.

input_id only actually sees a joystick with the wireless transceiver
(see a1), there you see that the js0 device claims to have tons of
absolute axes:

capabilities/abs decoded bit map:
  bit    0: FFFFFF01000701FF

while in the b/ case capabilities/abs is zero, i. e. no axes.

input_id is here:
https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-
input_id.c

In test_pointers() you see that has_joystick_axes_or_buttons is
determined by buttons/axes which are typical for a joystick:

        /* joysticks don't necessarily have buttons; e. g.
         * rudders/pedals are joystick-like, but buttonless; they have
         * other fancy axes */
        has_joystick_axes_or_buttons = test_bit(BTN_TRIGGER, bitmask_key) ||
                                       test_bit(BTN_A, bitmask_key) ||
                                       test_bit(BTN_1, bitmask_key) ||
                                       test_bit(ABS_RX, bitmask_abs) ||
                                       test_bit(ABS_RY, bitmask_abs) ||
                                       test_bit(ABS_RZ, bitmask_abs) ||
                                       test_bit(ABS_THROTTLE, bitmask_abs) ||
                                       test_bit(ABS_RUDDER, bitmask_abs) ||
                                       test_bit(ABS_WHEEL, bitmask_abs) ||
                                       test_bit(ABS_GAS, bitmask_abs) ||
                                       test_bit(ABS_BRAKE, bitmask_abs);

This needs to be checked against the decoded capabilities/key (for the
buttons) and capabilities/abs (for the absolute axes), the numerical
values of the evdev constants are in /usr/include/linux/input.h. The
above is just a heuristic of course which has been refined over time,
and might need more refinement.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1458631

Title:
  udev: /dev/input/js0 is created but no joystick attached

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1458631/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to