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)



RE: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - OS/2 - 2013-04-10

Well my input.conf file isn't being read that's why. I don't quite know how to fix.


RE: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - OS/2 - 2013-04-12

That's probably because patched Bluez didn't deploy properly. I'm running Fedora.

The Fedora repo has package 4.1.1 which I first had to install together with Blueman in order to resolve dependencies. After patching BlueZ 4.9.1 and overwriting into my system/distro it hasn't appeared to have deployed properly.


EDIT:
(1)
Never-mind all that ranting. Managed to get it working now. Stopped the Bluetooth service before applying (Kitlaan's patched) Bluez-4.9.1. Here are the full details and I now have it working on Fedora/openSUSE.

http://wiki.xbmc.org/index.php?title=HOW-TO:Setup_PS3_BD_Remote

I'm actually using this solution with mythTV and here is the input.conf file to use instead:

http://www.mythtv.org/wiki/Sony_PS3_BD_Remote

Great thing is I no longer have to use LIRC with mythTV, so one less service to worry about. The only drawback with this solution is to keep swapping the input.conf when switching between XBMC and mythTV.


(2)
The other solution I considered was patching xf86-input-evdev with an option to remap keys outside of Xorg's 255 keycode limit to unused keycodes < 255. Then rebuilding. It is outlined here:

http://www.mythtv.org/wiki/Remapping_remote_control_key_codes_greater_than_255

Problem: All keycodes of the PS3-RC are detected by the current kernel/uinput. So no special drivers are needed. But due to Xorg's keycode limitation of 255, all keycodes greater than 255 get discarded by Xorg. Hence some keys work rightaway and others don't. Further those keycodes which are < 255 do still have to mapped to something meaningful.
Check it out for the PS3-RC without the above patch:

Code:
# sudo evtest /dev/input/eventX


(3)
The other solution is to edit the kernel source header:

Quote:/usr/include/linux/input.h

It contains all the keycodes which are recognised by a Linux system. You take those keycodes of the PS3-RC which are > 255 and map them to unused keycode values < 255. Then recompile the kernel for the changes to take effect.
You then use xmodmap to map keycodes < 255 to meaningful actions/events/keys. These mappings should be put in a local file .Xmodmap and would look like:

Code:
...
keycode 256 = btn0
keycode 310 = btntl
keycode 311 = btntr
keycode 312 = btntl2
keycode 313 = btntr2
keycode 315 = btnstart
keycode 317 = btnthumbl
keycode 318 = btnthumbr
...

---

I hope this brings the patch/workaround to this problem up to date.


RE: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - Bamei - 2013-04-23

New to the forum and new to Linux

I've been reading this thread start to end, end to start, several times.
I've got my ps3 Remote up running with Ubuntu 12.1, XBMC Eden 11
I followed the How to guide here: http://wiki.xbmc.org/index.php?title=HOW-TO:Setup_PS3_BD_Remote

I had to go through the troubleshooting to make it connect and work.

Anyway, i am struggling with getting the remote buttons working.
I am using the example input.conf file from the How To site.
Currently Play and Direction buttons seems to be the only ones really working. And Stop.

My remote is an old one. The one with the Yellow button all the way to the right.

I would very much like someone to tell me what I exactly have to do to make all the buttons work.
Especially the Subtitles, assigning volume up/down, forward/rewind, pause, and a ton more...

The How To guide is very good, but it would be even better if it would show how to set it completely up and actually working as everyone want it to. (I'm assuming no one is satisfied with only Play and Direction keys to work)

Also, I read somewhere one of you have assigned a remote button to launch XBMC.
That would be cool to know how to do as well.

Finally, awesome thread! Reall good stuff in there, I just wish I knew how to work with it all... Huh

Cheers
Bamei


RE: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - OS/2 - 2013-04-23

If you make and install the Bluez patch, the install script will reinstall Bluez 4.91 to another location -- it won't overwrite Bluez package (version 4.1) supplied with the distro/PPA. It means the system will continue to operate the non-patched (or vanilla) version of Bluez unless you make changes to path of bluetoothd in the service file. It is why you're not seeing XBMC specific keycodes coming through.

Show me the output from your bluetooth service:

Code:
sudo systemctl status bluetooth.service



RE: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - Bamei - 2013-04-23

writing this: sudo systemctl status bluetooth.service gets me this output

sudo: systemctl: command not found



and thank you for looking into this :-)


RE: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - MartinHJ - 2013-04-24

(2013-04-12, 21:11)OS/2 Wrote: That's probably because patched Bluez didn't deploy properly. I'm running Fedora.

The Fedora repo has package 4.1.1 which I first had to install together with Blueman in order to resolve dependencies. After patching BlueZ 4.9.1 and overwriting into my system/distro it hasn't appeared to have deployed properly.


EDIT:
(1)
Never-mind all that ranting. Managed to get it working now. Stopped the Bluetooth service before applying (Kitlaan's patched) Bluez-4.9.1. Here are the full details and I now have it working on Fedora/openSUSE.

http://wiki.xbmc.org/index.php?title=HOW-TO:Setup_PS3_BD_Remote

I'm actually using this solution with mythTV and here is the input.conf file to use instead:

http://www.mythtv.org/wiki/Sony_PS3_BD_Remote

Great thing is I no longer have to use LIRC with mythTV, so one less service to worry about. The only drawback with this solution is to keep swapping the input.conf when switching between XBMC and mythTV.


(2)
The other solution I considered was patching xf86-input-evdev with an option to remap keys outside of Xorg's 255 keycode limit to unused keycodes < 255. Then rebuilding. It is outlined here:

http://www.mythtv.org/wiki/Remapping_remote_control_key_codes_greater_than_255

Problem: All keycodes of the PS3-RC are detected by the current kernel/uinput. So no special drivers are needed. But due to Xorg's keycode limitation of 255, all keycodes greater than 255 get discarded by Xorg. Hence some keys work rightaway and others don't. Further those keycodes which are < 255 do still have to mapped to something meaningful.
Check it out for the PS3-RC without the above patch:

Code:
# sudo evtest /dev/input/eventX


(3)
The other solution is to edit the kernel source header:

Quote:/usr/include/linux/input.h

It contains all the keycodes which are recognised by a Linux system. You take those keycodes of the PS3-RC which are > 255 and map them to unused keycode values < 255. Then recompile the kernel for the changes to take effect.
You then use xmodmap to map keycodes < 255 to meaningful actions/events/keys. These mappings should be put in a local file .Xmodmap and would look like:

Code:
...
keycode 256 = btn0
keycode 310 = btntl
keycode 311 = btntr
keycode 312 = btntl2
keycode 313 = btntr2
keycode 315 = btnstart
keycode 317 = btnthumbl
keycode 318 = btnthumbr
...

---

I hope this brings the patch/workaround to this problem up to date.


This all seems rather a lot of effort and inconvenience just to run one less service! My low powered Revo runs mythtv and xbmc using lirc and allows me to switch between the two from the remote without ever needing to pick up a keyboard or swap input.conf files!


RE: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - EnderEOC - 2013-05-01

Hi !

I'm having issue with my PS3 remote and xbmc.
I can't customize the keymap of the remote. I've used that tutorial http://wiki.xbmc.org/index.php?title=HOW-TO:Setup_PS3_BD_Remote
The remote works fine but the input.conf doesn't seem to be used at all. I can use the remote but since i can't customize any buttons, there's a lot of missing features Sad

Any ideas please ? Thank you


RE: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - OS/2 - 2013-05-01

(2013-04-23, 15:03)Bamei Wrote: writing this: sudo systemctl status bluetooth.service gets me this output

sudo: systemctl: command not found



and thank you for looking into this :-)

My Bad. Ubuntu 12.10 is somewhat behind and doesn't yet do systemd natively.

Can you run:

Code:
# whereis bluetoothd
# bluetoothd -v

and show the output?

What I suggest is you remove Bluez entirely from your system. The reinstall Kitlaan's patch via his PPA. This way you get the correct, patched-up version of Bluez without worrying about the system installing the standard issue-package instead.

Code:
# sudo apt-get purge bluez
# sudo add-apt-repository ppa:kitlaan/ppa
# sudo apt-get update
# sudo apt-get install bluez



RE: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - OS/2 - 2013-05-01

(2013-04-24, 07:34)MartinHJ Wrote: This all seems rather a lot of effort and inconvenience just to run one less service! My low powered Revo runs mythtv and xbmc using lirc and allows me to switch between the two from the remote without ever needing to pick up a keyboard or swap input.conf files!

You're missing the point. This routing input through standard Xorg actually reduces the problem somewhat in principle. The ideal scenario would be a complete and natural extension of your keyboard/mouse to a remote device.

You are correct you don't want to be shabbily swapping input.conf files. But nor is it possible to have both MythTV and XBMC use standard Xorg keymaps because each of these apps have different keys defined to different functions. The only alternative if running both mythTV and XBMC together on the same machine is to use LIRC with mythTV (because it's supported) and let XBMC use standard system keycodes (because XBMC reads them intrinsically).

