Controlling Kodi with USB gamepad (nes style)
-
Hi,
I have a USB gamepad (nes style model) connected to my RetroPi. I have Kodi running inside my RetroPie installation. I followed this example to create a joystick.xml file to control Kodi with my gamepad.
https://github.com/RetroPie/RetroPie-Setup/wiki/KODI
section Joypad Support
When running "cat /proc/bus/input/devices" I see that my USB gamepad has the name:
"usb gamepad "
I: Bus=0003 Vendor=0810 Product=e501 Version=0110 N: Name="usb gamepad " P: Phys=usb-3f980000.usb-1.4/input0 S: Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:0810:E501.0002/input/input1 U: Uniq= H: Handlers=event1 js0 B: PROP=0 B: EV=1b B: KEY=3ff 0 0 0 0 0 0 0 0 0 B: ABS=3 B: MSC=10
So my XML looks like
<?xml version="1.0" encoding="UTF-8"?> <keymap> <global> <joystick name="usb gamepad "> <button id="3">Select</button> <button id="2">Back</button> <axis id="1" limit="+1">Right</axis> <axis id="1" limit="-1">Left</axis> <axis id="2" limit="-1">Up</axis> <axis id="2" limit="+1">Down</axis> </joystick> </global> </keymap>
This file is stored as "/home/pi/.kodi/userdata/keymaps/joystick.xml"
But when I start Kodi the gamepad is not working.
Anny ideas?
-
Can you post a picture of that gamepad ? And also please post a Kodi log with it connected:
http://kodi.wiki/view/Log_file -
I just found out that in Kodi, when I go to input settings and then go to controllers, I see the default Kodi controller. There is a button called get more. I can use the button and there I can add a NES controller. When using this approach my gamepad works.
But shouldn't it also not work with the custom joystick.xml? Do you still want a logfile and picture of the gamepad?
-
My kodi.log is here: https://paste.ubuntu.com/26339933/
I have this controlle:" https://www.sossolutions.nl/controller-voor-de-nintendo-mini-classic-nesYou see that my USB pad is there called
"usb gamepad "
Are these spaces normal?
-
I had this issue and I used a simple workaround though it might not be what you want to do. The snes profile would load but the A button wouldn't select anything, only back out.
What I did was just use the default Kodi controller option. When you map it make sure to let any buttons you don't have time out (similar to how you set up ES mapping). Once you map the buttons you want to use it works flawlessly.
-
That gamepad seems to already have a configuration file, see here:
https://github.com/xbmc/peripheral.joystick/blob/Krypton/peripheral.joystick/resources/buttonmaps/xml/linux/usb_gamepad____________10b_2a.xml
Although it has only the game.controller.snes profile defined. This profiles are mainly for the RetroPlayer engine/emulators, to play games inside Kodi, which will only be officially available in Kodi 18. So try what TheDataCereal said, which is basically manual mapping one of this profiles in the Kodi interface, I also recommend using the default one.PS1: The gamepad configuration examples on RetroPie wiki are outdated, they are for Kodi < 17. The new ones have the format like the one posted above. In your case you should be able to do everything in the Kodi user interface, no need to create/edit the xml file.
PS2: Yes, it can have spaces after the name.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.