Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Sony PS3 BD remote with Kodi (xbmc)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
daaaaang
n00b
n00b


Joined: 04 Jul 2010
Posts: 48
Location: Ann Arbor, Michigan, US

PostPosted: Mon Sep 14, 2015 10:27 am    Post subject: Sony PS3 BD remote with Kodi (xbmc) Reply with quote

This would also fit in Kernel & Hardware, but I put it here since I feel like I mostly have that end of the problem solved at this point. I have a Logitech Harmony Remote that I'm trying to use to control Kodi via bluetooth. The most straightforward way to do this (that I could think of) was to have the remote pretend to be a PS3 BD remote and to have my computer pretend to be a PS3.

If you think there's a better remote for it to pretend to be, I am all ears—I'm definitely not married to the PS3 one.

Also, by the way, I've found a lot of guides for using a PS3 BD remote with linux, but they all rely on bluez 4 and also on a patch from a website that's been 404ing for a couple years :roll:.

At this point, I've managed to pair them using bluetoothctl, the remote appears to believe my computer is a PS3, and I can see every button press with hcidump. I can't get my computer to actually treat it as a keyboard, though.

When the remote turns on and connects to the computer, hcidump -X shows the following:

Code:
> HCI Event: Connect Request (0x04) plen 10
    bdaddr 00:04:20:F2:D3:CE class 0x00250c type ACL
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
    bdaddr 00:04:20:F2:D3:CE role 0x00
    Role: Master
> HCI Event: Command Status (0x0f) plen 4
    Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
> HCI Event: Role Change (0x12) plen 8
    status 0x00 bdaddr 00:04:20:F2:D3:CE role 0x00
    Role: Master
> HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 11 bdaddr 00:04:20:F2:D3:CE type ACL encrypt 0x00
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 11
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
< HCI Command: Write Scan Enable (0x03|0x001a) plen 1
    enable 0
> HCI Event: Command Complete (0x0e) plen 4
    Write Scan Enable (0x03|0x001a) ncmd 1
    status 0x00
> HCI Event: Max Slots Change (0x1b) plen 3
    handle 11 slots 5
> HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 11
    Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x87
< HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
    handle 11 page 1
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
> HCI Event: Read Remote Extended Features (0x23) plen 13
    status 0x00 handle 11 page 1 max 1
    Features: 0x06 0x00 0x00 0x00 0x00 0x00 0x00 0x00
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
    bdaddr 00:04:20:F2:D3:CE mode 2 clkoffset 0x0000
< ACL data: handle 11 flags 0x00 dlen 10
    L2CAP(s): Info req: type 2
> HCI Event: Command Status (0x0f) plen 4
    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
> ACL data: handle 11 flags 0x02 dlen 10
    L2CAP(s): Info req: type 2
< ACL data: handle 11 flags 0x00 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x02b8
        Enhanced Retransmission mode
        Streaming mode
        FCS Option
        Fixed Channels
        Unicast Connectless Data Reception
> ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x0080
        Fixed Channels
< ACL data: handle 11 flags 0x00 dlen 10
    L2CAP(s): Info req: type 3
> HCI Event: Remote Name Req Complete (0x07) plen 255
    status 0x00 bdaddr 00:04:20:F2:D3:CE name 'BD Remote Contol'
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
> ACL data: handle 11 flags 0x02 dlen 10
    L2CAP(s): Info req: type 3
< ACL data: handle 11 flags 0x00 dlen 20
    L2CAP(s): Info rsp: type 3 result 0
      Fixed channel list 0x00000006
        L2CAP Signalling Channel
        L2CAP Connless
> ACL data: handle 11 flags 0x02 dlen 20
    L2CAP(s): Info rsp: type 3 result 0
      Fixed channel list 0x00000002
        L2CAP Signalling Channel
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
> ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 17 scid 0x0040
< ACL data: handle 11 flags 0x00 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
      Connection successful
< ACL data: handle 11 flags 0x00 dlen 12
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 0
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
> ACL data: handle 11 flags 0x02 dlen 23
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 11
      RFC 0x00 (Basic)
< ACL data: handle 11 flags 0x00 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      MTU 672
> ACL data: handle 11 flags 0x02 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      MTU 672
> ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 19 scid 0x0041
< ACL data: handle 11 flags 0x00 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0041 scid 0x0041 result 1 status 2
      Connection pending - Authorization pending
< ACL data: handle 11 flags 0x00 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0041 scid 0x0041 result 0 status 0
      Connection successful
< ACL data: handle 11 flags 0x00 dlen 12
    L2CAP(s): Config req: dcid 0x0041 flags 0x00 clen 0
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
> ACL data: handle 11 flags 0x02 dlen 23
    L2CAP(s): Config req: dcid 0x0041 flags 0x00 clen 11
      RFC 0x00 (Basic)
< ACL data: handle 11 flags 0x00 dlen 18
    L2CAP(s): Config rsp: scid 0x0041 flags 0x00 result 0 clen 4
      MTU 672
