Skip to content

Instantly share code, notes, and snippets.

@zerkz
Last active Jan 14, 2023
Embed
What would you like to do?
[Linux] Simple Guide To Using a PS5 Controller with Chiaki

Overview

This guide is meant for those using Linux and wanting to use a PS5 Controller (Dualsense) with Chiaki to enable remote play for PS4/PS5.

Despite the PS5 Controller support added to the 5.12 kernel, I had issues getting it to be recognized by Chiaki.

I've only verified these steps on a PopOS 21.10 (Ubuntu derivative) system, running on 5.16 kernel.

If you have an alternate solution for Linux that worked for you, leave a comment to help others out!

What does this guide provide?

A reliable way of mapping your PS5 controller buttons to keyboard inputs, and then mapping those keyboard inputs to Chiaki.

This works when wired via USB-C, or wirelessly via bluetooth.

What doesn't work, and other oddities.

  • Haptic stuff does not seem to work.
  • Touchpad "button" seems to be recognized even though we can't explicitly map it using AntiMicroX.

Guide

Install dependencies

Both Chiaki and AntiMicroX have AppImage's available. AppImageLauncher handles easily integrating AppImages. Or you can run it manually

Map your PS5 Controller to Keyboard Inputs.

Run AntiMicroX (if you don't see it, it's likely running in your OS's "tray").

Your controller should be detected, and you should see inputs from it flashing as you pressed them on the controller.

Start mapping all buttons to keyboard inputs. I suggest avoiding dangerous keys like Delete, modifier keys like ctrl or alt, etc. Once finished, be sure to save them!

Here are mine for example:

res_mappings_1.png res_mappings_2.png

Configure Chiaki's mappings.

Run Chiaki, click the gear to open settings.

Click through each setting, hit the corresponding button on your controller, and it should be set to what you configured in AntiMicroX.

Here's my configuration for example:

res_chiaki_config.png

That's it. Connect to your PS5 remotely and test it out!

@andersonberg
Copy link

It worked perfectly for me, thank you!

@ayrton04
Copy link

ayrton04 commented Jul 29, 2022

Another option that works on Ubuntu 20.04:

  1. Download SDL source, build, and install:
git clone https://github.com/libsdl-org/SDL -b release-2.0.22
cd SDL
mkdir build
cd build
cmake ..
make
sudo make install
  1. Download chiaki source, edit CMake file, build, install:
git clone https://git.sr.ht/~thestr4ng3r/chiaki
echo "list(APPEND CMAKE_INSTALL_RPATH /usr/local/lib/)" >> chiaki/cmake/FindSDL2.cmake
cd chiaki
mkdir build
cd build
cmake ..
make
sudo make install

When you run the cmake .. commands, you may note that your system is missing some build dependencies. They should all be pretty easily solvable just using the Ubuntu package manager.

The issue, at least with Ubuntu 20.04, is that the version of SDL that is packaged with it (2.0.10) is too old to support the Dualsense as a controller. It may be that you don't have to go all the way to version 2.0.22 to get that feature, but it works.

@cjones26
Copy link

cjones26 commented Jan 8, 2023

@ayrton04 remember we also will need to install some dev packages (you may need other ones, as I already may have had some installed):

sudo apt install libxext-dev libsdl2-dev libavutil-dev libavcodec-dev libopus0 libogg0 libopus-dev libssl-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qtmultimedia5-dev libqt5svg5-dev

And also there are some third party Git submodules we need to init and update:

git submodule init
git submodule update

Thanks for the tip, though -- I was able to get my PS5 controller working!!

@zerkz
Copy link
Author

zerkz commented Jan 9, 2023

SDL is definitely something I would suggest (and seems future proof). Recently Chiaki got some new updates that allow touchpad / sensor handling via SDL.

I've tried this out on my Steam Deck using Chiaki, and it was beautiful. The gyro sensors integrated great with games like God of War.

@danfulf
Copy link

danfulf commented Jan 14, 2023

Thank you very much all for the input here.

Between @cjones26 and @ayrton04 comments, I now have Chiaki built on Fedora 37 and DualSense is working. Runs so much better than the Windows Official client.

Much appreciated, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment