libCEC - Doesnt respects Physicall Address

I jumped from 3.0.1 libCEC to 4.0.4, so I tested, if its better. And I found, that (long term present) bug still appears when using CEC.

Configuration:
TV (0000) <–> AVR (2000)[Hdmi 2 on TV] <–> C2 (2100)[HDMI 1 on AVR].
When AVR switched off, it passthroughs HDMI signal from C2.

Default configuration, TV set ON, AVR OFF, source HDMI2.
When C2 is started, Its detected correctly as Playback device 1 (logical adress 4), get physicall adress 2100, CEC works.

11:36:57.495 T:3809579888   DEBUG: CecLogMessage - Playback 1 (4): device status changed into 'handled by libCEC'
11:36:57.495 T:3809579888   DEBUG: CecLogMessage - Playback 1 (4): power status changed from 'unknown' to 'on'
11:36:57.495 T:3809579888   DEBUG: CecLogMessage - Playback 1 (4): vendor = Pulse Eight (001582)
11:36:57.495 T:3809579888   DEBUG: CecLogMessage - Playback 1 (4): CEC version 1.4
11:36:57.495 T:3809579888   DEBUG: CecLogMessage - AllocateLogicalAddresses - device '0', type 'playback device', LA '4'
11:36:57.495 T:3809579888   DEBUG: CecLogMessage - Playback 1 (4): physical address changed from ffff to 2100
11:36:57.496 T:3809579888   DEBUG: CecLogMessage - Playback 1 (4): osd name set to 'Kodi'
11:36:57.496 T:3809579888   DEBUG: CecLogMessage - Playback 1 (4): menu language set to 'eng'
11:36:57.496 T:3809579888   DEBUG: CecLogMessage - physical address unchanged (2100)

But, when I switched TV to source TV, and then I switched back to HDMI2, CEC is lost. Logs shows, that routes go to 2000 instead of 2100.

11:40:10.041 T:3809579888   DEBUG: CecLogMessage - >> 0f:82:00:00
11:40:10.042 T:3809579888   DEBUG: CecLogMessage - making TV (0) the active source
11:40:10.043 T:3809579888   DEBUG: CecLogMessage - marking Playback 1 (4) as inactive source
11:40:10.043 T:3809579888   DEBUG: CecLogMessage - >> source deactivated: Playback 1 (4)
11:40:10.044 T:3809579888   DEBUG: CecLogMessage - >> TV (0) -> Broadcast (F): active source (82)
11:40:15.799 T:3809579888   DEBUG: CecLogMessage - >> 0f:80:00:00:20:00
11:40:15.799 T:3809579888   DEBUG: CecLogMessage - >> TV (0) -> Broadcast (F): routing change (80)
11:40:16.405 T:3809579888   DEBUG: CecLogMessage - >> 0f:86:20:00
11:40:16.405 T:3809579888   DEBUG: CecLogMessage - >> TV (0) sets stream path to physical address 2000
11:40:16.405 T:3809579888   DEBUG: CecLogMessage - >> TV (0) -> Broadcast (F): set stream path (86)

libcec on jeOS cant be setuped by logical adresses, no problem, we can setup physicall ones. The trouble is, that even I setuped this option to 2100

<setting id="physical_address" value="2100" />

it doesnt help. When I switched on TV from Playback device 1 to TV (ie other source than C2), and then back, I lost my CEC in case AVR is on the way (I dont expect this issue with direct connection TV-C2).

I tried also choose AVR and hdmi port 1 on Peripherals, doesnt help either.

I am suspecting this is problem within jeOS, because I noticed, even when user change psychical adress (and its written to CEC peripherals config file cec_CEC_Adapter.xml first), after reboot, in jeOS OSD Peripherals is again default psychical adress value shown (greyed 0).

P.S.: Turn off and on TV doesnt cause this problem, if source is remained to HDMI2. The actual switching sources on TV seems to trigger this. Setting playback device as inactive source is correct, but there is some bug when set it again to active, in this particular configuration.

Just guessing but try to set also connected_device and cec_hdmi_port.

I believe thats choose AVR and hdmi port 1 on Peripherals, which are already tried change from defaults to AVR + 1, as it should be… The .xml file showing

 <setting id="cec_hdmi_port" value="1" />
 <setting id="connected_device" value="36038" />

but there is still mystery, how psychical adrees is (not) handled within libCEC OSD Settings… :thinking:

