Forum

Full Version: Samsung CEC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
(2nd Oct, 2014 06:08 PM)zkiifreak Wrote: [ -> ]
(2nd Oct, 2014 05:59 PM)rikardo1979 Wrote: [ -> ]I believe this is how the CEC is working. even you play just a music on XBMC there is always change in GUI of XBMC as the playback starts and this trigger On the CEC so thats why TV is turning ON.


I'm not sure but you can not stop this unless you deactivate CEC totally

By your explanation, it seems like the hdmi_ignore_cec_init is ignored by XBMC? If your explanation are correct, that setting is useless...??

I'm a little confused [SMILING FACE WITH SMILING EYES]
[edit]added the _init[/edit]
go into System>Settings>System>Input devices>Peripherals>CEC Adapter
deselect Make XBMC the active source when starrting
than reboot and try if that helps
(2nd Oct, 2014 07:08 PM)rikardo1979 Wrote: [ -> ]
(2nd Oct, 2014 06:08 PM)zkiifreak Wrote: [ -> ]
(2nd Oct, 2014 05:59 PM)rikardo1979 Wrote: [ -> ]I believe this is how the CEC is working. even you play just a music on XBMC there is always change in GUI of XBMC as the playback starts and this trigger On the CEC so thats why TV is turning ON.


I'm not sure but you can not stop this unless you deactivate CEC totally

By your explanation, it seems like the hdmi_ignore_cec_init is ignored by XBMC? If your explanation are correct, that setting is useless...??

I'm a little confused [SMILING FACE WITH SMILING EYES]
[edit]added the _init[/edit]
go into System>Settings>System>Input devices>Peripherals>CEC Adapter
deselect Make XBMC the active source when starrting
than reboot and try if that helps

Does not help - everything in there is off (except for the "Enabled" - that's enabled).

One thing I've discovered is this:
Is stated previously I do not have "Connected to" option (TV/AVR). But, if I set the physical address of the HDMI to 1000 and reboot, the option is will show itself. Now, this seems fine, and I select AVR hoping that my troubles will be gone (as the Pi is connected to my Denon AVR-2307 which in turn is connected to my Samsung UE46D6507). But when I try turning off the TV while listening to music, it just clicks a couple of times from the TV and the AVR and switches the TV back on. Afterwards (with no reboot), I go into the settings and the "Connected to" option is gone. As is the physical address which is reverted to 0.
Any takes?

PS: Tried editing the xml file in the peripheral_data folder, but that does not seem to do anything, and it is overwritten when applying new settings from GUI or rebooting Sad
what XBian/XBMC build you running and also what is your config.txt looking like?
cos this is working here just fine
(4th Oct, 2014 01:31 AM)rikardo1979 Wrote: [ -> ]what XBian/XBMC build you running and also what is your config.txt looking like?
cos this is working here just fine

I'm running XBIAN RC3.

Config.txt:
Code:
initramfs initramfs.gz  0x1000000
gpu_mem_512=128
gpu_mem_256=100
initial_turbo=1
disable_splash=1
hdmi_ignore_cec_init=1
decode_MPG2=*edited out*
arm_freq=950
core_freq=450
sdram_freq=500
over_voltage=2


Removed mpeg2 license, serial locked but still doesn't need to be public.
@zkiifreak

from the logs comes this:
1) RPI gets 1100 phys address what would mean that RPI is in port1 of Denon which is in port1 of TV.
2) but as XBMC is initing CEC, there is no other device on the bus answering pings(poll) on any address (01-15)
3) RPI adopts 01
4) later on RPI changes phys add from 1100 to 1000 via HDMI_ATTACHED event - normally that would mean that TV went through OFF/ON cycle (or rather hdmi cable was re-attached). but before TV was turned on already and after is no event that TV is going standby.

if you didn't change the cabling (Big Grin) (so Denon still P1 on TV and RPI P1 on denon) then 1000 is WRONG address (and any later actions / results are consequently (more or less) wrong.

tell me, is even the 1xxx address ok? (so your cec tree ends up in Samsung TV in HDMI1)? if yes, is there a reason for that? Samsungs have generally HDMI1 port meant as DVI only - so not suited for HDMI communications.

what is also not quite ok is that Denon do not propagate itself at all (regardless of being On/Off, it MUST).

now when looking again at log I see the deattach/attach event is repeating 3 or 4 times within 5 seconds what looks like Samsung's standard time for OFF/ON cycle (what would be correct). the address is cycling between 1000 and 1100 and settles at 1100. but on HDMI signalling there should be just 1 or 2 those events and of course physaddr should not change (please check again that your HDMI port is not 1 at samsung).

