HDMI CEC and XBMC


98 posts   Page 2 of 4   1, 2, 3, 4
by felix123 » Wed Jun 06, 2012 11:13 am
Wow thanks! Do you need any special kernel/distro? Or would it work with just the binary?
Posts: 153
Joined: Tue May 15, 2012 6:06 am
by Paul Webster » Wed Jun 06, 2012 1:40 pm
olajep wrote:Hello

I've written a quick hack which enables me to control OpenElec/XBMC with a TV remote control.
It's up on github:

https://github.com/olajep/rpi-cecd


Well done - and a clever way of doing it by feeding the keypresses back in via HTTP localhost to XBMC.
User avatar
Posts: 377
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by olajep » Wed Jun 06, 2012 1:57 pm
felix123 wrote:Wow thanks! Do you need any special kernel/distro? Or would it work with just the binary?

It works 'out-of-the-box' with the OpenElec RPi nightly builds.
http://sources.openelec.tv/tmp/image/openelec-rpi/

The binary is built with hardware floating point operations turned on. It means that for it to work, all libraries it links to must also have been built with hard-fp. However, I think most other RPi distros use soft-fp and then it will not work.

You could also download the SDK from the RPi github page and build it with soft-fp yourself.
Posts: 2
Joined: Wed Jun 06, 2012 10:19 am
by Paul Webster » Thu Jun 07, 2012 3:32 pm
I have had this working with Openelec.
I don't have a build environment so I simply copied the binary.

Code: Select all
git clone --branch binary https://github.com/olajep/rpi-cecd.git rpi-cecd-binary

then I copied the rpi.cecd file to the RPi (I put it on a local web server and used wget to grab it - but using scp is the way that is documented in the readme)
then I made it executable
Code: Select all
chmod +x rpi-cecd

then ran it ...
Code: Select all
./rpi-cecd &

and it worked - recent Sony TV.

Don't forget to enable HTTP control of XBMC if you have not already done it.

Note: it will not work out of the box with Raspbmc because, currently, it is hard-coded to use port 80 and today's Raspbmc listens by default on port 8080 and does not allow port below 1024.

So - ideally - rpi-cecd should take port number as a parameter.

Note:
I see that the Openelec team have include the source in their newest build - but I did not find the resulting binary in the pre-built Openelec (r11261 - from Chris Swan) that I used.
User avatar
Posts: 377
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by Paul Webster » Sat Jun 09, 2012 8:31 am
Quick update - this is now working out of the box with Openelec r11264
User avatar
Posts: 377
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by shawnmichael » Sat Jun 09, 2012 9:00 am
This made me use XBMC again after 2 years. I was using Serviio Media Server on my Sony Bravia TV because i can control via the TV remote.
Now that i can control XBMC with the TV remote its just a joy to use

£30 is a steal for what the little adaptor can do! It works as it should using the custom Pulse-Eight build of XBMC

My only slight negative point is theres no manual. I would love if there was a wiki page but found the forum and Facebook pages helpful.

My item arrived very quickly and felt xmas came 9 months early this year!!
Theres no other product like it, its a no brainer must buy for anyone running XBMC through HDMI on your TV
Posts: 1
Joined: Sat Jun 09, 2012 8:58 am
by Paul Webster » Sat Jun 09, 2012 5:13 pm
Are you referring to an external device, such as the Pulse8 adapter?
Such a thing is not needed with this latest build.
The HDMI CEC codes from the TV are recognised by software in RPi and are then sent as control codes to XBMC (currently via HTTP not via the Pulse8 libCEC route.
I also have a Sony Bravia TV ... and this is working very well. Even better is the fact that I am powering the RPi from the USB port on the TV.
User avatar
Posts: 377
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by t-a-s » Sat Jun 09, 2012 5:44 pm
Paul Webster wrote:Are you referring to an external device, such as the Pulse8 adapter?
Such a thing is not needed with this latest build.
The HDMI CEC codes from the TV are recognised by software in RPi and are then sent as control codes to XBMC (currently via HTTP not via the Pulse8 libCEC route.
I also have a Sony Bravia TV ... and this is working very well. Even better is the fact that I am powering the RPi from the USB port on the TV.


I'd be very careful powering the RPi from the USB port on your TV. Although it's really convenient, the Pi can draw way more current (>700mA depending what you have plugged into to it) than the USB port on the TV is designed to handle (mine is rated at 150mA).
Posts: 23
Joined: Sat Jun 09, 2012 5:36 pm
by Paul Webster » Sat Jun 09, 2012 8:43 pm
... possibly a topic for a different thread ... but right now the TV is powering 2 RPis .... one running XBMC (OpenElec is time) and the other running SqueezePlug (just to see how it performs).
User avatar
Posts: 377
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by t-a-s » Sat Jun 09, 2012 11:20 pm
Paul Webster wrote:... possibly a topic for a different thread ... but right now the TV is powering 2 RPis .... one running XBMC (OpenElec is time) and the other running SqueezePlug (just to see how it performs).


There is some conjecture about exactly what the RPi requires/uses in terms of current, but Eben wrote on the site the Model B will require a PSU capable of sourcing 700mA (http://www.raspberrypi.org/archives/260), so I would take that as the minimum.

In my opinion, it's really not worth the risk for the sake of another few pounds for a proper PSU. The best way, the Pi (and/or it's peripherals) won't perform properly/well if it cannot draw enough current. The worst, well... Chances are the USB ports on the TV are effectively fused so, if you damage them by overcurrent, you won't cause any further damage to the TV, but I wouldn't like to bet on it.

Unless you know for sure the USB ports on the TV are capable of sourcing 700mA (each, if you're running two!), I really would caution against it.
Posts: 23
Joined: Sat Jun 09, 2012 5:36 pm
by XavM » Wed Jun 13, 2012 9:11 am
Just a quick update to say that controlling XBMC (build r11298) on the Raspberry Pi with the TV Remote control thru CEC works fine with my Samsung TV (LE40A566P1MXZF)

(May be it just work with any TV supporting CEC, but i didn't know and wanted to test it)

PreRequisites :

enable HTTP control of XBMC
enable CEC on the Samsung TV (Menu/Application/Anynet+ HDMI-CEC/On)

(I had to reboot XBMC once to be able to use the TV remote)

Thanks to Chris Swan, i didn't even had to compile XBMC, but just downloaded the pre build image from his site : http://openelec.thestateofme.com/
Posts: 35
Joined: Thu May 31, 2012 11:29 pm
by t-a-s » Wed Jun 13, 2012 1:55 pm
XavM wrote:Just a quick update to say that controlling XBMC (build r11298) on the Raspberry Pi with the TV Remote control thru CEC works fine with my Samsung TV (LE40A566P1MXZF)...


Out of interest do all your controls work (like play, pause, rewind, etc)? The up, down, left, right and select work on my Samsung TV, but none of the playback controls or 0-9 keys do...
Posts: 23
Joined: Sat Jun 09, 2012 5:36 pm
by XavM » Wed Jun 13, 2012 3:27 pm
t-a-s wrote:
XavM wrote:Just a quick update to say that controlling XBMC (build r11298) on the Raspberry Pi with the TV Remote control thru CEC works fine with my Samsung TV (LE40A566P1MXZF)...


Out of interest do all your controls work (like play, pause, rewind, etc)? The up, down, left, right and select work on my Samsung TV, but none of the playback controls or 0-9 keys do...


Sorry, I didn't try others than : up, down, left, right, ok
My (only) SD card is now running Debian "wheezy"
I will update this thread as soon as i give it a new try
Posts: 35
Joined: Thu May 31, 2012 11:29 pm
by gregeric » Thu Jun 14, 2012 12:12 pm
olajep wrote:Hello

I've written a quick hack which enables me to control OpenElec/XBMC with a TV remote control.
It's up on github:

https://github.com/olajep/rpi-cecd


Many thanks for this, working great on my Samsung TVs (compass keys, exit & playback control tested).

A similar tool for X might be useful: allow the TV remote to control cursor movements etc ;)
Posts: 79
Joined: Mon Nov 28, 2011 10:08 am
by sge » Thu Jun 21, 2012 1:04 am
Wow amazing work olajep! I thought CEC wasn't going without the Broadcom releasing a data sheet or something O_o
Posts: 14
Joined: Sun Oct 23, 2011 3:12 am
by Paul Webster » Thu Jun 21, 2012 5:02 am
Now included in Raspbmc (RC3 released last night) and has been in Openelec for a few days.
User avatar
Posts: 377
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by strawberrytau » Fri Jun 22, 2012 9:08 am
In my (4 year old) Samsung, this works partially. Navigation and FF, Rewind work, but play and pause do not.

I'm impressed that even holding down keys causes a key repetition, though the rep rate needs speeding up.
Posts: 37
Joined: Wed May 30, 2012 7:56 am
by strawberrytau » Fri Jun 22, 2012 9:12 am
This probably explains why Play and Pause are not working on early SAMSUNGs.

http://forums.cnet.com/7723-13973_102-4 ... e-control/
Posts: 37
Joined: Wed May 30, 2012 7:56 am
by louisb » Fri Jun 22, 2012 9:04 pm
What is the best way of mapping the TV remote buttons into XBMC actions? All the UP/DOWN/LEFT/RIGHT and OK buttons work just fine. But BACK button on the remote does not work on my Sharp TV. (The END buttons works as a back button but I want to choose my own mapping). I also want to map the RED GREEN YELLOW BLUE buttons to the xbmc play/stop/pause actions

Unfortunately my BACK button is not recognised by rpi-cecd see below.
Code: Select all
sudo  rpi-cecd 8080
cec_callback: debug: reason=0x0004, len=0x03, retval=0x00, param1=0x002c4404, param2=0x00000000, param3=0x00000000, param4=0x00000000
button_pressed: operand1=0x2c has no binding
cec_callback: debug: reason=0x0008, len=0x03, retval=0x00, param1=0x002c4504, param2=0x00000000, param3=0x00000000, param4=0x00000000


I am using raspbmc RC3. (It is being attacked by DDoS see viewtopic.php?f=35&t=9122)

Thanks

Louis
Posts: 47
Joined: Wed Mar 07, 2012 7:08 am
by texy » Sat Jun 23, 2012 10:59 am
Hi,
I have never used hdmi-cec before so this is all new to me.
I have a 4 year old Samsung which has hdmi-cec capability ( LE32R87BD).
I have enabled cec in the setup menu, and there is a 'search connections' button, which when pressed appears to do something, then the menu looks like this :
photo (2).JPG
photo (2).JPG (28.01 KiB) Viewed 43441 times

You may notice that the 'select device' option downwards is greyed out and can't be selected - that may or may not be important.
Anyway I am using openELEC version r11380 of 21st June, and I have enabled HTTP control, but the TV remote does nothing.
Am I missing something in the setup?

Thanks,
Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2313
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by texy » Sat Jun 23, 2012 11:20 am
BTW, I can see in the logs that commands from the remote are being received :

Code: Select all
12:16:16 T:1207059552   DEBUG: webserver: request received for /xbmcCmds/xbmcHttp?command=Action(3)
12:16:38 T:1233740896   DEBUG: Previous line repeats 4 times.
12:16:38 T:1233740896   DEBUG: webserver: request received for /xbmcCmds/xbmcHttp?command=SendKey(61696)
12:16:38 T:1224787040   DEBUG: webserver: request received for /xbmcCmds/xbmcHttp?command=Action(2)
12:16:51 T:1224787040   DEBUG: webserver: request received for /xbmcCmds/xbmcHttp?command=SendKey(61696)
12:16:51 T:1224787040   DEBUG: webserver: request received for /xbmcCmds/xbmcHttp?command=Action(1)
12:16:58 T:1224787040   DEBUG: webserver: request received for /xbmcCmds/xbmcHttp?command=SendKey(61696)
12:16:58 T:1216386144   DEBUG: webserver: request received for /xbmcCmds/xbmcHttp?command=Action(1)
12:17:03 T:1216386144   DEBUG: webserver: request received for /xbmcCmds/xbmcHttp?command=SendKey(61696)
12:17:03 T:1216386144   DEBUG: webserver: request received for /xbmcCmds/xbmcHttp?command=Action(2)
12:17:10 T:1207059552   DEBUG: Previous line repeats 1 times.
12:17:10 T:1207059552   DEBUG: webserver: request received for /xbmcCmds/xbmcHttp?command=Action(4)


....the Action(1)'s etc are me press up, down, left, right on the remote.
Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2313
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by sbuhaian » Sat Jun 23, 2012 11:30 pm
My TV is Lg 32ld420. Rpi-cecd not work with this TV.
https://www.youtube.com/watch?v=YqIHh1bMxJI
Posts: 13
Joined: Mon Mar 12, 2012 12:52 pm
by rpi2000 » Sun Jun 24, 2012 8:28 am
I have a Samsung LE40B650 here and thr RPi isn't even recognized by Anynet+ CEC (Samsung's CEC implementation).

Is this likely to be a problem within the TV or could that be fixed later in the RPi? I'm currently running OpenELEC r11388 from yesterday.
Posts: 2
Joined: Sun Jun 24, 2012 8:26 am
by Max » Sun Jun 24, 2012 3:02 pm
rpi2000 wrote:I have a Samsung LE40B650 here and thr RPi isn't even recognized by Anynet+ CEC (Samsung's CEC implementation).

Is this likely to be a problem within the TV or could that be fixed later in the RPi? I'm currently running OpenELEC r11388 from yesterday.


CEC does work fine with other Samsung TVs.
Have a UE40D5000 here.
by texy » Sun Jun 24, 2012 3:59 pm
It works with raspbmc R3 and my tv. Very limited with what the remote can do however, but at least it proves the principle.
Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2313
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England