Glad this is Linux with some leeway in flexibility. Under Windows you'd be damned, might wait a couple of years for a fix to come through, or end up buying another propretary product but with hicups only further down the line.

(2013-05-01, 15:13)EnderEOC Wrote: Hi !

I'm having issue with my PS3 remote and xbmc.
I can't customize the keymap of the remote. I've used that tutorial http://wiki.xbmc.org/index.php?title=HOW-TO:Setup_PS3_BD_Remote
The remote works fine but the input.conf doesn't seem to be used at all. I can use the remote but since i can't customize any buttons, there's a lot of missing features Sad

Any ideas please ? Thank you

Please read my post above. There's another new user in the same boat as yours. The fact you get some key presses means your input.conf isn't being read and if that's indeed the case, it means you're not running the correct version of Bluez.


RE: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - EnderEOC - 2013-05-01

@OS/2 : thx i'll read that but the tutorial doesn't mention a required version of bluez. just that the patch is needed for some versions (Note: Newer versions of bluez have been released which appear to have this patch already. I didn't need to patch 4.63 to get BD working on ubuntu 10.04 Note: Kitlaan now has patches up to Bluez-4.69, and the patch is required for 4.64 - 4.69).

I'm running 4.99-2, which wouldn't need a patch right ?

I'm using Debian wheezy btw

edit : removed 4.99-2 and installed 4.94 with patch, will report after


RE: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - OS/2 - 2013-05-01

The patch applies up to Bluez 4.91. That's it.
Newer, standard-issue versions of Bluez package (that includes 4.99+) don't have the patch applied to the source code. The patch is kind of ridiculous as it's a simply a collection of reassignments of the input keymaps. But it works.
You need to download the source, patch the C files with the .diff prescription file provided. Recompile, and then install.

Alternatively you can just use the prebuilt patched binary from Kitlaan's PPA seeing you're running Debian.

openSUSE and Fedora are still offering version 4.1 of Bluez in their standard repos. So I'm not going to lose any sleep over not having the lastest code from out there.

(2013-05-01, 18:15)EnderEOC Wrote: edit : removed 4.99-2 and installed 4.94 with patch, will report after

The service file is not included in the package. You have to create your own one or back it up from your previous version of Bluez which you had installed. Then copy it back to /etc/init.d or /etc/systemd/system depending on your system.
The new location of the patched-up Bluez executable will be /usr/local/sbin. You need to edit your service file as required.


RE: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - EnderEOC - 2013-05-01

bluez_ps3remote_4.91.diff -- patch for bluez 4.91 - 4.94 -> so it should work for 4.94 right ?

Anyway, still the same result (input.conf seems to be read but same result as before patching). I'm gonna try with 4.91 now.

edit : same result with 4.91 and patch. Remote is sending key input to terminal and doesn't follow input.conf (key_I should be display button but i have it on top menu)

edit 2 : ok forget it. input.conf working now. I'm just a retard and forgot to change the mac address of the remote ^^

edit 3 : how come the remote is way slower to react ? and the functions seem to be way off from input.conf like "0x40 = KEY_M # POP UP/MENU", M is player control. But when i hit the pop up menu, it just skip back 30 seconds...
And i have a lot of these in /var/log/syslog
"May 1 19:09:24 localhost bluetoothd[6842]: Input: disconnect /org/bluez/6842/hci0/dev_00_19_C1_55_39_83
May 1 19:09:26 localhost bluetoothd[6842]: Hangup or error on ps3remote socket"


RE: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - OS/2 - 2013-05-02

(2013-05-01, 18:50)EnderEOC Wrote: edit 3 : how come the remote is way slower to react ? and the functions seem to be way off from input.conf like "0x40 = KEY_M # POP UP/MENU", M is player control. But when i hit the pop up menu, it just skip back 30 seconds...
And i have a lot of these in /var/log/syslog
"May 1 19:09:24 localhost bluetoothd[6842]: Input: disconnect /org/bluez/6842/hci0/dev_00_19_C1_55_39_83
May 1 19:09:26 localhost bluetoothd[6842]: Hangup or error on ps3remote socket"

Check your Idletimeout in input.conf. If the device timeouts, the frist keypress to reactivate the Bluetooth socket suffers a slight delay.
Once the device is connected there should be no delays/lag-times with subsequent key/button presses. That's until the connection switches off again after timeout.


RE: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - EnderEOC - 2013-05-03

I see.
I guess i didn't experience that before because the input.conf wasn't read, so no timeout ^^
So the timeout is what define when the remote will "turn off" to save battery ?

Another thing, my keyboard layout is azerty but the one used by bluez is qwerty, so i have to find out the correct keys so it'll will work properly.
Is there anyway to make bluez use the system keyboard layout and not qwerty ?
Thx for the help Smile


RE: [LINUX] Sony PlayStation 3 Blu-ray Disc Remote (PS3 BD) + LIRC + XBMC = SUCCESS - OS/2 - 2013-05-03

You'd have to find the correct keys for your locale. The input.conf file is hardwired so there's no way of automatically mapping keys between different locales. The Azerty KB is not so different from Qwerty (US/UK). The bulk of keys in both locales are Latin so you'd probably only need to change very few keys.
You can look up further appropriate Xorg keymaps in the header file /usr/include/linux/input.h.