HowTo: Pair a Sony PlayStation3 DualShock controller with Ubuntu

The ubiquitous Sony PlayStation3 DualShock controller. This controller has been around for ages now and IMO it’s one of the nicest multi-button game controllers out there. One of its nicer features is that it has USB and Bluetooth connectivity.

Click for full size!
The Sony PlayStation Dual Shock 3 Controller

It’s already been proven that you can connect a PS3 controller to Ubuntu using a standard USB cable, which is fine, but it’d be kinda cool to use Bluetooth as well. The thing is that the PS3 controller doesn’t follow the complete Bluetooth specification with regards to pairing. The reason for this is deliberate – you don’t want people being able to steal control of your PS3 controllers or your PS3 remotely, so pairing is performed manually using the USB cable. Once paired that way, the cable can be disconnected and you can continue using Bluetooth instead.

So can we replicate this in Ubuntu? Can we pair a controller via USB and then continue to use it via Bluetooth? Thanks to the QTSixA project, we can!

Prerequisites:

  • One PlayStation3 DualShock controller or compatible equivalent
  • One normal USB charge cable
  • Any Bluetooth adapter on your desktop PC or in-built in your laptop

Procedure:

  1. First we need to add the QTSixA project’s PPA to your system. Open a terminal and type in the following and hit Enter:

    $ sudo add-apt-repository ppa:falk-t-j/qtsixa
  2. You will be prompted about adding the repository. Just hit Enter:

    You are about to add the following PPA to your system:
    Packages for QtSixA and sixad software

    To enable this repository in Karmic and Lucid:
    sudo add-apt-repository ppa:falk-t-j/qtsixa

    In Jaunty and Intrepid, add the line to the software sources:
    deb http://ppa.launchpad.net/falk-t-j/qtsixa/ubuntu UBUNTU_VERSION main

    More info: https://launchpad.net/~falk-t-j/+archive/qtsixa
    Press [ENTER] to continue or ctrl-c to cancel adding it
  3. Once the PPA has been added, have your system update its cache of available software from the PPA’s with:

    $ sudo apt-get update
  4. Now let’s install the QTSixA application:

    $ sudo apt-get install qtsixa
  5. Now the fun can really begin! Get your PS3 controller and connect it to your system with its USB charge cable. The four red LED’s on the back of the controller will begin to flash and if you issue an lsusb command you will see the controller listed:

    $ lsusb
    Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 004 Device 003: ID 0480:a006 Toshiba America Info. Systems, Inc.
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 012: ID 054c:0268 Sony Corp. Batoh Device / PlayStation 3 Controller
    Bus 001 Device 003: ID 046d:08d7 Logitech, Inc. QuickCam Communicate STX
    Bus 001 Device 004: ID 046d:c517 Logitech, Inc. LX710 Cordless Desktop Laser
    Bus 001 Device 005: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

  6. Now let’s pair the controller to your PC’s Bluetooth adapter:

    $ sudo sixpair
    Current Bluetooth master: 00:25:56:2e:7f:52
    Setting master bd_addr to 00:1b:dc:00:3c:f1

  7. We’re nearly there! Now we just need to activate the controller so we can start using it! At this point you can now disconnect the USB cable (you don’t have to, especially if you’re still charging it) and enter the following command:

    $ sixad --start
    sixad-bin[13374]: started
    sixad-bin[13374]: sixad started, press the PS button now

  8. When prompted, press the PS button on your controller to activate it and the terminal will show something similar to the following:

    sixad-sixaxis[13430]: started
    New Device: 00:1E:3D:AA:82:6C PLAYSTATION(R)3 Controller (Bluetooth)
    sixad-sixaxis[13430]: Connected 'PLAYSTATION(R)3 Controller (00:1E:3D:aa:82:6c)' [Battery 05]

  9. That’s it! Your PS3 controller is now connected! You can now start using it in games that support using it.

Questions:

  • Can you pair multiple controllers?
    Yes! Just repeat the pairing process for all new controllers. The appropriate red LED number will light up on the controller to indicate which one it is.
  • The terminal is nice, but is there a GUI application to manage the controllers as well?
    Yes! Just launch the QTSixA application from the Ubuntu Dash menu launcher.
  • I don’t want to use my controller on my PC anymore – how do I reconnect it to my PS3?
    Simply reconnect the controller to your PS3 via its USB charge cable and turn your PS3 on. This will immediately change its pairing to the PS3 and prevent it connecting to your PC anymore.
  • Can I have the controller paired with the PS3 and the PC at the same time?
    No. The controller only allows for one master.
    .
  • I notice there’s a number of extra applications in the QTSixA suite. What are they for?
    The package allows for connecting other PlayStation accessories such as the keyboard and remote as well as extended features for the controller itself. Refer to the documentation of the QTSixA project for more information.