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

    DS4 in textmode menus

    Scheduled Pinned Locked Moved Help and Support
    ds4runcommandcontrollersbluetooh
    12 Posts 5 Posters 2.5k 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.
    • M
      mosi0815
      last edited by mosi0815

      Retropie 4.2 fully updated. (os packages and RetroPie)
      Completely stock.

      meleuM 1 Reply Last reply Reply Quote 0
      • meleuM
        meleu @mosi0815
        last edited by

        @mosi0815 I've made some changes on joy2key and posted about it here: https://retropie.org.uk/forum/post/77799

        The forum member @DarkWolf reported that his PlayStation 4 controller is working with my joy2key version.

        If you wanna try it too, follow the steps detailed in that topic.

        • Useful topics
        • joystick-selection tool
        • rpie-art tool
        • achievements I made
        DarkWolfD M 2 Replies Last reply Reply Quote 0
        • DarkWolfD
          DarkWolf @meleu
          last edited by DarkWolf

          @meleu @mosi0815
          Yes, I tested the newer version of them (the controller width the "led bar" on the touchpad)
          I don't know if it works with the older one though, I will test it (hopefully) tomorrow evening

          For now I would suggest trying it out by yourself :-)

          System: Raspberry 3 Model B, RetroPie 4.2.1
          Storage: 16gb Micro SD, 64gb USB Drive
          Theme: Updated NBBA

          Documentation solves many problems: https://retropie.org.uk/docs/

          M 1 Reply Last reply Reply Quote 0
          • M
            mosi0815 @meleu
            last edited by

            @meleu Oh yeah. Unified keymaps would be so great.
            I'm gonna test it and report back on the other thread.

            1 Reply Last reply Reply Quote 0
            • M
              mosi0815 @DarkWolf
              last edited by

              @DarkWolf It doesn't work with mine. I have two brand new ones. AFAIK there is only one hardware version of the PS4 controller. I have one from 2013 and two new ones. They look exactly the same. The only thing they changed is the firmware. This is why at least kernel 4.5 or the ds4drv is needed for the newer ones.
              The left joystick moves the selection from time to time but none of the buttons is working.
              I'm only talking about the textmode menus. Emulationstation end emulators work perfectly fine with them.

              @BuZz What are the next step to file an issue to GitHub?

              BuZzB DarkWolfD 2 Replies Last reply Reply Quote 0
              • BuZzB
                BuZz administrators @mosi0815
                last edited by BuZz

                @mosi0815 I doubt we can fix it in retropie. I don't have one of these controllers either so not much point filing an issue. Could even be some issue with the in kernel driver - I have no idea - since joy2key works with all other controllers that we know of, it may well be nothing to do with RetroPie itself. Did you try using the userland ds4drv ?

                To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                M 1 Reply Last reply Reply Quote 0
                • DarkWolfD
                  DarkWolf @mosi0815
                  last edited by

                  @mosi0815 Huh, there are differences in the hardware at some point...
                  I don't know much about the firmware stuff, but the newer ps4 controllers worked fine without ds4drv and the "old" one was connection but had no input at all, so I used the (bad, I have to say) ds4drv

                  If your controller isn't working correctly it might be your controller or you need the ds4drv (what would be a shame since we have the new kernel that should fix this, huh)
                  joy2key (at this point of time) takes the button number from the retroarch button config and uses that one as [enter], so nothing changed really (everything else works as before)

                  System: Raspberry 3 Model B, RetroPie 4.2.1
                  Storage: 16gb Micro SD, 64gb USB Drive
                  Theme: Updated NBBA

                  Documentation solves many problems: https://retropie.org.uk/docs/

                  1 Reply Last reply Reply Quote 1
                  • M
                    mosi0815 @BuZz
                    last edited by

                    @BuZz I didn't tried the userland driver before the kernel update but never used a text menu with it. The weird thing is that the controller works perfectly fine with emulationstation and all emulators. Also in jstest axis 0/1 move normal (left stick) and the front buttons are 0-3. Can I somehow help you to get debug data? I think this controllers are going to become quite popular now that they work out of the box.

                    1 Reply Last reply Reply Quote 0
                    • M
                      mosi0815 @BuZz
                      last edited by

                      @BuZz I found out what's wrong with it. It works when I hold the controller almost level. The accelerometer data comes in on axis 11,12 and 13. Like with the other axis there's a deadzone. Somehow the joy2key script gets confused by this data. I have no Idea how the script decides which axis to use but maybe it would be a good Idea to either read the axis from the emulation station config or to add an option to ignore certain ones.

                      S 1 Reply Last reply Reply Quote 0
                      • S
                        slajerek @mosi0815
                        last edited by slajerek

                        I confirm the same as @mosi0815 the buttons in runcommand are very slow to respond, but indeed it is much better (but not good!) when controler does not move. By very slow I mean we need several seconds to have the button acquired.

                        Thus, I need to constantly press (not hold) f.e. DPad Down button for few seconds to see the action reflected in runcommand menu.

                        Other menus and games work perfectly fine.

                        Edit:
                        The problem is due to time.sleep is always performed, even when there are events. So after each event is processed, the script waits some small amount of time, if there are many events waiting to be processed, then this is lagging menus. I fixed this problem by amending /opt/retropie/supplementary/runcommand/joy2key.py

                        At end of script I added check if the script can sleep, so if event occurs no sleep is performed:

                        js_fds = []
                        rescan_time = time.time()
                        
                        while True:
                            # added this:
                            do_sleep = True
                            if not js_fds:
                                js_devs, js_fds = open_devices()
                                if js_fds:
                                    i = 0
                                    current = time.time()
                                    js_last = [None] * len(js_fds)
                                    for js in js_fds:
                                        js_last[i] = current
                                        i += 1
                                else:
                                    time.sleep(1)
                            else:
                                i = 0
                                for fd in js_fds:
                                    event = read_event(fd)
                                    if event:
                                        # added this:
                                        do_sleep = False
                        
                                        if time.time() - js_last[i] > JS_REP:
                                            if fd in js_button_codes:
                                                button_codes = js_button_codes[fd]
                                            else:
                                                button_codes = default_button_codes
                                            if process_event(event):
                                                js_last[i] = time.time()
                                    elif event == False:
                                        close_fds(js_fds)
                                        js_fds = []
                                        break
                                    i += 1
                        
                            if time.time() - rescan_time > 2:
                                rescan_time = time.time()
                                if cmp(js_devs, get_devices()):
                                    close_fds(js_fds)
                                    js_fds = []
                        
                        # added this:
                            if do_sleep:
                                time.sleep(0.01)
                        

                        Created pull request with this fix: https://github.com/RetroPie/RetroPie-Setup/pull/2039

                        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.