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)



- logistiker - 2009-09-07

Here's what it says when starting:
/usr/sbin/bluetoothd -nd

Code:
bluetoothd[20213]: Bluetooth daemon 4.50
bluetoothd[20213]: Enabling debug information
bluetoothd[20213]: parsing main.conf
bluetoothd[20213]: discovto=0
bluetoothd[20213]: pairto=0
bluetoothd[20213]: pageto=8192
bluetoothd[20213]: name=%h-%d
bluetoothd[20213]: class=0x000100
bluetoothd[20213]: discov_interval=0
bluetoothd[20213]: Key file does not have key 'DeviceID'
bluetoothd[20213]: Starting SDP server
bluetoothd[20213]: Loading builtin plugins
bluetoothd[20213]: Loading audio plugin
bluetoothd[20213]: Loading input plugin
bluetoothd[20213]: Loading serial plugin
bluetoothd[20213]: Loading network plugin
bluetoothd[20213]: Loading service plugin
bluetoothd[20213]: Loading hciops plugin
bluetoothd[20213]: Loading hal plugin
bluetoothd[20213]: Loading storage plugin
bluetoothd[20213]: Loading plugins /usr/lib/bluetooth/plugins
bluetoothd[20213]: Loading netlink plugin
bluetoothd[20213]: register_interface: path /org/bluez/20213/any
bluetoothd[20213]: Registered interface org.bluez.Service on path /org/bluez/20213/any
bluetoothd[20213]: Starting experimental netlink support
bluetoothd[20213]: Failed to find Bluetooth netlink family
bluetoothd[20213]: Failed to init netlink plugin
bluetoothd[20213]: /etc/bluetooth/network.conf: Key file does not have key 'Disable'
bluetoothd[20213]: /etc/bluetooth/network.conf: Key file does not have key 'DisableSecurity'
bluetoothd[20213]: /etc/bluetooth/network.conf: Key file does not have key 'Interface'
bluetoothd[20213]: /etc/bluetooth/network.conf: Key file does not have key 'Interface'
bluetoothd[20213]: /etc/bluetooth/network.conf: Key file does not have key 'Interface'
bluetoothd[20213]: Config options: InterfacePrefix=bnep%d, PANU_Script=(null), GN_Script=(null), NAP_Script=(null), GN_Interface=pan0, NAP_Interface=pan1, Security=true
bluetoothd[20213]: Can't create GN bridge
bluetoothd[20213]: Unix socket created: 9
bluetoothd[20213]: audio.conf: Key file does not have key 'AutoConnect'
bluetoothd[20213]: audio.conf: Key file does not have key 'MaxConnected'
bluetoothd[20213]: Telephony plugin initialized
bluetoothd[20213]: HFP AG features: "Ability to reject a call" "Enhanced call status" "Extended Error Result Codes"
bluetoothd[20213]: HCI dev 0 registered
bluetoothd[20213]: child 20216 forked
bluetoothd[20213]: btd_adapter_ref(0xb8018000): ref=1
bluetoothd[20213]: HCI dev 0 up
bluetoothd[20213]: Starting security manager 0
bluetoothd[20213]: Changing Major/Minor class to 0x000104
bluetoothd[20213]: Stopping Inquiry at adapter startup
bluetoothd[20213]: register_interface: path /org/bluez/20213/hci0
bluetoothd[20213]: Registered interface org.bluez.Service on path /org/bluez/20213/hci0
bluetoothd[20213]: network_server_probe: path /org/bluez/20213/hci0
bluetoothd[20213]: btd_adapter_ref(0xb8018000): ref=2
bluetoothd[20213]: Adding record with handle 0x10000
bluetoothd[20213]: Record pattern UUID 0000000f-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00001115-0000-1000-8000-00805f9
bluetoothd[20213]: register_server_record: got record id 0x10000
bluetoothd[20213]: Registered interface org.bluez.NetworkPeer on path /org/bluez/20213/hci0
bluetoothd[20213]: network_server_probe: path /org/bluez/20213/hci0
bluetoothd[20213]: Adding record with handle 0x10001
bluetoothd[20213]: Record pattern UUID 0000000f-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00001117-0000-1000-8000-00805f9
bluetoothd[20213]: register_server_record: got record id 0x10001
bluetoothd[20213]: Registered interface org.bluez.NetworkHub on path /org/bluez/20213/hci0
bluetoothd[20213]: network_server_probe: path /org/bluez/20213/hci0
bluetoothd[20213]: Adding record with handle 0x10002
bluetoothd[20213]: Record pattern UUID 0000000f-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00001116-0000-1000-8000-00805f9
bluetoothd[20213]: register_server_record: got record id 0x10002
bluetoothd[20213]: Registered interface org.bluez.NetworkRouter on path /org/bluez/20213/hci0
bluetoothd[20213]: proxy_probe: path /org/bluez/20213/hci0
bluetoothd[20213]: btd_adapter_ref(0xb8018000): ref=3
bluetoothd[20213]: Registered interface org.bluez.SerialProxyManager on path /org/bluez/20213/hci0
bluetoothd[20213]: Parsing /etc/bluetooth/serial.conf failed: No such file or directory
bluetoothd[20213]: btd_adapter_ref(0xb8018000): ref=4
bluetoothd[20213]: headset_server_probe: path /org/bluez/20213/hci0
bluetoothd[20213]: btd_adapter_ref(0xb8018000): ref=5
bluetoothd[20213]: audio_adapter_ref(0xb801a858): ref=1
bluetoothd[20213]: audio.conf: Key file does not have key 'Master'
bluetoothd[20213]: Adding record with handle 0x10003
bluetoothd[20213]: Record pattern UUID 00000003-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00001108-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00001112-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00001203-0000-1000-8000-00805f9
bluetoothd[20213]: audio.conf: Key file does not have key 'SCORouting'
bluetoothd[20213]: Adding record with handle 0x10004
bluetoothd[20213]: Record pattern UUID 00000003-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 0000111e-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 0000111f-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00001203-0000-1000-8000-00805f9
bluetoothd[20213]: a2dp_server_probe: path /org/bluez/20213/hci0
bluetoothd[20213]: audio_adapter_ref(0xb801a858): ref=2
bluetoothd[20213]: audio.conf: Key file does not have key 'Enable'
bluetoothd[20213]: audio.conf: Key file does not have key 'Disable'
bluetoothd[20213]: audio.conf: Key file does not have group 'A2DP'
bluetoothd[20213]: audio.conf: Key file does not have group 'A2DP'
bluetoothd[20213]: audio.conf: Key file does not have group 'A2DP'
bluetoothd[20213]: audio.conf: Key file does not have group 'A2DP'
bluetoothd[20213]: audio.conf: Key file does not have key 'Master'
bluetoothd[20213]: SEP 0xb801b5c0 registered: type:0 codec:0 seid:1
bluetoothd[20213]: Adding record with handle 0x10005
bluetoothd[20213]: Record pattern UUID 00000019-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 0000110a-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 0000110d-0000-1000-8000-00805f9
bluetoothd[20213]: avrcp_server_probe: path /org/bluez/20213/hci0
bluetoothd[20213]: audio_adapter_ref(0xb801a858): ref=3
bluetoothd[20213]: audio.conf: Key file does not have key 'Master'
bluetoothd[20213]: Adding record with handle 0x10006
bluetoothd[20213]: Record pattern UUID 00000017-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 0000110c-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 0000110e-0000-1000-8000-00805f9
bluetoothd[20213]: Adding record with handle 0x10007
bluetoothd[20213]: Record pattern UUID 00000017-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[20213]: Record pattern UUID 0000110e-0000-1000-8000-00805f9
bluetoothd[20213]: Adapter /org/bluez/20213/hci0 has been enabled
bluetoothd[20213]: Failed to open RFKILL control device
bluetoothd[20213]: Entering main loop
bluetoothd[20213]: Inquiry Failed with status 0x0c
bluetoothd[20213]: child 20216 exited
bluetoothd[20213]: Computer is classified as desktop
bluetoothd[20213]: Setting 0x000104 for major/minor device class

