HID-Joy-Con-Whispering icon indicating copy to clipboard operation
HID-Joy-Con-Whispering copied to clipboard

uinputdriver crashing with Segfault

Open freundTech opened this issue 7 years ago • 10 comments

When running uinputdriver it just prints "uinput creation failed" (line 381 in the code). Errno is set to 19 (No such device), however I have both joycons in the changing grip and connected to the pc using the usb-C to usb-A cable.

lsusb finds the device as "Bus 001 Device 009: ID 057e:200e Nintendo Co., Ltd".

I'm running Arch Linux with kernel version 4.10.13-1-ARCH.

I also tried running as root.

freundTech avatar May 20 '17 10:05 freundTech

uinput has a kernel module which needs to be loaded on boot, try sudo modprobe uinput and if that works, add a file for uinput in /etc/modules-load.d/

shinyquagsire23 avatar May 21 '17 16:05 shinyquagsire23

Thanks. After loading uinput I'm no longer getting that error message, however now I'm getting a Segfault. Running it with gdb tells me that the segfault occured in udev_device_get_devnode () from /usr/lib/libudev.so.1

freundTech avatar May 21 '17 17:05 freundTech

Make sure you're running as root? That function only takes one argument and it's checked to be NULL so I'm not sure what else it could be.

shinyquagsire23 avatar May 21 '17 18:05 shinyquagsire23

Yes. I'm running it as root. Here is a log of gdb running the program as root and the ldd output. Maybe that helps libraries.txt log.txt

Also hidtest works, so it seems to be a problem with udev/uinput.

freundTech avatar May 24 '17 13:05 freundTech

Having the exact same scenario. Any updates?

Rapti avatar Oct 01 '17 18:10 Rapti

I have the same issue on Arch Linux, running Linux 4.13.5. Segfault in udev_device_get_devnode, hidtest works fine.

It works when I hardcode the uinput path:

    //char *uinput_path = udev_device_get_devnode(uinput);
    char *uinput_path = "/dev/uinput";

lubosz avatar Oct 12 '17 21:10 lubosz

I can confirm that @lubosz's fix worked on my system as well.

Serisium avatar Dec 09 '17 22:12 Serisium

Same error but since I'm new to linux I don't know where to put the workaround in the .c file. I'm on Ubuntu 17.10 4.13.0-32-generic x86_64

Bionov avatar Feb 04 '18 03:02 Bionov

@Bionov grep uinput_path * -IR in the src directory

How would you do that on Windows?

lubosz avatar Feb 04 '18 16:02 lubosz

Thanks, I managed to do it, running into another error but not linked with this one.

Bionov avatar Feb 12 '18 23:02 Bionov