Kodi Community Forum
[LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS (/showthread.php?tid=50717)



- repvik - 2011-05-06

After upgrading to Natty, a bunch of keybindings apparently disappeared.
(eg., the pause button no longer works in XBMC)
It also disconnects after a while, and no matter what I do I can't get it to reconnect. It shows up if I do "hcitool con" after pressing a button on the remote, but there's no response in XBMC.

I've rebuilt bluez with kitlaans experimental patch, but it doesn't appear to help.
When i reboot my HTPC, /sys/devices/virtual/input/input4 exists. But once the remote disconnects, input4 doesn't show up even if I reconnect the remote.


- kitlaan - 2011-05-11

I haven't gotten back to working with my patch for natty yet, but hope to find some time soon.

bluez 4.91 changed how uinput registration is done for the remote, and I'm not entirely sure it's doing the right things... I may just revert their handling to the old code. But more experimentation is needed.


- repvik - 2011-05-11

kitlaan Wrote:I haven't gotten back to working with my patch for natty yet, but hope to find some time soon.

bluez 4.91 changed how uinput registration is done for the remote, and I'm not entirely sure it's doing the right things... I may just revert their handling to the old code. But more experimentation is needed.
Cool. I got things working with the beta patch, except for the keymappings. It might be eating batteries for breakfeast though, I guess I'll find out in a few days.


- toX_ - 2011-05-11

ty kitlaan,

the community counts on ur patch Smile
it's like a "green"-patch for the ps3 remote!

d.g.toX_


- ruff - 2011-06-04

Finally I've moved to Natty. For those of you interested here is my ppa https://launchpad.net/~rufferson/+archive/bluez-ps3bt-remote
p.s. I recently moved to a new flat so my TV is still staying packed in the corner - i.e. no real life testing has been done so far, just adopting old changes to the new code. But anyway this ppa will have sooner or later proper code since i'll need it to manage my xbmc on a new OS
p.p.s. i got reports that it does work


- toX_ - 2011-06-04

ruff Wrote:Finally I've moved to Natty. For those of you interested here is my ppa https://launchpad.net/~rufferson/+archive/bluez-ps3bt-remote
p.s. I recently moved to a new flat so my TV is still staying packed in the corner - i.e. no real life testing has been done so far, just adopting old changes to the new code. But anyway this ppa will have sooner or later proper code since i'll need it to manage my xbmc on a new OS
p.p.s. i got reports that it does work

Hi, i can confirm that this version is working on natty Smile
ty for the good work

d.g.toX_


- jpeeters - 2011-06-05

ruff Wrote:Finally I've moved to Natty. For those of you interested here is my ppa https://launchpad.net/~rufferson/+archive/bluez-ps3bt-remote

I tried installing your package, but it unfortunately does not give me a working solution (see below for details about my setup). The whole thing works fine with Ubuntu's 11.04 stock bluez 4.91, but that version only gives me some buttons as we all know.

Code:
ii  bluetooth                             4.91-0ubuntu2ppa1                                  Bluetooth support
ii  bluez                                 4.91-0ubuntu2ppa1                                  Bluetooth tools and daemons
ii  bluez-alsa                            4.91-0ubuntu2ppa1                                  Bluetooth ALSA support
ii  bluez-cups                            4.91-0ubuntu2ppa1                                  Bluetooth printer driver for CUPS
ii  bluez-gstreamer                       4.91-0ubuntu2ppa1                                  Bluetooth GStreamer support
ii  libbluetooth-dev                      4.91-0ubuntu2ppa1                                  Development files for using the BlueZ Linux Bluetooth library
ii  libbluetooth3                         4.91-0ubuntu2ppa1                                  Library to use the BlueZ Linux Bluetooth stack

Code:
Jun  5 01:31:08 xbmc bluetoothd[2423]: Bluetooth deamon 4.91
Jun  5 01:31:08 xbmc bluetoothd[2424]: Starting SDP server
Jun  5 01:31:08 xbmc NetworkManager[518]: <warn> bluez error getting default adapter: Rejected send message, 1 matched rules; type="method_call", sender=":1.3" (uid=0 pid=518 comm="NetworkManager ") interface="org.bluez.Manager" member="DefaultAdapter" error name="(unset)" requested_reply=0 destination="org.bluez" (uid=0 pid=2423 comm="/usr/sbin/bluetoothd --udev "))
Jun  5 01:31:08 xbmc pulseaudio[1694]: bluetooth-util.c: Error from ListAdapters reply: org.freedesktop.DBus.Error.AccessDenied

