Archive:Set up PS3 BD Remote
This HOW-TO explains how to set up the remote control for the Sony PlayStation 3 to use with XBMC for Linux. You'll need a Bluetooth dongle and of course the remote control. All these information can be found here at the forum.
Note: Newer versions of bluez have been released which appear to have this patch already. I didn't need to patch 4.63 to get BD working on ubuntu 10.04
Note: Kitlaan now has patches up to Bluez-4.69, and the patch is required for 4.64 - 4.69
The latest versions of the patch are available at: http://kitlaan.twinaxis.com/projects/bluez-ps3remote/
sudo apt-get purge bluez sudo apt-get install libdbus-1-dev libglib2.0-dev python-dbus python-gobject cd ~ wget http://kitlaan.twinaxis.com/projects/bluez-ps3remote/bluez_ps3remote_4.91.diff wget http://www.kernel.org/pub/linux/bluetooth/bluez-4.91.tar.gz tar xvfz bluez-4.91.tar.gz cd bluez-4.91 patch -p1 < ../bluez_ps3remote_4.91.diff ./configure && make sudo checkinstall --fstrans=no --install=yes --pkgname=bluez --pkgversion "4.91-patched"
When starting bluetoothd, check /var/log/syslog to make sure the config files are read. If bluetoothd searches for them at /usr/etc, you'll have to create symlinks:
sudo ln -s /etc/bluetooth/input.conf /usr/etc/bluetooth/input.conf sudo ln -s /etc/bluetooth/audio.conf /usr/etc/bluetooth/audio.conf sudo ln -s /etc/bluetooth/serial.conf /usr/etc/bluetooth/serial.conf
Or, using kitlaan's PPA:
sudo apt-get purge bluez sudo add-apt-repository ppa:kitlaan/ppa sudo apt-get update sudo apt-get install bluez
1.2 Kernel module
Check if the uinput module is running:
lsmod | grep uinput
If that's not the case:
sudo modprobe uinput echo uinput >> /etc/modules
Please note that the pairing script requires that the dbus-python and pygobject python modules are installed. They are normally installed on a default 9.04 Jaunty. (If you need them added, apt-get install python-dbus and python-gobject.)
cd ~ wget http://kitlaan.twinaxis.com/projects/bluez-ps3remote/ps3pair.tar.gz tar xvfz ps3pair.tar.gz cd ~/ps3pair sudo python ps3_pair.py
Now press START+Enter on your PS3 remote for at least 7 seconds, then it should detect the remote. Then run
to verify that the remote is paired (and connected). If list-devices is not installed into /usr/share, check the bluez source tree, it should be in there. Also, running
cat /proc/bus/input/devices | grep emot
should show the remote. If it does not show up, you may not have the uinput module loaded.
Then customize the file "/etc/bluetooth/input.conf" for button mappings and timeout values (Example here). At this point, the remote should connect (and auto-disconnect after a timeout, if configured). The d-pad is probably the best way to test it within xbmc. If you have a terminal active, pressing the number buttons should type the number.
Note: - The pairing scripts are not required by some distro's - just install Blueman and set up your BD remote as an input service and trust the device - this way you dont explicitly need to pair the device - it simply becomes a keyboard extension. The input.conf below will take care of key mapping.
1.4 Example input.conf
A more advanced bluetooth input.conf is probably lurking in the depths of this thread, however here's an example to get you started. The first thing you'll need to change in this is your BD Remote's hardware address (i.e. change 00:1E:3D:B6:12:7E to your remote's address)
# input.conf - kitlaan custom # Configuration file for the input service # This section contains options which are not specific to any # particular interface [General] # Set idle timeout (in minutes) before the connection will # be disconnect (defaults to 0 for no timeout) #IdleTimeout=30 # This section contains options that are specific to a device [00:1E:3D:B6:12:7E] # # Set a custom idle timeout for this device. With kitlaan's patch, idle timeout is in *seconds* instead of minutes! IdleTimeout=90 # This section is the PS3 Remote keymap. It is loaded when bluez starts. # Use 'uinput.h' from bluez sources or '/usr/include/linux/input.h' for # a list of possible KEY_* values. # [PS3 Remote Map] # When the 'OverlayBuiltin' option is TRUE (the default), the keymap uses # the built-in keymap as a starting point. When FALSE, an empty keymap is # the starting point. #OverlayBuiltin = TRUE 0x16 = KEY_E # EJECT 0x64 = KEY_A # AUDIO 0x65 = KEY_Z # ANGLE 0x63 = KEY_T # SUBTITLE 0x0f = KEY_DELETE # CLEAR 0x28 = KEY_GRAVE # TIMER 0x00 = KEY_1 # NUM-1 0x01 = KEY_2 # NUM-2 0x02 = KEY_3 # NUM-3 0x03 = KEY_4 # NUM-4 0x04 = KEY_5 # NUM-5 0x05 = KEY_6 # NUM-6 0x06 = KEY_7 # NUM-7 0x07 = KEY_8 # NUM-8 0x08 = KEY_9 # NUM-9 0x09 = KEY_0 # NUM-0 0x81 = KEY_F7 # RED 0x82 = KEY_F8 # GREEN 0x80 = KEY_F9 # BLUE 0x83 = KEY_F10 # YELLOW 0x70 = KEY_I # DISPLAY 0x1a = KEY_S # TOP MENU 0x40 = KEY_M # POP UP/MENU 0x0e = KEY_ESC # RETURN 0x5c = KEY_C # TRIANGLE/OPTIONS 0x5d = KEY_BACKSPACE # CIRCLE/BACK 0x5f = KEY_TAB # SQUARE/VIEW 0x5e = KEY_SPACE # CROSS 0x54 = KEY_UP # UP 0x56 = KEY_DOWN # DOWN 0x57 = KEY_LEFT # LEFT 0x55 = KEY_RIGHT # RIGHT 0x0b = KEY_ENTER # ENTER 0x5a = KEY_F1 # L1 0x58 = KEY_F2 # L2 0x51 = KEY_F3 # L3 0x5b = KEY_F4 # R1 0x59 = KEY_F5 # R2 0x52 = KEY_F6 # R3 0x43 = KEY_HOMEPAGE # PS button 0x50 = KEY_INSERT # SELECT 0x53 = KEY_HOME # START 0x33 = KEY_R # SCAN BACK 0x32 = KEY_PLAY # PLAY 0x34 = KEY_F # SCAN FORWARD 0x30 = KEY_PAGEUP # PREVIOUS 0x38 = KEY_STOP # STOP 0x31 = KEY_PAGEDOWN # NEXT 0x60 = KEY_COMMA # SLOW/STEP BACK 0x39 = KEY_PAUSE # PAUSE 0x61 = KEY_DOT # SLOW/STEP FORWARD 0xff = KEY_MAX
After pairing, running
cat /proc/bus/input/devices | grep emot
doesn't list your device, and you've got uinput loaded
lsmod | grep uinput
- Install blueman
sudo apt-get install blueman
- Open System->Preferences->Bluetooth Manager.
- If your device is listed (it should be), right click it and select Input service.
- Go to a terminal and try pushing some buttons on the remote, it should work.