Build and Install Packages
Install the bluez-compat and joystick packages.
$ sudo apt-get bluez-compat joystick
The hidd daemon in the bluez-compat package has been deprecated but it provides the only way to connect with the PS3 controller. It will not interfere with the current bluetooth service.
From this point you can take one of two roads.
- If you are on 32bit (i386) or 64bit (amd64) versions of Ubuntu I have precompiled all the binaries you will need. Simply download the corresponding tarball for your architecture and follow a couple simple steps to complete the setup.
- The other option is to manually patch and compile the binaries yourself. This is a bit more time consuming but not anymore difficult as I have documented the exact steps for this method as well. This option is necessary if you are on some other architecture (PowerPC, etc.) or if you experience any problems with the precompiled binaries I provided.
Option 1: Download Precompiled Binaries
You can test which architecture you are using by running uname.
$ uname -a
Linux xps 2.6.27-7-generic #1 SMP Tue Nov 4 19:33:06 UTC 2008 x86_64 GNU/Linux
Download the tarball of binaries which corresponds to your architecture.
bluez-compat_ps3_amd64.tgz
bluez-compat_ps3_i386.tgz
Untar the files.
$ tar xzvf bluez-compat_ps3_<arch>.tgz
bluez-compat_4.12-0ubuntu5_amd64.deb sixpair
Skip down to the Install the Updated Package section.
Option 2: Patch and Compile Binaries
Download the hidd daemon patch:
patch-hidd-3.19-pabr3
Install the dpkg-dev and fakeroot which will allow you to compile the blues-utils package.
$ sudo apt-get dpkg-dev fakeroot
Install the blues-utils package, apply the patch, and build the package.
$ sudo apt-get source bluez-utils $ sudo apt-get build-dep bluez-utils $ patch bluez-4.12/compat/hidd.c patch-hidd-3.19-pabr3 $ cd bluez-4.12 $ sudo dpkg-buildpackage -rfakeroot $ cd ../
This will build all the bluez related packages, the only one we are interested in is bluez-compat.
Download the sixpair.c source code:
sixpair.c
Install the libusb-dev and libusb-0.1-4 which will allow you to compile the sixpair utility.
$ sudo apt-get libusb-dev libusb-0.1-4
Build the sixpair utility.
$ gcc -o sixpair sixpair.c -lusb
Install the Updated Package
At this point you should have either downloaded or compiled the bluez-compat package.
Install the patched bluez-compat package.
$ sudo dpkg -i bluez-compat_4.12-0ubuntu5_<arch>.deb
Optional: if you will dist-upgrade your system, the process will overwrite your modified package with newer versions. You can either choose to redo the above steps every time a new version of bluez-utils is packaged, or “hold” the package. This should work with both apt and aptitude.
$ sudo echo bluez-compat hold | sudo dpkg --set-selections