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

    Zero Delay Encoder, USB Hub, Random /dev/input/js*

    Scheduled Pinned Locked Moved Help and Support
    usbudevencoderjs0xboxdrv
    31 Posts 6 Posters 6.4k 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.
    • E
      elarson
      last edited by

      so figured out why xboxdrv wasn't working today. it was a copy-and-paste error.

      Got it working with one controller and it loads the game. Going to try two now.

      1 Reply Last reply Reply Quote 0
      • E
        elarson
        last edited by

        So xboxdrv seems to be working, but my ROM crashes when I have all four joysticks configured. If I have three of them configured through xboxdrv, it works. But if I add a fourth, the ROM crashes.

        You can see the output of my previous runcommand.sh up above.

        #red
        "/opt/retropie/supplementary/xboxdrv/bin/xboxdrv" --detach-kernel-driver --evdev "/dev/input/by-path/platform-3f980000.usb-usb-0:1.1.3.1:1.0-event-joystick" --evdev-keymap "BTN_BASE=a,BTN_BASE3=b,BTN_BASE5=back,BTN_BASE6=start,BTN_TOP2=black,BTN_BASE4=y,BTN_BASE2=x,BTN_PINKIE=white" --evdev-absmap "ABS_X=y1,ABS_Y=x1" --axismap "" --mimic-xpad --silent --device-name "Joystick Red" &
        
        #blue
        "/opt/retropie/supplementary/xboxdrv/bin/xboxdrv" --detach-kernel-driver --evdev "/dev/input/by-path/platform-3f980000.usb-usb-0:1.1.3.3:1.0-event-joystick" --evdev-keymap "BTN_BASE=a,BTN_BASE3=b,BTN_BASE5=back,BTN_BASE6=start,BTN_TOP2=black,BTN_BASE4=y,BTN_BASE2=x,BTN_PINKIE=white" --evdev-absmap "ABS_X=y1,ABS_Y=x1" --axismap "" --mimic-xpad --silent --device-name "Joystick Blue" &
        
        #green
        "/opt/retropie/supplementary/xboxdrv/bin/xboxdrv" --detach-kernel-driver --evdev "/dev/input/by-path/platform-3f980000.usb-usb-0:1.1.3.4:1.0-event-joystick" --evdev-keymap "BTN_BASE=a,BTN_BASE3=b,BTN_BASE5=back,BTN_BASE6=start,BTN_BASE4=y,BTN_BASE2=x" --evdev-absmap "ABS_X=y1,ABS_Y=x1" --axismap "" --mimic-xpad --silent --device-name "Joystick Green" &
        
        #yellow
        "/opt/retropie/supplementary/xboxdrv/bin/xboxdrv" --detach-kernel-driver --evdev "/dev/input/by-path/platform-3f980000.usb-usb-0:1.1.3.2:1.0-event-joystick" --evdev-keymap "BTN_BASE=a,BTN_BASE3=b,BTN_BASE5=back,BTN_BASE6=start,BTN_BASE4=y,BTN_BASE2=x" --evdev-absmap "ABS_X=y1,ABS_Y=x1" --axismap "" --mimic-xpad --silent --device-name "Joystick Yellow" &
        
        1 Reply Last reply Reply Quote 0
        • mituM
          mitu Global Moderator
          last edited by

          Can you try by disconnecting the keyboard and the mouse and leaving only the joysticks connected ? I've seen a similar report sometime ago when RA crashes with lots of gamepads connected, I wonder what's the magic number before it crashes.

          E 1 Reply Last reply Reply Quote 0
          • E
            elarson @mitu
            last edited by

            @mitu

            Unhooking the keyboard and extra gamepad keeps it from crashing.

            But not all the joysticks are working in the game. In the lower left, while the ROM starts up, it shows it's initializing the controllers.

            • DragonRise Inc. Generic USB Joystick
            • Joystick Red
            • Joystick Yellow
            • Joystick Green
            • Joystick Blue
            • DragonRise Inc. Generic USB Joystick
            • DragonRise Inc. Generic USB Joystick

            It may have done a fourth DragonRise, maybe I missed two that were back-to-back.

            Only players two and four worked, which were Blue and Green respectively. I suspect it used DragonRise devices for players one and three. These are consistent though. It always seems to be players two and four, but it did it with Red and Green on a different boot.

            When I configure devices through Retroarch, it shows my xboxdrv names I gave them. I thought the --detach-kernel-driver might help it from registering the DragonRise controllers, but they still register. It'd be nice if I could get rid of these somehow.

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

              @elarson said in Zero Delay Encoder, USB Hub, Random /dev/input/js*:

              When I configure devices through Retroarch, it shows my xboxdrv names I gave them. I thought the --detach-kernel-driver might help it from registering the DragonRise controllers, but they still register. It'd be nice if I could get rid of these somehow.

              I had the same impression, but it looks like it's not hiding them. What happens if you remove the .cfg file for the DragonRise controllers , so that only the named controllers are auto-configured ?

              E 1 Reply Last reply Reply Quote 0
              • E
                elarson @mitu
                last edited by

                @mitu

                It still registered them during initialization of the ROM. Players two and four were still controllable, but this time by yellow and green.

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

                  Well, since all your controller get detected (and configured, it seems), you can re-order them using @meleu's joystick reordering tool - https://github.com/meleu/RetroPie-joystick-selection. It can re-order them by name, so you can push back the DragonRise controllers and have your named controller be P1-P4.

                  But it's getting a bit complicated and I'm not sure if plugging in more controllers wouldn't complicate things further.

                  E 1 Reply Last reply Reply Quote 0
                  • E
                    elarson @mitu
                    last edited by

                    @mitu

                    Thanks, I had forgotten about that tool. I hadn't used it since I got xboxdrv to rename the inputs.

                    That works. The only problem I have now is that player 1 (red), when I hit the start button it, it exits the game. Verbose logging has the following once I hit that button, nothing too exciting. Outside the game (I've tried multiple games, all do the same), hitting the red start button brings up the main menu, just like the other players. I've tried reconfiguring red.

                    [INFO] Unloading game..
                    [libretro INFO] [MAME 2003] saving mygame.hi hiscore memory file...
                    [INFO] Unloading core..
                    [INFO] Unloading core symbols..
                    [INFO] Saved core options file to "/opt/retropie/configs/all/retroarch-core-options.cfg"
                    [INFO] Threaded video stats: Frames pushed: 1919, Frames dropped: 1.
                    
                    mituM 1 Reply Last reply Reply Quote 0
                    • mituM
                      mitu Global Moderator @elarson
                      last edited by

                      @elarson said in Zero Delay Encoder, USB Hub, Random /dev/input/js*:

                      The only problem I have now is that player 1 (red), when I hit the start button it, it exits the game

                      That seems like a you've not set the hotkey for that controller and start maps to the exit hotkey. Post the .cfg auto-configuration file for that controller.

                      E 2 Replies Last reply Reply Quote 0
                      • E
                        elarson @mitu
                        last edited by elarson

                        @mitu

                        That's what I was thinking too. I compared it to my blue joystick, which works fine, and they're identical (other than input_device name). I wired each of the controller sets up to the encoders the same way, skipping spots if they didn't have a particular button. But blue and red have the same buttons.

                        If I take out input_exit_emulator_btn, then it doesn't exit the emulator when I press red's start. But it also doesn't exit when I press both Select + Start. If I take it out of red's, but leave it in the others, it was exiting the emulator when I pressed Start on another controller (only tried one, not all of them)
                        input_exit_emulator_btn = "7"

                        input_device = "Joystick Red"
                        input_driver = "udev"
                        input_l_btn = "5"
                        input_load_state_btn = "5"
                        input_start_btn = "7"
                        input_exit_emulator_btn = "7"
                        input_down_axis = "+1"
                        input_r_btn = "4"
                        input_save_state_btn = "4"
                        input_right_axis = "+0"
                        input_state_slot_increase_axis = "+0"
                        input_select_btn = "6"
                        input_left_axis = "-0"
                        input_state_slot_decrease_axis = "-0"
                        input_up_axis = "-1"
                        input_a_btn = "0"
                        input_b_btn = "1"
                        input_reset_btn = "1"
                        input_enable_hotkey_btn = "6"
                        input_x_btn = "2"
                        input_menu_toggle_btn = "2"
                        input_y_btn = "3"
                        
                        input_device = "Joystick Blue"
                        input_driver = "udev"
                        input_l_btn = "5"
                        input_load_state_btn = "5"
                        input_start_btn = "7"
                        input_exit_emulator_btn = "7"
                        input_down_axis = "+1"
                        input_r_btn = "4"
                        input_save_state_btn = "4"
                        input_right_axis = "+0"
                        input_state_slot_increase_axis = "+0"
                        input_select_btn = "6"
                        input_left_axis = "-0"
                        input_state_slot_decrease_axis = "-0"
                        input_up_axis = "-1"
                        input_a_btn = "0"
                        input_b_btn = "1"
                        input_reset_btn = "1"
                        input_enable_hotkey_btn = "6"
                        input_x_btn = "2"
                        input_menu_toggle_btn = "2"
                        input_y_btn = "3"
                        
                        1 Reply Last reply Reply Quote 0
                        • E
                          elarson @mitu
                          last edited by

                          @mitu

                          I may be able to live with it. I over did it with the buttons and can wire a dedicated exit button. I can wire the exit button to player one and modify the config files to not have an exit button.

                          If you have any other suggestions, I'd be open. But otherwise, thank you for all your help with this!

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

                            The mapping is ok, so Start+Select should exit - I don't know why it wouldn't work. P1 is the only one able to exit or toggle the menu - that's how RetroArch works - but there might be some confusion on the RA's part because of duplicate inputs from the original controller and the virtual (xboxdrv) one.

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

                              One idea - to hide the original controllers - is to change the permissions on the /dev/input/eventX files corresponding to the original controllers - removing the input group read/write permissions on those devices.
                              That would work only if you start xboxdrv as root.

                              E 1 Reply Last reply Reply Quote 0
                              • D
                                dsstrainer @elarson
                                last edited by dsstrainer

                                @elarson
                                Go with Xarcade's encoder. https://shop.xgaming.com/collections/arcade-parts/products/x-arcade-build-your-own-arcade-control-panel-kit
                                It's a keyboard encoder and has a proper harness. $35 (for the 2018 model) and supports a full keyboard of keys which would give enough for 4 players as you can simply map up to 101 keys to movements. It's the same one used in their Tanksticks.

                                But don't use the xarcade userdriver found here as that just converts it into a joystick instead of keyboard, but retroarch doesn't allow as many features with joypads as it does with keyboards so its pointless and de-features it. Plus you can default keyboard as the primary device and it won't get confused as "just another gamepad" and get out of order. I did one of my units with that encoder and it's the best encoder I've used.

                                My second unit was with 2 ZD's and they work great normally.. its just when plugging in 2 additional gamepads... rpi gets confused suddenly one which is supposed to be index 0 and 1.

                                RetroPie v4.2 • RPi3 Model B • 5.1V 2.5A PSU • 8GB SanDisk class 10 microSD • 16GB External USB Thumb Drive
                                Roms, images and configs stored in USB and symlinked from normal microsd location
                                Xarcade Keyboard encoder + Zero Delay Joystick encoder

                                E 1 Reply Last reply Reply Quote 0
                                • E
                                  elarson @dsstrainer
                                  last edited by

                                  @dsstrainer

                                  How can you hook up 101 inputs? There are only 54 (by my count) male connections, and 11 of those I assume are daisy-chained grounds.

                                  1 Reply Last reply Reply Quote 0
                                  • E
                                    elarson @mitu
                                    last edited by

                                    @mitu

                                    But the /dev/input/event* are random so I can't script it to disable those. I could probably do it for testing. Or if I was better a Linux...

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

                                      Here'a one-liner that will provide the event device from an joystick input device (here for /dev/input/js0):

                                      readlink  -f /dev/input/by-path/`udevadm info /dev/input/js0 | grep ID_PATH= | awk -F= ' { print $2 }'`-event-joystick
                                      

                                      You can also check with cat /proc/bus/input/devices to see which event device is associated with a /dev/input/jsX device.

                                      1 Reply Last reply Reply Quote 0
                                      • J
                                        Jerrymrivera @mitu
                                        last edited by

                                        @mitu
                                        Any Chance you can break this down.
                                        i am new to this and setup 1 set of controls with no problem but when i plug in second it neither one works.
                                        noticed that its showing as same.

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

                                          @jerrymrivera Please don't bump old forum posts.
                                          Create a new topic and explain your problem, adding the relevant info about your setup, as explained in https://retropie.org.uk/forum/topic/3/read-this-first.

                                          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.