Code:
xbmc@xbmc:~$ /usr/share/doc/bluez/examples/list-devices
Traceback (most recent call last):
  File "/usr/share/doc/bluez/examples/list-devices", line 7, in <module>
    manager = dbus.Interface(bus.get_object("org.bluez", "/"),
  File "/usr/lib/pymodules/python2.7/dbus/bus.py", line 244, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/pymodules/python2.7/dbus/proxies.py", line 241, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/pymodules/python2.7/dbus/bus.py", line 183, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/pymodules/python2.7/dbus/bus.py", line 281, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/pymodules/python2.7/dbus/connection.py", line 630, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.bluez was not provided by any .service files



- toX_ - 2011-06-05

what does ur input.conf look like

mine looks like this (with nearly all working buttons)

Code:
[General]

[00:19:C1:57:1D:8B]
IdleTimeout=30

[PS3 Remote Map]
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

u should first test ur remote in a texteditor if it works (it's acts like a keyboard)

d.g.toX_


- ruff - 2011-06-05

Aha, i see kitlaan finally implemented his idea to map keys explicitly in config file Smile Mine works differently, i'm still using old patch with hardcoded layout, config from my ppa looks like this (it is supplied with package):
Code:
ruff@ruff:~/bluez-src$ cat /etc/bluetooth/input.conf
# Configuration file for the input service

# This section contains options which are not specific to any
# particular interface
[General]

# Set idle timeout (in seconds) before the connection will
# be disconnect (defaults to 0 for no timeout)
IdleTimeout=25

##
# Section for options, specific to Sony PS3 BD Remote driver
[PS3 Remote]

# Set keymap to generic keycodes/scancodes, in order
# to be compatible with old XInput driver.
Compat=1
In compat mode key mapping conforms to the one from the config above though Smile Except display/menu/options buttons.


- toX_ - 2011-06-05

just realized that my old config doesn't work :/

so how to impliment all the keys? or do u plan to get in contact with kitlaan to build one "fitting for all" package

keep up the good work

d.g.toX_


- ruff - 2011-06-05

well, to be honest i don't need the ability to assign keys on remote, hardcoded layout is completely sufficient for me to manage xbmc - once you can read all keys from remote you can assign whichever functions you need in keymap.xml. As well as power-saving works great since i'm not using any other BT HID. But if kitlaan's code is based in mine and he needs any help with his package I can help with coding %)


- kitlaan - 2011-06-07

Ah, sorry guys. I've been busy with work (ah, project releases) for way too long. Now that it's GA'd, I'm going to get back to this on the weekend (hopefully). If I do my upgrade to natty, then I'll have to Smile

ruff, I'll take a look at your current code this week. I'm not sure how much mine has diverged in the last few years, but hopefully I'll figure out why the initial device detection is going badly.


- CSB! - 2011-06-07

My XBMC box is on 24/7, and I've periodically had the remote stop working, sometimes it'll work for over 24 hours, other times, it'll stop within an hour.

This error reflects the event in my syslog:
Code:
Jun  7 10:10:14 hostname bluetoothd[1904]: Hangup or error on ps3remote server socket

The easiest way to fix the problem seems to be power cycling the remote.

Any ideas on how to debug this?


- menno - 2011-06-07

Could this be made available for the apple tv2?


- ruff - 2011-06-08

CSB! Wrote:Any ideas on how to debug this?
Have you tried replacing batteries? Seems like rf channel dies and remote cannot pair back until explicitly turned on by powercycle