Kodi Community Forum

Full Version: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2015-09-16, 17:50)CrazyCoder Wrote: [ -> ]Unpair/remove it first, then repeat.
Tried that
(2015-06-29, 23:20)vaughan Wrote: [ -> ]After this the remote control may work, or it may be necessary to do the following:

Press START and ENTER simultaneously for about five seconds on the PS3 remote - 'PS3' light will start flashing
Then type:
Code:
sudo bluez-test-input connect <device ID>
(where you replace <device ID> with whatever unique ID was displayed when you ran 'sudo python ps3_pair.py')

After that, if you run
Code:
/usr/share/doc/bluez/examples/list-devices
it should show :
Code:
Connected = 1

Had to do this as an extra step to get my harmony ultimate to work, did you made this up?
(2015-09-16, 17:50)CrazyCoder Wrote: [ -> ]Unpair/remove it first, then repeat.

solution in my last post
Anyone know how to fix the not wake up after timeout thing?
I reinstalled from scratch, tried unpair/pair, nothing changes :/
Hi,
[quote='vaughan' pid='2095313' dateline='1441129354']
In case anyone is interested I have updated the MythTV wiki page on the Sony PS3 BD Remote at https://www.mythtv.org/wiki/Sony_PS3_BD_Remote , to incorporate some of the ideas discussed here plus some other experimenting.

Have followed the wiki but having a few problems.
When I run sudo bluetoothd -n -d the keystrokes are all recognised but when I open Kodi (15.2) only a few work
play,back,enter, up,down,left and right.
The bluetooth control in Ubuntu (15.04)recognises the PS3 but indicates that it is not paired.
When running the sudo bluez-test-input connect <device MAC address>,with the correct address ( I have double checked this with hcitool con and the bluetooth control in Ubuntu, I get error message org.bluez.Error.DoesNotExist.
Have removed the PS3 and started from scratch but with the same result.
The input.conf appears correct.
Am I missing something obvious, the start of the post indicates that it uses LIRC but I haven't as it seems you don't need it.
Regards
Geoff
I eventually caved and bought a Harmony to consolidate all my remotes. I couldn't justify a Harmony Elite so I got a used Harmony 900 instead. My PS3 BD remote remote works perfectly so I didn't want to get an MCE IR receiver and go through with all that hoopla and tweak the keymaps etc *again*, so I got a PS3 BT adapter instead.

I wasn't sure if it would work, but to cut to the chase: it did. Had to modify Bluez with the deviceid of the adapter (and also added the deviceid for newer Harmony remotes who can connect to PS3 directly with bluetooth, since I want to be able to upgrade my Harmony in the future and connect it via BT to my pc in "PS3 mode")
does anyone know how to geet this work on Bt in ubuntu 16?
I managed to get the PS3 Remote working in 16.04 and it was a lot simpler than it used to be.

At the time of writing this I have Bluez 5.37 installed.

In the command line run bluetoothctl

Code:
$ bluetoothctl

Now type scan on and then press the enter and ps button on the remote at the same time to put the remote into pairing mode

Code:
[bluetooth]# scan on

Then run devices and identify the mac address of your PS3 Remote

Code:
[bluetooth]# devices
Device XX:XX:XX:XX:XX XX-XX-XX-XX-XX-XX

Once you have the mac address of your PS3 remote (XX:XX:XX:XX:XX:XX in the above example)

Code:
[bluetooth]# trust  XX:XX:XX:XX:XX:XX

(If you get an error message, make sure that you put the mac address of the remote in CAPITALS)

Code:
[bluetooth]# connect XX:XX:XX:XX:XX:XX

Congratulations, your remote is now paired.

Code:
[bluetooth]# quit

to exit back to the main prompt.

You can now use evtest to make sure that your remote is recognised and working.

Some gotchas if you're upgrading from a previously working bluez4 setup.

1) /etc/bluetooth/input.conf doesn't seem to work anymore. The keys are just recognised directly by the system. This means that changing the keys needs to be done in keyboard.xml
2) the remote does not disconnect any more and batteries might run flat very quickly. (I haven't had the new setup long enough to tell)
3) Some keys higher than 255 are not recognised.

