Help with CEC commands (N2)

I just checked it a bit and it’s definitely broken.

So I checked my settings before changing physical address:

I changed it to just like 3. After OK I lost CEC connection and when I re-enter the options look now:


The options changed! Now I am able to set the HDMI port number and it’s set to default 1.

I see on my TV Kodi is now on HDMI1, but in “real” it’s on HDMI3. So I changed the HDMI port to 3 and CEC is working again now, physical address is still 0.

Ok, but now the next issue:

bPAAutoDetected is false, OK
m_configuration.baseDevice is NOT CECDEVICE_UNKNOWN -> useless
m_configuration.iHDMIPort < CEC_MIN_HDMI_PORTNUMBER -> useless
m_configuration.iHDMIPort > CEC_MAX_HDMI_PORTNUMBER -> useless

CEC_MIN_HDMI_PORTNUMBER is 1,
CEC_MAX_HDMI_PORTNUMBER is 15

The user is not able to set a number smaller then 1 or higher than 15.
So strPhysicalAddress("0") will be set every time as the condition is never met.

I guess this is wrong:

If iPhysicalAddress is set by user m_configuration.iHDMIPort need to be set to 0 (CEC_HDMI_PORTNUMBER_NONE), then it should work. Then iPhysicalAddress get higher priority over iHDMIPort. libCEC check first by else if HDMI port set, then afterwards by else if physical address is set. So this will never be hit if HDMI port is set to 1 - 15:

Physical addresses are valid from 0x1000 - 0xFFFE.
The TV would be 0000, my device connected to HDMI port 3 should be then: 3000 by this description: https://elinux.org/images/d/d9/Verkuil.pdf

Physical Address
Physical address: Hierarchy placement
Range: 0.0.0.0 - F.F.F.F
Root device: 0.0.0.0: HDMI Sink, typically a TV
First device: 1.0.0.0: Device connected to HDMI port 1 on root device
Second device: 2.0.0.0: Device connected to HDMI port 2 on root device
Third device: 1.1.0.0: Device connected to HDMI port 1 on first device

Or another example:
0x2200 is [TV] -> HDMI 2 -> [AVR] -> HDMI 2 -> [CE DEVICE]

I will need to check it in more detail the next days.

1 Like