Here's what bluetoothd says on a keypress (play button) from the remote:

Code:
bluetoothd[20213]: adapter_get_device(00:24:33:9D:F5:18)
bluetoothd[20213]: adapter_create_device(00:24:33:9D:F5:18)
bluetoothd[20213]: Creating device /org/bluez/20213/hci0/dev_00_24_33_9D_F5_18
bluetoothd[20213]: btd_device_ref(0xb801c5f8): ref=1
bluetoothd[20213]: Incoming connection on PSM 17
bluetoothd[20213]: Removing temporary device /org/bluez/20213/hci0/dev_00_24_33_9D_F5_18
bluetoothd[20213]: Removing device /org/bluez/20213/hci0/dev_00_24_33_9D_F5_18
bluetoothd[20213]: btd_device_unref(0xb801c5f8): ref=0
bluetoothd[20213]: device_free(0xb801c5f8)



- logistiker - 2009-09-07

Ok, I set up a pincodes file in the /var/lib/bluetooth/macaddr/pincodes file and set it as 0000. It seems the keypress event has calmed down a little in hcidump:

hcidump (pressed play):
Code:
> ACL data: handle 42 flags 0x02 dlen 17
    L2CAP(d): cid 0x0041 len 13 [psm 19]
      HIDP: Data: Input report
> ACL data: handle 42 flags 0x02 dlen 17
    L2CAP(d): cid 0x0041 len 13 [psm 19]
      HIDP: Data: Input report

bluetooth -nd:

