← Back to team overview

touch-packages team mailing list archive

[Bug 1458631] Re: udev: /dev/input/js0 is created but no joystick attached

 

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
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1458631

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

Status in linux package in Ubuntu:
  Incomplete
Status in systemd package in Ubuntu:
  Incomplete

Bug description:
  With ubuntu vivid i see a /dev/input/js0. I do not have a joystick or
  gamepad attached. This invalid input device cause a game in steam
  "Crypt of the necrodancer" to crash during start. The game works fine
  when I delete it.

  This appears to be a ubuntu specific bug as it does not show up on
  fedora 22.

  It goes away if I unplug the mouse/keyboard usb dongle I use. If I
  attach a wired keyboard only it does not show up. I tried adding a
  wired mouse too, but that causes js0 to appear too. The output of
  udevadm changes depending on what mouse I have attached. The following
  output is from using the dongle for my wireless mouse/keyboard (both
  microsoft products)

  $sudo udevadm info /dev/input/js0
  P: /devices/pci0000:00/0000:00:1a.2/usb5/5-1/5-1:1.2/0003:045E:0745.0003/input/input7/js0
  N: input/js0
  S: input/by-id/usb-Microsoft_Microsoft®_2.4GHz_Transceiver_v6.0-if02-joystick
  S: input/by-path/pci-0000:00:1a.2-usb-0:1:1.2-joystick
  E: DEVLINKS=/dev/input/by-id/usb-Microsoft_Microsoft®_2.4GHz_Transceiver_v6.0-if02-joystick /dev/input/by-path/pci-0000:00:1a.2-usb-0:1:1.2-joystick
  E: DEVNAME=/dev/input/js0
  E: DEVPATH=/devices/pci0000:00/0000:00:1a.2/usb5/5-1/5-1:1.2/0003:045E:0745.0003/input/input7/js0
  E: ID_BUS=usb
  E: ID_FOR_SEAT=input-pci-0000_00_1a_2-usb-0_1_1_2
  E: ID_INPUT=1
  E: ID_INPUT_JOYSTICK=1
  E: ID_INPUT_KEY=1
  E: ID_INPUT_KEYBOARD=1
  E: ID_MODEL=Microsoft®_2.4GHz_Transceiver_v6.0
  E: ID_MODEL_ENC=Microsoft®\x202.4GHz\x20Transceiver\x20v6.0
  E: ID_MODEL_ID=0745
  E: ID_PATH=pci-0000:00:1a.2-usb-0:1:1.2
  E: ID_PATH_TAG=pci-0000_00_1a_2-usb-0_1_1_2
  E: ID_REVISION=0251
  E: ID_SERIAL=Microsoft_Microsoft®_2.4GHz_Transceiver_v6.0
  E: ID_TYPE=hid
  E: ID_USB_DRIVER=usbhid
  E: ID_USB_INTERFACES=:030101:030102:030000:
  E: ID_USB_INTERFACE_NUM=02
  E: ID_VENDOR=Microsoft
  E: ID_VENDOR_ENC=Microsoft
  E: ID_VENDOR_ID=045e
  E: MAJOR=13
  E: MINOR=0
  E: SUBSYSTEM=input
  E: TAGS=:seat:uaccess:
  E: USEC_INITIALIZED=117298

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


References