((without the PA changes, libCEC will not resend "active source" command and TV will not turn ON then)). with this conditions libCEC is doing OK (if RPI is active source and one would reconnect it to other HDMI port, it has to send active source command again (to signal PA changed, and TV should change HDMI input). and TV should turn-on o "active source" command).

I remember I had also some troubles with calling GetPhysicalAddress() on HDMI_ATTACH event - considered it to remove - but having Samsung's TVs only also I can't be sure it is working/not working with other brands.

answer my questions and then based on them we can test libcec without the PA refresh on HDMI events.

edited mine config.txt (normally I use)
Code:
hdmi_force_hotplug=1
hdmi_ignore_cec_init=1

so I removed them (with any of them RPIs FW has not generated the HDMI_X events), rebooted and tested HDMI1, HDMIX, both via AVR and direct attachment to TV.
I get the same result as you get when RPI attached VIA another CEC switch (AVR). then PA loops xtimes through correct one (X100) and wrong (1000). that means when RPI fw is changing PA, it is reseting to 1000 first (and obviously this event should not be reported as it is just temporary step). we can report that to Popcornmix - although he is not with Broadcom anymore.

I could not replicate this wrong behaviour when directly attached to TV, nor even HDMI1. But when at HDMI1(DVI), RPI wasn't able to detect AVR device - so TV is obviously filtering some traffic on DVI port.

that means, put to config.txt
Code:
hdmi_force_hotplug=1
hdmi_ignore_cec_init=1