Code:
bluetoothd -nd
bluetoothd[3545]: Bluetooth daemon 4.50
bluetoothd[3545]: Enabling debug information
bluetoothd[3545]: parsing main.conf
bluetoothd[3545]: discovto=0
bluetoothd[3545]: pairto=0
bluetoothd[3545]: pageto=8192
bluetoothd[3545]: name=%h-%d
bluetoothd[3545]: class=0x000100
bluetoothd[3545]: discov_interval=0
bluetoothd[3545]: Key file does not have key 'DeviceID'
bluetoothd[3545]: Starting SDP server
bluetoothd[3545]: Loading builtin plugins
bluetoothd[3545]: Loading audio plugin
bluetoothd[3545]: Loading input plugin
bluetoothd[3545]: Loading serial plugin
bluetoothd[3545]: Loading network plugin
bluetoothd[3545]: Loading service plugin
bluetoothd[3545]: Loading hciops plugin
bluetoothd[3545]: Loading hal plugin
bluetoothd[3545]: Loading storage plugin
bluetoothd[3545]: Loading plugins /usr/lib/bluetooth/plugins
bluetoothd[3545]: Loading netlink plugin
bluetoothd[3545]: register_interface: path /org/bluez/3545/any
bluetoothd[3545]: Registered interface org.bluez.Service on path /org/bluez/3545/any
bluetoothd[3545]: Starting experimental netlink support
bluetoothd[3545]: Failed to find Bluetooth netlink family
bluetoothd[3545]: Failed to init netlink plugin
bluetoothd[3545]: /etc/bluetooth/network.conf: Key file does not have key 'Disable'
bluetoothd[3545]: /etc/bluetooth/network.conf: Key file does not have key 'DisableSecurity'
bluetoothd[3545]: /etc/bluetooth/network.conf: Key file does not have key 'Interface'
bluetoothd[3545]: /etc/bluetooth/network.conf: Key file does not have key 'Interface'
bluetoothd[3545]: /etc/bluetooth/network.conf: Key file does not have key 'Interface'
bluetoothd[3545]: Config options: InterfacePrefix=bnep%d, PANU_Script=(null), GN_Script=(null), NAP_Script=(null), GN_Interface=pan0, NAP_Interface=pan1, Security=true
bluetoothd[3545]: Can't create GN bridge
bluetoothd[3545]: Unix socket created: 9
bluetoothd[3545]: audio.conf: Key file does not have key 'AutoConnect'
bluetoothd[3545]: audio.conf: Key file does not have key 'MaxConnected'
bluetoothd[3545]: Telephony plugin initialized
bluetoothd[3545]: HFP AG features: "Ability to reject a call" "Enhanced call status" "Extended Error Result Codes"
bluetoothd[3545]: HCI dev 0 registered
bluetoothd[3545]: child 3548 forked
bluetoothd[3545]: btd_adapter_ref(0xb80bb000): ref=1
bluetoothd[3545]: Failed to open RFKILL control device
bluetoothd[3545]: Entering main loop
bluetoothd[3545]: child 3548 exited
bluetoothd[3545]: HCI dev 0 up
bluetoothd[3545]: Starting security manager 0
bluetoothd[3545]: Changing Major/Minor class to 0x000104
bluetoothd[3545]: register_interface: path /org/bluez/3545/hci0
bluetoothd[3545]: Registered interface org.bluez.Service on path /org/bluez/3545/hci0
bluetoothd[3545]: network_server_probe: path /org/bluez/3545/hci0
bluetoothd[3545]: btd_adapter_ref(0xb80bb000): ref=2
bluetoothd[3545]: Adding record with handle 0x10000
bluetoothd[3545]: Record pattern UUID 0000000f-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00001115-0000-1000-8000-00805f9
bluetoothd[3545]: register_server_record: got record id 0x10000
bluetoothd[3545]: Registered interface org.bluez.NetworkPeer on path /org/bluez/3545/hci0
bluetoothd[3545]: network_server_probe: path /org/bluez/3545/hci0
bluetoothd[3545]: Adding record with handle 0x10001
bluetoothd[3545]: Record pattern UUID 0000000f-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00001117-0000-1000-8000-00805f9
bluetoothd[3545]: register_server_record: got record id 0x10001
bluetoothd[3545]: Registered interface org.bluez.NetworkHub on path /org/bluez/3545/hci0
bluetoothd[3545]: network_server_probe: path /org/bluez/3545/hci0
bluetoothd[3545]: Adding record with handle 0x10002
bluetoothd[3545]: Record pattern UUID 0000000f-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00001116-0000-1000-8000-00805f9
bluetoothd[3545]: register_server_record: got record id 0x10002
bluetoothd[3545]: Registered interface org.bluez.NetworkRouter on path /org/bluez/3545/hci0
bluetoothd[3545]: proxy_probe: path /org/bluez/3545/hci0
bluetoothd[3545]: btd_adapter_ref(0xb80bb000): ref=3
bluetoothd[3545]: Registered interface org.bluez.SerialProxyManager on path /org/bluez/3545/hci0
bluetoothd[3545]: Parsing /etc/bluetooth/serial.conf failed: No such file or directory
bluetoothd[3545]: btd_adapter_ref(0xb80bb000): ref=4
bluetoothd[3545]: headset_server_probe: path /org/bluez/3545/hci0
bluetoothd[3545]: btd_adapter_ref(0xb80bb000): ref=5
bluetoothd[3545]: audio_adapter_ref(0xb80bd850): ref=1
bluetoothd[3545]: audio.conf: Key file does not have key 'Master'
bluetoothd[3545]: Adding record with handle 0x10003
bluetoothd[3545]: Record pattern UUID 00000003-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00001108-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00001112-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00001203-0000-1000-8000-00805f9
bluetoothd[3545]: audio.conf: Key file does not have key 'SCORouting'
bluetoothd[3545]: Adding record with handle 0x10004
bluetoothd[3545]: Record pattern UUID 00000003-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 0000111e-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 0000111f-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00001203-0000-1000-8000-00805f9
bluetoothd[3545]: a2dp_server_probe: path /org/bluez/3545/hci0
bluetoothd[3545]: audio_adapter_ref(0xb80bd850): ref=2
bluetoothd[3545]: audio.conf: Key file does not have key 'Enable'
bluetoothd[3545]: audio.conf: Key file does not have key 'Disable'
bluetoothd[3545]: audio.conf: Key file does not have group 'A2DP'
bluetoothd[3545]: audio.conf: Key file does not have group 'A2DP'
bluetoothd[3545]: audio.conf: Key file does not have group 'A2DP'
bluetoothd[3545]: audio.conf: Key file does not have group 'A2DP'
bluetoothd[3545]: audio.conf: Key file does not have key 'Master'
bluetoothd[3545]: SEP 0xb80be5c8 registered: type:0 codec:0 seid:1
bluetoothd[3545]: Adding record with handle 0x10005
bluetoothd[3545]: Record pattern UUID 00000019-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 0000110a-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 0000110d-0000-1000-8000-00805f9
bluetoothd[3545]: avrcp_server_probe: path /org/bluez/3545/hci0
bluetoothd[3545]: audio_adapter_ref(0xb80bd850): ref=3
bluetoothd[3545]: audio.conf: Key file does not have key 'Master'
bluetoothd[3545]: Adding record with handle 0x10006
bluetoothd[3545]: Record pattern UUID 00000017-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 0000110c-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 0000110e-0000-1000-8000-00805f9
bluetoothd[3545]: Adding record with handle 0x10007
bluetoothd[3545]: Record pattern UUID 00000017-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[3545]: Record pattern UUID 0000110e-0000-1000-8000-00805f9
bluetoothd[3545]: Creating device /org/bluez/3545/hci0/dev_00_24_33_9D_F5_18
bluetoothd[3545]: btd_device_ref(0xb80bf668): ref=1
bluetoothd[3545]: Probe drivers for /org/bluez/3545/hci0/dev_00_24_33_9D_F5_18
bluetoothd[3545]: hid_device_probe: path /org/bluez/3545/hci0/dev_00_24_33_9D_F5_18
bluetoothd[3545]: btd_device_ref(0xb80bf668): ref=2
bluetoothd[3545]: Registered interface org.bluez.Input on path /org/bluez/3545/hci0/dev_00_24_33_9D_F5_18
bluetoothd[3545]: Adapter /org/bluez/3545/hci0 has been enabled
bluetoothd[3545]: Computer is classified as desktop
bluetoothd[3545]: Setting 0x000104 for major/minor device class
bluetoothd[3545]: adapter_get_device(00:24:33:9D:F5:18)
bluetoothd[3545]: Incoming connection on PSM 17
bluetoothd[3545]: Incoming connection on PSM 19
bluetoothd[3545]: Error opening uinput device file
bluetoothd[3545]: Error setting up uinput

