[LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: XBMC General Help and Support (/forumdisplay.php?fid=111)
+---- Forum: Linux and Live support (/forumdisplay.php?fid=52)
+---- Thread: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS (/showthread.php?tid=50717)
- neil.j1983 - 2009-11-20 19:16
nanny07 Wrote:ok.. finally. SUCCESS!
i will post mine up on pastebin ;ater if you get stuck, but you need to uncomment the line with [11:22:33,etc] in it, and change it to your mac address
you also need to uncomment the line which tells it to use the PS3 REMOTE XBMC profiler, then scroll down to the very bottom and change the KEY_* entries to whatever key you want, the list of available ones is in the file /etc/input.h (i think), i'm pretty new to this ubuntu thing myself..
If anyone works out how to launch xbmc with a remote keypress i would be very grateful if they could share the method.
- nanny07 - 2009-11-20 20:35
i try the one of kitlaan but same fuction missing: like volume, the music/movies/tv show button (red,blue,yellow) and one for emulate the right-click
EDIT: one more thing... in the kitlaan's file the timeout is set on 30 minutes! I think it's too high... what about 3 minutes?
- kitlaan - 2009-11-21 10:28
I've been going between many timeout values. The most recent one I've been doing is 4 minutes. The default bluez timeout is 0 (as in no timeout)! I would definitely change the value if you're using the remote. In my usage, I always set a custom timeout value (i.e. set one in the device-specific section).
The KEY_* strings can be grabbed from the files listed in the conf file. Most of them match up to what's expected, but a few are really dependant on how Xorg has the keymaps set up. The most likely source is /usr/src/linux-headers-.../include/linux/input.h. From there, you may also have to configure your userdata/keymaps/keyboard.xml.
(Note, in Linux, there's the kernel keymap, and then there's the Xorg keymap, which is limited to 255 values. If you can't get a key working, you probably need to set up an xorg keymap.)
Here's a better tar archive for the pair/unpair scripts (based on the original ones)
- nanny07 - 2009-11-21 14:57
I made a search in this 3d and I found this very useful post that show me the name of every button and this one for the keymap.xml
So I have modify the keymap in accord with this list of command and now it's all configured!
I think this post will be usefull for who want to change some settings
getting PS3 BD Remote from Connected: 0 => 1 under bluez - faxo - 2009-11-23 04:22
Like nanny07 and others, I had the same problem with the PS3 BD Remote not getting "Connected: 1" (and thus not appearing in '/proc/bus/input/devices | grep emot'). This was after running kitlaan's bluez and ps3 pairing script multiple times. I also confirmed that my output from 'bluetoothd -nd' was as expected, and /var/lib/bluetooth/ contained all the right device codes (the same as kitlaan's).
Then I saw nanny07's post about having done a pairing in windows and things suddenly working for him. I tried to do the same, but I could not pair the remote in windows, because the IOGEAR software that came with my dongle wouldn't accept a pairing without a PIN number.
That's when I happened accross the following:
and decided to give it a shot. After updating line 27, per the author's instructions, to have the remote's MAC address, I fired up the script, and to my surprise it worked! Every keypress was reported by the script correctly, 'list-devices' returned "Connected: 1", and cat /proc/bus/input/devices showed the remote. For the first time ever, Linux and the remote were communicating.
But, as soon as I CTRL-C'd out of the script, things returned to their previous state. No more "Connected: 1" in list-devices, and no more remote in /proc/bus/input/devices.
Back to no communication between the remote and bluetoothd. Frustrating.
I ran the script several more times (3? 5?), to see if I could reproducibly have it connect. It worked every time, holding enter+start per the instructions.
That's when something unbelievable happened. After I exited the script (after X runs, maybe 5), I held enter+start while running 'bluetoothd -nd' but without running the script, and output appeared from bluetoothd. I hit some random buttons on the remote and bluetoothd reported the ID #'s of the keypresses every time.
I exited out of 'bluetoothd -nd' and re-ran it as '/etc/init.d/bluetooth start', and this time just hit a few buttons on the remote (not enter+start). Checking list-devices, to my surprise, it was "Connected: 1". It also appeared in /proc/bus/input/devices. Hitting numbers on the remote did exactly as was described above, they appeared in my xterm window.
Wanting to see if this working state would survive a reboot, I power cycled.. and again hit a few arrow keys on the remote, and it instantly connected again. Firing up XBMC, the basic directional navigation and selection worked! Amazing. Since that point, hitting any button on the remote causes it to pair/connect instantly, and it stays that way until my input.conf Timeout, at which point it goes to sleep (I'm using a timeout of 1 minute currently). Pressing buttons on it again pairs/connects it, so everything is working great.
So how to explain this drastic switch to a working state? This remote was brand new out of the box, and I don't own a PS3, and it had never been paired with anything before.
As such, the following is a wild hypothesis (for which I have no data to back up) which may or may not be true:
I propose that the act of direct-connecting to the PS3 BD Remote X times (where X = 1? 3? 5?) via the h00s script
trained the remote to connect back to my dongle's MAC address whenever it's woken up via keypress. Under this (admittedly far fetched) model, the remote connects to the last bluetooth MAC address which connected to it. Perhaps this is why the PS3 BD Remote instructions say that it can only be paired with one PS3 at a time.
(I really know nothing about Bluetooth, so if this theory is completely ridiculous, now you know why!)
Hopefully this "silly" method of getting the remote to connect helps someone else. If it makes any sense and holds out for others, perhaps kitlaan can update his pairing script to also perform an outbound connection as a final step. I'm now on to playing with Keymaps to get the other half of the buttons to work in XBMC.
Thanks to everyone who's contributed to this thread. The work is tremendous and appreaciated.
only few keys are working, what should i do now? - shiree1 - 2009-11-23 13:44
kitlaan Wrote:... From there, you may also have to configure your userdata/keymaps/keyboard.xml.
first of all, thanks for your support. i'm a linux noob and completely depending on guys on this forum.
i'm on karmic x64 minimal without any window manager and xbmc 9.11beta1 from svn ppa.
after fresh install, i installed your patched bluez 4.57 from ppa, and paired with ps3_pair.py script.
it paired without problem and few keys (NUMBERS 0~9, ENTER, RETURN, HOMEPAGE generally,
and STOP and BACKWARD SCAN in full screen video. these are all keys that i found working) are working after that.
so, i tried to re-config my remote in keyboard mode. changed few lines from input.conf like this,
copied /usr/share/xbmc/system/keymaps/keyboard.xml to ~/.xbmc/userdata/keymaps/keyboard.xml but changed nothing
(it looks like already matches with the input.conf codes),
in xbmc's SETTINGS > SYSTEM > INPUT DEVICES, checked the option "REMOTE CONTROL SENDS KEYBOARD PRESS" on.
but still only the same keys are working.
then i saw your post and checked my keymaps.
my kernel keymap is pc105(intl) us, and xorg.conf is configured like this,
it looks like everything's configured correctly, but still not working properly.
and i have no idea what's wrong.
what should i do now? any suggestion?
now it's working properly.
i don't know why, because i did too many things that i don't even understand.
but i'm suspecting it's somehow concerned with the lirc.
however, thanks guys.
- spArcling - 2009-11-23 14:29
Thanks, this fixed it for me as well.
nanny07 Wrote:ok.. finally. SUCCESS!
- kitlaan - 2009-11-24 01:27
shiree1 Wrote:hi, kitlaan.
If I remember right, the input.conf that's shipped in the deb, sends keys that aren't part of xbmc's default keyboard.xml... See this post. I think other than the ones that you listed, maybe triangle, up/down/left/right, will work in the default.
In other news, I'm hoping sometime this thanksgiving break I'll have some time to get back to work on improving ruff's smart-sleeping functionality so I can finally get that into my patch. (ruff's implementation is great; just trying to add bluez cleanup/shutdown code.) If not, I may just shove it in as is just to have it in.
bluez~kitlaan ppa update! - kitlaan - 2009-11-25 17:21
Anyone that's using using bluez from my PPA will need to watch out for the next update (bluez_4.57-0ubuntu1~kitlaan9). This one changes the format of input.conf. It'll probably show up in the next few hours.
Here's the changes, so you know what you're expecting:
To do the quick-reconnect, I had to change how I loaded the keymap (otherwise things could get all messed up).
I would make a copy of your current input.conf and put it in a safe place. When the upgrade happens, it'll keep your old file, so you'll have to merge the changes in. For reference, here's the original and my custom input.conf
- faxo - 2009-11-28 01:37
kitlaan Wrote:Hey everybody!
Awesome. Is there a diff (like your first post) for we non-Ubuntu types?