Fix twin usb joysticks detected as one on linux
recently I got some cheap usb twin joysticks with no brand, tried them with MAME but they seems to show up as a single joystick. checked available devices but found only /dev/input/js0 to be present and ofc jstest-gtk is only showing a single device.
after some research it appeared that there are some linux patches that fix the problem but they have not made it to the kernel I use yet -4.19.0 in my case-
found a solution that works here, the steps are:
1. get usb device vendor id and product id via lsusb
mine showed up like "0810:e301 Personal Communication Systems, Inc."
so vid is 0810 and pid is e301
2. add special handling for the kernel via
sh
echo "options usbhid quirks=0x0810:0xe301:0x00000040" | sudo tee -a /etc/modprobe.d/usbhid.config
ofc replace vid and pid with yours
3. regenerate initramfs via
sh
sudo update-initramfs -u
4. reboot your machine
5. assert is work by checking out that /dev/input
directory has js0 and js1 files -this can change if you have other joysticks pugged in-