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)



- flxfxp - 2009-10-07

dc2447, if you could make a deb out of it that would be great.
Also please post a small tutorial on how to do it so I don't have to ask for your assistance each time Smile


- ruff - 2009-10-07

Hi flxfxp,
You mean you've compiled my git or 55rel?
In my git you need to add/uncomment Compat=1 in ps3 remote section of input.conf to enable compatible layout.


- flxfxp - 2009-10-07

hi ruff,

What's the compatibility mode? Can it still do some of the more advance xbmc functions?
I'm taking the liberty to edit the key config and create a custom keymap.xml to have every function assigned. Or am I reinventing the wheel?


- flxfxp - 2009-10-07

ruff, how do I assign the following keys:
{}[])(*&^%$#@

for example KEY_} does not work (obviously)

nevermind: I'll use the F-keys.


- flxfxp - 2009-10-07

Ok, here is a new installation procedure that uses 4.54 by ruff with his powersave and keymap patches. I edited most of the keys maps to have them working in xbmc without lirc. The only downside is that it has to build from source, which requires the entire toolbox plus time to compile.
This can be fixed as soon as I know how to properly make deps.

Procedure:
Code:
apt-get install libnl1 -y
            apt-get build-dep bluez -y
            wget http://flx.me/script/bluez_patched.tar.gz
            tar -xzvf bluez_patched.tar.gz
            cd bluez_make
            ./configure
            make
            make install
            cd $mypwd
            wget http://flx.me/script/ps3_pair.tar.gz
             tar -xzvf ps3_pair.tar.gz
            rm ps3_pair.tar.gz
            update-rc.d -f bluetooth remove
             echo modprobe uinput > /etc/rc.local
            echo /usr/local/sbin/bluetoothd >> /etc/rc.local
            echo "exit 0" >> /etc/rc.local
            echo "<keymap>" > /home/xbmc/.xbmc/userdata/Keymap.xml
            echo " <global>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "  <keyboard>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f1>XBMC.ActivateWindow(osdaudiosettings)</f1>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f2>XBMC.ActivateWindow(osdaudiosettings)</f2>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f3>XBMC.ActivateWindow(videolibrary)</f3>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f4>XBMC.ActivateWindow(videofiles)</f4>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f5>XBMC.ActivateWindow(MyMusic)</f5>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f6>XBMC.ActivateWindow(MyPictures)</f6>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f7>XBMC.ActivateWindow(Weather)</f7>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "  </keyboard>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "   </global>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo " <FullscreenVideo>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "    <keyboard>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f12>NextSubtitle</f12>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <menu>ShowVideoMenu</menu>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "    </keyboard>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo " </FullscreenVideo>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "</keymap>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo -e '\E[1;37m\033[1mI have to reboot.\033[0m'
            echo Press a key to reboot
            read -n1 any_key
            reboot



- dc2447 - 2009-10-07

for now just do
./configure
make
sudo checkinstall -D
and you will get a binary


- flxfxp - 2009-10-07

Thanks dc2447, creating and testing package...

