• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Controlling Kodi with USB gamepad (nes style)

Scheduled Pinned Locked Moved Help and Support
kodigamepadkeymap
6 Posts 3 Posters 3.7k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B
    blup
    last edited by blup 1 Jul 2018, 15:06 6 Jan 2018, 20:04

    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?

    1 Reply Last reply Reply Quote 0
    • R
      Rascas
      last edited by 6 Jan 2018, 23:00

      Can you post a picture of that gamepad ? And also please post a Kodi log with it connected:
      http://kodi.wiki/view/Log_file

      1 Reply Last reply Reply Quote 0
      • B
        blup
        last edited by 7 Jan 2018, 12:58

        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?

        1 Reply Last reply Reply Quote 0
        • B
          blup
          last edited by blup 1 Jul 2018, 15:07 7 Jan 2018, 14:50

          My kodi.log is here: https://paste.ubuntu.com/26339933/
          I have this controlle:" https://www.sossolutions.nl/controller-voor-de-nintendo-mini-classic-nes

          You see that my USB pad is there called

           "usb gamepad           " 
          

          Are these spaces normal?

          1 Reply Last reply Reply Quote 0
          • K
            KN4THX
            last edited by 8 Jan 2018, 00:29

            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.

            "If you're gonna play the Game Boy, You gotta learn to play it right" - https://www.youtube.com/watch?v=FYLGl92ETNQ

            1 Reply Last reply Reply Quote 0
            • R
              Rascas
              last edited by Rascas 1 Aug 2018, 12:01 8 Jan 2018, 11:57

              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.

              1 Reply Last reply Reply Quote 2
              6 out of 6
              • First post
                6/6
                Last post

              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.

                This community forum collects and processes your personal information.
                consent.not_received