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

    joy2key_sdl.py doesn't support my controller

    Scheduled Pinned Locked Moved Help and Support
    help
    10 Posts 2 Posters 1.1k 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.
    • R
      rhester72
      last edited by

      From a debug run:

      2025-04-04 14:32:34,816 DEBUG  Joystick #0 Retro Games LTD THEGamepad added
      2025-04-04 14:32:34,816 DEBUG  Un-configured device "Retro Games LTD THEGamepad", mapped using generic mapping
      

      The "generic mapping" definitely isn't working for the device as the entire dpad is unrecognized and x is mapped to l.

      /opt/retropie/configs/all/retroarch-joypads has a properly-formed (if awkwardly named, containing a leading space and multiple spaces, like so:)

      ' Retro Games LTD   THEGamepad .cfg'
      

      configuration file that works properly in Retroarch.

      strace shows that the Python script is indeed properly opening the device configuration file (wonky spaces and all), so naming isn't an issue. Why is it claiming "un-configured"?

      mituM 1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator @rhester72
        last edited by

        @rhester72 said in joy2key_sdl.py doesn't support my controller:

        Why is it claiming "un-configured"?

        Because it doesn't recognize the .cfg file to be related to your controller.

        R 1 Reply Last reply Reply Quote 0
        • R
          rhester72 @mitu
          last edited by

          @mitu How is that determined? I see joy2key_sdl.py open the config file. It contains the correct path and filename:

          /opt/retropie/configs/all/retroarch-joypads/ Retro Games LTD   THEGamepad .cfg
          

          and said config file contains all the expected elements of other configs (like USB Gamepad.cfg) with a proper input_vendor_id and input_product_id.

          Sadly, my Python skills aren't great, so it's a bit difficult for me to follow it to determine exactly what elements in there that it's not finding...any guidance there would be appreciated.

          R 1 Reply Last reply Reply Quote 0
          • R
            rhester72 @rhester72
            last edited by rhester72

            It may also be helpful to note that sdl2-jstest recognizes the controller GUID:

            Joystick Name:     'Retro Games LTD THEGamepad'
            Joystick GUID:     0300f445591c00002600000010010000
            Joystick Number:    0
            Number of Axes:     2
            Number of Buttons:  8
            Number of Hats:     0
            Number of Balls:    0
            GameControllerConfig:
              Name:    'THEGamepad'
              Mapping: '0300f445591c00002600000010010000,THEGamepad,a:b2,b:b1,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b0,platform:Linux,'
            

            and all input responds normally. I wondered that this being a sort-of-newish controller whether the RetroPie copy of gamecontrollerdb.txt might be stale and in need of refresh, but I couldn't find it at all in RetroPie (and thus I'm very unclear on whether the actual controller DB is derived from).

            1 Reply Last reply Reply Quote 0
            • mituM
              mitu Global Moderator
              last edited by mitu

              Please add the info requested in https://retropie.org.uk/forum/topic/3/read-this-first.

              Run the following command and post the output:

              cat /proc/bus/input/devices
              

              and also provide the contents of the RetroArch profile file ( Retro Games LTD THEGamepad .cfg).

              R 1 Reply Last reply Reply Quote 0
              • R
                rhester72 @mitu
                last edited by

                Pi Model or other hardware: (B, B+, 2 B, 3, X86 PC etc..): 500
                Power Supply used: (If using a Pi): Supplied
                RetroPie Version Used (eg 3.6, 3.8.1, 4.1 - do not write latest): Unsure how to determine, installed from source and updated 2 days ago
                Built From: (Pre made SD Image on RetroPie website, Berryboot, or on top of existing OS etc.. - please provide the filename of any image used): Stock 64-bit Bookworm install plus https://retropie.org.uk/docs/Manual-Installation/
                USB Devices connected: Gamepad and supplied HID mouse
                Controller used: Retro Games LTD THEGamepad
                Error messages received: As indicated in initial post
                Verbose log (if relevant):
                Guide used: (Mention if you followed a guide)
                File: (File with issue - with FULL path)
                Emulator: (Name of emulator - if applicable)
                Attachment of config files: (PLEASE USE PASTEBIN.COM FOR LARGE LOGS)
                How to replicate the problem: As indicated in initial post


                pi@retropie:~ $ cat /proc/bus/input/devices 
                I: Bus=0003 Vendor=093a Product=2510 Version=0111
                N: Name="PixArt USB Optical Mouse"
                P: Phys=usb-xhci-hcd.0-2/input0
                S: Sysfs=/devices/platform/axi/1000120000.pcie/1f00200000.usb/xhci-hcd.0/usb1/1-2/1-2:1.0/0003:093A:2510.0001/input/input0
                U: Uniq=
                H: Handlers=mouse0 event0 
                B: PROP=0
                B: EV=17
                B: KEY=70000 0 0 0 0
                B: REL=903
                B: MSC=10
                
                I: Bus=0019 Vendor=0001 Product=0001 Version=0100
                N: Name="pwr_button"
                P: Phys=gpio-keys/input0
                S: Sysfs=/devices/platform/pwr_button/input/input1
                U: Uniq=
                H: Handlers=kbd event1 
                B: PROP=0
                B: EV=3
                B: KEY=10000000000000 0
                
                I: Bus=0003 Vendor=1c59 Product=0026 Version=0110
                N: Name=" Retro Games LTD   THEGamepad "
                P: Phys=usb-xhci-hcd.1-1/input0
                S: Sysfs=/devices/platform/axi/1000120000.pcie/1f00300000.usb/xhci-hcd.1/usb3/3-1/3-1:1.0/0003:1C59:0026.0002/input/input2
                U: Uniq=
                H: Handlers=event2 js0 
                B: PROP=0
                B: EV=1b
                B: KEY=ff00000000 0 0 0 0
                B: ABS=3
                B: MSC=10
                
                I: Bus=0003 Vendor=2e8a Product=0010 Version=0111
                N: Name="Raspberry Pi Ltd Pi 500 Keyboard"
                P: Phys=usb-xhci-hcd.1-2/input0
                S: Sysfs=/devices/platform/axi/1000120000.pcie/1f00300000.usb/xhci-hcd.1/usb3/3-2/3-2:1.0/0003:2E8A:0010.0003/input/input3
                U: Uniq=
                H: Handlers=sysrq kbd leds event3 
                B: PROP=0
                B: EV=120013
                B: KEY=1000000000007 ff9f207ac14057ff febeffdfffefffff fffffffffffffffe
                B: MSC=10
                B: LED=1f
                
                I: Bus=0003 Vendor=2e8a Product=0010 Version=0111
                N: Name="Raspberry Pi Ltd Pi 500 Keyboard Mouse"
                P: Phys=usb-xhci-hcd.1-2/input1
                S: Sysfs=/devices/platform/axi/1000120000.pcie/1f00300000.usb/xhci-hcd.1/usb3/3-2/3-2:1.1/0003:2E8A:0010.0004/input/input4
                U: Uniq=
                H: Handlers=mouse1 event4 
                B: PROP=0
                B: EV=17
                B: KEY=ff0000 0 0 0 0
                B: REL=1943
                B: MSC=10
                
                I: Bus=0003 Vendor=2e8a Product=0010 Version=0111
                N: Name="Raspberry Pi Ltd Pi 500 Keyboard System Control"
                P: Phys=usb-xhci-hcd.1-2/input1
                S: Sysfs=/devices/platform/axi/1000120000.pcie/1f00300000.usb/xhci-hcd.1/usb3/3-2/3-2:1.1/0003:2E8A:0010.0004/input/input5
                U: Uniq=
                H: Handlers=kbd event5 
                B: PROP=0
                B: EV=1b
                B: KEY=c000 0 0 40000001000000 1200000000 0 100000800000000 40000010cc00 10168000000000 0
                B: ABS=10000030000
                B: MSC=10
                
                I: Bus=0003 Vendor=2e8a Product=0010 Version=0111
                N: Name="Raspberry Pi Ltd Pi 500 Keyboard Consumer Control"
                P: Phys=usb-xhci-hcd.1-2/input1
                S: Sysfs=/devices/platform/axi/1000120000.pcie/1f00300000.usb/xhci-hcd.1/usb3/3-2/3-2:1.1/0003:2E8A:0010.0004/input/input6
                U: Uniq=
                H: Handlers=kbd event6 
                B: PROP=0
                B: EV=1f
                B: KEY=33fff 0 0 483ffff17aff32d bfd4444600000000 1 130ff38b17c000 677bfad9415fed 19ed68000004400 10000002
                B: REL=1040
                B: ABS=100000000
                B: MSC=10
                
                I: Bus=0003 Vendor=2e8a Product=0010 Version=0111
                N: Name="Raspberry Pi Ltd Pi 500 Keyboard"
                P: Phys=usb-xhci-hcd.1-2/input1
                S: Sysfs=/devices/platform/axi/1000120000.pcie/1f00300000.usb/xhci-hcd.1/usb3/3-2/3-2:1.1/0003:2E8A:0010.0004/input/input7
                U: Uniq=
                H: Handlers=sysrq kbd leds event7 
                B: PROP=0
                B: EV=120013
                B: KEY=1000000000007 ff98007a000007ff febeffdfffefffff fffffffffffffffe
                B: MSC=10
                B: LED=1f
                
                I: Bus=001e Vendor=0000 Product=0000 Version=0001
                N: Name="vc4-hdmi-0"
                P: Phys=vc4-hdmi-0/input0
                S: Sysfs=/devices/platform/soc@107c000000/107c701400.hdmi/rc/rc0/input8
                U: Uniq=
                H: Handlers=kbd event8 
                B: PROP=20
                B: EV=100017
                B: KEY=ffffc000000000 3ff 0 400000320fc200 40830c900000000 0 210300 49d2c040ec00 1e378000000000 8010000010000000
                B: REL=3
                B: MSC=10
                
                I: Bus=0000 Vendor=0000 Product=0000 Version=0000
                N: Name="vc4-hdmi-0 HDMI Jack"
                P: Phys=ALSA
                S: Sysfs=/devices/platform/soc@107c000000/107c701400.hdmi/sound/card0/input9
                U: Uniq=
                H: Handlers=event9 
                B: PROP=0
                B: EV=21
                B: SW=40
                
                I: Bus=001e Vendor=0000 Product=0000 Version=0001
                N: Name="vc4-hdmi-1"
                P: Phys=vc4-hdmi-1/input0
                S: Sysfs=/devices/platform/soc@107c000000/107c706400.hdmi/rc/rc1/input10
                U: Uniq=
                H: Handlers=kbd event10 
                B: PROP=20
                B: EV=100017
                B: KEY=ffffc000000000 3ff 0 400000320fc200 40830c900000000 0 210300 49d2c040ec00 1e378000000000 8010000010000000
                B: REL=3
                B: MSC=10
                
                I: Bus=0000 Vendor=0000 Product=0000 Version=0000
                N: Name="vc4-hdmi-1 HDMI Jack"
                P: Phys=ALSA
                S: Sysfs=/devices/platform/soc@107c000000/107c706400.hdmi/sound/card1/input11
                U: Uniq=
                H: Handlers=event11 
                B: PROP=0
                B: EV=21
                B: SW=40
                

                pi@retropie:~ $ cat "/opt/retropie/configs/all/retroarch/autoconfig/ Retro Games LTD   THEGamepad .cfg"
                input_device = " Retro Games LTD   THEGamepad "
                input_driver = "udev"
                input_vendor_id = "7257"
                input_product_id = "38"
                input_left_axis = "-0"
                input_left_axis_label = "D-Pad Left"
                input_state_slot_decrease_axis = "-0"
                input_right_axis = "+0"
                input_right_axis_label = "D-Pad Right"
                input_state_slot_increase_axis = "+0"
                input_r_btn = "5"
                input_r_btn_label = "Z"
                input_save_state_btn = "5"
                input_down_axis = "+1"
                input_down_axis_label = "D-Pad Down"
                input_l_btn = "4"
                input_load_state_btn = "4"
                input_y_btn = "3"
                input_x_btn = "0"
                input_menu_toggle_btn = "0"
                input_b_btn = "2"
                input_b_btn_label = "B"
                input_reset_btn = "2"
                input_a_btn = "1"
                input_up_axis = "-1"
                input_up_axis_label = "D-Pad Up"
                input_select_btn = "6"
                input_start_btn = "7"
                input_start_btn_label = "Start"
                input_exit_emulator_btn = "7"
                input_enable_hotkey_btn = "6"
                
                R 1 Reply Last reply Reply Quote 0
                • R
                  rhester72 @rhester72
                  last edited by rhester72

                  Solved.

                  I had to hand-create the autoconfig based on another config and didn't realize that the input_device string is normalized vs. the filename. More specifically, the file name is:

                   Retro Games LTD   THEGamepad .cfg
                  

                  however, the input_device string inside the file is/should be:

                  Retro Games LTD THEGamepad
                  

                  Retroarch seems to only care that the VID/PID matches, but joy2key_sdl.py needs extra spacing removed in the device name.

                  Sorry for the confusion and hope it helps someone in the future!

                  mituM 1 Reply Last reply Reply Quote 0
                  • mituM
                    mitu Global Moderator @rhester72
                    last edited by mitu

                    @rhester72 said in joy2key_sdl.py doesn't support my controller:

                    Retroarch seems to only care that the VID/PID matches, but joy2key_sdl.py needs extra spacing removed in the device name.

                    Hm, joy2key should also cover this case. What I don't understand why the device name is normalized in the script, but was not normalized when the config was saved, both cases involved libsdl2 producing the device name.

                    Did you copy the .cfg file from another installation ?

                    EDIT: ok, so the matching by PID/VID is not implemented, but it will be. The question remains though - was the .cfg file copied from another (older) installation ?

                    EDIT2: This PR should fix your issue without modifying the input_device_name in the RetroArch .cfg file. Now that it has been merged, just update RetroPie-SetupĀ and you can have the new/fixed version.

                    R 1 Reply Last reply Reply Quote 0
                    • R
                      rhester72 @mitu
                      last edited by

                      @mitu

                      Not copied from another installation, but created somewhat strangely nonetheless. I already had a "USB Gamepad" configured previously before introducing a new controller.

                      When I attempted to initially configure the controller clean, ES would configure it, but only store the config in es_temporaryinput.cfg (perhaps because I already had another controller defined? ES would lose the config on each restart, so I eventually ended up hand-merging es-input.cfg and es_temporaryinput.cfg. But that's an aside...). It wouldn't mirror the configuration to Retroarch at all.

                      To make RA happy, I had to hand-configure the controller in Retroarch (GUI) itself and save from there, which produced the "not-normalized" device name in the configuration file.

                      Thank you for the "fix" (and the inspiration)!

                      mituM 1 Reply Last reply Reply Quote 0
                      • mituM
                        mitu Global Moderator @rhester72
                        last edited by

                        @rhester72 said in joy2key_sdl.py doesn't support my controller:

                        To make RA happy, I had to hand-configure the controller in Retroarch (GUI) itself and save from there, which produced the "not-normalized" device name in the configuration file.
                        [..]

                        OK, so the other possibility of a device name mismatch is the configuration being created outside of EmulationStation's scripts - in this case via RetroArch itself. In any case, this kind of setups will hopefully be better supported by joy2key in the future.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          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.