RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    ControlBlock Joystick configuration

    Scheduled Pinned Locked Moved ControlBlock, PowerBlock & Co.
    control blockjoystick
    21 Posts 4 Posters 8.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.
    • D
      darkav
      last edited by darkav

      Hi,

      ControlBlock(2) with Gamepad Arcade.
      Trying to play Daphne games (so no Arcade, Daphne uses the joystick directly) I realized that the joystick "directions" are not correct (e.g. left is up and so on).
      (this is obviously not an issue with lr games)
      I'm sure that the wiring is correct according with the board labels.

      If I run jstest, I have:

      • UP: - 32767
      • DOWN: 32767
      • RIGHT: - 32767
      • LEFT: 32767

      Is that correct?
      If not, where I can investigate to fix the issue?

      1 Reply Last reply Reply Quote 0
      • D
        darkav
        last edited by

        Upgrade: Making some test, it seems that the issue is that using /dev/input/js0 LR / TP axis are switched.
        How this is possible? Can this be fixed with some configuration?

        1 Reply Last reply Reply Quote 0
        • D
          darkav
          last edited by

          Opened an issue on ControlBlock driver: https://github.com/petrockblog/ControlBlockService2/issues/14

          1 Reply Last reply Reply Quote 0
          • P
            petrockblog Global Moderator
            last edited by

            When you run jstest, do the values for UP, DOWN, RIGHT, LEFT change when you move the joystick?

            D 1 Reply Last reply Reply Quote 0
            • D
              darkav @petrockblog
              last edited by

              @petrockblog Yes.
              Also, the joysticks(s) with MAME works perfectly.
              The problem is when using it for emulators/games that uses the joystick directly, such as Daphne, ScummVM, Prince of Persia Port...

              1 Reply Last reply Reply Quote 0
              • D
                darkav
                last edited by

                Did a change switching the axis and one axis in ControlBlock driver: https://github.com/petrockblog/ControlBlockService2/pull/15

                This fixed the issue.

                1 Reply Last reply Reply Quote 0
                • P
                  petrockblog Global Moderator
                  last edited by

                  Thanks for the pull request. These are always most welcome :-)

                  1 Reply Last reply Reply Quote 0
                  • V
                    Valerius
                    last edited by

                    I just re-installed the binarys and the service, which fixed another issue (the "3 minute shutdown bug").
                    Unfortunately the joystick axis is still messed up in Daphne:

                    Up is Right
                    Down is Left
                    Right is Up
                    Left is Down

                    The Joystick works perfectly in every other Retroarch emulator.
                    Any ideas?

                    1 Reply Last reply Reply Quote 0
                    • V
                      Valerius
                      last edited by

                      Can/should I edit the ArcadeGamepad.cpp like darkav did and re-compile the driver?
                      I'm not sure that would help, since darkav stated that in his case "left was up and so on".
                      But in my case left is down.

                      I'm really stumped with this one...

                      1 Reply Last reply Reply Quote 0
                      • P
                        petrockblog Global Moderator
                        last edited by

                        You might want to try and revert the changes from the changes https://github.com/petrockblog/ControlBlockService2/pull/15/files. There, the X and Y axes were essentially flipped.

                        You can re-compile and re-install the driver with make, sudo make install, and sudo make install servicethen. Note that the config file at /etc/controlblockconfig.cfgis reset with the installation.

                        V 1 Reply Last reply Reply Quote 0
                        • V
                          Valerius @petrockblog
                          last edited by

                          @petrockblog
                          It worked! This fixed my issue!
                          Now I have to remember to never, ever do a driver update... ;)
                          Thank you!

                          1 Reply Last reply Reply Quote 0
                          • P
                            petrockblog Global Moderator
                            last edited by

                            Glad to hear!

                            1 Reply Last reply Reply Quote 0
                            • MontezumaM
                              Montezuma
                              last edited by

                              I wondered why did you exchanged the axes configuration?
                              Before the changes - all directions were matching the description on the ControlBlock board and the atari800 emulator was working fine.
                              Now I updated the ControlBlock software and the axes are swapped and atari800 does not work anymore.

                              1 Reply Last reply Reply Quote 0
                              • MontezumaM
                                Montezuma
                                last edited by

                                I have just checked that atari800 uses (in a correct way) the SDL library to get joystick position.
                                I also assume that SDL has a correct implementation (proven in many project):
                                https://www.libsdl.org/release/SDL-1.2.15/docs/html/sdljoystickgetaxis.html
                                https://www.libsdl.org/release/SDL-1.2.15/docs/html/guideinput.html
                                This means that your change was breaking compatibility not only with atari800 but with all games using the SDL library!
                                Sorry guys, but a proper place to fix your problem was your buggy Daphne emulator...

                                D 1 Reply Last reply Reply Quote 0
                                • P
                                  petrockblog Global Moderator
                                  last edited by

                                  Thanks for pointing to the SDL reference documentation. I was not aware of that and I agree that SDL compatibility is more important. Daphne should fix this in the emulator. I have just merged your pull request.

                                  1 Reply Last reply Reply Quote 1
                                  • D
                                    darkav @Montezuma
                                    last edited by darkav

                                    @montezuma nps. I will keep my fork with the changes :D Just pointing out that the "issue" was not only on Daphne (I remember also scummvm, some ports having exaclty the same issue) so not sure now where exactly is the problem....

                                    MontezumaM 1 Reply Last reply Reply Quote 0
                                    • MontezumaM
                                      Montezuma
                                      last edited by

                                      @darkav
                                      Sure you can keep the "Daphne" specific fork of the ControlBlock driver. This is the advantage of open source software and github.
                                      But again - the driver is a wrong place to make an emulator specific fix!

                                      If you don't believe the SDL documentation, you can just run a test, which I run 5 minutes ago:

                                      1. Quit the emulation station (F4)
                                      2. List input devices (ls /dev/input) - you should see js0 and js1 (Controlblock joysticks)
                                      3. Connect any USB gamepad to the Raspberry Pi (fox example USB versions of the NES/SNES gamepads)
                                      4. List input devices again (ls /dev/input) - this time you will see a new device: js2
                                      5. run jstest to see how the original Linux driver works:
                                        jstest /dev/input/js2
                                      6. You will see the following:
                                        LEFT - AXIS 0: -32767
                                        RIGHT - AXIS 0: 32767
                                        UP - AXIS 1: -32767
                                        DOWN - AXIS 1: -32767
                                        This is exaclty the same that the ControlBlock driver does now and should do!

                                      I hope this finally convinced everybody.

                                      1 Reply Last reply Reply Quote 0
                                      • MontezumaM
                                        Montezuma @darkav
                                        last edited by

                                        @darkav
                                        When I look at your first post again, I think you wiring may be wrong...

                                        1 Reply Last reply Reply Quote 0
                                        • MontezumaM
                                          Montezuma
                                          last edited by

                                          I looked at Daphne source code. It uses SDL correctly.
                                          input.cpp
                                          void process_joystick_motion(SDL_Event *event)

                                          Now it is obvious for me that darkav issues are related to his setup (most probably wrong wiring). It is a pity that instead of double checking the hardware, he spoiled the driver, causing problems for all other users...

                                          D 1 Reply Last reply Reply Quote 0
                                          • D
                                            darkav @Montezuma
                                            last edited by

                                            @montezuma said in ControlBlock Joystick configuration:

                                            I looked at Daphne source code. It uses SDL correctly.
                                            input.cpp
                                            void process_joystick_motion(SDL_Event *event)

                                            Now it is obvious for me that darkav issues are related to his setup (most probably wrong wiring). It is a pity that instead of double checking the hardware, he spoiled the driver, causing problems for all other users...

                                            Wiring is correct. It's a pity you assumed I didn't double check the hardware.
                                            Next step (even if unlikely the problem is on it) is to check the board.

                                            Also, I did a PR which has been reviewed and merged by the author of the driver ...it's very unpolite to say that "I spoiled the driver".

                                            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.