> ACL data: handle 11 flags 0x02 dlen 18
    L2CAP(s): Config rsp: scid 0x0041 flags 0x00 result 0 clen 4
      MTU 672
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 1


And the following appears in /proc/bus/input/devices:

Code:
I: Bus=0005 Vendor=046d Product=c129 Version=0000
N: Name="Bluetooth HID Boot Protocol Device"
P: Phys=
S: Sysfs=/devices/pci0000:00/0000:00:1a.0/usb5/5-1/5-1.4/5-1.4:1.0/bluetooth/hci0/hci0:11/input23
U: Uniq=
H: Handlers=event2
B: PROP=0
B: EV=1


If I press, say, all the directional buttons on the remote, I see this from hcidump -X:

Code:
> ACL data: handle 11 flags 0x02 dlen 17
    L2CAP(d): cid 0x0041 len 13 [psm 0]
      0000: a1 01 10 00 00 54 ff ff  ff ff ff 01 05           .....T.......
> ACL data: handle 11 flags 0x02 dlen 17
    L2CAP(d): cid 0x0041 len 13 [psm 0]
      0000: a1 01 00 00 00 ff ff ff  ff ff ff 00 05           .............
> ACL data: handle 11 flags 0x02 dlen 17
    L2CAP(d): cid 0x0041 len 13 [psm 0]
      0000: a1 01 20 00 00 55 ff ff  ff ff ff 01 05           .. ..U.......
> ACL data: handle 11 flags 0x02 dlen 17
    L2CAP(d): cid 0x0041 len 13 [psm 0]
      0000: a1 01 00 00 00 ff ff ff  ff ff ff 00 05           .............
> ACL data: handle 11 flags 0x02 dlen 17
    L2CAP(d): cid 0x0041 len 13 [psm 0]
      0000: a1 01 40 00 00 56 ff ff  ff ff ff 01 05           ..@..V.......
> ACL data: handle 11 flags 0x02 dlen 17
    L2CAP(d): cid 0x0041 len 13 [psm 0]
      0000: a1 01 00 00 00 ff ff ff  ff ff ff 00 05           .............
> ACL data: handle 11 flags 0x02 dlen 17
    L2CAP(d): cid 0x0041 len 13 [psm 0]
      0000: a1 01 80 00 00 57 ff ff  ff ff ff 01 05           .....W.......
> ACL data: handle 11 flags 0x02 dlen 17
    L2CAP(d): cid 0x0041 len 13 [psm 0]
      0000: a1 01 00 00 00 ff ff ff  ff ff ff 00 05           .............


However, when I run startx, I see the following in /var/log/Xorg.0.log:

Code:
[1002205.336] (II) config/udev: Adding input device Bluetooth HID Boot Protocol Device (/dev/inp
ut/event2)
[1002205.336] (**) Bluetooth HID Boot Protocol Device: Applying InputClass "keyboard-all"
[1002205.336] (II) Using input driver 'evdev' for 'Bluetooth HID Boot Protocol Device'
[1002205.336] (**) Bluetooth HID Boot Protocol Device: always reports core events
[1002205.336] (**) evdev: Bluetooth HID Boot Protocol Device: Device: "/dev/input/event2"
[1002205.336] (--) evdev: Bluetooth HID Boot Protocol Device: Vendor 0x46d Product 0xc129
[1002205.336] (WW) evdev: Bluetooth HID Boot Protocol Device: Don't know how to use device
[1002205.360] (EE) PreInit returned 8 for "Bluetooth HID Boot Protocol Device"
[1002205.360] (II) UnloadModule: "evdev"


I've also copied http://blog.lvengine.com/Imgs/articles/article_14/input.conf into /etc/bluetooth/input.conf (with an updated MAC address). But I can't get X to react to any button presses on the remote.

Possibly relevant is that I have HID_SONY currently compiled into the kernal as a module:

Code:
CONFIG_HID_SONY=m


However, this is all that appears in lsmod when I first connect with the remote:

Code:
Module                  Size  Used by
hidp                   13914  1


I can run modprobe hid_sony, but all that ever gets me is:

Code:
Module                  Size  Used by
hid_sony               12964  0
hidp                   13914  1


I feel like I am just so close here, like there's maybe just a single line of code that I need to put somewhere to get this working. But heck if I know what to put—and where. Any ideas?

Thank you for reading!
Matt
Back to top
View user's profile Send private message
daaaaang
n00b
n00b


Joined: 04 Jul 2010
Posts: 48
Location: Ann Arbor, Michigan, US

PostPosted: Sat Sep 19, 2015 2:54 pm    Post subject: Reply with quote

One thing I'll highlight that could be particularly relevant is this line in /proc/bus/input/devices:

Code:
H: Handlers=event2


While other devices in there have lines like this:

Code:
H: Handlers=kbd event1


My bet is that the lack of "kbd" is a meaningful clue, but it sure doesn't mean anything to me.

I've given up (for now) on doing this The Right Way, so now I'm trying to figure out a way to pipe hcidump into some sort of virtual keyboard input device. Has anybody done anything like that before? If so, would you point me at a good place to start?

Much appreciated,
Matt
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum