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

    Redream switches controller order

    Scheduled Pinned Locked Moved Help and Support
    redreamcontrollerorder
    9 Posts 2 Posters 624 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.
    • ectoE
      ecto
      last edited by

      I have asked this of the Redream Discord some time ago, but I never got an answer...
      I have two X-Box 360 wired controllers connected to the two USB 2.0 ports of my RPi4 (one black one white).

      When I start RetroPie, I have the white one as controller 1 and the black one as controller 2. As soon as I start Redream, the controllers disconnect and reconnect in the reverse order. (white 2 and black 1). They stay that way after exiting and restarting Redream until I reboot the RPi4.
      If I switch the USB ports before starting the RPi I have the black one as controller 1 and the white one als controller 2. But when running Redream they get switched around again.

      It's not a big deal. It's more like a riddle why this happens. Has someone else have the same experience?

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

        Is your PI overclocked ? Maybe the Redream start-up triggers a power surge and disconnects the USB bus, re-configuring the USB device order.
        You can look up the system messages with dmesg and see if any USB disconnects are reported.

        ectoE 2 Replies Last reply Reply Quote 1
        • ectoE
          ecto @mitu
          last edited by

          @mitu Yes it's heavily overclocked (@2100MHz). I will look into that and report back, thanks!

          1 Reply Last reply Reply Quote 0
          • ectoE
            ecto
            last edited by

            I tried again with no overclocking at all and it made no difference. :(
            But thanks for the suggestion.

            1 Reply Last reply Reply Quote 0
            • ectoE
              ecto @mitu
              last edited by ecto

              @mitu OK, I had a look at dmesgand here are the interesting parts:

              Right at startup , there is this:

              [    6.833011] xpad: loading out-of-tree module taints kernel.
              [    6.835333] input: Microsoft X-Box 360 pad as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input8
              [    6.837342] input: Microsoft X-Box 360 pad as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.0/input/input9
              [    6.845673] usbcore: registered new interface driver xpad
              

              When I start redream the following pops up in the log:

              [  599.405279] xpad 1-1.3:1.0: xpad_try_sending_next_out_packet - usb_submit_urb failed with result -2
              [  599.505049] xpad 1-1.1:1.0: xpad_try_sending_next_out_packet - usb_submit_urb failed with result -2
              [  599.669440] input: Microsoft X-Box 360 pad as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.0/input/input15
              [  599.682745] input: Microsoft X-Box 360 pad as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input16
              [  599.686682] xpad 1-1.3:1.0: xpad_try_sending_next_out_packet - usb_submit_urb failed with result -2
              [  599.777338] xpad 1-1.1:1.0: xpad_try_sending_next_out_packet - usb_submit_urb failed with result -2
              [  600.042547] input: Microsoft X-Box 360 pad as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.0/input/input17
              [  600.043443] input: Microsoft X-Box 360 pad as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input18
              [  600.044424] xpad 1-1.3:1.0: xpad_try_sending_next_out_packet - usb_submit_urb failed with result -2
              [  600.202648] xpad 1-1.1:1.0: xpad_try_sending_next_out_packet - usb_submit_urb failed with result -2
              [  612.979873] input: Microsoft X-Box 360 pad as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.0/input/input19
              [  612.980968] input: Microsoft X-Box 360 pad as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input20
              

              And this is a part of redream.log:

              [INFO]  SDL     registered device 0 desc=auto name=auto
              [INFO]  SDL     registered device 4 desc=030000005e0400008e02000014016800 name=Xbox 360 Controller #1
              [INFO]  SDL     registered device 5 desc=030000005e0400008e02000010016800 name=Xbox 360 Controller #2
              [INFO]  SDL     registered device 2 desc=keyboard name=keyboard
              [INFO]  SDL     registered device 1 desc=disabled name=disabled
              [INFO]  SDL     registered device 0 desc=auto name=auto
              [INFO]  SDL     registered device 4 desc=030000005e0400008e02000014016800 name=Xbox 360 Controller #1
              [INFO]  SDL     registered device 5 desc=030000005e0400008e02000010016800 name=Xbox 360 Controller #2
              [INFO]  SDL     registered device 2 desc=keyboard name=keyboard
              [INFO]  SDL     registered device 1 desc=disabled name=disabled
              [INFO]  SDL     registered device 0 desc=auto name=auto
              [INFO]  SDL     registered device 4 desc=030000005e0400008e02000014016800 name=Xbox 360 Controller #1
              [INFO]  SDL     registered device 5 desc=030000005e0400008e02000010016800 name=Xbox 360 Controller #2
              [INFO]  SDL     registered device 2 desc=keyboard name=keyboard
              [INFO]  SDL     registered device 1 desc=disabled name=disabled
              

              What I'm wondering is this: I don't have the xpad driver compiled through retropie_setup.sh (at least it doesn't show up there). When I install it from there , the message still pops up and the order of the pads is still reversed.
              But the keybindings and button names are strange after that. I have to rebind the keys with Emulationstation, yet in PPSSPP the buttons are still incorrect and some have names of triggers. I can deinstall the driver with 'retropie_setup' and it reverts back to normal after a fresh keybinding in Emulationstation.
              IDK if these errors are easily resolved, because otherwise I'd rather stick to is as-is, as there seem to be some pitfalls along the way...

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

                Hm, the log shows xpad re-initializing the gamepads, but the USB connection is not reset, so it's not an USB port problem (as I initially thought). Since it only happens with redream, I'm thinking it may be trying to directly query the gamepads through the SDL2 HIDAPI driver and this may cause the gamepads to reset themselves. redream may come with its own SDL2 statically compiles so that's why this doesn't happen with other SDL2 applications (like EmulationStation itself) which use the system's SDL2 library (built without HIDAPI).

                Can you get the emulator command from /dev/shm/runcommand.log and run it manually (exit EmulationStation first), but prefix it with SDL_JOYSTICK_HIDAPI=0:

                
                SDL_JOYSTICK_HIDAPI=0 /opt/retropie/emulators/redream/redream <PATH_TO_GAME_ISO/CDI>
                

                and see if the same issue occurs ?

                ectoE 1 Reply Last reply Reply Quote 0
                • ectoE
                  ecto @mitu
                  last edited by ecto

                  @mitu Thanks for your suggestions. I tried it like this from the cli:
                  SDL_JOYSTICK_HIDAPI=0 /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ dreamcast ~/RetroPie/roms/dreamcast/18\ Wheeler\ -\ American\ Pro\ Trucker.chd
                  which produced this runcommand.log
                  and
                  /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ dreamcast ~/RetroPie/roms/dreamcast/18\ Wheeler\ -\ American\ Pro\ Trucker.chd
                  produced this runcommand.log

                  With SDL_JOYSTICK_HIDAPI=0 the pad order stays the same, so this is a big succsess !

                  But there are some new problems now:
                  The underruns are new. Idk what I did there, but they weren't there the last time I tried. Also, I'm a little confused with all thos Mesa warnings. I don't recall if they were there before... Maybe I tried something stupid. I have to dig into that and turn it back -.-

                  The big problem is, that with SDL_JOYSTICK_HIDAPI=0 I have no ingame sound. The boot logo sound is there, but after that, there is nothing. Strange.

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

                    The SDL hint I mentioned should not have any effect on the rendering or audio, not sure why you're seeing this now. You can totally 'replace' the SDL2 library used internally by redream with the one shipped with the system by using

                    SDL_DYNAMIC_API=/usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0
                    

                    as a command prefix (just like SDL_JOYSTICK_HIDAPI=0).
                    You can also try adding the

                    export SDL_JOYSTICK_HIDAPI=0
                    

                    to /opt/retropie/emulators/redream/redream (which is a shell script) and see if that makes a difference.

                    ectoE 1 Reply Last reply Reply Quote 1
                    • ectoE
                      ecto @mitu
                      last edited by ecto

                      @mitu I'm stupid. Somehow turbo mode was on and that's why there was no sound.
                      Sideloading the built-in SDL library doesn't help. But I'll set the export thing in the redream script. The underruns don't seem to affect the gameplay otherwise...
                      Anyway thanks for the help! Another little quirk is gone from my list. :D

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