I'll post back if I figure out how to fix these things. I'll be starting from here: http://forum.kodi.tv/showthread.php?tid=...pid1783270

Good Luck.
(2016-11-05, 17:46)chunkymonkey Wrote: [ -> ]
Code:
[bluetooth]# connect XX:XX:XX:XX:XX:XX

Congratulations, your remote is now paired.

This seems to be a temporary pairing. When the remote loses power, it seems to lose the connection, and has to be put into pairing mode and connected again to work. Is that an abnormal experience?

Is the pairing code for the ps3 bt remote known?
Couldn't get bluez5.37 in 16.04 to work properly. (Same old story, missing buttons, no sleep etc). In the end I just built bluez 4.101 from source with the ps3 patch. Also included a patch for the ps3 controller, so it pairs like a real PS3. (Just insert/pull out usb cable, press home button, boom connected). Only thing is that it probably won't pair wirelessly with the Dualshock4, but that is possible to patch in later. (Bluez5 got DS4 support in version 5.14).

Then just apt-mark hold the various bluez packages. (If you build debs, then only the main executable is needed for PS remote/controller). It might or might not be kosher to use Bluez4 in 16.04, but at least for my needs (PS3 remote/joypad) it works fine.
I've finally managed to get PS3 BD remote working on Ubuntu 16.04 LTS without any patches/hacks - IdleTimeout works, custom key mappings work aswell. All you need is to install bluez 5.46 from 17.10 or 5.48 from 18.04. I myself used the 18.04 (Bionic) version 5.48.

Instructions:

1) In case of amd64, download http://mirrors.kernel.org/ubuntu/pool/ma..._amd64.deb and http://mirrors.kernel.org/ubuntu/pool/ma..._amd64.deb .
2) Install the debs:
Code:
dpkg -i libreadline7_7.0-3_amd64.deb bluez_5.48-0ubuntu3_amd64.deb
3) Modify the default /etc/bluetooth/input.conf - you only need 2 options there - IdleTimeout=1 (1 minute idle timeout) and UserspaceHID=false - both options are already there, just commented out and with different default values.
4) Restart bluetooth service:
Code:
systemctl restart bluetooth.service
5) Pair/connect your PS3 BD remote using GUI or console tools like bluetoothctl .
6) Kodi will recognize ~half of the remote keys - the rest needs to be mapped via udev. Create /etc/udev/hwdb.d/99-ps3-bd-remote.hwdb file with the following content:
Code:
evdev:input:b0005v054Cp0306*
 KEYBOARD_KEY_9000f=del         # KEY_CLEAR
 KEYBOARD_KEY_90028=a           # KEY_TIME              Audio delay control
 KEYBOARD_KEY_90064=f11         # KEY_AUDIO             keymaps/custom.xml:FullscreenVideo:AudioNextLanguage
 KEYBOARD_KEY_90063=f12         # KEY_SUBTITLE          keymaps/custom.xml:FullscreenVideo:NextSubtitle
 KEYBOARD_KEY_90065=z           # KEY_ANGLE             Zoom/aspect ratio
 KEYBOARD_KEY_90070=tab         # KEY_INFO              Fullscreen playback
 KEYBOARD_KEY_9001a=i           # KEY_MENU              Info
 KEYBOARD_KEY_90040=o           # KEY_CONTEXT_MENU      Codec info
 KEYBOARD_KEY_90081=s           # KEY_RED               Shutdown menu
 KEYBOARD_KEY_90082=f5          # KEY_GREEN             keymaps/custom.xml:FullscreenVideo:ActivateWindow(osdvideosettings)
 KEYBOARD_KEY_90083=f6          # KEY_YELLOW            keymaps/custom.xml:FullscreenVideo:ActivateWindow(osdaudiosettings)
 KEYBOARD_KEY_90080=f7          # KEY_BLUE              keymaps/custom.xml:FullscreenVideo:ActivateWindow(osdsubtitlesettings)
 KEYBOARD_KEY_9000d=c           # KEY_OPTION            Contextual menu
 KEYBOARD_KEY_90010=m           # KEY_SCREEN            Sidebar
 KEYBOARD_KEY_9000f=mute        # BTN_0                 Mute
 KEYBOARD_KEY_90001=volumedown  # KEY_SELECT            Volume down
 KEYBOARD_KEY_90004=volumeup    # BTN_START             Volume up
 KEYBOARD_KEY_9000b=f1          # BTN_TL                keymaps/custom.xml:Global:ActivateWindow(videos,movietitles,return)
 KEYBOARD_KEY_90009=f2          # BTN_TL2               keymaps/custom.xml:Global:ActivateWindow(videos,tvshowtitles,return)
 KEYBOARD_KEY_90002=f3          # BTN_THUMBL            keymaps/custom.xml:Global:ActivateWindow(videos,files,return)
 KEYBOARD_KEY_9000c=h           # BTN_TR                TV channels
 KEYBOARD_KEY_9000a=e           # BTN_TR2               TV EPG
 KEYBOARD_KEY_90003=f4          # BTN_THUMBR            keymaps/custom.xml:Global:ActivateWindow(settings)
 KEYBOARD_KEY_90030=previoussong # KEY_PREVIOUS
 KEYBOARD_KEY_90031=nextsong    # KEY_NEXT
 KEYBOARD_KEY_90033=rewind      # KEY_REWIND
 KEYBOARD_KEY_90034=fastforward # KEY_FORWARD
 KEYBOARD_KEY_90060=comma       # KEY_FRAMEBACK
 KEYBOARD_KEY_90061=dot         # KEY_FRAMEFORWARD
 KEYBOARD_KEY_90039=playpause   # KEY_PAUSE
 KEYBOARD_KEY_90038=stopcd      # KEY_STOP