edit: failed.
Code:
xbmc@AurigaHD:~$ sudo dpkg -i bluez-patched_454_i386.deb
Selecting previously deselected package bluez-patched.
(Reading database ... 51174 files and directories currently installed.)
Unpacking bluez-patched (from bluez-patched_454_i386.deb) ...
dpkg: bluez-patched: warning - conffile `etc/alsa' is not a plain file or symlink (= `/etc/alsa')
dpkg: bluez-patched: warning - conffile `etc/dbus-1' is not a plain file or symlink (= `/etc/dbus-1')
dpkg: bluez-patched: warning - conffile `etc/dbus-1/system.d' is not a plain file or symlink (= `/etc/dbus-1/system.d')
dpkg: bluez-patched: warning - conffile `etc/udev' is not a plain file or symlink (= `/etc/udev')
dpkg: bluez-patched: warning - conffile `etc/udev/rules.d' is not a plain file or symlink (= `/etc/udev/rules.d')
dpkg: error processing bluez-patched_454_i386.deb (--install):
unable to create `./etc/bluetooth/main.conf': No such file or directory
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
bluez-patched_454_i386.deb



- ruff - 2009-10-07

flxfxp Wrote:hi ruff,

What's the compatibility mode? Can it still do some of the more advance xbmc functions?
Compat mode is parameter of input.conf from bluez distribution, it has nothing to do with xbmc itself, except that in that mode remote is using keys already mapped for keyboard in keymap.xml
the layout in compat mode provided in this post
http://www.xbmc.org/forum/showpost.php?p=397714&postcount=83
Then, i'm using fillowing keymap in userdata
Code:
ruff@ruff:~/bluez$ cat ~/.xbmc/userdata/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>



- flxfxp - 2009-10-07

By the way, here is the compiled patch file diffed against the official 4.54. This hold my keymaps and the powersave patch.

http://dl.getdropbox.com/u/50769/xbmscript/patch


- flxfxp - 2009-10-07

I've succesfully created a deb of the patched bluez 4.54
You can find it here: http://dl.getdropbox.com/u/50769/xbmscript/bluez-patched_4.54-1_i386.deb
I did however had to use "fakeroot debian/rules binary" (after compilation) instead of letting "dpkg-buildpackage -rfakeroot" do the whole nine yards because that failed.

I created the deb by following this guide: http://ubuntuforums.org/showthread.php?t=51003

Updated installation procedure:
Code:
apt-get install libnl1 libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 -y
            wget http://flx.me/script/bluez-patched_4.54-1_i386.deb
            dpkg -i bluez-patched_4.54-1_i386.deb
            wget http://flx.me/script/ps3_pair.tar.gz
             tar -xzvf ps3_pair.tar.gz
            rm ps3_pair.tar.gz
             echo modprobe uinput > /etc/rc.local
            echo /usr/local/sbin/bluetoothd >> /etc/rc.local
            echo "exit 0" >> /etc/rc.local
            echo "<keymap>" > /home/xbmc/.xbmc/userdata/Keymap.xml
            echo " <global>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "  <keyboard>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f1>XBMC.ActivateWindow(osdaudiosettings)</f1>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f2>XBMC.ActivateWindow(osdaudiosettings)</f2>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f3>XBMC.ActivateWindow(videolibrary)</f3>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f4>XBMC.ActivateWindow(videofiles)</f4>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f5>XBMC.ActivateWindow(MyMusic)</f5>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f6>XBMC.ActivateWindow(MyPictures)</f6>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f7>XBMC.ActivateWindow(Weather)</f7>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f11>skipprevious</f11>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f12>skipnext</f12>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "  </keyboard>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "   </global>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo " <FullscreenVideo>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "    <keyboard>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f11>bigstepback</f11>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <f12>bigstepforward</f12>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "        <menu>ShowVideoMenu</menu>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "    </keyboard>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo " </FullscreenVideo>" >> /home/xbmc/.xbmc/userdata/Keymap.xml
            echo "</keymap>" >> /home/xbmc/.xbmc/userdata/Keymap.xml



- flxfxp - 2009-10-07

By the way ruff, it disconnects rather fast. After 15 seconds of no usage it times out. I assume that is bluez its doing and not the remote itself?


- ruff - 2009-10-07

Yes, it is default setting for disconnect (15sec) you can set bigger IdleTimeout in input.conf


- flxfxp - 2009-10-07

I've uncommented IdleTimeout and set it to 180, 3 minutes.
It doesn't get picked up. Still disconnects after 15 secs


- Allfodr - 2009-10-08

@flxfxp With updated installation procedure this works like a charm, I just want to say thanks to all involved.


Just to let you know.... - LAGMonkey - 2009-10-08

When using your deb package i get the following...

Code:
xbmc@xbmc:~$ sudo ./blue.sh
Reading package lists... Done
Building dependency tree
Reading state information... Done
libnl1 is already the newest version.
libgstreamer-plugins-base0.10-0 is already the newest version.
libgstreamer0.10-0 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
--2009-10-07 19:17:20--  [url]http://flx.me/script/bluez-patched_4.54-1_i386.deb[/url]
Resolving flx.me... 75.119.196.245
Connecting to flx.me|75.119.196.245|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 470650 (460K) [text/plain]
Saving to: `bluez-patched_4.54-1_i386.deb.2'

100%[======================================>] 470,650      489K/s   in 0.9s

2009-10-07 19:17:30 (489 KB/s) - `bluez-patched_4.54-1_i386.deb.2' saved [470650/470650]

(Reading database ... 148398 files and directories currently installed.)
Unpacking bluez-patched (from bluez-patched_4.54-1_i386.deb) ...
dpkg: error processing bluez-patched_4.54-1_i386.deb (--install):
trying to overwrite `/etc/bluetooth/main.conf', which is also in package bluez
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
bluez-patched_4.54-1_i386.deb
--2009-10-07 19:17:45--  [url]http://flx.me/script/ps3_pair.tar.gz[/url]
Resolving flx.me... 75.119.196.245
Connecting to flx.me|75.119.196.245|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 26178 (26K) [application/x-tar]
Saving to: `ps3_pair.tar.gz'

100%[======================================>] 26,178       116K/s   in 0.2s

2009-10-07 19:17:45 (116 KB/s) - `ps3_pair.tar.gz' saved [26178/26178]