(and feel free to report this raspberry github issue tracker - although I have feeling you get answer about editing config.txt).
((and if the Denon has ARC sound routing, put it into HDMI2. then you can stick RPI into any other HDMI port (not DVI) and your TV will route the HDMI sound to AVR - according to "receiver on/off" setting in Samsung's CEC hotkey menu).
(2nd Oct, 2014 06:08 PM)zkiifreak Wrote: [ -> ]By your explanation, it seems like the hdmi_ignore_cec_init is ignored by XBMC? If your explanation are correct, that setting is useless...??

config.txt settings are not relevant for XBMC itself directly. ignore_cec_init is telling to RPI fw that is should not turn CEC active mode on HDMI init (so CEC high level functionality within RPI firmware should stay passive/deactivated - libCEC is handling everything itself on CEC bus, it is not using the FWs own cec functions).

--
I have never tested playing audio while wanting TV be off, but looking at XBMC CEC implementation - on XBMC OnPlay event XBMC is generating "active source" command what will turn TV ON - for this there is condition that CEC XBMC setting "Make XBMC active source on start" must be ON and RPI must be at the time of OnPlay event as Inactive Source (that means you switched from RPI to another source).

that means that if one want's XBMC be auto activated on start - only way how to keep XBMC away from sending AS (turning TV ON) is that it is still active source (you use TV for XBMC on RPI only).

((for your and mine use pattern I don't see why we could not patch that to distinguish between Music/Video and send AS only for video. but considering that 95% users doesn't have external Audio and thus need TV be ON to get sound, separate setting to regulate this will be needed)).
First off: wauv! What a fantastic reply!
I'll try to see, if I can answer correctly.
(7th Oct, 2014 07:20 PM)mk01 Wrote: [ -> ]@zkiifreak

tell me, is even the 1xxx address ok? (so your cec tree ends up in Samsung TV in HDMI1)? if yes, is there a reason for that? Samsungs have generally HDMI1 port meant as DVI only - so not suited for HDMI communications.
Seems like whatever i put in does not work. If I put in 2xxx it changes to hdmi2 on the Samsung...
I've even moved the HDMI cable from HDMI1 to HDMI2 on the Samsung - no dice there, still same ol' same ol'.
(7th Oct, 2014 07:20 PM)mk01 Wrote: [ -> ]what is also not quite ok is that Denon do not propagate itself at all (regardless of being On/Off, it MUST).

now when looking again at log I see the deattach/attach event is repeating 3 or 4 times within 5 seconds what looks like Samsung's standard time for OFF/ON cycle (what would be correct). the address is cycling between 1000 and 1100 and settles at 1100. but on HDMI signalling there should be just 1 or 2 those events and of course physaddr should not change (please check again that your HDMI port is not 1 at samsung).

((without the PA changes, libCEC will not resend "active source" command and TV will not turn ON then)). with this conditions libCEC is doing OK (if RPI is active source and one would reconnect it to other HDMI port, it has to send active source command again (to signal PA changed, and TV should change HDMI input). and TV should turn-on o "active source" command).

I remember I had also some troubles with calling GetPhysicalAddress() on HDMI_ATTACH event - considered it to remove - but having Samsung's TVs only also I can't be sure it is working/not working with other brands.

answer my questions and then based on them we can test libcec without the PA refresh on HDMI events.
Tried to; let me know if anything is missing. I'm not sure i've got it right??
(7th Oct, 2014 07:20 PM)mk01 Wrote: [ -> ]
edited mine config.txt (normally I use)
Code:
hdmi_force_hotplug=1
hdmi_ignore_cec_init=1

so I removed them (with any of them RPIs FW has not generated the HDMI_X events), rebooted and tested HDMI1, HDMIX, both via AVR and direct attachment to TV.
I get the same result as you get when RPI attached VIA another CEC switch (AVR). then PA loops xtimes through correct one (X100) and wrong (1000). that means when RPI fw is changing PA, it is reseting to 1000 first (and obviously this event should not be reported as it is just temporary step). we can report that to Popcornmix - although he is not with Broadcom anymore.
That sound reasonable!
(7th Oct, 2014 07:20 PM)mk01 Wrote: [ -> ]I could not replicate this wrong behaviour when directly attached to TV, nor even HDMI1. But when at HDMI1(DVI), RPI wasn't able to detect AVR device - so TV is obviously filtering some traffic on DVI port.

that means, put to config.txt
Code:
hdmi_force_hotplug=1
hdmi_ignore_cec_init=1
Do i need to clean my glasses or is that a repeation of the previous code block?
(7th Oct, 2014 07:20 PM)mk01 Wrote: [ -> ](and feel free to report this raspberry github issue tracker - although I have feeling you get answer about editing config.txt).
((and if the Denon has ARC sound routing, put it into HDMI2.
This Denon is so old that it does have ARC Sad
(7th Oct, 2014 07:20 PM)mk01 Wrote: [ -> ]then you can stick RPI into any other HDMI port (not DVI) and your TV will route the HDMI sound to AVR - according to "receiver on/off" setting in Samsung's CEC hotkey menu).

I hope the issue is able to be resolved. It sounds like I'm kinda minority when it comes to the need of having the tv off and the amp on for playing music Wink

Thanks a big bunch for taking the time to answer my issue!! Smile Smile
@zkiifreak

if you put 2xxx where ? information in cec peripheral setting (hdmi port / PA) in xbmc should be updated correctly by xbmc/cec (normally it should be maintenance free for user). don't use it as primary option to handle/resolve cec/hdmi issues.

the config.txt parameters I repeated, yes. just to be sure. do this:
1) update config.txt accordingly
2) remove /home/xbian/.xbmc/userdata/peripheral_data/*
3) HDMI cable from Denon put to HDMI2 on TV
4) reboot RPI

on reboot and with the already mentioned settings RPI/Cec with get PA on reboot (so the correct), will report that to XBMC and no other HDMI plug/unplug events will be generated (so PA won't be messed). CEC should work normally - so should become AS if set so (no need to select from TV again and again), should not be turning tv ON immediately after you put OFF, in log there must not be any PA change... just the first one during CEC start going from ffff to XXXX.

then we can look into the audio playing workflow.
(8th Oct, 2014 04:52 AM)mk01 Wrote: [ -> ]@zkiifreak

if you put 2xxx where ? information in cec peripheral setting (hdmi port / PA) in xbmc should be updated correctly by xbmc/cec (normally it should be maintenance free for user). don't use it as primary option to handle/resolve cec/hdmi issues.

the config.txt parameters I repeated, yes. just to be sure. do this:
1) update config.txt accordingly
2) remove /home/xbian/.xbmc/userdata/peripheral_data/*
3) HDMI cable from Denon put to HDMI2 on TV
4) reboot RPI

on reboot and with the already mentioned settings RPI/Cec with get PA on reboot (so the correct), will report that to XBMC and no other HDMI plug/unplug events will be generated (so PA won't be messed). CEC should work normally - so should become AS if set so (no need to select from TV again and again), should not be turning tv ON immediately after you put OFF, in log there must not be any PA change... just the first one during CEC start going from ffff to XXXX.

then we can look into the audio playing workflow.
Hi
Did all the steps. It seems to work - do you want logs? At least working for the audio! Fantastic. But let's not jump to conclusions. I'll "stress" test it for at couple of days Wink

Furthermore by 2XXX I mean as the PA in the CEC settings in XBMC. That kinda messed it up good Tongue But not going down that path again.

Now, just one last thing remaining (which I might be able to live with, give and take): When I switch from RPi (XBMC) to normal TV it works OK, but going back again does not work perfectly. I have to open the "Tools" menu on the Samsung and select XBMC to be able to control XBMC through the HDMI-CEC (Anynet+ as Samsung calls it). Is this be design in the TV or is it in XBMC/RPi? I do have the "Make XBMC the active source when starting" enabld in the CEC settings on XBMC... Everything else is disabled/none/ignore.

Thanks again for the advice thus far!!!!! Hope it's possible to fix the last thing?
it was broken in libcec a bit before we fixed it all. now it should work (speaking of AS). the behaviour you describe is consistent with the wrong PA as you say.

actually "active source" command and with it stored info is the only CEC function dependent on PA and not LA. because the TV at the end switches to HDMI port, not virtual logical address. if the LA get's changed during daily lifecycle and normal media/tv use incorrectly (co without also the physical connected port) - imagine on start we set 2100 correctly and send AS. Tv knows, that we are active and that we are connected in HDMI1 of denon and denon in HDMI2 of TV. later you watch BD or TV (so TV changes from HDMI2 to another one). then you choose back XBMC... If RPI sent info in-between that its PA changed - TV will rewrite its memory that XBMC is not at 2100 anymore but XXX. And once you click XBMC hoping for it back, TV changes to XXXX instead of 2100. but TV still sees XBMC name on the bus (although not active anymore and as you use tools->XBMC, TV actually asks the "other" XBMC of its PA, XBMC sends 2100 and that's why it works again.

so...
I don't need logs anymore, only check please if again for the messed messages where your RPI suddenly sends LA change and the "race" starts again.

I'm just compiling for you libCEC with the callback to PA change deactivated, so after load it should never consider its PA be changed. will post link shortly.
try that
http://ivka57.dyndns-ip.com/others/xbian-package-cec2.4.1-2-1412802409.deb

(just wget it to your RPI and install with dpkg -i )
(9th Oct, 2014 07:08 AM)mk01 Wrote: [ -> ]try that
http://ivka57.dyndns-ip.com/others/xbian-package-cec2.4.1-2-1412802409.deb

(just wget it to your RPI and install with dpkg -i )

Just installed that package.
Seems like it does nothing?! Huh I still get the awesome functionality of being able to turn of the TV to listen to music. But the thing about changing from RPi to normal TV function does not work Sad

I don't know if it helps, but when "attached" to the RPi (XBMC) and CEC is working, when changing away generates a message on my TV "Disconnecting Anynet+ device". When "reattaching" to the RPi (and changing the TV source to HDMI2, there is no "Connecting to Anynet+ device" message. I have to select the TV's Tools --> Anynet+ (HDMI-CEC) --> Device List --> XBMC before the connecting occurs.
Do I have to remove the hdmi_force_hotplug=1 from config.txt after your new libCEC compile? Do I have to enable more settings in the CEC Adapter settings in XBMC? (Still only "Enabled" and "Make XBMC the active source when starting" there, nothing else).

Still very baffled by your commitment! Big Grin Shy Smile

Let me know what you need!

Thanks!
the libcec you installed is just taking care that the PA won't be wrongly changed (as it was before without the hacks in config.txt). now you can remove then again. reboot and do the stuff. send me please debug log after as before.

in between popcornmix is analysing RPI FW code.

mk
(9th Oct, 2014 04:46 PM)mk01 Wrote: [ -> ]the libcec you installed is just taking care that the PA won't be wrongly changed (as it was before without the hacks in config.txt). now you can remove then again. reboot and do the stuff. send me please debug log after as before.

in between popcornmix is analysing RPI FW code.

mk
Hmm, first impression after reboot (removed the hdmi_force_hotplug=1):
The TV and Denon AVR was both off. Now, the TV turned on... (Rebooted by doing a sudo reboot while the TV was off). Good / bad ???? Bad in my opinion as a random reboot in the middle of the night will turn on the TV.
Now, I'll restart XBMC with the DEBUG option and report back Wink
the message about disconnecting anynet+ device is natural for Samsungs. nothing bad is hapenning, just the TV is sending proper CEC command to CEC bus about "Routing change" what means devices should update their info what source will be active (TV in your case) and that XBMC is not AS anymore.

(so on samsung it MUST appear always on changing sources - if all the devices with TV have proper CEC comm established. if Samusng wont display this - then it is bad and it means TV do not consider the inputs you are switching as properly working CEC devices).
Pages: 1 2 3
Reference URL's