shinyquagsire23 / HID-Joy-Con-Whispering

Talk to Joy-Con from a PC because it's cool
MIT License
179 stars 23 forks source link

uinputdriver crashing with Segfault #1

Open freundTech opened 7 years ago

freundTech commented 7 years ago

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.

shinyquagsire23 commented 7 years ago

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/

freundTech commented 7 years ago

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

shinyquagsire23 commented 7 years ago

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.

freundTech commented 7 years ago

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.

Rapti commented 6 years ago

Having the exact same scenario. Any updates?

lubosz commented 6 years ago

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";
Serisium commented 6 years ago

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

Bionov commented 6 years ago

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

lubosz commented 6 years ago

@Bionov grep uinput_path * -IR in the src directory

How would you do that on Windows?

Bionov commented 6 years ago

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