I'd like to note that adding the pincodes file still does not make it show in "cat /proc/bus/input/devices | grep Name" but now at least it complains about not being able to set up uinput which it didn't before.


- ruff - 2009-09-07

try
sudo modprobe uinput
and then pair the remote


- flxfxp - 2009-09-07

Sorry, but I'm getting kind of lost. I've gotten my Asrock ION 330 today and successfully installed XBMC on it with VDPAU support on Ubuntu minimal. I would like to use my bluetooth dongle with my ps3 remote but i'm getting lost in between the various guides such as http://www.strengholt-online.nl/playstation-remote-pairen-met-xbmc/221/ (luckily im dutch).
I found it using "hcitool scan" and paired it using hidd. However I'm at a loss at what the next best procedure is.

Just to put it straightforward:
What is the BEST/EASIEST method to install/pair the ps3 remote via cli (commandline interface) and use with xbmc?
Will it remain properly connected with no batteryloss?

Your help is much appreciated!

Dennis


BDremote installation instructions - logistiker - 2009-09-07

Requirements:

1. kernel config:

Networking Support -> Bluetooth subsystem support -> * everything in here and bluetooth device drivers unless you know exactly which modules you need.

Device Drivers -> Input Device Support -> Misc Devices -> * User Level driver support. (you can compile as a module but you'll need to modprobe uinput before you configure the bluetooth connection with the remote)

Also make sure you have USB support enabled if you have a usb bluetooth dongle (EHCI, OHCI and UHCI)

2. bluez-4.50 (4.51 or 4.52 may work but I haven't gotten them to compile properly)
--You'll need to patch bluez with ruff's patches for device.c, device.h, fakehid.c and fakehid.h in this forum on pages 5 and 6

3. blueman 1.10

4. After you have all those installed (remember to reboot if you've built a new kernel), follow these instructions:

1. Plug in bluetooth usb dongle (I don't have anything else to test with)
2. Type this in the console: hciconfig hci0 up piscan
3. Type this again: hciconfig
--You should see PSCAN and ISCAN in hci0
4. Right click on the blueman icon and select setup new device.
5. Press Forward
6. Put the BD Remote in discovery mode by pressing and hold both start & enter buttons. The mac address of the bdremote should appear and then BD Remote text in the window. Also if you see an authorization dialog box open, press the always accept button.
7. Select BD Remote that appeared in the first window and press forward.
8. Select "Don't Pair" and press forward.
9. Select "Input Service" under "Connect to:"
--You should now see Device Added and connected successfully
10. Close that window and right click on the blueman icon again and select devices to open the devices window.
11. Select the bdremote device and press the trust button.
12. Everything will work now except it won't come up on reboot if the dongle is already plugged in. You'll need to add this to your local start (I use gentoo so that would be /etc/conf.d/local.start): hciconfig hci0 up pscan
13. Now you can use xev or some program to test the remote. You should only have to press some buttons a few times before it initializes and then button presses after that will be instant.


Also note that you will not need blueman anymore after you have the bdremote configured. You don't have to run the blueman-applet with the remote and you could uninstall it because everything that the remote needs is in the /var/lib/bluetooth/macaddr directory. It might also be wise to back up that directory so you don't have to configure it again in case you lose it.

In addition, with bluez-4.50 the /etc/init.d/bluetooth daemon doesn't exist anymore. dbus initializes the bluetoothd daemon. Also, no configuration is necessary in /etc/bluetooth.


- logistiker - 2009-09-08

>What is the BEST/EASIEST method to install/pair the ps3 remote via cli >(commandline interface) and use with xbmc?

After messing around with it for days, I'm utterly convinced that it's currently impossible to use the command line tools to configure the BD Remote. You'll just have to install blueman and follow my instructions in the previous post.


- ruff - 2009-09-08

logistiker Wrote:You'll just have to install blueman and follow my instructions in the previous post.

I don't think it it necessary to make the trick with piscan, mine was already in pscan after inserting dongle, and it was sufficient to pair the remote, though...
thanks anyway for summing everything together.
But I'm afraid the patch submitted to bluez devs is still ignored, since I don't see it in current git and no comments from devs are posted about it yet.


- logistiker - 2009-09-08

ruff Wrote:I don't think it it necessary to make the trick with piscan, mine was already in pscan after inserting dongle, and it was sufficient to pair the remote, though...
thanks anyway for summing everything together.
But I'm afraid the patch submitted to bluez devs is still ignored, since I don't see it in current git and no comments from devs are posted about it yet.

After lots of testing, I found that pscan makes blueman kind of flakey. Sometimes it works but it fails in a lot of places during set up. When I set it as piscan, it worked every time (tested 4 times in a row). Note that after the remote is configured, it can operate fine in just pscan which is the mode it puts it in every time you insert the bluetooth dongle.


- logistiker - 2009-09-08

ruff Wrote:But I'm afraid the patch submitted to bluez devs is still ignored, since I don't see it in current git and no comments from devs are posted about it yet.

Which patches are being ignored? I remember you said they accepted the power saving patch. Which files does the power saving patch affect (device.c and device.h)?

I don't see why they should ignore the uinput patch to make the remote like a keyboard. I think it's better to have something right now than to wait for xinput2 because who knows when that will be ready?


- logistiker - 2009-09-08

Ruff: I modded your patch. You had the next and previous buttons reversed (pageup and pagedown). I also changed playpause back to pause. The reason for this is so that there aren't two buttons detected as XF86AudioPlay.

Code:
diff -ur bluez-4.47/input/fakehid.c bluez-4.47-my/input/fakehid.c
--- bluez-4.47/input/fakehid.c    2009-04-23 03:40:04.000000000 +0200
+++ bluez-4.47-my/input/fakehid.c    2009-08-23 23:31:01.000000000 +0200
@@ -31,11 +31,13 @@
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
+#include <sys/stat.h>

#include <bluetooth/bluetooth.h>
#include <bluetooth/l2cap.h>
#include <bluetooth/hidp.h>
#include <bluetooth/sdp.h>
+#include <bluetooth/hci.h>

#include <glib.h>
#include <dbus/dbus.h>
@@ -94,11 +96,11 @@

static unsigned int ps3remote_keymap[] = {
    [0x16] = KEY_EJECTCD,
-    [0x64] = KEY_AUDIO,
-    [0x65] = KEY_ANGLE,
-    [0x63] = KEY_SUBTITLE,
-    [0x0f] = KEY_CLEAR,
-    [0x28] = KEY_TIME,
+    [0x64] = KEY_A,            /* audio */
+    [0x65] = KEY_Z,            /* angle */
+    [0x63] = KEY_T,            /* subtitle */
+    [0x0f] = KEY_DELETE,        /* clear */
+    [0x28] = KEY_END,        /* timer */
    [0x00] = KEY_1,
    [0x01] = KEY_2,
    [0x02] = KEY_3,
@@ -109,41 +111,41 @@
    [0x07] = KEY_8,
    [0x08] = KEY_9,
    [0x09] = KEY_0,
-    [0x81] = KEY_RED,
-    [0x82] = KEY_GREEN,
-    [0x80] = KEY_BLUE,
-    [0x83] = KEY_YELLOW,
-    [0x70] = KEY_INFO,        /* display */
+    [0x81] = KEY_F7,        /* red */
+    [0x82] = KEY_F8,        /* green */
+    [0x83] = KEY_F9,        /* yellow */
+    [0x80] = KEY_F10,        /* blue */
+    [0x70] = KEY_D,            /* display */
    [0x1a] = KEY_MENU,        /* top menu */
-    [0x40] = KEY_CONTEXT_MENU,    /* pop up/menu */
+    [0x40] = KEY_F11,        /* pop up/menu */
    [0x0e] = KEY_ESC,        /* return */
-    [0x5c] = KEY_OPTION,        /* options/triangle */
+    [0x5c] = KEY_F12,        /* options/triangle */
    [0x5d] = KEY_BACK,        /* back/circle */
-    [0x5f] = KEY_SCREEN,        /* view/square */
-    [0x5e] = BTN_0,            /* cross */
+    [0x5f] = KEY_V,            /* view/square */
+    [0x5e] = KEY_X,            /* cross */
    [0x54] = KEY_UP,
    [0x56] = KEY_DOWN,
    [0x57] = KEY_LEFT,
    [0x55] = KEY_RIGHT,
    [0x0b] = KEY_ENTER,
-    [0x5a] = BTN_TL,        /* L1 */
-    [0x58] = BTN_TL2,        /* L2 */
-    [0x51] = BTN_THUMBL,        /* L3 */
-    [0x5b] = BTN_TR,        /* R1 */
-    [0x59] = BTN_TR2,        /* R2 */
-    [0x52] = BTN_THUMBR,        /* R3 */
+    [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_SELECT,
-    [0x53] = BTN_START,
-    [0x33] = KEY_REWIND,        /* scan back */
+    [0x50] = KEY_INSERT,        /* select */
+    [0x53] = KEY_HOME,        /* start */
+    [0x33] = KEY_R,            /* scan back */
    [0x32] = KEY_PLAY,
-    [0x34] = KEY_FORWARD,        /* scan forward */
-    [0x30] = KEY_PREVIOUS,
-    [0x38] = KEY_STOP,
-    [0x31] = KEY_NEXT,
-    [0x60] = KEY_FRAMEBACK,        /* slow/step back */
-    [0x39] = KEY_PAUSE,
-    [0x61] = KEY_FRAMEFORWARD,    /* slow/step forward */
+    [0x34] = KEY_F,            /* scan forward */
+    [0x30] = KEY_PAGEUP,        /* next */
+    [0x38] = KEY_STOP,        /* stop */
+    [0x31] = KEY_PAGEDOWN,        /* previous */
+    [0x60] = KEY_COMMA,        /* slow/step back */
+    [0x39] = KEY_PAUSE,        /* pause */
+    [0x61] = KEY_DOT,        /* slow/step forward */
    [0xff] = KEY_MAX,
};

@@ -167,7 +169,7 @@
    for (i = 0; i < 24; i++) {
        if ((lastmask & (1 << i)) == (mask & (1 << i)))
            continue;
-        if (ps3remote_bits[i] == 0)
+    if (ps3remote_bits[i] == 0)
            goto error;
        retval = ps3remote_keymap[ps3remote_bits[i]];
        if (mask & (1 << i))
@@ -208,18 +210,67 @@
                        lastmask & 0xff, lastkey);
    return -1;
}
+static gboolean ps3remote_sendkey(int uinput, unsigned int key,
+                  unsigned int value)
+{
+    struct uinput_event event;
+    memset(&event, 0, sizeof(event));
+    gettimeofday(&event.time, NULL);
+    event.type = EV_KEY;
+    event.code = key;
+    event.value = value;
+    if (write(uinput, &event, sizeof(event)) != sizeof(event)) {
+        error("Error writing to uinput device");
+        return FALSE;
+    }

+    memset(&event, 0, sizeof(event));
+    gettimeofday(&event.time, NULL);
+    event.type = EV_SYN;
+    event.code = SYN_REPORT;
+    if (write(uinput, &event, sizeof(event)) != sizeof(event)) {
+        error("Error writing to uinput device");
+        return FALSE;
+    }
+    return TRUE;
+}
+static gboolean ps3remote_out(GIOChannel *chan, GIOCondition cond,
+                                gpointer data)
+{
+    struct fake_input *fake = data;
+    const struct input_device *idev = ((struct fake_hid *)fake->priv)->idev;
+    gulong ms;
+    uint16_t to = (((struct fake_hid *)fake->priv)->timeout < 5) ?
+                300 : ((struct fake_hid *)fake->priv)->timeout;
+
+    if(g_timer_elapsed(((struct fake_hid *)fake->priv)->timer,&ms) > to ) {
+        DBG("idle timeout, disconnecting BT channel");
+        device_request_disconnect(idev->device, NULL);
+        return FALSE;
+    } else
+        usleep(1000);
+    return TRUE;
+}
static gboolean ps3remote_event(GIOChannel *chan, GIOCondition cond,
                gpointer data)
{
+    static unsigned int lastkey = 0;
+    static unsigned int lastval = 0;
    struct fake_input *fake = data;
-    struct uinput_event event;
    unsigned int key, value = 0;
    gsize size;
    char buff[50];

-    if (cond & G_IO_NVAL)
-        return FALSE;
+    g_timer_start(((struct fake_hid *)fake->priv)->timer);
+    if (cond & G_IO_NVAL) {
+        if(lastkey == KEY_HOMEPAGE && lastval == 1) {
+            DBG("Remote turned off");
+            goto failed;
+        } else {
+            DBG("Remote unpaired [%u:%u]", lastkey, lastval);
+            goto failed;
+        }
+    }

    if (cond & (G_IO_HUP | G_IO_ERR)) {
        error("Hangup or error on rfcomm server socket");
@@ -233,50 +284,51 @@
        error("IO Channel read error");
        goto failed;
    }
-
    key = ps3remote_decode(buff, size, &value);
    if (key == KEY_RESERVED) {
        error("Got invalid key from decode");
        goto failed;
    } else if (key == KEY_MAX)
        return TRUE;
-
-    memset(&event, 0, sizeof(event));
-    gettimeofday(&event.time, NULL);
-    event.type = EV_KEY;
-    event.code = key;
-    event.value = value;
-    if (write(fake->uinput, &event, sizeof(event)) != sizeof(event)) {
-        error("Error writing to uinput device");
+    /* Delaying key till release, assuming possible turn-off */
+    if(key == KEY_HOMEPAGE) {
+        if(value == 0 && lastkey == KEY_HOMEPAGE && lastval == 1) {
+            ps3remote_sendkey(fake->uinput, key, 1);
+            ps3remote_sendkey(fake->uinput, key, 0);
+        } else
+            DBG("Delayed: %u:%u (%u:%u)", key, value, lastkey, lastval);
+    } else if(!ps3remote_sendkey(fake->uinput, key, value))
        goto failed;
-    }
-
-    memset(&event, 0, sizeof(event));
-    gettimeofday(&event.time, NULL);
-    event.type = EV_SYN;
-    event.code = SYN_REPORT;
-    if (write(fake->uinput, &event, sizeof(event)) != sizeof(event)) {
-        error("Error writing to uinput device");
-        goto failed;
-    }
-
+    lastkey = key;
+    lastval = value;
+    DBG("Passed key %u:%u", key, value);
    return TRUE;

-failed:
+failed: /*
    ioctl(fake->uinput, UI_DEV_DESTROY);
    close(fake->uinput);
-    fake->uinput = -1;
+    fake->uinput = -1;*/
+    g_timer_stop(((struct fake_hid *)fake->priv)->timer);
    g_io_channel_unref(fake->io);
-
+    DBG("Event failed");
    return FALSE;
}
-
static int ps3remote_setup_uinput(struct fake_input *fake,
                  struct fake_hid *fake_hid)
{
    struct uinput_dev dev;
+    struct stat sbuf;
    int i;

+    if(fake->uinput > 0) {
+        if(!(i=fstat(fake->uinput, &sbuf))) {
+            DBG("input %d is opened", fake->uinput);
+            return 0;
+        } else {
+            DBG("fstat(%d): error[%d]: %s", fake->uinput, i, strerror(errno));
+        }
+    }
+
    fake->uinput = open("/dev/input/uinput", O_RDWR);
    if (fake->uinput < 0) {
        fake->uinput = open("/dev/uinput", O_RDWR);
@@ -348,6 +400,8 @@
        .disconnect    = fake_hid_common_disconnect,
        .event        = ps3remote_event,
        .setup_uinput    = ps3remote_setup_uinput,
+        .fake        = NULL,
+        .timeout    = 15,
    },

    { },
@@ -373,6 +427,13 @@
int fake_hid_connadd(struct fake_input *fake, GIOChannel *intr_io,
                        struct fake_hid *fake_hid)
{
+    if(fake_hid->fake == NULL) {
+        fake_hid->fake = fake;
+        fake_hid->timer = g_timer_new();
+    } else {
+        g_free(fake);
+        fake = fake_hid->fake;
+    }
    if (fake_hid->setup_uinput(fake, fake_hid)) {
        error("Error setting up uinput");
        return ENOMEM;
@@ -382,6 +443,6 @@
    g_io_channel_set_close_on_unref(fake->io, TRUE);
    g_io_add_watch(fake->io, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
                    (GIOFunc) fake_hid->event, fake);
-
+    g_io_add_watch(fake->io, G_IO_OUT, (GIOFunc) ps3remote_out, fake);
    return 0;
}
diff -ur bluez-4.47/input/fakehid.h bluez-4.47-my/input/fakehid.h
--- bluez-4.47/input/fakehid.h    2009-02-25 21:14:11.000000000 +0100
+++ bluez-4.47-my/input/fakehid.h    2009-08-23 22:57:46.000000000 +0200
@@ -31,6 +31,10 @@
    int (*disconnect) (struct fake_input *fake_input);
    gboolean (*event) (GIOChannel *chan, GIOCondition cond, gpointer data);
    int (*setup_uinput) (struct fake_input *fake, struct fake_hid *fake_hid);
+    struct fake_input *fake;
+    const struct input_device *idev;
+    GTimer *timer;
+    uint16_t timeout;
};

struct fake_hid *get_fake_hid(uint16_t vendor, uint16_t product);



- hojan - 2009-09-09

Hi, can I please ask a noob question. I have set up my Asrock ION 330, Ubuntu 9.04 and the latest XBMC. I plugged in a BT dongle and can use my PS3 remote fine in XBMC.

That is, if I stop lirc. Running lirc, it doesn't work. But that's fine, for now.

My question is, I can navigate XBMC and play music and so on, but I can't use special functions, like queuing songs or bring up the info window.

Pressing 0 on the remote gives the following in xbmc.log
23:51:48 T:3039852432 M:1530847232 DEBUG: SDLKeyboard: scancode: 19, sym: 48, unicode: 48, modifier: 0
23:51:48 T:3039852432 M:1530847232 DEBUG: OnKey: 61536 pressed, action is 58
I tried to add the following in keymap.xml

<MyMusicFiles>
<remote>
<key id="61536">Queue</key>
</remote>

but that doesn't help. What am I missing? Any help is appreciated!


- logistiker - 2009-09-09

hojan Wrote:That is, if I stop lirc. Running lirc, it doesn't work. But that's fine, for now.

As Ruff already mentioned and I will confirm, you don't need lirc at all so don't even waste your time with it.

hojan Wrote:My question is, I can navigate XBMC and play music and so on, but I can't use special functions, like queuing songs or bring up the info window.

Pressing 0 on the remote gives the following in xbmc.log
23:51:48 T:3039852432 M:1530847232 DEBUG: SDLKeyboard: scancode: 19, sym: 48, unicode: 48, modifier: 0
23:51:48 T:3039852432 M:1530847232 DEBUG: OnKey: 61536 pressed, action is 58
I tried to add the following in keymap.xml

<MyMusicFiles>
<remote>
<key id="61536">Queue</key>
</remote>

I don't use xbmc but I would assume any program would use the standard keycodes which are definitely not that long. If you want to get the standard keycodes recognized in X windows for any key you press on a keyboard input device, you must use a program called xev.


- flxfxp - 2009-09-09

Thanks logistiker, but I really don't run a GUI interface. So there is currently no good option for installing/configuring the ps3 bluetooth remote via CLI?


- logistiker - 2009-09-09

flxfxp Wrote:Thanks logistiker, but I really don't run a GUI interface. So there is currently no good option for installing/configuring the ps3 bluetooth remote via CLI?

You could set it up on a different computer that is running X windows and then copy the /var/lib/bluetooth directory from that computer over to the computer that doesn't have a gui installed. Other than that unfortunately I don't see any other way to set up bluetooth. I attempted many times to set up the bdremote with hcitool and sdptool but those commands simply didn't set up or give me the data necessary to create all the files needed in the /var/lib/bluetooth directory. A few files of note that were missing and crucial to getting it to work were sdp and trust. There is a third file also that I can't remember right now that was also missing.


- ruff - 2009-09-09

@logistiker
seems like all patches are ignored, I gave up communicating with them.
As for keys - might be, I've been playing hard with different combinations till I found working mapping for all keys. Afterwards I dug sources and grasped the logic, but was too tired to do it again for x time %)