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

    How to install force feedback support for Pantherlord/Greenasia USB PS1/2 Dualshock adapters

    Scheduled Pinned Locked Moved Ideas and Development
    playstation 1dual shockusb adaptersixaxisrumble
    13 Posts 9 Posters 6.9k 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.
    • P
      PET2001
      last edited by

      This is a very rough guide on how to get working force feedback on Sony PS1/PS2 Dualshock controllers connected via the ubiquitous Pantherlord/Greenasia adapters which look like this:

      PS1/2-Adapter

      Raspian supports those adapters via hid-pl.ko, but the driver is compiled without force feedback support. To get force feedback working, you have to change the kernel's build configuration and compile your own hid-pl.ko.

      Download the kernel sources matching the installed kernel version. I used this

      Compiling Raspberry Pi kernel modules

      and this

      Compiling a kernel module for the raspberry pi 2

      as guides.

      Get the hash for your current kernel version (/usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz), download the tgz-archive with the kernel sources from github (curl -L https://github.com/raspberrypi/linux/archive/[kernel_hash].tar.gz >rpi-linux.tar.gz) and unpack the source files.

      Use sudo modprobe configs to get /proc/config.gz and unpack it into the source directory. Edit .config:

      # CONFIG_PANTHERLORD_FF is not set ==>> CONFIG_PANTHERLORD_FF=y

      and

      # CONFIG_GREENASIA_FF is not set ==>> CONFIG_GREENASIA_FF=y

      To compile the module the correct Module.symvers file for the installed kernel version is needed. You can find Modules.symvers in /usr/src/linux-headers-x.x.x if the kernel headers are installed (I had no luck downloading Modules.symvers using the guides mentioned above). Copy Modules.symvers into the directory containing the kernel sources.

      Use make modules_prepare and compile with

      make M=drivers/input/

      from the kernel source dir. Compiling with make drivers/hid/hid-pl.ko (which seems to be the faster way) does not work because Modules.symvers gets truncated (don't know why) and the driver cannot be loaded during startup (that I know from various tests...).

      Backup the original file /lib/modules/x.x.x-v7+/kernel/drivers/hid/hid-pl.ko and replace it with hid-pl.ko from source-dir/drivers/hid.

      Edit etc/modules and put ff-memless on a new line (ff-memless is the force feedback component needed by hid-pl.ko with force feedback support).

      Reboot your RetroPie. After boot dmesg should show:

      [ 3.270040] pantherlord 0003:0810:0001.0001: input,hidraw0: USB HID v1.10 Joystick [Twin USB Joystick] on usb-3f980000.usb-1.5/input0
      [ 3.270151] pantherlord 0003:0810:0001.0001: Force feedback for PantherLord/GreenAsia devices by Anssi Hannula <anssi.hannula@gmail.com>

      I got this working on my Raspberry Pi 3 using Kernel 4.4.38-v7+. Obviously if you do a kernel update after installing the recompiled hid-pl.ko you have to compile again, using the sources for the new kernel.

      The rumble on my PS1/2 controllers connected via Pantherlord adapter is weaker than the rumble effects on PS3 controllers connected via bluetooth. This might be an effect of using 5v via usb to drive the rumble motors, compared to 7.5v on the original hardware.

      edmaul69E BuZzB W 3 Replies Last reply Reply Quote 2
      • edmaul69E
        edmaul69 @PET2001
        last edited by

        @PET2001 this would be cool if it works for me. I cant even figure out how to get force feedback on my ps3 controller on lr-pcsx-rearmed.

        1 Reply Last reply Reply Quote 0
        • BuZzB
          BuZz administrators @PET2001
          last edited by BuZz

          @PET2001 nice. if you submit this to raspberry pi Linux GitHub repo, they may well l enable it in the main kernels. They have for other settings.

          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

          P 1 Reply Last reply Reply Quote 0
          • P
            PET2001 @BuZz
            last edited by

            @BuZz

            proposing to enable

            CONFIG_PANTHERLORD_FF=y
            CONFIG_GREENASIA_FF=y

            in the default config for the Raspberry kernel seems like a good idea (as this is already the default on my Ubuntu systems, were the Pantherlord adapters work with force feedback out of the box). There is however one issue remaining: Unless I put ff-memless into my /etc/modules, the Pantherlord driver will not load but throw a "hid_pl: Unknown symbol input_ff_create_memless (err 0)" in the syslog. Obviously that would be a bad experience for users of the Raspberry kernel as it leads to the Pantherlord adapter not working at all.

            So until somebody here in the forum can figure out how to make the Pantherlord module get to load the necessary force feedback module (ff-memless) automatically, if a Pantherlord USB adapter is detected, I will abstain from proposing a change to the kernel defaults.

            1 Reply Last reply Reply Quote 0
            • W
              w1naenator @PET2001
              last edited by w1naenator

              @pet2001 Works for me, too.
              There is my compiled copy for RPI3 kernel version 4.9.35-v7+.
              Mega

              1 Reply Last reply Reply Quote 0
              • P
                peg
                last edited by

                Still works fine with RetroPie 4.4 running on a 3B+.

                Here's my freshly backed version of hid-pl.ko with Force Feedback support for Kernel 4.14.30-v7+. Maybe it helps someone.

                R 1 Reply Last reply Reply Quote 1
                • R
                  RetrosPlayer @peg
                  last edited by

                  @peg
                  hi, im using your shared file and by putting ff-memless into my /etc/modules like PET2001 said, the rumble its working, however i have an issue, the rumble works, on metal gear solid, dino crisis 2 and crash bandicoot 3, but in games like resident evil 2 and Spyro 3 that does support rumble, the rumble doesnt work, you know what can be the cause?. im using an original sony playstation 1 controller with the usb adapter. and im using retropie 4.4 with the Kernel 4.14.30-v7+.

                  thanx for the files, the guide and any help on this matter.

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

                    Hi all, old topic but hoping you can help

                    I have latest build, 4.5.1 with kernal 4.14.98-v7+

                    For the life of me I cannot download this from GitHub. Could someone either supply my the link or compile the code for me?

                    1 Reply Last reply Reply Quote 0
                    • P
                      peg
                      last edited by

                      @deanoiv

                      It's a little tricky. First you need to get the exact git hash the firmware you're running is based on. Based on that you can get the git hash the kernel used in this firmware is based on. Finally you can download the matching kernel sources.

                      This should do:

                      FIRMWARE_HASH=$(zgrep "* firmware as of" /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz | head -1 | awk '{ print $5 }')
                      KERNEL_HASH=$(wget https://raw.github.com/raspberrypi/firmware/$FIRMWARE_HASH/extra/git_hash -O -)
                      
                      curl -L https://github.com/raspberrypi/linux/archive/${KERNEL_HASH}.tar.gz  > rpi-linux.tar.gz
                      
                      1 Reply Last reply Reply Quote 0
                      • P
                        peg
                        last edited by peg

                        Hi,

                        Since since the original HowTo by @PET2001 is very rough and I had some time on my hands: Here's a step by step guide on how to compile and activate the driver with Force Feedback support. Only tested on RetroPie 4.4 running on a 3B+.

                        # Install required tools (bc is required for modules_prepare, see Compile)
                        sudo apt-get update
                        sudo apt-get install build-essential bc
                        
                        # Setup required variables
                        FIRMWARE_HASH=$(zgrep "* firmware as of" /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz | head -1 | awk '{ print $5 }')
                        KERNEL_HASH=$(wget https://raw.github.com/raspberrypi/firmware/${FIRMWARE_HASH}/extra/git_hash -O -)
                        KERNEL_VERSION=$(uname -a | awk '{ print $3 }')
                        HID_DRIVERS_DIR=/lib/modules/${KERNEL_VERSION}/kernel/drivers/hid
                        BUILD_DIR=~/psff_build
                        
                        # Setup build dir
                        mkdir $BUILD_DIR
                        cd $BUILD_DIR
                        
                        # Get kernel source
                        wget https://github.com/raspberrypi/linux/archive/${KERNEL_HASH}.tar.gz -O ${KERNEL_HASH}.tar.gz
                        tar xfz ${KERNEL_HASH}.tar.gz
                        cd linux-${KERNEL_HASH}
                        
                        # Get Module.symvers and Module7.symvers (not sure Module.symvers is really needed)
                        wget https://raw.github.com/raspberrypi/firmware/${FIRMWARE_HASH}/extra/Module.symvers 
                        wget https://raw.github.com/raspberrypi/firmware/${FIRMWARE_HASH}/extra/Module7.symvers 
                        
                        # Get current kernel config
                        sudo modprobe configs
                        gunzip -c /proc/config.gz > .config
                        
                        # Enable force feedback / rumble support
                        sed -i 's/# CONFIG_PANTHERLORD_FF is not set/CONFIG_PANTHERLORD_FF=y/' .config
                        sed -i 's/# CONFIG_GREENASIA_FF is not set/CONFIG_GREENASIA_FF=y/' .config
                        
                        # Compile driver
                        make modules_prepare
                        make drivers/hid/hid-pl.ko
                        
                        # Update existing hid-pl.ko with FF support (w/ backup of old version) 
                        sudo cp -b drivers/hid/hid-pl.ko ${HID_DRIVERS_DIR}
                        
                        # Enable ff-memless module (not sure why "sudo echo ..." isn't enough)
                        sudo su 
                        echo ff-memless >> /etc/modules
                        exit
                        
                        # Reboot
                        sudo reboot
                        
                        mituM D 2 Replies Last reply Reply Quote 0
                        • mituM
                          mitu Global Moderator @peg
                          last edited by

                          @peg said in How to install force feedback support for Pantherlord/Greenasia USB PS1/2 Dualshock adapters:

                          ...
                          # Enable ff-memless module (not sure why "sudo echo ..." isn't enough)
                          

                          That's a common mistake when dealing with redirection

                          sudo echo ff-memless >> /etc/modules
                          

                          will run just the 'echo' with sudo privileges, the redirection is done with user privileges. An alternative is to use tee:

                          echo ff-memless | sudo tee /etc/modules
                          
                          1 Reply Last reply Reply Quote 1
                          • D
                            deanoiv @peg
                            last edited by deanoiv

                            @peg As a very experienced windows user and novice Linux user I cant thank you enough for this. Took me about 3 days to get near to achieving it, and you did it in 5 minutes :) Tested on 3 b+ running 4.5.1

                            1 Reply Last reply Reply Quote 0
                            • F
                              funksallbrother
                              last edited by

                              @peg Many thanks for all this work too. Just to let you know I had to tweak this guide slightly as when running 'make modules_prepare' I got errors on Retropie 4.8 running on a pi zero 2W. It seems that I had to install 'libssl-dev' first before this command. Can confirm that after this all other steps worked, rebooted and rumble working on both pads as expected on the Trixes adaptor.

                              For those getting the same errors, here's a full update to @peg guide (I take no credit and thank @peg for this easy tutorial and just helping anyone with the same issue)

                              # Install required tools (bc is required for modules_prepare, see Compile)
                              sudo apt-get update
                              sudo apt-get install build-essential bc
                               
                              # Setup required variables
                              FIRMWARE_HASH=$(zgrep "* firmware as of" /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz | head -1 | awk '{ print $5 }')
                              KERNEL_HASH=$(wget https://raw.github.com/raspberrypi/firmware/${FIRMWARE_HASH}/extra/git_hash -O -)
                              KERNEL_VERSION=$(uname -a | awk '{ print $3 }')
                              HID_DRIVERS_DIR=/lib/modules/${KERNEL_VERSION}/kernel/drivers/hid
                              BUILD_DIR=~/psff_build
                               
                              # Setup build dir
                              mkdir $BUILD_DIR
                              cd $BUILD_DIR
                               
                              # Get kernel source
                              wget https://github.com/raspberrypi/linux/archive/${KERNEL_HASH}.tar.gz -O ${KERNEL_HASH}.tar.gz
                              tar xfz ${KERNEL_HASH}.tar.gz
                              cd linux-${KERNEL_HASH}
                               
                              # Get Module.symvers and Module7.symvers (not sure Module.symvers is really needed)
                              wget https://raw.github.com/raspberrypi/firmware/${FIRMWARE_HASH}/extra/Module.symvers 
                              wget https://raw.github.com/raspberrypi/firmware/${FIRMWARE_HASH}/extra/Module7.symvers 
                               
                              # Get current kernel config
                              sudo modprobe configs
                              gunzip -c /proc/config.gz > .config
                               
                              # Enable force feedback / rumble support
                              sed -i 's/# CONFIG_PANTHERLORD_FF is not set/CONFIG_PANTHERLORD_FF=y/' .config
                              sed -i 's/# CONFIG_GREENASIA_FF is not set/CONFIG_GREENASIA_FF=y/' .config
                               
                              # install libssl-dev otherwise following driver compile will fail on 4.8 / pi zero 2w
                              sudo apt-get install libssl-dev
                              
                              # Compile driver
                              make modules_prepare
                              make drivers/hid/hid-pl.ko
                               
                              # Update existing hid-pl.ko with FF support (w/ backup of old version) 
                              sudo cp -b drivers/hid/hid-pl.ko ${HID_DRIVERS_DIR}
                               
                              # Enable ff-memless module (not sure why "sudo echo ..." isn't enough)
                              sudo su 
                              echo ff-memless >> /etc/modules
                              exit
                               
                              # Reboot
                              sudo reboot
                              
                              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.