16

How do I use a PlayStation 3 controller with Ubuntu?

karel
  • 122,292
  • 133
  • 301
  • 332
nerd7473
  • 353

7 Answers7

14

You are able to connect the controller to the pc via usb cable. This is supplied with a PS3 device (it is the primary way to charge the controller). I don't know how to connect the controller via bluetooth to your computer (if you even have a bluetooth receiver), so this answer focusses on usb connection. It might be that the controller already works if you do this (You can test this with jstest-gtk as listed below). I use another similar PnP controller, and it works without difficulty.

if it does not work automatically, this link might answer your question. In summary:

  • install xboxdrv from the Ubuntu Software Center or with sudo apt-get install xboxdrv
  • start xboxdrv with sudo xboxdrv --detach-kernel-driver
  • If you press the Playstation button, the computer will receive its input and simulate it as an Xbox 360 controller, which should work the same as the playstation controller.

You can test the functionality of your controller through Jstest-gtk (install: sudo apt-get install jstest-gtk)

Good luck, let me know if it works.

Michael
  • 464
12

You should use sixad/QtSixA http://qtsixa.sourceforge.net/ . Just install from the repo and pair with sixpair while the sixaxis is connected with usb, and then connect with Bluetooth by pressing the PS button.

sudo add-apt-repository ppa:falk-t-j/qtsixa
sudo apt-get update
sudo apt-get install qtsixa

Connect with USB

sixpair

Disconnect sixaxis from USB

sixad -s

press PS button to connect over bluetooth

simernes
  • 507
11

There is nothing to install anymore on recent versions of Ubuntu, as Dualshock 3 (and 4 I believe) is natively supported by the Kernel, in both USB and Bluetooth.

USB Usage

If you want to use it also via Bluetooth, prefer to make the Bluetooth setup first.

Connecting the controller via USB just works™ out of the box. The main drawback is that the controller remains paired with your PlayStation, so when you disconnect the controller, it turns on the PlayStation. Remember to turn it off.

To avoid this, you need to pair the controller via Bluetooth, which will un-pair it from the console.

Bluetooth usage

First connection

  1. If you controller is connected over USB, disconnect it first.
  2. Open Bluetooth settings in the Gnome Control Center
  3. Ensure Bluetooth is enabled, and keep that window open
  4. Connect the controller via USB
  5. Accept the confirmation dialog that opens: Confirm Bluetooth Connection dialog
  6. Disconnect the USB cable

Note that this will dissociate the controller from your PlayStation (otherwise it would still turn it on when you press the PlayStation button). If you want to re-associate it, you will need to connect it via cable first, like you did with your PC.

Following connections

From now on, you just have to press the PlayStation button to connect it via Bluetooth to your PC.

Turning off the controller

There are 2 options to turn off the controller:

  1. Hold the PlayStation button for 10 seconds; or
  2. Go to the Bluetooth settings, select your device, and disconnect it with the toggle.
Didier L
  • 353
10

Sorry to be that guy but compiling from source worked for me and the PPA has been pretty quiet for a while now (not weird at all considering the GitHub hasn't been updated in 4 years and the "final" version was released around the same time), so don't hold your breath for a xenial package.

The excellent guide I linked gives you a few commands to download all prereqs and compile but I will summarize here:

sudo apt-get update &&
  sudo apt-get install git dialog build-essential pyqt4-dev-tools libusb-dev libjack-dev libbluetooth-dev python-dbus checkinstall -y &&
  git clone https://github.com/falkTX/qtsixa.git && 
  cd qtsixa &&
  make &&
  sudo checkinstall
muru
  • 207,228
HelaFaye
  • 101
3

For those still looking for the answer in Ubuntu 22.04, I've found the work-around. See my post on Stack Overflow or the original bug report:

https://stackoverflow.com/a/77769154/5022999 https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/2045931

  • Edit /etc/bluetooth/input.conf
  • Uncomment ClassicBondedOnly=true and change to ClassicBondedOnly=false
  • Restart bluetooth: systemctl restart bluetooth
PEBKAC
  • 31
0

On Ubuntu 15.10/16.04 and Linux Mint 18, you can still use the QtSixA PPA, but specifying "vivid" as the Ubuntu version (15.04), since that was the last officially supported version. To do so, execute the following:

sudo add-apt-repository "deb http://ppa.launchpad.net/falk-t-j/qtsixa/ubuntu vivid main"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 736E4F0B
sudo apt update
sudo apt install sixad

Note: as far as I can tell, the GUI based application is no longer useful, at least to detect and connect controllers through Bluetooth. Because of that, you need to use the command line-based applications, i.e. sixad and sixpair

Edit: Apparently and according to my tests, sixad automatically starts at the boot, but doesn't work at all when that happens, having to stop it an re-start it to make it to work. To prevent sixad from being started at the boot, you have to execute:

sudo systemctl disable sixad

and, when you're going to use it, execute:

sudo sixad -s

of course, all the above is because QTSixA is no longer supported. The PS3 and PS4 controllers are supposed to work natively in Linux, but I still prefer to use it instead of the native support. I haven't been able to connect my PS3 controllers natively, and when I use QTSixA, I can do other things like specify the Bluetooth MAC address to be paired with.

I think I will mail the developer to know if it's possible for him to resume the support. I believe that only applying small modifications, the project could work properly out-of-the-box. And, even without doing anything, the PPA could still work.

-2

PPA won't work on Ubuntu Xenial derivates but there is a solution. If you have Ubuntu 16.04 and would like to use qtsixa, you can use these commands to trick the PPA into thinking that you’re running 15.10:

sudo cp /etc/lsb-release /etc/lsb-release.backup
sudo gedit /etc/lsb-release

Change the following lines to the values below:

DISTRIB_ID=Ubuntu

DISTRIB_RELEASE=15.10

DISTRIB_CODENAME=wily

DISTRIB_DESCRIPTION="Trusty Tahr"

and save.

Now install the PPA for qtsixa. Then copy the original lsb-release file back to were it was.

sudo cp /etc/lsb-release.backup /etc/lsb-release

Now you can reboot.

sudo reboot

Useful for using Intel Graphics Installer for Linux™ too, tested in Linux Mint 18 thanks to this post.

Zanna
  • 72,312
yast166
  • 21