Or you mean manually delete those two from .xml file to have working physical adress? Will try…

P.S.: Full .xml is

<settings>
    <setting id="activate_source" value="1" />
    <setting id="button_release_delay_ms" value="0" />
    <setting id="button_repeat_rate_ms" value="0" />
    <setting id="cec_hdmi_port" value="1" />
    <setting id="cec_standby_screensaver" value="0" />
    <setting id="cec_wake_screensaver" value="0" />
    <setting id="connected_device" value="36038" />
    <setting id="device_name" value="Kodi" />
    <setting id="device_type" value="1" />
    <setting id="double_tap_timeout_ms" value="100" />
    <setting id="enabled" value="1" />
    <setting id="pause_or_stop_playback_on_deactivate" value="231" />
    <setting id="pause_playback_on_deactivate" value="0" />
    <setting id="physical_address" value="2100" />
    <setting id="power_avr_on_as" value="0" />
    <setting id="send_inactive_source" value="0" />
    <setting id="standby_devices" value="231" />
    <setting id="standby_devices_advanced" value="" />
    <setting id="standby_pc_on_tv_standby" value="36028" />
    <setting id="standby_tv_on_pc_standby" value="0" />
    <setting id="tv_vendor" value="0" />
    <setting id="use_tv_menu_language" value="0" />
    <setting id="wake_devices" value="231" />
    <setting id="wake_devices_advanced" value="" />
</settings>

You wrote that address is reset to “0”. And I noticed this part of the code https://github.com/xbmc/xbmc/blob/master/xbmc/peripherals/devices/PeripheralCecAdapter.cpp#L1232
That’s why I was wondering what those variables has the value…

Yes, thats “another” thing.

  1. Setup of physical address doesnt affects PA after TV source switch and back
  2. Value (2100) is written to the .xml after setup, but after reboot C2 value is overriden, and goes back to the zero.

I differentiate those two clearly, because 2. doesnt causes 1; ie. even before reboot, after manual PA change through OSD, pop-up notify about CEC conf update, .xml file is updated…CEC works (on 2100) after that manual change (which is still good sign that value is correct). Still after switch source and then back to C2 CEC goes into 2000 instead of choosed 2100. And on top of that, after reboot this “choose” is reverted.

Sorry, than I’m no help.

But thanks to your dig I guess this is Kodi playground, not CE then, or?

I never hit this on Desktop, as I dont have Pulse Eight adapter, so I didnt thought about that :neutral_face:

It should be Recording device not playback device which is weird in the first place. I’m guessing this is an uboot issue. Some registers are wrong used for C2 in uboot

hmm. On the other TV connected directly to C2 Ive got recording device:

9:49:54.498 T:3775386480 WARNING: CecLogMessage - Write: write failed
19:49:54.498 T:3775386480   DEBUG: CecLogMessage - >> POLL not sent
19:49:54.498 T:3775386480   DEBUG: CecLogMessage - using logical address 'Recorder 1'
19:49:54.498 T:3775386480   DEBUG: CecLogMessage - Recorder 1 (1): device status changed into 'handled by libCEC'
19:49:54.498 T:3775386480   DEBUG: CecLogMessage - Recorder 1 (1): power status changed from 'unknown' to 'on'
19:49:54.498 T:3775386480   DEBUG: CecLogMessage - Recorder 1 (1): vendor = Pulse Eight (001582)
19:49:54.498 T:3775386480   DEBUG: CecLogMessage - Recorder 1 (1): CEC version 1.4
19:49:54.498 T:3775386480   DEBUG: CecLogMessage - AllocateLogicalAddresses - device '0', type 'recording device', LA '1'

Maybe its because AVR between, or different TV brand? I dont know… But initial CEC works very well, no matter if labeled recording or playback device.

@JimmyS I have a very similar problem. CEC works fine, but when I switch TV to other source (like TV) and back to HDMI1 where the AVR is, I don’t have CEC anymore. Did you manage to solve this somehow?
Using N2, Onkyo avr, Pana GX tv

libCEC do not like it when the CEC connection got stopped like by switching “hard” the HDMI-CEC line.
Also 99% of CEC issues are related if this connection schema is used: device -> AVR -> TV

Also Onkyo is known about having a bad/special CEC implementation.
Also Panasonic is known about having a bad/special CEC implementation.

For Panasonic you can try to change the libCEC version:

Maybe it helps or it make thing more worse. Last step is to create a issue here: