Solved HOW-TO: properly connect XBMC with HDMI via non-CEC AVR to TV
#1
Symptoms:
CEC remote commands for the TV don't work reliable.
Sometimes I can browse the XBMC menus via CEC just fine, sometimes nothing happens.

First the solution:
In XBMC → Settings → System → Input Devices → Peripherals → CEC Adapter:
set "Physical address" to 1000 instead of 0
This value corresponds with AVR connected to HDMI port 1 on the TV, so:
XBMC device → AVR (non-CEC)→ TV(HDMI1)

How to detect if your AVR is not CEC capable?
First set debugging to enabled in your XBMC device.
Reboot and and inspect xbmc.log for the message:

Code:
DEBUG: UpdateAudioSystemStatus - no CEC capable amplifier found

This message is very important: I had plugged in 2 hdmi devices in my AVR, and they switched
audio and video fine, but as you see in the message above, CEC won't work on the AVR and I was asking for trouble.

The command I used to debug in Openelec (after logging in via ssh) was:

Code:
tail -F /storage/.xbmc/temp/xbmc.log | grep -i cec

You can also use cec-client, but in that case its wise to first disable CEC in XBMC.
I used cec-client to test the responses of the TV to direct instructions you send with this command.
See https://github.com/Pulse-Eight/libcec for more info.

Explanation:
I'm not pretending to be an expert, but I was struggling with this issue for some time and now decided to investigate it. I was browsing several forums and wiki's, but didn't find a real solution. Most solutions point in the direction of bad HDMI cables, issues with libcec, Raspberry PI specific issues and incompatible audio/video hardware. I didn't expect the real solution to be that simple, even more reason to share this.
So thanks for all the people on this and other forums for pointing me a little in the right direction.

I think this is what happens:
XBMC announces itself in my scenario with CEC at physical address 1.1.0.0. (or 1100 in the xbmc.log)
According to http://elinux.org/CEC_(Consumer_Electron..._over_HDMI that is correct, because TV is root device at 0.0.0.0, AVR is 1.0.0.0, and RPI is 1.1.0.0.
So far so good, you think, but remember that my AVR is not CEC capable, so it doesn't have a physical address.
So, when booting, XBMC registers itself with the TV and everything seems to work. When changing the HDMI source to another one on the TV (HDMI2 in my case), TV becomes active source, XBMC becomes inactive source and TV gets connected with physical address 2.0.0.0. That's still correct.
When switching back to HDMI1 on the TV, the TV switches to physical address 1.0.0.0. Which is the AVR, not XBMC. However my AVR is not CEC capable, so no response. And XBMC keeps broadcasting from physical address 1.1.0.0 that it wants to be active source, and gets no response.
So by setting the physical address in XBMC to 1000, it will register at the physical address of the AVR and it will respond to the TV when switching back.

In the case that I had my other HDMI device connected to HDMI2 on the AVR instead of HDMI2 on the TV, things got messed up. I think the reason for that is that routing changes between the HDMI ports of the AVR are not send, so my TV gets confused. And that's not good because it's the root device. Also, my proposed solution is not going to work in this scenario, because you set XBMC to be 1000, so pretending to be on the physical address of the non-CEC AVR. So telling it that there are no other HDMI devices connected to the AVR.

Extra tips:
If somehow in the middle of testing and configuring, the XMBC device fails the become “active source”, you will see this message in xbmc.log:

Code:
DEBUG: CecLogMessage - command 'active source' was not acked by the controller
DEBUG: CecLogMessage - failed to make 'Recorder 1' the active source. will retry later

In that case it helps to switch to another HDMI device, preferably on a different HDMI port on the TV. Wait at least a few seconds and switch back to XBMC source.
To be sure, reboot your XBMC and check if switching between HDMI sources keeps CEC focus on the XBMC device. If not, probably the physical address has gone to 0 again. So you go to the CEC settings in XBMC and set the right physical address again as described in the top of this message.

My setup:
TV: Panasonic TH42PZ80E HDMI port 1 to AVR
AVR: Marantz SR-4001 HDMI port 1 to XBMC
XBMC: Raspberry PI (Openelec 3.2.3)

message example with same issue, already sent a PM:
http://forum.xbmc.org/showthread.php?tid...stemStatus

@Moderator:
Searching for “CEC” on this forum doesn't work because a search term has to be at least 4 characters long. Maybe you can help out to set the right keywords so people find this message.
In case this How-To is helpful enough, you can move it to the general How-To section in your forum.

Keywords: CecLogMessage, UpdateAudioSystemStatus, Physical address, HDMI, libcec, AVR, remote control
Reply
#2
Hi hamkaas,
Could you run libcec in monitor mode with "cec-client -m" and post the log of all CEC traffic for both the cases where remote control passthrough is and is not working?
I maybe able to explain what is going on.
Reply
#3
Brilliant guide.

Thank you so much for this. This resolved my issue perfectly after trying so many other ways to get CEC control via my LG tv and Onkyo amp.
Reply
#4
I have a CEC AVR (Yamaha) and LG Tv. My previous tv would control XBMC on RPI flawlessly but since upgrading to the LG it simply fails to detect XBMC unless its plugged directly into the TV and not via the AVR.
Anyway i had all but given up on CEC until i saw this

First the solution:
In XBMC → Settings → System → Input Devices → Peripherals → CEC Adapter:
set "Physical address" to 1000 instead of 0
This value corresponds with AVR connected to HDMI port 1 on the TV, so:
XBMC device → AVR (non-CEC)→ TV(HDMI1)


I changed the physical address to 1000 and WOW it suddenly all works again. Can't thank you enough for this great bit of info!

cheers
Reply
#5
Hi, just wanna say thanks for this tip
Now I can use the tv remote to control rpi even when the tv input is changed or when the tv is powered off
and the media buttons work too
I'm using Panasonic TV P55ST50 and Pioneer MCS 838.

Although I would like to know how to get the physical address for HDMI 2/3 and so on since I prefer to have my DVR connected to HDMI 1
Reply
 
Thread Rating:
  • 2 Vote(s) - 5 Average



Logout Mark Read Team Forum Stats Members Help
HOW-TO: properly connect XBMC with HDMI via non-CEC AVR to TV52