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)



- kitlaan - 2009-11-06

flxfxp Wrote:Sorry, I didnt see your post. Good work on the ppa repo! Last build by you is on version 4.51, will you make more recent builds as well?

Looking at the changelog between bluez 4.51 and 4.57, there isn't very much that affects our particular usage. But I'll set up a package for 4.57 this weekend. (It's amazing how fast bluez releases; it's a pretty fast moving target Smile )


I have yet to integrate the "fast reconnect" code that was in the original patch into mine, as I'm still wrapping my head around that code-path. But I'm hoping to figure out how that ends up working the way it does soon (as it's quite useful!).



So, in summary for those of you newly coming in:
  • The PPA version (https://launchpad.net/~kitlaan/+archive/ppa) is a all-in-one deal, based on the in-karmic version, with no self-compiling needed. (Only karmic packages exist at the moment.)
  • Supports customizing specific keys in the keymap via input.conf.
  • Supports auto-timeout of the remote.
  • You do not need to use the eventclient or LIRC.
  • You may want to enable "Remote sends keyboard keys" in the XBMC system configuration.
  • Pairing is still done using the ps3_pair python script.



- snappca - 2009-11-06

Ok so I've purchased another bluetooth dongle and rebooted and it shows up with a MAC address in hciconfig. Then I run ps3_pair.py a couple of times before I get my remote to be discovered and it finds it like this:

Code:
Searching for devices, please wait...        
Found:                                      
1: 00:1A:0E:F2:75:FC [Unknown]              
Select the device you wish to add [1]:

I honestly was caught off guard as I was monitoring another log and by the time I looked over my remote's blue light had turned off. So I ctrl-c and reran the script. This time the output looked like:

Code:
Searching for devices, please wait...                                                                                                
Found:                                                                                                                                
1: 00:1A:0E:F2:75:FC [BD Remote Control]                                                                                              
Select the device you wish to add [1]:                                                                                                
Registering device...  Done

I thought I was home free so I log in and fire up XBMC and nothing seems to happen. Additionally, if I rerun the ps3_pair.py script it never finds my remote.

Am I bumping into issues since I am not using the actual Sony PS3 remote but using the Blu-Link PS3 compatible remote instead?

This is the remote I have: http://www.blu-link.com/

Will I need to modify the /etc/bluetooth/input.conf file to point to my remote or something? I am woefully ignorant of how the pieces to this puzzle should be fitting together.


- kitlaan - 2009-11-06

snappca Wrote:Am I bumping into issues since I am not using the actual Sony PS3 remote but using the Blu-Link PS3 compatible remote instead?

This is the remote I have: http://www.blu-link.com/

Will I need to modify the /etc/bluetooth/input.conf file to point to my remote or something? I am woefully ignorant of how the pieces to this puzzle should be fitting together.

Can you post the lines from /var/log/syslog relating to bluetooth? Alternatively, do a "sudo /etc/init.d/bluetooth stop" then a "bluetoothd -n -d" and paste those logs. Also "/usr/share/doc/bluez/examples/list-devices" should tell you if it was properly paired.

The bluez code tags specifically to vendor id 0x054c and product 0x0306. I'm wondering is that remote has different id's.

You may be able to do a "sudo hidd" or a "cat /proc/bus/input/devices" and spot your device in there. If you do, let me know the device/product/vendor ids.


- snappca - 2009-11-06

So getting any output from list-devices means that I do have something properly paired, but that the ID is not matching a configuration?

Here's the list-devices output.....is it the UUID's that you are targetting?

Code:
# sudo /usr/share/doc/bluez/examples/list-devices

[ /org/bluez/1792/hci0 ]
    Name = snapphome-0
    Powered = 1
    Devices = dev_00_1A_0E_F2_75_FC
    DiscoverableTimeout = 0
    PairableTimeout = 0
    Discoverable = 0
    Address = 00:02:76:17:D8:83
    Discovering = 0
    Pairable = 1
    Class = 4849924
    [ /org/bluez/1792/hci0/dev_00_1A_0E_F2_75_FC ]
        Name = BD Remote Control
        Paired = 0
        Adapter = /org/bluez/1792/hci0
        Alias = BD Remote Control
        Connected = 0
        UUIDs = 0x1124 0x1200
        Address = 00:1A:0E:F2:75:FC
        Class = 0x00250c
        Trusted = 1

Here's the bluetoothd -nd output since the syslog output was substantial and I wasn't sure just how far back you wanted me to go:

Code:
# sudo bluetoothd -nd 2>&1 | tee bluetoothd.log

<removed initial part of output due to exceeding xbmc forum post length restrictions>

                                  
bluetoothd[1792]: register_server_record: got record id 0x10002                                                                      
bluetoothd[1792]: Registered interface org.bluez.NetworkRouter on path /org/bluez/1792/hci0                                          
bluetoothd[1792]: proxy_probe: path /org/bluez/1792/hci0                                                                              
bluetoothd[1792]: btd_adapter_ref(0x7fbd893f8c30): ref=3                                                                              
bluetoothd[1792]: Registered interface org.bluez.SerialProxyManager on path /org/bluez/1792/hci0                                      
bluetoothd[1792]: Parsing /etc/bluetooth/serial.conf failed: No such file or directory                                                
bluetoothd[1792]: btd_adapter_ref(0x7fbd893f8c30): ref=4                                                                              
bluetoothd[1792]: headset_server_probe: path /org/bluez/1792/hci0                                                                    
bluetoothd[1792]: btd_adapter_ref(0x7fbd893f8c30): ref=5                                                                              
bluetoothd[1792]: audio_adapter_ref(0x7fbd893fa9f0): ref=1                                                                            
bluetoothd[1792]: audio.conf: Key file does not have key 'Master'                                                                    
bluetoothd[1792]: Adding record with handle 0x10003                                                                                  
bluetoothd[1792]: Record pattern UUID 00000003-0000-1000-8000-00805f9                                                                
bluetoothd[1792]: Record pattern UUID 00000100-0000-1000-8000-00805f9                                                                
bluetoothd[1792]: Record pattern UUID 00001002-0000-1000-8000-00805f9                                                                
bluetoothd[1792]: Record pattern UUID 00001108-0000-1000-8000-00805f9                                                                
bluetoothd[1792]: Record pattern UUID 00001112-0000-1000-8000-00805f9                                                                
bluetoothd[1792]: Record pattern UUID 00001203-0000-1000-8000-00805f9                                                                
bluetoothd[1792]: audio.conf: Key file does not have key 'SCORouting'                                                                
bluetoothd[1792]: Adding record with handle 0x10004                                                                                  
bluetoothd[1792]: Record pattern UUID 00000003-0000-1000-8000-00805f9                                                                
bluetoothd[1792]: Record pattern UUID 00000100-0000-1000-8000-00805f9                                                                
bluetoothd[1792]: Record pattern UUID 00001002-0000-1000-8000-00805f9                                                                
bluetoothd[1792]: Record pattern UUID 0000111e-0000-1000-8000-00805f9                                                                
bluetoothd[1792]: Record pattern UUID 0000111f-0000-1000-8000-00805f9                                                                
bluetoothd[1792]: Record pattern UUID 00001203-0000-1000-8000-00805f9                                                                
bluetoothd[1792]: a2dp_server_probe: path /org/bluez/1792/hci0                                                                        
bluetoothd[1792]: audio_adapter_ref(0x7fbd893fa9f0): ref=2                                                                            
bluetoothd[1792]: audio.conf: Key file does not have key 'Enable'                                                                    
bluetoothd[1792]: audio.conf: Key file does not have key 'Disable'                                                                    
bluetoothd[1792]: audio.conf: Key file does not have group 'A2DP'                                                                    
bluetoothd[1792]: audio.conf: Key file does not have group 'A2DP'                                                                    
bluetoothd[1792]: audio.conf: Key file does not have group 'A2DP'                                                                    
bluetoothd[1792]: audio.conf: Key file does not have group 'A2DP'                                                                    
bluetoothd[1792]: audio.conf: Key file does not have key 'Master'                                                                    
bluetoothd[1792]: SEP 0x7fbd893fc030 registered: type:0 codec:0 seid:1                                                                
bluetoothd[1792]: Adding record with handle 0x10005                                                                                  
bluetoothd[1792]: Record pattern UUID 00000019-0000-1000-8000-00805f9                                                                
bluetoothd[1792]: Record pattern UUID 00000100-0000-1000-8000-00805f9                                                                
bluetoothd[1792]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[1792]: Record pattern UUID 0000110a-0000-1000-8000-00805f9
bluetoothd[1792]: Record pattern UUID 0000110d-0000-1000-8000-00805f9
bluetoothd[1792]: avrcp_server_probe: path /org/bluez/1792/hci0
bluetoothd[1792]: audio_adapter_ref(0x7fbd893fa9f0): ref=3
bluetoothd[1792]: audio.conf: Key file does not have key 'Master'
bluetoothd[1792]: Adding record with handle 0x10006
bluetoothd[1792]: Record pattern UUID 00000017-0000-1000-8000-00805f9
bluetoothd[1792]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[1792]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[1792]: Record pattern UUID 0000110c-0000-1000-8000-00805f9
bluetoothd[1792]: Record pattern UUID 0000110e-0000-1000-8000-00805f9
bluetoothd[1792]: Adding record with handle 0x10007
bluetoothd[1792]: Record pattern UUID 00000017-0000-1000-8000-00805f9
bluetoothd[1792]: Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[1792]: Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[1792]: Record pattern UUID 0000110e-0000-1000-8000-00805f9
bluetoothd[1792]: Creating device /org/bluez/1792/hci0/dev_00_1A_0E_F2_75_FC
bluetoothd[1792]: btd_device_ref(0x7fbd893fdaf0): ref=1
bluetoothd[1792]: Probe drivers for /org/bluez/1792/hci0/dev_00_1A_0E_F2_75_FC
bluetoothd[1792]: hid_device_probe: path /org/bluez/1792/hci0/dev_00_1A_0E_F2_75_FC
bluetoothd[1792]: btd_device_ref(0x7fbd893fdaf0): ref=2
bluetoothd[1792]: Registered interface org.bluez.Input on path /org/bluez/1792/hci0/dev_00_1A_0E_F2_75_FC
bluetoothd[1792]: Adapter /org/bluez/1792/hci0 has been enabled
bluetoothd[1792]: return_link_keys (sba=00:02:76:17:D8:83, dba=00:02:76:16:DA:98)
bluetoothd[1792]: Computer is classified as desktop
bluetoothd[1792]: Setting 0x000104 for major/minor device class



- kitlaan - 2009-11-06

Well, at the very list, the remote does seem to be detected by your bluetooth dongle.

Sadly, no device/vendor/product IDs were in that output. I'm still trying to determine the easiest way to sniff that out. The only way I've come across is to do a "cat /proc/bus/input/devices" while the device is connected.


- snappca - 2009-11-06

Would hcitool info '<MAC_ADDRESS>' provide what you are looking for? I can't seem to figure out how to get my remote connected again. I can't see it when I run hcitool scan or the ps3_pair.py script. Should I remove the configuration for bluetoothd to be able to scan for it again? If so, how exactly do I revert the configuration back to the pre-ps3_pair.py setup?


- snappca - 2009-11-06

Man, it is bugging me that I don't know whether I am the one at fault or what. It seems really flaky whether the device will be connected or not. I just tried running ps3_python.py --remove '<MAC_ADDRESS>' a couple of times. The first time it tried scanning and failed to find anything as usual....then when I ran it again it found the device, but it looks like the script is trying to add it. I then ran hcitool info <MAC_ADDRESS> and it spit out the following:

Code:
BD Address:  00:1A:0E:F2:75:FC
        Device Name: BD Remote Control
        LMP Version: 2.0 (0x3) LMP Subversion: 0x31c
        Manufacturer: Broadcom Corporation (15)
        Features: 0xbc 0x02 0x04 0x38 0x08 0x00 0x00 0x00
                <encryption> <slot offset> <timing accuracy> <role switch>
                <sniff mode> <RSSI> <power control> <enhanced iscan>
                <interlaced iscan> <interlaced pscan> <AFH cap. slave>

I'm thinking that isn't of any help, but I thought I'd send it anyway.


- kitlaan - 2009-11-06

I wish I had better answers for you...

I made myself an "unpair" script based on ps3_pair.py, which replaced part of the code with the following (note the RemoveDevice instead of the CreateDevice). You use it in the same manner as the pair.
Code:
print "Deregistering device... ",
sys.stdout.flush()
try:
        dev = self.adapter.FindDevice(dev[0])
        self.adapter.RemoveDevice(dev)
        print "Done"
except Exception, e:
        print "Failed (", e, ")"
        os._exit(1)
finally:
        os._exit(0)

Maybe that'll help get the device unregistered (it should no longer show up in "list-devices" if it works).


- snappca - 2009-11-06

Thanks, that unpair method worked fine. I unpaired it and than reran the ps3_pair.py a couple of times and got it connected again. One thing I notices was the fact that right after I get it paired, if I run the "list-devices" command I see a line saying "Connected = 1" which is obviously different from the original output I posted earlier. I ran "cat /proc/bus/input/devices" while it was connected hoping for some additional output, but there wasn't anything new. Also no matter how much I mash buttons I can't get the "list-devices" to show "Connected = 1" again after it times out.

The only way I can get any change in the output of "/proc/bus/input/devices" is to remove the bluetooth dongle. These are the lines that seem to be associated with it:

Code:
I: Bus=0003 Vendor=0a5c Product=4502 Version=0111
N: Name="HID 0a5c:4502"                          
P: Phys=usb-0000:00:04.0-2.1/input0              
S: Sysfs=/devices/pci0000:00/0000:00:04.0/usb2/2-2/2-2.1/2-2.1:1.0/input/input5
U: Uniq=                                                                      
H: Handlers=kbd event5                                                        
B: EV=120013                                                                  
B: KEY=1000000000007 ff800000000007ff febeffdff3cfffff fffffffffffffffe        
B: MSC=10                                                                      
B: LED=7
I: Bus=0003 Vendor=0a5c Product=4503 Version=0111
N: Name="HID 0a5c:4503"
P: Phys=usb-0000:00:04.0-2.2/input0
S: Sysfs=/devices/pci0000:00/0000:00:04.0/usb2/2-2/2-2.2/2-2.2:1.0/input/input6
U: Uniq=
H: Handlers=mouse2 event6
B: EV=17
B: KEY=70000 0 0 0 0
B: REL=3
B: MSC=10

I'm assuming both of those are related to the dongle and not the remote.


- kitlaan - 2009-11-07

My PPA (https://launchpad.net/~kitlaan/+archive/ppa) now has packages for bluez 4.57. (The debs for 4.51 are now in the "superseded" area.)


- pfriederichs - 2009-11-09

kitlaan Wrote:My PPA (https://launchpad.net/~kitlaan/+archive/ppa) now has packages for bluez 4.57. (The debs for 4.51 are now in the "superseded" area.)

Thanks to all who responded to my posts I finally did get this working with the help of Kitlaan's PPA -- works great under Karmic w/ XMBC 9.1 Alpha.

Thanks again I was dreading the thought of going to a RF/IF remote with this great PS3 remote and having no line of sight issues.

Again thanks!!


- pfriederichs - 2009-11-09

kitlaan Wrote:My PPA (https://launchpad.net/~kitlaan/+archive/ppa) now has packages for bluez 4.57. (The debs for 4.51 are now in the "superseded" area.)

Kitlaan would it be possible to post the Jaunty deb's -- It looks like I am going to actually downgrade to Jauntu/XBMC Stable for the time being due to various bugs/annoyances I have been experiencing (but the remote works great LOL) or is it possible to install these Karmic PPA's in Jaunty?

I am not a Linux expert so I appreciate any feedback!


- kitlaan - 2009-11-10

pfriederichs Wrote:Kitlaan would it be possible to post the Jaunty deb's -- It looks like I am going to actually downgrade to Jauntu/XBMC Stable for the time being due to various bugs/annoyances I have been experiencing (but the remote works great LOL) or is it possible to install these Karmic PPA's in Jaunty?

I am not a Linux expert so I appreciate any feedback!

Supposedly a Jaunty build is in the queue; we'll find out in a few hours, so look for it!


- nanny07 - 2009-11-11

is it working with xbmc live 9.11?


- ruff - 2009-11-11

what exactly? bluez daemon is working of course, though i doubt it is supplied with prepatched version %)