[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) |
- Frozone - 2009-08-11 erhnam Wrote:I wrote a howto. It's only in Dutch but most of the commands are there. Here's the link:Any chance that u translate it to english? - erhnam - 2009-08-12 Asure Wrote:I started out from your blog post (i'm dutch) before i came to the XBMC forums I used XBMC Live 9.04, so in fact Ubuntu 9.04. It has been a while ago since I wrote the blogpost. Maybe it's better to start all over again, using the latest bits and bytes and write a better howto. - Asure - 2009-08-15 I ran some test today. I can't sleep with unanswered questions running around in my mind We've pretty much confirmed - ps3d.py not working on 9.04. - bdremoted not working on 9.04 (full, in my case) So i went for Hardy 8.04 release. Installed libbluetooth, compiled bdremote. Code: /etc/init.d/bluetooth stop Code: [code]det=0, port=8888, tmout=1, rep=10, deb=200, addr=00:21:4F:B2:3E:13 So i'm pretty sure ps3d.py would also work on Hardy. But now i've got another problem. Apparently the ppa's for hardy have no VPDAU. So that's not doing my ION any good..! ps3d.py: Code: cd /usr/share/python-support/xbmc-eventclients-common/xbmc/ Code: ./ps3_remote.py localhost It still hangs on "client, addr = self._sock.accept ()" loop. After all these actions, simply running bdremoted as before still works. Remote is detected again, and can be used w/o problems. Next tests: Try xbmc live 9.04 and see what happens.. - Asure - 2009-08-15 Update: Live 9.04.1 cd-rom did not work with the steps above. I followed the howto below, to use the older bluetooth 3.x stuff from hardy: http://jackflapb.wordpress.com/2009/03/23/howto-downgrading-intrepids-bluetooth-packages-to-hardys/ Basically the steps are: 1. Remove all bluetooth stuff 2. Replace jaunty with hardy in your apt sources.. 3. Install bluetooth and libbluetooth-dev from hardy. 4. Re-compile bdremoted using libbluetooth-dev from hardy. 5. Start bluetooth and stop it, run bdremoted as before, notice it detects keypresses Installing bluetooth from Hardy will break lots of stuff it seems.. so be carefull I'm looking into going back to Jaunty apt sources and fix the breakage somehow. - TREX6662k5 - 2009-08-15 "So i'm pretty sure ps3d.py would also work on Hardy. But now i've got another problem. Apparently the ppa's for hardy have no VPDAU. So that's not doing my ION any good..!" Compile from SVN instead. - Asure - 2009-08-15 I didn't have any accelleration in desktop, so i was assuming i'd need to figure out another way to get it to work. Even though the glx shows up in X logs. Guess desktop wasn't using it ? Trex6662k5: Are you running 9.04 with working bdremoted/lirc ? Or another flavor of linux ? Edit: Guess i needed to switch on 'use restricted drivers' if google is correct: https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia - ruff - 2009-08-16 Having been trying lot of variants on my ubuntu jaunty. Neither of them satisfied me. The problems: Lirc works fine until you turned off the remote. Then, bluetoothd is not removing old device record, and new registration confuses Lirc - it just using correct event descriptor. This is half of the story. I've written simple script which monitors number of PS3 records in bus/input/devices, and if more then 1 - restarts bluetoothd. However, this produces a new HAL event, and XBMC captures new keyboard device (ps3 remote) directly from HAL, ignoring Lirc. Then tried lot of custom scripts, written own python script to handle events, tried to bypass this with Lirc as event client - no go, still, XBMC doesn't care about any input device as soon as it sees new keyboard. However, this new keyboard (ps3remote) is capable of sending cursor movement keys, play/stop, escape and numbers. Not a big list of options to choose. As such, I've modified bluez's ps3remote driver to: 1) Correctly detect remote turning off and clean up device handler 2) Correctly handle holding of PS button, to allow remote to be turned off without generating ps button event. 3) remap keys on remote to send normal keyboard keys, which are predefined in system/Keymaps.xml Here is the patch: Code: --- bluez-4.47/input/fakehid.c 2009-04-23 03:40:04.000000000 +0200 Here is little customization i'm using in my userdata/Keymaps.xml Code: <keymap> Ability to turn off the remote controller (holding PS button for 7 secs) allows to save batteries. - TREX6662k5 - 2009-08-16 Asure Wrote:I didn't have any accelleration in desktop, so i was assuming i'd need to figure out another way to get it to work. Even though the glx shows up in X logs. Guess desktop wasn't using it ? Running a minimal Hardy Ubuntu installation on an ION machine with BDRemoted. You need to update to the latest nvidia driver but that will conflict with an exsisting nvidia driver that arrives with ubuntu. You can blacklist the driver or remove the restricted package in order to load the latest nvidia driver. Then you need to compile xbmc from svn to get vdpau working. IIRC Hardy builds don't have vdpau enabled. - Asure - 2009-08-16 I've given up. I went to back to the drawing board, minimal hardy, removed the nvidia stuff, dropped in glx-190 and compiled from svn after manually adding vpdau devel stuff. That worked great, with vdpau working. Except, bluetooth fails to work for me for some reason i don't understand. No errors in any logs. Tried 3 dongles, all blink, rebooted several times etc.. It still works fine with ps3_remote.py.. which i don't get.. I guess i'm off to the store on monday for a MCE reciever or something. The BD remote would be used for my ps3 for now There is a way out though. If someone good at python would use the 'stopablethread' stuff inside ps3d.py to create a version of ps3_remote.py that can time-out, i would be sorted. I'm no good at python though (Otherwise i do that myself.) Bluez 4.47 is the way to go - Exposure - 2009-08-16 Using the latest BlueZ 4.47 we can use the remote as a standard keyboard thanks to fakehid. This works almost out of the box, except for the keys that have a keycode above 255 since X can't handle those. Take a look at the post above by Ruff, for the fakehid patch. A different approach is to use evrouter to map the keys. I'm also looking into Gizmod but both seem to struggle with XBMC running as a standalone X session. - Asure - 2009-08-16 Let me be the first to say: Great first post Ruff ! I took your 'power off' as inspiration and hackup up ps3_remote.py a bit : Code: if xbmc.previous_key == "43": Then ps3_remote.py drops back to the terminal.. to keep it going i made a 'remote.sh' and dropped a call to it into rc.local : Code: #!/bin/bash Sidenote: I fixed up the notifications since eventserver is somewhat broken, and it now only sends a notification on connect and exit. (otherwise it beeps all the time on each eventserver-notification message) Still, a version that times out would be cleaner.. need to brush up my python-skillz.. - ruff - 2009-08-16 Asure Wrote:Let me be the first to say: Great first post Ruff !Thanks %) Asure Wrote:Sidenote: I fixed up the notifications since eventserver is somewhat broken, and it now only sends a notification on connect and exit. (otherwise it beeps all the time on each eventserver-notification message)I also noticed that it is somewhat broken, that's why I became determined to hack bluez. That is - when xbmc sees new input device - all events sent by eventclient are ignored by event server. It only detects Hello/bye packets, and all key events are lost in vain (timed out). Bluez, on the other hand, is lowlevel, it correctly handles pairing, it sends all necessary hal/dbus notifications... just incorrectly handles unpairing and sends keyevents, xbmc is not aware of %) Also this stickiness of xbmc to new input device allows to forget about all other devices. Even if you plugged usb keyboard to htpc for some reason, just hold ps to unpair and hit it once again to pair - and voilĂ Of course, I'd rather prefer ps3bd to be detected as remote controller to use more explicit mappings of <remote> sections in Keymaps.xml. On the other hand, this keyboard driver allows me to launch xbmc from desktop using gnome's keybindings, as I'm turning off xbmc while going to work, to make cpu idle and save the power %) - TREX6662k5 - 2009-08-18 Asure Wrote:I've given up. I went to back to the drawing board, minimal hardy, removed the nvidia stuff, dropped in glx-190 and compiled from svn after manually adding vpdau devel stuff. That worked great, with vdpau working. Except, bluetooth fails to work for me for some reason i don't understand. No errors in any logs. Tried 3 dongles, all blink, rebooted several times etc.. Pair the remote first. Then stop bluetooth, launch sudo bdremoted, launch sudo lircd then restart bluetooth, then check irw. - Exposure - 2009-08-19 What exactly is the advantage of using XBMC's EventClient support? As far as I know it sends events to XBMC and show notifications on screen when something happens to the input device? As far as I know i'm not using EventClient (does XBMC load it under the hood?). The remote is working fine as a keyboard, using Bluez and uinput. I don't get any notifications in XBMC about the remote, but do I need any?. It is connected at boot and works for as long as the machine is running so there's nothing to notify me about. I've hooked up a multimeter to the remote to check power usage. Compared to the PS3, it does use more power overall. I guess the wireless connection with a PS3 is more finetuned than the connection with a generic USB bluetooth dongle. After about 30 mins the remote seems to enter a low-power state all by itself. The only minor issue I'm having is with the keys on the remote with keycodes >255. The fakehid driver is the culprit here, as Ruff pointed out. In my opinion all problematic keys should be mapped to some normal keyboard letter instead of being ignored. That way anyone who isn't satisfied with the mapping can use gizmod, evrouter, keymap.xml etc. to change it to their liking, without having to recompile fakehid.c. - ruff - 2009-08-19 Well, my initial intention to modify fakehid was to fix unpairing and manual remote turn-off with ps key. And at the same time I remapped the keys to avoid additional daemons and configurations %) |