[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) |
- kitlaan - 2010-06-09 Zerogoki Wrote:how do I re-pair the remote when I stopped the bluetooth service? So either with the bluetooth service stopped and running "sudo bluetoothd -nd", OR just run the bluetooth service. Running manually is useful as it gives more debugging information. Then once you're happy, just ctrl-c out of bluetoothd, and re-start the bluetooth service. (You may want to run the ps3_unpair script, if list-devices shows your remote.) Then, in another console, run the ps3_pair script, and follow the instructions. There should be some indication of stuff going on in the bluetoothd output... If it looks good, ctrl-c out of bluetoothd, and run it again. This time just hit buttons on the remote (no pairing), and it should detect... - Zerogoki - 2010-06-09 Thanks again for the replay Kitlaan. I think we are getting close to the root of the problem. So I did what you said and 1) unpaired my remote. 2) stopped the bluetooth service. 3) I started "sudo bluetoothd -nd" and in another terminal ran the pairing script. When I went back to the bluetoothd terminal screen I saw nothing when I was mashing buttons. then after about 30 sec to a min later of still mashing I saw a bunch of Got Key commands flying up the screen. so far so good (kind of, see below). I tried the "hold PS button" to disconnect and after about 20 seconds i got the following message: Code: bluetoothd[xxxx]: Got Key: 108 [0] I wasnt sure what this meant but after pressing a button it looked like my remote reconnected because I saw this: Code: bluetoothd[xxxx]: adapter_get_device(00:26:43:BA:B6:57) so disregarding the error I continued on. At this point I got the remote commands coming in through bluetooth and looks good. So next I terminated the bluetoothd and restarted it. Now when I go to press buttons, nothing. I kept pressing for like 5 mins and still nothing. So it seems i am closer but my main problem is when I stop/start the bluetooth service my remote stops working completely. This is probably explains why when I reboot my system the remote doesnt work ( I verified uniput and the bluetooth service starts up on reboot). My second problem (well question) is what might be the cause of the delay in my initial connection? I mean after I re-pair the remote I would think it would already be connected and sending commands immediately but it takes like I said about 30 sec to a full min before I see the remote commands coming out. Third, that funky error message when my remote disconnected. I also flipped my off switch and saw the error (see my comment in this thread here on how to add a switch to the BD remote ). but again both times when I turned my remote back on and pressed a button, I saw the Got Key commands again. - vonb3ta - 2010-06-10 Hi guys I have basically been following the EXACT steps Zerogoki has been following, but am also getting the exact same responses, here is what I have done: First I entered the commands: Code: sudo nano /etc/apt/sources.list Then added: Code: deb http://ppa.launchpad.net/kitlaan/ppa/ubuntu jaunty main At the top, then Ctrl+X, saved and exited. Followed by these commands: Code: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6F7177CC After this I followed Zerogoki's footsteps: Zerogoki Wrote:here are the commands I run: At this point every time I enter: Code: sudo python ps3_pair.py When typing Code: /usr/share/doc/bluez/examples/list-devices Paired 0 Connected 0 Trusted 1 ====> THE BREAKTHROUGH After reading the other threads, I tried: Code: hciconfig hdi0 lm ACCEPT,MASTER I am going to try to add hciconfig hdi0 lm ACCEPT,MASTER to rc.local and see if I can get this to load every startup. Zerogoki, you might want to try and put in the terminal Code: hciconfig hdi0 lm ACCEPT,MASTER If and when I get this working I will write up a Tutorial for XBMClive users, or I will try to write a script as well - Zerogoki - 2010-06-10 Hey vonb3ta, Thanks for the info. Actually I have got the remote working (with and without setting the hci0 to MASTER) and have seen it work in XBMC (for me is Ctrl+Alt+F7) when I go back to that screen (see my previous comment above). The problem I am having is after I get the remote working and stop and start the bluetooth service, the remote doesnt reconnect automatically. I have to run the unpair and then the pair script again to get it to work again. Does yours work if you stop/start the bluetooth service ("sudo /etc/init.d/bluetooth stop" then "sudo /etc/init.d/bluetooth start") or if you restart the system? I did as you suggested and tried setting the hci0 from SLAVE to MASTER after I re-started the bluetooth service (since if I do it before I start the bluetooth service it defaults back to SLAVE) when the remote was working but still the remote never connects again. If I unpair and pair the remote it works again (after about 30 sec of waiting I see my commands). I ran the "/usr/share/doc/bluez/examples/list-devices" and here is what it says when the remote is working: Code: [/org/bluez/xxxx/hci0 ] Now the only part that has me concerned is the Paired = 0. Maybe this is why it doesnt work between bluetooth sessions. - Zerogoki - 2010-06-10 GOOD News!! (for the most part), I some how got my remote to auto connect when I stop/start the bluetooth service. I also got it to work across reboots (yay). here's what I did. I was reading through faxo comments in post #395 and for some reason I started playing with the "sudo hcitool" commands. I stop and started the bluetooth service (so my remote wasnt working_ and I did an "sudo hcitool cc 00:26:43:BA:B6:57 " which posted some error Code: [ 490.976695] hci_cmd_task: hci0 command tx timeout I kept playing around with this procedure and after looking at other commands it seems that sudo hcitool <almost anything> 00:26:43:BA:B6:57 " makes the remote work (like running that tool does or sets something up that makes everything fall into place). So I went into the /etc/rc.local and just added my command (I added "sudo hcitool name 00:26:43:BA:B6:57") just above the "exit 0" and saved it. did a restart and poof! remote works as soon as I am in XBMC. Well thats one for the books.. I did however download h00s' ps3bdremote file and played with it before getting this to work but I really dont think it did anything for me. So I am going to do a clean install of XBMC live and create a list of commands/steps I did and if I get it working ill post it and have a nice cold beer. Thanks to everyone that helped in getting me this far, if all goes well phase 2 will be getting the buttons setup as I want. but one step at a time. p.s. I also tested doing "/etc/init.d/bluetooth stop" then "sudo bluetoothd -nd" to see the commands (I had to go into another screen and do my magical "sudo hcitool name 00:26:43:BA:B6:57" command and when I went back to the bluetoothd debug screen I saw my command. I also verified that the time out works too (still getting that weird GLib-CRITICAL" error I posted above but at this point I dont care). XBMC Live 9.11 with PS3 BD Remote , Yes it really works! - Zerogoki - 2010-06-10 So.... I did everything from scratch and bibbity bobbity boo, wam bam thank you mam, the remote works in XBMC live! Here are the step by step instructions I took to get this working. I pretty much did this on my machine while typing this up so I shouldnt be missing anything. Install XBMC live to a harddrive or USB drive. After you boot into XBMC for the first time just hit "Ctrl+Alt+F1" to get to the first screen's terminal. Log in using the username password you setup when installing XBMC. Now the first then we are going to do is an update and install all the software we need for this. Code: sudo apt-get update Code: sudo apt-get install python-software-properties Code: sudo add-apt-repository ppa:kitlaan/ppa Code: sudo apt-get update Code: sudo apt-get install bluez python-bluez python-dbus Next we will setup the "uniput" module which is what sends the remote commands into the kernel. Code: sudo modprobe uinput Code: sudo nano /etc/modules At this point bluetooth should be installed and running. you can confirm by doing: "sudo /etc/init.d/bluetooth status". It should say bluetooth is running. Next let start the pairing process. Code: wget http://kitlaan.twinaxis.com/holdingcell/ps3pair.tar.gz Code: tar xvfz ps3pair.tar.gz Code: sudo python ps3pair/ps3_pair.py Just to note normally before I run this I like to start holding down the start+enter keys on the remote for a few seconds before I press enter. If it finds something it will post the address with the name (note sometimes the remote's name at first comes up as [unknown]. If only 1 thing comes up just type 1 and enter. It should register the device followed by a "done". Now if you press the up button on the remote and nothing happens after like a minute (it should cycle through your commands send so far); try this: Code: sudo hcitool name xx:xx:xx:xx:xx Next we will update the bluetooth input file. Code: sudo nano /etc/bluetooth/input.conf Here you want to see the remote's config info. what we want to do is replace where it has [11:22:33:44:55] with your remote's address. dont forget to uncomment the line (remote the # just before it) so it runs when the script runs. If you wnat the remote to time out after lets say 30 seconds, uncomment the line just below that says IdleTimeout=30 (note you can change this to anything you want). For now lets just skip the editing of the buttons. lets make sure everything is working so far. Before we restart there is one last thing we should add that I need to get it working 100% . We will open the rc.local file add add the hcitool command to this file. Code: sudo nano /etc/rc.local In the file go just above the last line ("exit 0"), add the command "sudo hcitool name xx:xx:xx:xx:xx" where again the xx's are your remote's address". save it (Ctrl+X, Y, and enter) and now we should be ready for the restart. You should be able to also go back to the XBMC screen (Ctrl+Alt+F7) and see the remote work. When you restart XBMC the remote should respond to simple commands like up, down, enter, play, and stop, etc. We will need to customize the input.conf and/or key mappings xml file to fully use all the keys. I just wanted to add that I noticed that when I run the pairing script the very first think I saw after my command was that "[ xxx.xxxxxxx] hci_cmd_task: hci0 command tx timeout" message which is what I get when I run the hcitool command. I am figuring this error is what I needed to have happen when the bluetooth service starts or I reboot to get the remote to work. Again I wanted to say thanks to Kitlaan for his code and everyone else that commented in this thread on getting this working in XBMC Live. Now where is my beer!? - vonb3ta - 2010-06-13 thanks Zerogoki , your technique worked for me I changed the Code: sudo hcitool name xx:xx:xx:xx:xx Code: hciconfig hdi0 lm ACCEPT,MASTER Which works as well, thus no need for the Bluetooth address Anyway I am working on a Shell Script to do all of this in an automated system as well as install any of the Aeon Skins ps3 patch cannot be applied to bluez 4.66 - logistiker - 2010-06-21 Ruff: I'm trying to apply your patch to bluez 4.66. It applies but it does not build. It builds on 4.65 correctly. Here's the error it stops on when running make: Code: libtool: link: x86_64-pc-linux-gnu-gcc -shared audio/.libs/audio_libasound_module_pcm_bluetooth_la-pcm_bluetooth.o audio/.libs/audio_libasound_module_pcm_bluetooth_la-ipc.o -Wl,--whole-archive sbc/.libs/libsbc.a -Wl,--no-whole-archive -Wl,-rpath -Wl,/var/tmp/portage/net-wireless/bluez-4.66-r2/work/bluez-4.66/lib/.libs lib/.libs/libbluetooth.so /usr/lib64/libasound.so -lm -ldl -lpthread -lrt -march=amdfam10 -Wl,-O1 -Wl,-soname -Wl,libasound_module_pcm_bluetooth.so -o audio/.libs/libasound_module_pcm_bluetooth.so - vonb3ta - 2010-06-22 perhaps my script can help, just use the "install Ps3 remote part" as well as the pair part of the script. http://forum.xbmc.org/showthread.php?tid=76094 kitlaan PPA -- bluez 4.66 - kitlaan - 2010-06-26 logistiker Wrote:Ruff: I'm trying to apply your patch to bluez 4.66. It applies but it does not build. It builds on 4.65 correctly. My latest patch now handles 4.66. The bluez code changed how debug prints worked in the last release. In addition, a bug was fixed where a crash could happen during idle disconnect (thanks Kristian!). bluez-4.66 packages for lucid and karmic are in the build queue for my PPA. They have NOT been tested, as of this post, so user beware. - xbmc-ps3 - 2010-07-06 Zerogoki Wrote: Unfortunately for me when running this it doesn't appear to pair properly, and neither running the suggested hcitool etc. or hciconfig etc. seem to fix this. When I run /usr/share/doc/bluez/examples/list-devices immediately after the pairing command it shows (amongst other info); Trusted=1 Connected=1 Paired=0 If I then run the /usr/share/doc/bluez/examples/list-devices command immediately after it shows; Trusted=1 Connected=0 Paired=0 I did try to pair the dongle and remote in Windows a few times to see if this would help at all(and it does pair fine) but after doing this I have the same problems. Anyone have any ideas that could help me out? - zagon - 2010-07-07 xbmc-ps3 Wrote:Unfortunately for me when running this it doesn't appear to pair properly, and neither running the suggested hcitool etc. or hciconfig etc. seem to fix this. Stuck on this as well, got it pair once (after a hell of a lot of tries) w/ ps3_pair. Listed in /usr/share/doc/bluez/examples/list-devices . No dice getting it to work, or unpair/pair again etc. - LAGMonkey - 2010-07-07 for my bluetooth dongle to work at all, i have a command issued in my /etc/rc.local file code Wrote:hciconfig hci0 reset Now the hci0 bit might change for you but, as i said, if i dont issue that command my Bluetooth dongle just wont work as its looking for the microsoft mouse that it came with to connect to it. bluez 4.69 - kitlaan - 2010-07-15 Yeah, I'm still confused why pairing/connection doesn't work for some people. Either there's bluetooth dongles that aren't quite right, or the bluez pair/connection logic has a hole in it that I haven't run across yet. No rhyme or reason for it that I can tell, so far. I'm working on a bluez 4.69 patch. I also moved the patch location to a more permanent place. - xbmc-ps3 - 2010-07-16 kitlaan Wrote:Yeah, I'm still confused why pairing/connection doesn't work for some people. Either there's bluetooth dongles that aren't quite right, or the bluez pair/connection logic has a hole in it that I haven't run across yet. No rhyme or reason for it that I can tell, so far. Is there any info that we could collate that would be of use? |