WARNING: you may need to change the first line with the remote's bus, vendor and product ID. You can get this info with "evtest" command (also you can get all 900xx key codes - just press the remote keys while "evtest" is running). I think that provided values should work - but I'm not sure, maybe the bus ID will be different on your system or something. And of course, you can change the mappings if you don't like those.

7) Rebuild the hwdb.bin file:
Code:
systemd-hwdb update
8) Retrigger udev:
Code:
udevadm trigger
9) That's it - Kodi should now recognize all your custom key mappings. The remote should disconnect automatically after being idle for 1 minute and enter the sleep mode.
10) UPDATE - my ~/.kodi/userdata/keymaps/custom.xml :
Code:
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
  <Global>
    <keyboard>
      <f1>ActivateWindow(videos,movietitles,return)</f1>
      <f2>ActivateWindow(videos,tvshowtitles,return)</f2>
      <f3>ActivateWindow(videos,files,return)</f3>
      <f4>ActivateWindow(settings)</f4>
    </keyboard>
  </Global>
  <FullscreenVideo>
    <keyboard>
      <f5>ActivateWindow(osdvideosettings)</f5>
      <f6>ActivateWindow(osdaudiosettings)</f6>
      <f7>ActivateWindow(osdsubtitlesettings)</f7>
      <f11>AudioNextLanguage</f11>
      <f12>NextSubtitle</f12>
    </keyboard>
  </FullscreenVideo>
</keymap>
Thanks @kornaz.
Does the remote eats first button press when returning from the sleep?
How much time does it take to wake up the remote?
Hey. The remote ignores the first button press when returning from sleep. It takes about ~1-2s for the remote to wake up (closer to 1s I'd say).
Excellent...was gonna go with 18.04 (skipping 16.04 altogether) and use the patched bluez from 14.04. Now I don't have toSmile
It took the Bluez team 11 years to properly implement PS3 era supportSmile
Did anyone test the new BlueZ with the Logitech Harmony?