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-12-12

dogk1cker Wrote:xbmc@xbmc:~$ sudo bluetoothd -nd
[sudo] password for xbmc:
bluetoothd[10896]: Bluetooth daemon
bluetoothd[10896]: Enabling debug information
bluetoothd[10896]: parsing main.conf
bluetoothd[10896]: discovto=0
bluetoothd[10896]: pairto=0
bluetoothd[10896]: pageto=8192
bluetoothd[10896]: name=%h-%d
bluetoothd[10896]: class=0x000100
bluetoothd[10896]: inqmode=0
bluetoothd[10896]: Key file does not have key 'DeviceID'
bluetoothd[10896]: Unable to get on D-Bus
xbmc@xbmc:~$

You may need to stop the existing bluetoothd process before your run that command. (That would explain the "Unable to get on D-Bus" output). (either "sudo /etc/init.d/bluetooth stop" or "sudo killall bluetoothd")


- faxo - 2009-12-12

kitlaan Wrote:I uploaded a new patch; same place as before. It uses seconds now, as well as making some tweaks to the timer handling. Let me know if you still see the assert.

Thanks for the new patch. The assertion is still present, however bluetoothd doesn't seem to be crashing anymore. At least, I haven't been able to get it to crash after ~40 connect-timeout cycles.

The seconds-based timeout is working well. I have my remote on a 15s timeout, which is great for the batteries. (Admittedly, it did take me about 5 minutes to figure out why my bluetooth keyboard was sluggish and unresponsive.. until I realized that the timeout change applies universally, not just to the PS3 remote. Once I increased the keyboard timeout from 2 to 120, things were better Smile

One question: if I use the remote to Suspend, the machine goes to sleep faster than 15 seconds, which means that the remote won't get timed out. Does that mean the remote is going to sit there broadcasting for a long time and drain its batteries? (If so, how long I wonder? 30 minutes Ruff might have mentioned?)

This makes me wonder if a command-line util to forcibly timeout/disconnect the remote is warranted. Such a util could then be used by the suspend/hibernate script to make sure the remote is off prior to sleep state.


- awef - 2009-12-17

I've tried to this up using the wiki page, but I'm having trouble at this part:

cat /proc/bus/input/devices | grep emot

This doesn't show up my device.

If I do /usr/share/doc/bluez/examples/list-devices

It lists this:

Code:
[ /org/bluez/646/hci0 ]
    Name = CORE2DUO
    Powered = 1
    Devices = dev_00_24_33_4E_A2_3E
    DiscoverableTimeout = 0
    PairableTimeout = 0
    Discoverable = 0
    Address = 00:04:61:80:10:D6
    Discovering = 0
    Pairable = 1
    Class = 4849664
    [ /org/bluez/646/hci0/dev_00_24_33_4E_A2_3E ]
        Name = BD Remote Control
        Paired = 0
        Adapter = /org/bluez/646/hci0
        Alias = BD Remote Control
        Connected = 0
        UUIDs = 0x1124 0x1200
        Address = 00:24:33:4E:A2:3E
        Class = 0x00250c
        Trusted = 1


I'm guessing 'Paired = 0' is an issue? I ran the pair script are per the wiki and it seemed to work OK. If I try it again, it says it already exists.

Any tips on what to try? I'm running xbmc-live (karmic) installed on HD.


Great Work - But - joe180 - 2009-12-21

My first post so I shell make it a goodie kinda. before I begin , just want to say thanks for all the hard work that has gone into getting the PS3 remote working.

After about 2 hours of reading each and every post in this thread and tring what was instructed I am still unable to get the "grep emot". So I hoping someone can help me out here as I really dont want to convert my system to a "puke" win$ system.

This is what I have done as per wiki:

1st attempt was via the apt-get route, all fine no issues. remote paired after a few attempts all good but no remote was being added as HID.

2nd attempt remove all bluez and compile as per wiki. Once again remote paired but no go on the HID.

On both tries I noticed when I hit the buttons I was getting something via hcidump, so I guess it was reciving the commands. However nothing was happening in XBMC.

While doing this list-device would say device was connected = 1 , then a second later it would say connected = 0. So it appears the uinput does not add the device.

bluetoothd -nd reports this

Code:
bluetoothd[11062]: adapter_get_device(00:23:06:E7:C7:F4)
bluetoothd[11062]: adapter_get_device(00:23:06:E7:C7:F4)
bluetoothd[11062]: adapter_get_device(00:23:06:E7:C7:F4)
bluetoothd[11062]: adapter_get_device(00:23:06:E7:C7:F4)

device-list reports this

Code:
[ /org/bluez/11451/hci0 ]
    Name = Mavin
    Powered = 1
    Devices = dev_00_23_06_E7_C7_F4
    DiscoverableTimeout = 0
    PairableTimeout = 0
    Discoverable = 0
    Address = 00:09:DD:10:59:6C
    Discovering = 0
    Pairable = 1
    Class = 4849924
    [ /org/bluez/11451/hci0/dev_00_23_06_E7_C7_F4 ]
        Name = BD Remote Control
        Paired = 0
        Adapter = /org/bluez/11451/hci0
        Alias = BD Remote Control
        Connected = 0
        UUIDs = 0x1124 0x1200
        Address = 00:23:06:E7:C7:F4
        Class = 0x00250c
        Trusted = 1

I have tested the bluetooth dongle and remote in windows and works perfectly.

Please can someone help me out here Big Grin


- awef - 2009-12-22

joe180 Wrote:After about 2 hours of reading each and every post in this thread and tring what was instructed I am still unable to get the "grep emot". So I hoping someone can help me out here as I really dont want to convert my system to a "puke" win$ system.

I ended up using a different thread, whose instructions worked better:

http://forum.xbmc.org/showthread.php?tid=60713


- kitlaan - 2009-12-23

For some strange reason, sometimes pairing does occur, but the remote does not believe it. Sometimes un-pairing and re-pairing will cause it to magically work.

I've seen it "just work" with some people; "all the sudden work after a reboot" with others; "eventually work after restarting bluez a few times"; and of course, not work at all with a few.

In my case, it didn't work the first few pairings, then just started working after tinkering with the ps3bdremote script and then pairing/unpairing/pairing.

So.... if it seems to be working, try a few more times. It may just end up working.


If not, the LIRC approach is a good alternative, but does involve more software and configuration.


Glibc.. - Asure - 2010-01-09

Still having the glibc errors. Did anyone find a way to solve these ?
Info:
- Ubuntu Jaunty 9.04
- Full apt-get upgraded box as of 9-1-2010
- Added kitlaan ppa as outlined in the steps on previous pages.
- 30 second timeout.
Log: http://www.zonko.nl/files/btdlog.txt
What i did, i Paired the remote a day before. Noticed it died, then made today's logs.
1. Killed bluetoothd and restarted it in -nd, but the remote won't register or connect to it for some reason.
2. ps3_unpaired it (in the log)
3. ps3_paired it. Remote works fine at this point
4. Hit the 30 sec timer, assertion happens.

At this point i can kill & restart bluetoothd any number of times, but it won't register the remote again. (even if pairing data seems correct, see point #3 above.)

Anybody ever fix this glibc assertion ? If so : How did you do it ? Wink

Edit: I rolled my own , versions 4.51 and up all tried, and all give errors. Some even segfault.. whoops. ?

Option 1:
bluetoothd[8191]: Got key: 108 [1]
bluetoothd[8191]: Got key: 108 [0]
bluetoothd[8191]: Got key: 108 [1]
bluetoothd[8191]: Got key: 108 [0]
bluetoothd[8191]: Disconnecting device because of timeout
bluetoothd[8191]: Input: disconnect /org/bluez/8191/hci0/dev_00_21_4F_B2_3E_13
bluetoothd[8191]: Disconnecting PS3 remote
bluetoothd[8191]: Destroying timer

(bluetoothd:8191): GLib-CRITICAL **: g_source_remove: assertion `tag > 0' failed

or Segfault at the end instead of assertion failure.. Sad

Edit2:
dogk1cker Wrote:hey flxfxp,
I did you patch:
http://flx.me/script/bluez-patched-4.54.tar.gz
AND IT WORKS!!!!!!!
Thanx a bunch.
dogk1cker
This one works after make clean and installing flex and byacc Smile
Code:
bluetoothd[15672]: ps3remote_event: Passed key 103:0
bluetoothd[15672]: ps3remote_event: Passed key 108:1
bluetoothd[15672]: ps3remote_event: Passed key 108:0
bluetoothd[15672]: ps3remote_out: idle timeout, disconnecting BT channel
bluetoothd[15672]: Input: disconnect /org/bluez/15672/hci0/dev_00_21_4F_B2_3E_13
bluetoothd[15672]: ps3remote_event: Remote disconnected [108:0]
bluetoothd[15672]: ps3remote_event: Event failed
bluetoothd[15672]: adapter_get_device(00:21:4F:B2:3E:13)
bluetoothd[15672]: Incoming connection on PSM 17
bluetoothd[15672]: Incoming connection on PSM 19
bluetoothd[15672]: ps3remote_setup_uinput: input 25 is opened
bluetoothd[15672]: ps3remote_event: Passed key 103:1
bluetoothd[15672]: ps3remote_event: Passed key 103:0
bluetoothd[15672]: ps3remote_event: Passed key 103:1
bluetoothd[15672]: ps3remote_event: Passed key 103:0
Just generates a new number on each timeout.
Code:
Jan  9 16:16:09 alex-desktop kernel: [  414.670198] input: PS3 Remote Controller as /devices/virtual/input/input8
Jan  9 16:47:59 alex-desktop kernel: [ 2324.425956] input: PS3 Remote Controller as /devices/virtual/input/input9
Jan  9 16:52:33 alex-desktop kernel: [ 2598.892594] input: PS3 Remote Controller as /devices/virtual/input/input10



- dirtyHippy - 2010-01-18

I am having trouble pairing my remote. Like many others, I can (semi)successfully run ps3_pair, but pairing never actually occurs. I say semi-successfully because the first time I run ps3_pair, it fails with the message
Code:
Registering device... Failed ( org.freedesktop.DBus.Error.NoReply: Did not receive a reply.  Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. )
The next time I try to connect using ps3_pair, it seems toworks as it should. However, I only have one entry in /var/lib/bluetooth/ and it is not the entry for my remote.

Below is the output from bluetoothd -nd. I tried to capture the cycle of running ps3_unpair, then ps3_pair (failing) and finally ps3_pair (success), but there might be some extra lines at the beginning.

Code:
bluetoothd[2743]: Creating device /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36
bluetoothd[2743]: Device /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36 has vendor=0x054c product=0x0306 version=0x0100
bluetoothd[2743]: btd_device_ref(0x7faf526b5a20): ref=1
bluetoothd[2743]: Probe drivers for /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36
bluetoothd[2743]: Driver match input-hid for /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36
bluetoothd[2743]: hid_device_probe: path /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36
bluetoothd[2743]: btd_device_ref(0x7faf526b5a20): ref=2
bluetoothd[2743]: Registered interface org.bluez.Input on path /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36
bluetoothd[2743]: Adapter /org/bluez/2743/hci0 has been enabled
bluetoothd[2743]: Computer is classified as desktop
bluetoothd[2743]: Setting 0x000104 for major/minor device class
bluetoothd[2743]: Discovery session 0x7faf526b49b0 with :1.84 activated
bluetoothd[2743]: session_ref(0x7faf526b49b0): ref=1
bluetoothd[2743]: session_unref(0x7faf526b49b0): ref=0
bluetoothd[2743]: Discovery session 0x7faf526b49b0 with :1.84 deactivated
bluetoothd[2743]: Stopping discovery
bluetoothd[2743]: Stopping discovery
bluetoothd[2743]: Removing device /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36
bluetoothd[2743]: input_remove: path /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36
bluetoothd[2743]: Unregistered interface org.bluez.Input on path /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36
bluetoothd[2743]: btd_device_unref(0x7faf526b5a20): ref=1
bluetoothd[2743]: btd_device_unref(0x7faf526b5a20): ref=0
bluetoothd[2743]: device_free(0x7faf526b5a20)
bluetoothd[2743]: Discovery session 0x7faf526b49b0 with :1.85 activated
bluetoothd[2743]: session_ref(0x7faf526b49b0): ref=1
bluetoothd[2743]: session_unref(0x7faf526b49b0): ref=0
bluetoothd[2743]: Discovery session 0x7faf526b49b0 with :1.85 deactivated
bluetoothd[2743]: Stopping discovery
bluetoothd[2743]: Stopping discovery
bluetoothd[2743]: create_device(00:23:06:E8:7E:36)
bluetoothd[2743]: adapter_create_device(00:23:06:E8:7E:36)
bluetoothd[2743]: Creating device /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36
bluetoothd[2743]: Device /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36 has vendor=0x054c product=0x0306 version=0x0100
bluetoothd[2743]: btd_device_ref(0x7faf526b59f0): ref=1
bluetoothd[2743]: adapter_get_device(00:23:06:E8:7E:36)
bluetoothd[2743]: Removing device /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36
bluetoothd[2743]: btd_device_unref(0x7faf526b59f0): ref=0
bluetoothd[2743]: device_free(0x7faf526b59f0)
bluetoothd[2743]: Discovery session 0x7faf526adf20 with :1.86 activated
bluetoothd[2743]: session_ref(0x7faf526adf20): ref=1
bluetoothd[2743]: session_unref(0x7faf526adf20): ref=0
bluetoothd[2743]: Discovery session 0x7faf526adf20 with :1.86 deactivated
bluetoothd[2743]: Stopping discovery
bluetoothd[2743]: Stopping discovery
bluetoothd[2743]: create_device(00:23:06:E8:7E:36)
bluetoothd[2743]: adapter_create_device(00:23:06:E8:7E:36)
bluetoothd[2743]: Creating device /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36
bluetoothd[2743]: Device /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36 has vendor=0x054c product=0x0306 version=0x0100
bluetoothd[2743]: btd_device_ref(0x7faf526b9ec0): ref=1
bluetoothd[2743]: adapter_get_device(00:23:06:E8:7E:36)
bluetoothd[2743]: Probe drivers for /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36
bluetoothd[2743]: Driver match input-hid for /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36
bluetoothd[2743]: hid_device_probe: path /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36
bluetoothd[2743]: btd_device_ref(0x7faf526b9ec0): ref=2
bluetoothd[2743]: Registered interface org.bluez.Input on path /org/bluez/2743/hci0/dev_00_23_06_E8_7E_36

Any help would be greatly appreciated!

[edit] I should mention I'm running Ubuntu 9.10 AMD64 on a Zotac ION board.


- pumkinut - 2010-01-19

Okay, I've got the remote to work, and it works across a reboot. The problem now is I can't get all the buttons to work.

Here's my input.conf:
Code:
root@XBMCLive:/home/xbmc/.xbmc/userdata# 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 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:11:22:33:44:55]
#
# Set a custom idle timeout (in minutes) for this specific device
IdleTimeout=1



# 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_EJECTCD        # EJECT
0x64 = KEY_AUDIO          # AUDIO             (XBMC recommendation: KEY_A)
0x65 = KEY_ANGLE          # ANGLE             (XBMC recommendation: KEY_Z)
0x63 = KEY_SUBTITLE       # SUBTITLE          (XBMC recommendation: KEY_T)
0x0f = KEY_CLEAR          # CLEAR             (XBMC recommendation: KEY_DELETE)
0x28 = KEY_TIME           # TIMER             (XBMC recommendation: KEY_END)
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_RED            # RED               (XBMC recommendation: KEY_F7)
0x82 = KEY_GREEN          # GREEN             (XBMC recommendation: KEY_F8)
0x80 = KEY_BLUE           # BLUE              (XBMC recommendation: KEY_F9)
0x83 = KEY_YELLOW         # YELLOW            (XBMC recommendation: KEY_F10)
0x70 = KEY_INFO           # DISPLAY           (XBMC recommendation: KEY_D)
0x1a = KEY_MENU           # TOP MENU
0x40 = KEY_CONTEXT_MENU   # POP UP/MENU       (XBMC recommendation: KEY_F11)
0x0e = KEY_ESC            # RETURN
0x5c = KEY_OPTION         # TRIANGLE/OPTIONS  (XBMC recommendation: KEY_C)
0x5d = KEY_BACK           # CIRCLE/BACK
0x5f = KEY_SCREEN         # SQUARE/VIEW       (XBMC recommendation: KEY_V)
0x5e = BTN_0              # CROSS             (XBMC recommendation: KEY_X)
0x54 = KEY_UP             # UP
0x56 = KEY_DOWN           # DOWN
0x57 = KEY_LEFT           # LEFT
0x55 = KEY_RIGHT          # RIGHT
0x0b = KEY_ENTER          # ENTER
0x5a = BTN_TL             # L1                (XBMC recommendation: KEY_F1)
0x58 = BTN_TL2            # L2                (XBMC recommendation: KEY_F2)
0x51 = BTN_THUMBL         # L3                (XBMC recommendation: KEY_F3)
0x5b = BTN_TR             # R1                (XBMC recommendation: KEY_F4)
0x59 = BTN_TR2            # R2                (XBMC recommendation: KEY_F5)
0x52 = BTN_THUMBR         # R3                (XBMC recommendation: KEY_F6)
0x43 = KEY_HOMEPAGE       # PS button
0x50 = KEY_SELECT         # SELECT            (XBMC recommendation: KEY_INSERT)
0x53 = BTN_START          # START             (XBMC recommendation: KEY_HOME)
0x33 = KEY_REWIND         # SCAN BACK         (XBMC recommendation: KEY_R)
0x32 = KEY_PLAY           # PLAY
0x34 = KEY_FORWARD        # SCAN FORWARD      (XBMC recommendation: KEY_F)
0x30 = KEY_PREVIOUS       # PREVIOUS          (XBMC recommendationL KEY_PAGEUP)
0x38 = KEY_STOP           # STOP
0x31 = KEY_NEXT           # NEXT              (XBMC recommendation: KEY_PAGEDOWN)
0x60 = KEY_FRAMEBACK      # SLOW/STEP BACK    (XBMC recommendation: KEY_COMMA)
0x39 = KEY_PAUSE          # PAUSE
0x61 = KEY_FRAMEFORWARD   # SLOW/STEP FORWARD (XBMC recommendation: KEY_DOT)
0xff = KEY_MAX

Should the "OverlayBuiltin=True" be uncommented for things to work?

Here's my keymap.xml
Code:
root@XBMCLive:/home/xbmc/.xbmc/userdata# cat Keymap.xml
<keymap>
<global>
  <keyboard>
        <insert>Queue</insert>
        <a>AudioNextLanguage</a>
        <x>Close</x>
        <f1>VolumeDown</f1>
        <f4>VolumeUp</f4>
        <f2>SetVolume(50)</f2>
        <f3>SetVolume(75)</f3>
        <d>FullScreen</d>
        <t>ActivateWindow(Favourites)</t>
        <f7>XBMC.ActivateWindow(MyMusic)</f7>
        <f8>XBMC.ActivateWindow(MyVideos)</f8>
        <f9>XBMC.ActivateWindow(MyPictures)</f9>
        <f10>XBMC.ActivateWindow(Weather)</f10>
        <f11>ContextMenu</f11>
        <v>Playlist</v>
        <end>XBMC.ActivateWindow(ShutdownMenu)</end>
  </keyboard>
</global>
<MusicPlaylist>
  <keyboard>
        <f12>MoveItemUp</f12>
        <v>MoveItemDown</v>
        <d>Playlist</d>
  </keyboard>
</MusicPlaylist>
<MusicPlaylistEditor>
  <keyboard>
        <f12>MoveItemUp</f12>
        <v>MoveItemDown</v>
        <d>Playlist</d>
  </keyboard>
</MusicPlaylistEditor>
<Visualisation>
  <keyboard>
        <f12>Playlist</f12>
        <home>reloadkeymaps</home>
  </keyboard>
</Visualisation>
<VideoPlaylist>
  <keyboard>
        <f12>MoveItemUp</f12>
        <v>MoveItemDown</v>
        <d>Playlist</d>
  </keyboard>
</VideoPlaylist>
<FullscreenVideo>
    <keyboard>
        <f12>NextSubtitle</f12>
        <menu>ShowVideoMenu</menu>
    </keyboard>
</FullscreenVideo>
</keymap>
It looks as if all the buttons are mapped, but the only ones that seem to work are the D-Pad, the PS button, the back button (circle with arrow to another circle on the left), the play, pause, stop, FF, Rew buttons, and that's about it.

What's the correct format and location of the keymap.xml

mine right now is:
/home/xbmc/.xmbc/userdata/Keymap.xml

Should it be keymap, Keymap, keymaps, or Keymaps. Also, should it be in the:

/home/xbmc/.xbmc/userdata/keymaps directory.

I'm almost there, I've just got a couple of bumps to get over.


- pumkinut - 2010-01-20

W00T! Please disregard my last post. I read through the entire thread and things finally clicked. I have everything set up and working correctly now.


- TREX6662k5 - 2010-01-20

I sometimes get the same using bdremoted. Usually taking out the battery and reinserting them works. Mine re-pairs automatically and works.

I'd like to try this out at one point but why use python scripts to pair when you can use hidd --connect <mac>?

kitlaan Wrote:For some strange reason, sometimes pairing does occur, but the remote does not believe it. Sometimes un-pairing and re-pairing will cause it to magically work.

I've seen it "just work" with some people; "all the sudden work after a reboot" with others; "eventually work after restarting bluez a few times"; and of course, not work at all with a few.

In my case, it didn't work the first few pairings, then just started working after tinkering with the ps3bdremote script and then pairing/unpairing/pairing.

So.... if it seems to be working, try a few more times. It may just end up working.


If not, the LIRC approach is a good alternative, but does involve more software and configuration.



- Asure - 2010-01-27

@kitlaan / Flx : Does the pairing-script pair other things than the PS3 remote ?
I've been breaking my balls trying to get a Logitech PS3 BT adapter module (for his harmony) to pair with the scripts available. I think it's never paired correctly.

I didn't make proper logs from bluetoothd but i remember seeing 'av target' a few times after attempting to pair the thing. Then i went googling and noticed some Apple equipment pairs as AV Target as well.

The logs from an unpaired device look similar to this (apple keyboard log)
The full post is here for reference.
Code:
bluetoothd[5120]: Changing service classes to 0x0a0100
bluetoothd[5120]: register_server_record: got record id 0x10006
bluetoothd[5120]: Registered interface org.bluez.NetworkRouter on path /org/bluez/5120/hci0
bluetoothd[5120]: register_interface: path /org/bluez/5120/hci0
bluetoothd[5120]: Registered interface org.bluez.Service on path /org/bluez/5120/hci0
bluetoothd[5120]: Creating device /org/bluez/5120/hci0/dev_00_1F_5B_7E_99_A6
bluetoothd[5120]: Probe drivers for /org/bluez/5120/hci0/dev_00_1F_5B_7E_99_A6
bluetoothd[5120]: serial_probe: path /org/bluez/5120/hci0/dev_00_1F_5B_7E_99_A6: 00001101-0000-1000-8000-00805f9b34fb
bluetoothd[5120]: Registered interface org.bluez.Serial on path /org/bluez/5120/hci0/dev_00_1F_5B_7E_99_A6
bluetoothd[5120]: adapter_get_device(00:1F:5B:7E:99:A6)
bluetoothd[5120]: Found AV Target
bluetoothd[5120]: Registered interface org.bluez.Control on path /org/bluez/5120/hci0/dev_00_1F_5B_7E_99_A6
[b]bluetoothd[5120]: Found AV Target[/b]
bluetoothd[5120]: Creating device /org/bluez/5120/hci0/dev_00_1E_3D_17_09_5A
bluetoothd[5120]: Probe drivers for /org/bluez/5120/hci0/dev_00_1E_3D_17_09_5A
bluetoothd[5120]: Adapter /org/bluez/5120/hci0 has been enabled
bluetoothd[5120]: Computer is classified as unknown
bluetoothd[5120]: Current device class is 0x0a2100
bluetoothd[5120]: Setting 0x000100 for major/minor device class
bluetoothd[5120]: Changing major/minor class to 0x0a2100
bluetoothd[5120]: adapter_get_device(00:1E:3D:17:09:5A)
bluetoothd[5120]: Incoming connection on PSM 17
bluetoothd[5120]: adapter_get_device(00:1E:3D:17:09:5A)
bluetoothd[5120]: Incoming connection on PSM 17
00:1E:3D - Alps electric
00:23:06 - Alps electric
00:1F:5B - Apple (Av target.)

Now, i know his Ps3 remote is the Alps type, and something goes wrong with that, but it also looks similar to the Logitech BT unit. It has a button 'connect' that simulates start+enter (or enters pairing modus), and attempts to pair as AV Target instead of an input device.

Can we pair other items with ps3_pair scripts ?
How about changing code ? I'm not an expert, but i guess there's never any connect() done ? What to change it to ?
Code:
if svc.GetInterfaceName() == "org.bluez.Input":
        svc.Connect()
Seems to me it only would connect to input devices instead of others ?
I think logitech didn't copy the entire ps3 remote / codes / BT stuff and just presents itself as a keyboard, instead of 'real' ps3 bd remote. (Even if they name the device the same during scans.)

I guess the question becomes 'how to i pair other equipment under no-gui xbmc-live ?' Smile


- fostersimported - 2010-02-08

Hello all.
I am a little lost and would like some more pointers for mapping the ps3 remote buttons, getting the other buttons to work.

I have xbmc-live on 4gb usb

I have got the remote to conect and auto disconect.

The following buttons work:
D-pad
Return
Playstation/home
Play

If I run, sudo killall bluetoothd, then sudo bluetooth -nd. I can see that all the butons work. As the ouput shows:

bluetoothd[8191]: Got key: 108 [1]
bluetoothd[8191]: Got key: 108 [0]
I have do have a different 'Got key Number' for each key press.

Its just no mater what i change on the input.conf i cant assign the other buttons.

This is my first post here and I have tryed to find what I am missing, but to no aval.

Thanks in adance


- pumkinut - 2010-02-08

Can you post your input.conf file from /etc/bluetooth?

What finally clicked was the following. In input.conf there are lines that have comments (the text following a #) that say "(XBMC recommendation: <whatever>)". These are the parts of the .conf file that need changed.

So if you have:
Code:
0x64 = KEY_AUDIO          # AUDIO             (XBMC recommendation: KEY_A)
You need to change the "KEY_AUDIO" to whatever XBMC needs for a certain function, for example:
Code:
0x64 = KEY_A
Or something similar. Basically, the key definition in the default input.conf from above, KEY_AUDIO is not a recognized key to XBMC, so it needs to be changed to something that XBMC can do something with.

I changed my default input.conf file to reflect all of the "XBMC recommendations" and everything stared to work. From there I modified my keymap.xml file to get the functionality that I wanted.

If some of the keys are working, but others aren't, that means your remote is recognized and working, it just needs valid key definitions for the buttons that currently aren't working.

Hope this helps. If not post back to the thread.

By the way, the different "Got key" numbers for each button push is as expected. There's a key number for the initial press, and a different number for the release of the button, IIRC.


- fostersimported - 2010-02-09

Ok here is the input.conf file, sorry I dont know how to rap it into a scrolling window.


Quote:# 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=600



# This section contains options that are specific to a device
[00:24:33:93:E8:43]
#
# Set a custom idle timeout (in seconds) for this specific device
IdleTimeout=30



# 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_EJECTCD # EJECT
0x64 = KEY_AUDIO # AUDIO (XBMC recommendation: KEY_A)
0x65 = KEY_ANGLE # ANGLE (XBMC recommendation: KEY_Z)
0x63 = KEY_SUBTITLE # SUBTITLE (XBMC recommendation: KEY_T)
0x0f = KEY_CLEAR # CLEAR (XBMC recommendation: KEY_DELETE)
0x28 = KEY_TIME # TIMER (XBMC recommendation: KEY_END)
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_RED # RED (XBMC recommendation: KEY_F7)
0x82 = KEY_GREEN # GREEN (XBMC recommendation: KEY_F8)
0x80 = KEY_BLUE # BLUE (XBMC recommendation: KEY_F9)
0x83 = KEY_YELLOW # YELLOW (XBMC recommendation: KEY_F10)
0x70 = KEY_DISPLAY # DISPLAY (XBMC recommendation: KEY_D)
0x1a = KEY_MENU # TOP MENU
0x40 = KEY_CONTEXT_MENU # POP UP/MENU (XBMC recommendation: KEY_F11)
0x0e = KEY_ESC # RETURN
0x5c = KEY_OPTION # TRIANGLE/OPTIONS (XBMC recommendation: KEY_C)
0x5d = KEY_BACK # CIRCLE/BACK
0x5f = KEY_SCREEN # SQUARE/VIEW (XBMC recommendation: KEY_V)
0x5e = BTN_0 # CROSS (XBMC recommendation: KEY_X)
0x54 = KEY_UP # UP
0x56 = KEY_DOWN # DOWN
0x57 = KEY_LEFT # LEFT
0x55 = KEY_RIGHT # RIGHT
0x0b = KEY_ENTER # ENTER
0x5a = BTN_TL # L1 (XBMC recommendation: KEY_F1)
0x58 = BTN_TL2 # L2 (XBMC recommendation: KEY_F2)
0x51 = BTN_THUMBL # L3 (XBMC recommendation: KEY_F3)
0x5b = BTN_TR # R1 (XBMC recommendation: KEY_F4)
0x59 = BTN_TR2 # R2 (XBMC recommendation: KEY_F5)
0x52 = BTN_THUMBR # R3 (XBMC recommendation: KEY_F6)
0x43 = KEY_HOMEPAGE # PS button
0x50 = KEY_SELECT # SELECT (XBMC recommendation: KEY_INSERT)
0x53 = BTN_START # START (XBMC recommendation: KEY_HOME)
0x33 = KEY_REWIND # SCAN BACK (XBMC recommendation: KEY_R)
0x32 = KEY_PLAY # PLAY
0x34 = KEY_FORWARD # SCAN FORWARD (XBMC recommendation: KEY_F)
0x30 = KEY_PREVIOUS # PREVIOUS (XBMC recommendationL KEY_PAGEUP)
0x38 = KEY_STOP # STOP
0x31 = KEY_NEXT # NEXT (XBMC recommendation: KEY_PAGEDOWN)
0x60 = KEY_FRAMEBACK # SLOW/STEP BACK (XBMC recommendation: KEY_COMMA)
0x39 = KEY_PAUSE # PAUSE
0x61 = KEY_FRAMEFORWARD # SLOW/STEP FORWARD (XBMC recommendation: KEY_DOT)
0xff = KEY_MAX