Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    [7.3-Beta29][FORK] Controler issue in emulators

    GamePad/GPIO/USB encoder
    controler issue
    2
    15
    1738
    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.
    • davidb2111
      davidb2111 Staff @delferius last edited by

      Hi @delferius

      Thanks for the MR. Please just be aware that the MR will not be in 7.3 (i.e 8.0) as it is in freeze stage. Just keep at aligned with master branch.

      Regarding the controller issue, I think I don't understand: does it work well in ES and not in retroarch for both 8bitdo controllers and openJVS?

      also, how does openjvs controllers appears in the system ? you could use sdl2 -jstest -l to list detected controllers and sdl2-jstest -t X where X is the id of your controller to test buttons.

      David

      delferius 1 Reply Last reply Reply Quote 0
      • delferius
        delferius @davidb2111 last edited by delferius

        Hi @davidb2111 and thanks for your help!

        My controllers are correctly detected by jstest and the input events works for both (openjvs_a1p1/openjvs_a1p2):

        # sdl2-jstest -l
        error: failed to read gamecontrollerdb.txt: Invalid RWops
        Found 3 joystick(s)
        
        Joystick Name:     '8Bitdo SF30 Pro'
        Joystick Path:     '/dev/input/event4'
        Joystick GUID:     05000000c82d00000061000000010000
        Joystick Number:    0
        Number of Axes:     4
        Number of Buttons: 16
        Number of Hats:     1
        Number of B***s:    0
        GameControllerConfig:
          Name:    '8BitDo SF30 Pro'
          Mapping: '05000000c82d00000061000000010000,8BitDo SF30 Pro,a:b0,b:b1,back:b10,                                                                                                     dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstic                                                                                                     k:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrig                                                                                                     ger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTO                                                                                                     N_LABELS:=1,'
        Axis code  0:    0
        Axis code  1:    1
        Axis code  2:    2
        Axis code  3:    5
        Button code  0:   304
        Button code  1:   305
        Button code  2:   306
        Button code  3:   307
        Button code  4:   308
        Button code  5:   309
        Button code  6:   310
        Button code  7:   311
        Button code  8:   312
        Button code  9:   313
        Button code 10:   314
        Button code 11:   315
        Button code 12:   316
        Button code 13:   317
        Button code 14:   318
        Button code 15:   319
        Hat code  0:   16
        
        Joystick Name:     'openjvs_a1p1'
        Joystick Path:     '/dev/input/event2'
        Joystick GUID:     000000006f70656e6a76735f61317000
        Joystick Number:    1
        Number of Axes:     2
        Number of Buttons:  8
        Number of Hats:     0
        Number of B***s:    0
        GameControllerConfig:
          missing (see 'gamecontrollerdb.txt' or SDL_GAMECONTROLLERCONFIG)
        Axis code  0:    0
        Axis code  1:    1
        Button code  0:   256
        Button code  1:   257
        Button code  2:   258
        Button code  3:   259
        Button code  4:   260
        Button code  5:   261
        Button code  6:   262
        Button code  7:   263
        
        Joystick Name:     'openjvs_a1p2'
        Joystick Path:     '/dev/input/event3'
        Joystick GUID:     000000006f70656e6a76735f61317000
        Joystick Number:    2
        Number of Axes:     2
        Number of Buttons:  8
        Number of Hats:     0
        Number of B***s:    0
        GameControllerConfig:
          missing (see 'gamecontrollerdb.txt' or SDL_GAMECONTROLLERCONFIG)
        Axis code  0:    0
        Axis code  1:    1
        Button code  0:   256
        Button code  1:   257
        Button code  2:   258
        Button code  3:   259
        Button code  4:   260
        Button code  5:   261
        Button code  6:   262
        Button code  7:   263
        
        
        #sdl2-jstest -t 1
        Joystick Name:   'openjvs_a1p1'
        Joystick Number: 0
        
        Axes  2:
           0:      0  [                                                                                                                                                    #                                                                                                                                                    ]
           1:      0  [                                                                                                                                                    #                                                                                                                                                    ]
        
        Buttons  8:
           0: 0  [ ]
           1: 0  [ ]
           2: 1  [#]
           3: 0  [ ]
           4: 0  [ ]
           5: 0  [ ]
           6: 0  [ ]
           7: 0  [ ]
        
        Hats  0:
        
        B***s  0:
        
        Press Ctrl-c to exit
        
        

        Everything is ok on emulationstation, I can easily remap buttons and navigate with all my controllers but when I start any emulators nothing response.

        davidb2111 1 Reply Last reply Reply Quote 0
        • davidb2111
          davidb2111 Staff @delferius last edited by

          @delferius

          Oh, understood. Could you please share the file /recalbox/share/system/.emulationstation/es_inputs.cfg ?

          delferius 1 Reply Last reply Reply Quote 0
          • delferius
            delferius @davidb2111 last edited by delferius

            @davidb2111 I have only forward the interessant part of the file below. Tell me if you want the entire file.

            	<inputConfig type="joystick" deviceName="openjvs_a1p1" deviceGUID="000000006f70656e6a76735f61317000" deviceNbAxes="2" deviceNbHats="0" deviceNbButtons="8">
            		<input name="left" type="axis" id="0" value="1" code="0" />
            		<input name="down" type="axis" id="1" value="-1" code="1" />
            		<input name="right" type="axis" id="0" value="-1" code="0" />
            		<input name="up" type="axis" id="1" value="1" code="1" />
            		<input name="r1" type="button" id="5" value="1" code="261" />
            		<input name="l1" type="button" id="2" value="1" code="258" />
            		<input name="y" type="button" id="0" value="1" code="256" />
            		<input name="x" type="button" id="1" value="1" code="257" />
            		<input name="b" type="button" id="3" value="1" code="259" />
            		<input name="a" type="button" id="4" value="1" code="260" />
            		<input name="hotkey" type="button" id="7" value="1" code="263" />
            		<input name="select" type="button" id="7" value="1" code="263" />
            		<input name="start" type="button" id="6" value="1" code="262" />
            	</inputConfig>
            	<inputConfig type="joystick" deviceName="openjvs_a1p2" deviceGUID="000000006f70656e6a76735f61317000" deviceNbAxes="2" deviceNbHats="0" deviceNbButtons="8">
            		<input name="left" type="axis" id="0" value="1" code="0" />
            		<input name="down" type="axis" id="1" value="-1" code="1" />
            		<input name="right" type="axis" id="0" value="-1" code="0" />
            		<input name="up" type="axis" id="1" value="1" code="1" />
            		<input name="r1" type="button" id="5" value="1" code="261" />
            		<input name="l1" type="button" id="2" value="1" code="258" />
            		<input name="y" type="button" id="0" value="1" code="256" />
            		<input name="x" type="button" id="1" value="1" code="257" />
            		<input name="b" type="button" id="3" value="1" code="259" />
            		<input name="a" type="button" id="4" value="1" code="260" />
            		<input name="hotkey" type="button" id="7" value="1" code="263" />
            		<input name="select" type="button" id="7" value="1" code="263" />
            		<input name="start" type="button" id="6" value="1" code="262" />
            	</inputConfig>
            
            

            I also try a full build with a clean output folder, in case it get corrupted...

            davidb2111 1 Reply Last reply Reply Quote 0
            • davidb2111
              davidb2111 Staff @delferius last edited by

              @delferius said in [7.3-Beta29][FORK] Controler issue in emulators:

              @davidb2111 I have only forward the interessant part of the file below. Tell me if you want the entire file.

              	<inputConfig type="joystick" deviceName="openjvs_a1p1" deviceGUID="000000006f70656e6a76735f61317000" deviceNbAxes="2" deviceNbHats="0" deviceNbButtons="8">
              		<input name="left" type="axis" id="0" value="1" code="0" />
              		<input name="down" type="axis" id="1" value="-1" code="1" />
              		<input name="right" type="axis" id="0" value="-1" code="0" />
              		<input name="up" type="axis" id="1" value="1" code="1" />
              		<input name="r1" type="button" id="5" value="1" code="261" />
              		<input name="l1" type="button" id="2" value="1" code="258" />
              		<input name="y" type="button" id="0" value="1" code="256" />
              		<input name="x" type="button" id="1" value="1" code="257" />
              		<input name="b" type="button" id="3" value="1" code="259" />
              		<input name="a" type="button" id="4" value="1" code="260" />
              		<input name="hotkey" type="button" id="7" value="1" code="263" />
              		<input name="select" type="button" id="7" value="1" code="263" />
              		<input name="start" type="button" id="6" value="1" code="262" />
              	</inputConfig>
              	<inputConfig type="joystick" deviceName="openjvs_a1p2" deviceGUID="000000006f70656e6a76735f61317000" deviceNbAxes="2" deviceNbHats="0" deviceNbButtons="8">
              		<input name="left" type="axis" id="0" value="1" code="0" />
              		<input name="down" type="axis" id="1" value="-1" code="1" />
              		<input name="right" type="axis" id="0" value="-1" code="0" />
              		<input name="up" type="axis" id="1" value="1" code="1" />
              		<input name="r1" type="button" id="5" value="1" code="261" />
              		<input name="l1" type="button" id="2" value="1" code="258" />
              		<input name="y" type="button" id="0" value="1" code="256" />
              		<input name="x" type="button" id="1" value="1" code="257" />
              		<input name="b" type="button" id="3" value="1" code="259" />
              		<input name="a" type="button" id="4" value="1" code="260" />
              		<input name="hotkey" type="button" id="7" value="1" code="263" />
              		<input name="select" type="button" id="7" value="1" code="263" />
              		<input name="start" type="button" id="6" value="1" code="262" />
              	</inputConfig>
              
              

              I also try a full build with a clean output folder, in case it get corrupted...

              Do you skip d-pad and fill only joystick section ?

              delferius 1 Reply Last reply Reply Quote 0
              • delferius
                delferius @davidb2111 last edited by

                @davidb2111 No I skip joystick (analog) part and fill dpad for openjvs a1p1/openjvs a1p2 controllers.
                For 8bitdo SF30 I assign all inputs and it's the same issue.

                delferius 1 Reply Last reply Reply Quote 0
                • delferius
                  delferius @delferius last edited by

                  Fresh and clean build test of this morning. Always the same issue.
                  I make my current build from the master, I will try from 7.3-Beta 30.

                  delferius 1 Reply Last reply Reply Quote 0
                  • delferius
                    delferius @delferius last edited by

                    @davidb2111
                    Finally when I disable my openJVS driver, all work perfect, my emulate controller seem to enter in conflict with something.
                    For information, I had no issues with my driver on the 6.1.1 forked release :/.

                    delferius 1 Reply Last reply Reply Quote 0
                    • delferius
                      delferius @delferius last edited by

                      @davidb2111
                      When I select "Game library driver" instead of "automatic" driver in the ES controller settings my openJVS controller work as expected but not the 8bitdo SF30 controller. What exactly happen on usage of one or the other driver settings?

                      davidb2111 1 Reply Last reply Reply Quote 0
                      • davidb2111
                        davidb2111 Staff @delferius last edited by

                        @delferius

                        I don't remember well. I think it's how the controller is processed:

                        • through SDL
                        • through udev
                        delferius 1 Reply Last reply Reply Quote 0
                        • delferius
                          delferius @davidb2111 last edited by

                          @davidb2111 Is there a way to solve my problem? In the 6.1.1 version all worked fine. What's exactly changed behind this driver setting?

                          davidb2111 1 Reply Last reply Reply Quote 0
                          • davidb2111
                            davidb2111 Staff @delferius last edited by

                            @delferius

                            There are so many components that changed since 6.1.1 I can't enumerate all of them: kernel, sdl, EmulationStation, python, ...

                            I did not catch the exact problem you have and I don't have that type of controller. This makes the resolution of the problem twice as hard, sorry.

                            First, what is OpenJVS? And how do you connect it to the card ?

                            delferius 1 Reply Last reply Reply Quote 0
                            • delferius
                              delferius @davidb2111 last edited by Zing

                              @davidb2111
                              First, thanks for your help.

                              OpenJVS is a python module to emulate Joypad from RS485 JVS arcade protocol.
                              My module talk to the arcade IO-board throught Serial connection and trigger inputs over uinput virtual joypad device.

                              You can find the source code over here:
                              https://gitlab.com/gaper-private/openjvs/-/tree/python3

                              All work perfect on emulation station. But when I want to used OpenJVS controller on emulator, I must select "Game library driver" instead of "automatic" driver in the ES controller setting.

                              I use 4 different joypads on my system:
                              8bitdo SF30
                              8bitdo M30
                              openjvs_a1p1
                              openjvs_a1p2

                              8bitdo controllers seem to work only with "System driver" and OpenJVS with "Game library driver". So I can't use 8bitdo and OpenJVS controllers at the same times (to play ninja turtle with 4 player for example).

                              To reproduce the issue you can use a python script with uinput library. If you want I can write it for you.

                              1 Reply Last reply Reply Quote 0
                              • delferius
                                delferius last edited by

                                🆙🆙🆙🆙

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post

                                Want to support us ?

                                86
                                Online

                                99.6k
                                Users

                                28.1k
                                Topics

                                187.1k
                                Posts

                                Copyright © 2021 recalbox.com