bluez/
bluez/.svn/
bluez/.svn/tmp/
bluez/.svn/props/
bluez/.svn/prop-base/
bluez/.svn/text-base/
bluez/.svn/tmp/props/
bluez/.svn/tmp/prop-base/
bluez/.svn/tmp/text-base/
bluez/ServiceInterface.pyc
bluez/BlueZInterface.pyc
bluez/BaseInterface.pyc
bluez/errors.pyc
bluez/utils.pyc
bluez/Device.pyc
bluez/Adapter.pyc
bluez/Manager.pyc
bluez/__init__.pyc
bluez/BlueZInterface.py
bluez/ServiceInterface.py
bluez/utils.py
bluez/Adapter.py
bluez/__init__.py
bluez/Device.py
bluez/errors.py
bluez/BaseInterface.py
bluez/Manager.py
bluez/Agent.py
bluez/Agent.pyc
bluez/.svn/dir-prop-base
bluez/.svn/format

gzip: stdin: decompression OK, trailing garbage ignored
bluez/.svn/all-wcprops
bluez/.svn/entries
bluez/.svn/text-base/Makefile.am.svn-base
bluez/.svn/text-base/BlueZInterface.py.svn-base
bluez/.svn/text-base/ServiceInterface.py.svn-base
bluez/.svn/text-base/utils.py.svn-base
bluez/.svn/text-base/Adapter.py.svn-base
bluez/.svn/text-base/__init__.py.svn-base
bluez/.svn/text-base/Device.py.svn-base
bluez/.svn/text-base/errors.py.svn-base
bluez/.svn/text-base/BaseInterface.py.svn-base
bluez/.svn/text-base/Manager.py.svn-base
bluez/.svn/text-base/Agent.py.svn-base
ps3_pair.py
tar: Child returned status 2
tar: Error exit delayed from previous errors
-e \E[1;37mI have to reboot.
Press a key to reboot
read: 31: Illegal option -n

Broadcast message from xbmc@xbmc
        (/dev/pts/0) at 19:17 ...

The system is going down for reboot NOW!
xbmc@xbmc:~$

After the restart i have no bluetooth unless i issue the following...

sudo hciconfig hci0 reset
sudo /etc/init.d/bluetooth start

the following is a hcidump

Code:
xbmc@xbmc:~$ sudo hcidump hci0
HCI sniffer - Bluetooth packet analyzer ver 1.42
device: hci0 snap_len: 1028 filter: 0xffffffff
> ACL data: handle 11 flags 0x02 dlen 17
    L2CAP(d): cid 0x0041 len 13 [psm 0]
> ACL data: handle 11 flags 0x02 dlen 17
    L2CAP(d): cid 0x0041 len 13 [psm 0]

the following buttons work according to the PS3 remote map.

Code:
eject-cd 1   2   3
a        4   5   6
z        7   8   9
t        DEL 0 END

F7 F8 F9 F10

d Menu F11 Esc

F12    Up    Back
Left Enter Right
v     Down   x

F1 HomePage F4
F2          F5
F3 Ins Home F6

r        Play      f
PageDown Stop PageUp
,     Play-Pause   .

eject-cd, 0-9, Ecs, up, down, left, right, enter, HomePage, r, Play,Stop.

The following is my keymap.xml file (undedited from the deb package).
Code:
xbmc@xbmc:~/.xbmc/userdata$ cat Keymap.xml
<keymap>
<global>
  <keyboard>
        <f1>XBMC.ActivateWindow(osdaudiosettings)</f1>
        <f2>XBMC.ActivateWindow(osdaudiosettings)</f2>
        <f3>XBMC.ActivateWindow(videolibrary)</f3>
        <f4>XBMC.ActivateWindow(videofiles)</f4>
        <f5>XBMC.ActivateWindow(MyMusic)</f5>
        <f6>XBMC.ActivateWindow(MyPictures)</f6>
        <f7>XBMC.ActivateWindow(Weather)</f7>
  </keyboard>
   </global>
<FullscreenVideo>
    <keyboard>
        <f12>NextSubtitle</f12>
        <menu>ShowVideoMenu</menu>
    </keyboard>
</FullscreenVideo>
</keymap>

I have Ubuntu 9.04 (Jaunty), XBMC SVN 23481. Bluez v4.32 is installed according to package manager.