Fredrum / chiaki

Raspberry Pi fork of the Free and Open Source PS4 and PS5 Remote Play client Chiaki.
https://github.com/Fredrum/chiaki/wiki/rpi02---branch-for-Bullseye,-64bit,-h265-and-kmsdrm
GNU Affero General Public License v3.0
68 stars 11 forks source link

Dualsense support (PS5 controller) #12

Closed carlosmellado closed 2 years ago

carlosmellado commented 3 years ago

What platform does your feature request apply to? Raspberry Pi, RaspberryOS, Retropie, or anything running under RaspberryPi and Debian.

Is your feature request related to a problem? Please describe. Yes, I'm unable to play on chiaki by using a Dualsense (PS5) controller.

Describe the solution you'd like Include the new Official driver for Linux

Describe alternatives you've considered As this driver is included on 5.12 Kernel, but Debian for Raspberry is still on 5.10, include steps to install them manually.

Additional context I managed to install the driver by my own, following the next steps:

  1. Clone the driver to any folder: git clone https://aur.archlinux.org/hid-playstation-dkms.git hid-playstation
  2. Enter on the folder: cd hid-playstation
  3. Compile it: make
  4. Copy the generated driver into the module folder: sudo cp hid-playstation.ko /lib/modules/$(uname -r)/extra
  5. Enable it:
    sudo depmod
    sudo modprobe hid-playstation

Now, the dualsense controller works on Chiaki, you can start the session with the touchpad on the remote controller, via USB or Bluetooth, but it doesn't work when you're on the session. The controller stops reponding and I'm unable to play anything.

P.S: Via USB, the speaker on the controller works, meanwhile, when connected via Bluetooth it doesn't.

Fredrum commented 3 years ago

Hello!! One thing that's happening is that to work around an issue with the Sony controllers we are looking up the guid's. That should get printed out in the terminal you are starting Chiaki I believe.

You can then compare to see if your controller is featured in this list: https://github.com/Fredrum/chiaki/blob/master/gui/src/controllermanager.cpp

Audio over Bluetooth is not supported with the DS4 and isn't working anywhere except with the Consoles themselves. I've looked around for a solution but haven't found it. Some guy recently managed to hack and get it sort of working but it seems its been a struggle to implement it in a driver. (I'm using some AirPods for bt audio to avoid wires)

https://www.youtube.com/watch?v=Ru6TYGhNMWE and https://www.youtube.com/watch?v=H2bjd7Oc2l0&t=109s and https://github.com/sensepost/dual-pod-shock/issues/1

I haven't got a PS5 so I won't be able to test myself. I'm playing with a DS4 over bluetooth with only the kernel5.4 Sony driver and that's been working well without having to do anything special.

I'll look into what you are saying here to try to understand what's going on. I think you're saying that the updated Sony driver that makes the PS5 controller work is only coming in through Kernel 5.12.

I probably won't do anything for that in Chiaki itself since it's a Kernel/OS thing but I'll just leave your Issue ticket open and others can see how you fixed it. Thanks for posting a solution!!

Fredrum commented 3 years ago

EDIT: scrapping my previous comment.

424C414B45 commented 3 years ago

I've tried @carlosmellado 's method, which did result in the DualSense touchpad working to control the mouse cursor - but Chiaki still did not recognize input from the controller.

So, I tried @Fredrum 's solution, mapping the controller - but I get to this point and:

root@raspberrypi:/home/pi# cd SDL root@raspberrypi:/home/pi/SDL# mkdir build; cd build root@raspberrypi:/home/pi/SDL/build# ./configure bash: ./configure: No such file or directory

Fredrum commented 3 years ago

Oops my instructions were incorrect. This step should not be there: mkdir build; cd build The ./configure should be done in the root SDL directory.

But the remapping would only solve the problem of button presses working in the wrong way. If you have no input triggering whatsoever then the remapping won't make any difference.

I don't have a PS5 or PS5 controller so am not able to test or fix this at this point.

424C414B45 commented 3 years ago

Bummer

carlosmellado commented 3 years ago

Hey, on my case, I finally have the Dualsense controller fully working. The problem is that libsdl2-dev on rpi Debian has the 2.0.10 version and 2.0.14 is required. So I had to update Debian to bullseye (test version) and that allowed me to upgrade libsdl2-dev to 2.0.14 and it worked like a charm with no more hackings.

424C414B45 commented 3 years ago

@carlosmellado if it's not too much trouble, could you explain what steps to take to accomplish that? I'm a newb, just got the Raspberry to learn and stumbled across Chiaki as a first project.

Fredrum commented 3 years ago

Hi Carlos, did you try just building SDL2 from source instead of updating to Bullseye? Its a relatively easy build. But I have not yet tried to 'install' it. One probably would want to apt remove the original (2.0.10) SDL2 first.

@424 You could try building and installing SDL2 from source instead of installing Bullseye. If that works it should be a smaller operation. Only if you're ok with the possiblity of messing up your sd card OS install, I think.

carlosmellado commented 3 years ago

Hi Fredrum, Nope, I didn’t tried it, as I’m not an expert on Linux and I didn’t know how to do it. So if someone tries it and works, it would be nice if they explains the steps to make it work.

Fredrum commented 2 years ago

Closing as I head this is now working with the SDL2 that one gets with Bullseye.

bmn001 commented 2 years ago

I'm sorry to revive this closed issue, but I'm really struggling to get this working in Ubuntu 21.10.

Kernel is 5.13.0-37, libsdl2-dev is 2.0.14, so this should be working, but it just isn't. All buttons respond correctly in jstest, so the OS is definitely seeing inputs...but the Chiaki window just will not recognize any button presses.

Any ideas?

carlosmellado commented 2 years ago

On the Chiaki GUI, AFAIK the only thing that works is the touchpad, that acts like a mouse. So if everything works fine you should see a mouse pointer as soon as you press the touchpad. Then, you can double click on your PlayStation by using it.