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

    PS4 controller not detected in Retropie 4.6 on Pi 4B

    Scheduled Pinned Locked Moved Help and Support
    ps4 controllerpi4 bretropie 4.6dualshock 4usb gamepad
    39 Posts 5 Posters 8.3k 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.
    • mituM
      mitu Global Moderator
      last edited by

      @juanzt said in PS4 controller not detected in Retropie 4.6 on Pi 4B:

      https://bbs.archlinux.org/viewtopic.php?id=262451

      The forum link you posted indicates this is a patch for a 3rd party PS4 controller, which fails detection because of missing functionality, but it might not work for all controllers (https://bbs.archlinux.org/viewtopic.php?pid=2010615#p2010615).

      Could someone tell me all the steps to follow to test this patch in Retropie?

      You could try to install using the makefile from https://github.com/soreau/hid-sony, but you'll need to replace the hid_sony.c file with the one from the upstream kernel and then apply the patch before installing it:

      git clone https://github.com/soreau/hid-sony
      cd hid-sony
      wget -O hid-sony.c https://raw.githubusercontent.com/raspberrypi/linux/rpi-5.10.y/drivers/hid/hid-sony.c
      # save the patch from https://bbs.archlinux.org/viewtopic.php?pid=2010615#p2010615 to a `patch.diff` file in the `hid-sony` folder
      # then run the patch 
      patch < patch.diff
      
      make && sudo make install
      
      ? 1 Reply Last reply Reply Quote 0
      • ?
        A Former User @mitu
        last edited by

        @mitu

        Hello,

        I do all these steps but it seems hid-sony.ko patched is not using because in hid-sony.c patched the string " failed to retrieve feature report 0x81 with the DualShock 4 MAC address" is not found and dmesg show this message.

        Regards.

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

          If the installation of the patched hid-sony module went fine, you should reboot before trying out again the controller. If that doesn't work, then the patched driver is not working with your controller.

          ? 1 Reply Last reply Reply Quote 0
          • ?
            A Former User @mitu
            last edited by

            @mitu

            I type

            make && sudo make install
            

            And then reboot.

            When the system was reloaded again, I get "failed to retrieve feature report 0x81 with the DualShock 4 MAC address" in dmesg and I take a look a hid-sony.c patched and I not found this string in the file.

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

              Then the patching hasn't been successful, maybe the patch doesn't apply correctly to the current version of hid-sony. Do you get any errors after running the patch command ?

              ? 1 Reply Last reply Reply Quote 0
              • ?
                A Former User @mitu
                last edited by A Former User

                @mitu

                patching file hid-sony.c
                Hunk #1 succeeded at 476 (offset -28 lines).
                Hunk #2 succeeded at 2455 (offset -139 lines).
                Hunk #3 succeeded at 2524 (offset -139 lines).
                patch unexpectedly ends in middle of line
                Hunk #4 succeeded at 2564 with fuzz 1 (offset -139 lines).
                
                

                It seems ok.

                I have looked at the resulting hid-sony.c file and the new function appears and it seems that the rest of the things that have marked to remove on .diff file has been removed.

                $ make && sudo make install
                make -C /lib/modules/5.10.63-v7+/build M=/home/pi/hid-sony modules
                make[1]: Entering directory '/usr/src/linux-headers-5.10.63-v7+'
                  CC [M]  /home/pi/hid-sony/hid-sony.o
                  MODPOST /home/pi/hid-sony/Module.symvers
                  CC [M]  /home/pi/hid-sony/hid-sony.mod.o
                  LD [M]  /home/pi/hid-sony/hid-sony.ko
                make[1]:  Leaving directory '/usr/src/linux-headers-5.10.63-v7+'
                cp hid-sony.ko /lib/modules/5.10.63-v7+/kernel/drivers/hid/
                
                1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator
                  last edited by

                  Looks like it the patch/install went ok, if it's still not working then maybe the patch is not enough for the controller.

                  ? 1 Reply Last reply Reply Quote 0
                  • ?
                    A Former User @mitu
                    last edited by A Former User

                    @mitu

                    I take a look at: https://github.com/soreau/hid-sony and I see a Reload module section.

                    I try it and I get this:

                    $ sudo rmmod hid_sony && modprobe hid-sony
                    modprobe: ERROR: could not insert 'hid_sony': Operation not permitted
                    

                    How could I remove the module and add it again?

                    I type:

                    $ lsmod
                    Module                  Size  Used by
                    hid_sony               36864  0
                    hidp                   24576  2
                    cmac                   16384  1
                    bnep                   20480  0
                    hci_uart               40960  1
                    btbcm                  16384  1 hci_uart
                    bluetooth             393216  9 hidp,hci_uart,bnep,btbcm
                    

                    hid_sony is not use.

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

                      @juanzt said in PS4 controller not detected in Retropie 4.6 on Pi 4B:

                      sudo rmmod hid_sony && modprobe hid-sony

                      This should be 'sudo rmmod hid_sony && sudo modprobe hid-sony, both operations require root` privileges.
                      Restarting will take care of loading the updated module, so that's an option.

                      ? 1 Reply Last reply Reply Quote 0
                      • ?
                        A Former User @mitu
                        last edited by A Former User

                        @mitu

                        Thanks for the info.

                        I reboot several times and I type:

                        $ dkms status
                        hid-sony, 0.1.3, 5.10.63-v7+, armv7l: installed (original_module exists)
                        xpad, 0.4, 5.10.63-v7+, armv7l: installed (original_module exists)
                        
                        

                        Could it be possible that it does not load the module that I have compiled?

                        hid-sony.c doesn't contains "failed to retrieve feature report 0x81 with the DualShock 4 MAC address" string. Where dmesg take it from?

                        Regards.

                        mituM 1 Reply Last reply Reply Quote 0
                        • mituM
                          mitu Global Moderator @A Former User
                          last edited by

                          @juanzt said in PS4 controller not detected in Retropie 4.6 on Pi 4B:

                          Could it be possible that it does not load the module that I have compiled?

                          If you installed the Custom hid-sony driver from RetroPie-Setup, then you should un-install it and then re-install the patched driver.

                          ? 1 Reply Last reply Reply Quote 0
                          • ?
                            A Former User @mitu
                            last edited by A Former User

                            I uninstall Custom hid-sony driver and I type:

                            $ make && sudo make install
                            

                            Then

                            $ sudo reboot
                            

                            And on restart I type dmesg:

                            [   74.513174] usb 1-1.3: new full-speed USB device number 21 using dwc_otg
                            [   74.648746] usb 1-1.3: New USB device found, idVendor=054c, idProduct=09cc, bcdDevice= 1.00
                            [   74.648772] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
                            [   74.648784] usb 1-1.3: Product: Wireless Controller
                            [   74.648796] usb 1-1.3: Manufacturer: Sony Interactive Entertainment
                            [   74.648807] usb 1-1.3: SerialNumber: Wireless Controller
                            [   74.672009] sony 0003:054C:09CC.0011: failed to retrieve feature report 0x81 with the DualShock 4 MAC address
                            [   74.672389] sony 0003:054C:09CC.0011: hidraw0: USB HID v81.11 Gamepad [Sony Interactive Entertainment Wireless Controller] on usb-3f980000.usb-1.3/input3
                            [   74.672405] sony 0003:054C:09CC.0011: failed to claim input
                            
                            

                            Where dmesg take "failed to retrieve feature report 0x81 with the DualShock 4 MAC address" string from?

                            mituM 1 Reply Last reply Reply Quote 0
                            • mituM
                              mitu Global Moderator @A Former User
                              last edited by

                              @juanzt Sorry, no idea why it's still not working.

                              ? 1 Reply Last reply Reply Quote 0
                              • ?
                                A Former User @mitu
                                last edited by

                                @mitu

                                It's Ok, thank you for guiding me through all the steps.

                                Regards.

                                ? 1 Reply Last reply Reply Quote 0
                                • ?
                                  A Former User @A Former User
                                  last edited by A Former User

                                  @mitu

                                  After trying a thousand things, I try this:

                                   $ sudo modinfo hid_sony
                                  filename:       /lib/modules/5.10.63-v7+/updates/dkms/hid-sony.ko
                                  ....
                                  ....
                                  ....
                                  

                                  So path to hid_sony is /lib/modules/$(uname -r)/updates/dkms/ not /lib/modules/$(uname -r)/kernel/drivers/hid/

                                  So I try this:

                                  $ sudo cp ./hid-sony.ko /lib/modules/$(uname -r)/updates/dkms/
                                  

                                  And now my controller works!!!!

                                   $ dmesg
                                  
                                  [    8.590774] usb 1-1.3: Product: Wireless Controller
                                  [    8.590789] usb 1-1.3: Manufacturer: Sony Interactive Entertainment
                                  [    8.590803] usb 1-1.3: SerialNumber: Wireless Controller
                                  [    8.639230] input: Sony Interactive Entertainment Wireless Controller Touchpad as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.3/0003:054C:09CC.0003/input/input2
                                  [    8.639929] input: Sony Interactive Entertainment Wireless Controller Motion Sensors as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.3/0003:054C:09CC.0003/input/input3
                                  [    8.704967] input: Sony Interactive Entertainment Wireless Controller as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.3/0003:054C:09CC.0003/input/input1
                                  [    8.705567] sony 0003:054C:09CC.0003: input,hidraw0: USB HID v81.11 Gamepad [Sony Interactive Entertainment Wireless Controller] on usb-3f980000.usb-1.3/input3
                                  
                                  

                                  Please include hid-sony.diff in Retropie to PS4 controllers that give the error: "failed to retrieve feature report 0x81 with the DualShock 4 MAC address" can work.

                                  Thanks

                                  C 1 Reply Last reply Reply Quote 0
                                  • System referenced this topic on
                                  • C
                                    chrismeistre @A Former User
                                    last edited by

                                    @JuanZt

                                    Just stopped by to thank you. I've used your steps and was able to get my PS4 controller (not original) to work.

                                    1 Reply Last reply Reply Quote 0
                                    • M misuok referenced this topic on
                                    • mituM mitu referenced this topic on
                                    • 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.