Hdmi-CEC and OSMC

Hi,
I had a corrupted SD card so I had to reinstall OSMC to a new card. RaspberryPI2 B with 1G of RAM.

Initially everything was working fine (well, I had to reconfigure everything), but once I just realized that the remote doesn’t work as it used to. And it worked initially with the new system also. But now it stopped working with TV. It’s a Samsung.
On the TV the Anynet+ is enabled, but when I go to find devices it doesn’t find any.

It worked, but now it doesn’t work…

Debug logs can be found here:
https://paste.osmc.tv/sodalamusi

Could it be that I have enabled a tty console also (so when mediacenter service is stopped I got a text console on screen, instead of rebooting kodi)?

When kodi is not running the cec-client’s outputs this:

osmc@osmc:~/.kodi/temp$ cec-client
No device type given. Using 'recording device'
CEC Parser created - libCEC version 6.0.2
no serial port given. trying autodetect:
 path:     /dev/cec0
 com port: Linux

opening a connection to the CEC adapter...
DEBUG:   [              97]     Broadcast (F): osd name set to 'Broadcast'
DEBUG:   [              97]     CLinuxCECAdapterCommunication::Open - m_fd=3 bStartListening=1
DEBUG:   [              97]     CLinuxCECAdapterCommunication::Open - ioctl CEC_ADAP_G_PHYS_ADDR - addr=2000
DEBUG:   [              97]     CLinuxCECAdapterCommunication::Open - ioctl CEC_ADAP_S_LOG_ADDRS - log_addr_mask=0000 num_log_addrs=0
DEBUG:   [              98]     CLinuxCECAdapterCommunication::Open - ioctl CEC_ADAP_S_LOG_ADDRS - log_addr_mask=8000 num_log_addrs=1
NOTICE:  [              98]     connection opened
DEBUG:   [              98]     CLinuxCECAdapterCommunication::Process - CEC_DQEVENT - CEC_EVENT_STATE_CHANGE - log_addr_mask=8000 phys_addr=2000
DEBUG:   [              99]     << Broadcast (F) -> TV (0): POLL
TRAFFIC: [              99]     << f0
DEBUG:   [              99]     processor thread started
DEBUG:   [             404]     CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=01 len=1 addr=f0 opcode=ffffffff
DEBUG:   [             404]     >> POLL sent
DEBUG:   [             404]     TV (0): device status changed into 'present'
DEBUG:   [             404]     << requesting vendor ID of 'TV' (0)
TRAFFIC: [             404]     << f0:8c
DEBUG:   [             471]     CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=01 len=2 addr=f0 opcode=8c
DEBUG:   [            1471]     expected response not received (87: device vendor id)
TRAFFIC: [            1472]     << f0:8c
DEBUG:   [            1524]     CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=01 len=2 addr=f0 opcode=8c
DEBUG:   [            2525]     expected response not received (87: device vendor id)
DEBUG:   [            2525]     registering new CEC client - v6.0.2
DEBUG:   [            2525]     SetClientVersion - using client version '6.0.2'
NOTICE:  [            2525]     setting HDMI port to 1 on device TV (0)
DEBUG:   [            2525]     SetConfiguration: double tap timeout = 200ms, repeat rate = 0ms, release delay = 500ms
DEBUG:   [            2525]     detecting logical address for type 'recording device'
DEBUG:   [            2525]     trying logical address 'Recorder 1'
DEBUG:   [            2525]     << Recorder 1 (1) -> Recorder 1 (1): POLL
TRAFFIC: [            2525]     << 11
DEBUG:   [            2587]     CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=24 len=1 addr=11 opcode=ffffffff
TRAFFIC: [            2588]     << 11
DEBUG:   [            2659]     CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=24 len=1 addr=11 opcode=ffffffff
DEBUG:   [            2659]     >> POLL not sent
DEBUG:   [            2659]     using logical address 'Recorder 1'
DEBUG:   [            2659]     Recorder 1 (1): device status changed into 'handled by libCEC'
DEBUG:   [            2659]     Recorder 1 (1): power status changed from 'unknown' to 'on'
DEBUG:   [            2659]     Recorder 1 (1): vendor = Pulse Eight (001582)
DEBUG:   [            2659]     Recorder 1 (1): CEC version 1.4
DEBUG:   [            2659]     AllocateLogicalAddresses - device '0', type 'recording device', LA '1'
DEBUG:   [            2659]     CLinuxCECAdapterCommunication::SetLogicalAddresses - ioctl CEC_ADAP_S_LOG_ADDRS - log_addr_mask=0000 num_log_addrs=0
DEBUG:   [            2660]     CLinuxCECAdapterCommunication::Process - CEC_DQEVENT - CEC_EVENT_STATE_CHANGE - log_addr_mask=0000 phys_addr=2000
DEBUG:   [            2802]     CLinuxCECAdapterCommunication::Process - CEC_DQEVENT - CEC_EVENT_STATE_CHANGE - log_addr_mask=0002 phys_addr=2000
DEBUG:   [            2802]     changing physical address to 2000
DEBUG:   [            2802]     Recorder 1 (1): physical address changed from ffff to 2000
DEBUG:   [            2802]     CLinuxCECAdapterCommunication::SetLogicalAddresses - ioctl CEC_ADAP_S_LOG_ADDRS - log_addr_mask=0002 num_log_addrs=1
DEBUG:   [            2802]     Recorder 1 (1): osd name set to 'CECTester'
DEBUG:   [            2802]     Recorder 1 (1): menu language set to 'eng'
DEBUG:   [            2802]     using provided physical address 2000
NOTICE:  [            2802]     CEC client registered: libCEC version = 6.0.2, client version = 6.0.2, firmware version = 0, logical address(es) = Recorder 1 (1) , physical address: 2.0.0.0,  compiled on 2021-02-21 00:19:23 by root@compiler2 on Linux 4.19.0-9-amd64 (armv7l), features: P8_USB, DRM, P8_detect, Linux
DEBUG:   [            2802]     << Recorder 1 (1) -> TV (0): OSD name 'CECTester'
TRAFFIC: [            2802]     << 10:47:43:45:43:54:65:73:74:65:72
DEBUG:   [            3358]     CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=01 len=11 addr=10 opcode=47
DEBUG:   [            3358]     << requesting power status of 'TV' (0)
TRAFFIC: [            3358]     << 10:8f
DEBUG:   [            3425]     CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=01 len=2 addr=10 opcode=8f
DEBUG:   [            4425]     expected response not received (90: report power status)
TRAFFIC: [            4425]     << 10:8f
DEBUG:   [            4478]     CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=01 len=2 addr=10 opcode=8f
waiting for input
DEBUG:   [            5478]     expected response not received (90: report power status)
^Csignal caught: 2 - exiting
DEBUG:   [           32931]     unregistering all CEC clients
NOTICE:  [           32931]     unregistering client: libCEC version = 6.0.2, client version = 6.0.2, firmware version = 0, logical address(es) = Recorder 1 (1) , physical address: 2.0.0.0,  compiled on 2021-02-21 00:19:23 by root@compiler2 on Linux 4.19.0-9-amd64 (armv7l), features: P8_USB, DRM, P8_detect, Linux
DEBUG:   [           32931]     Recorder 1 (1): power status changed from 'on' to 'unknown'
DEBUG:   [           32931]     Recorder 1 (1): vendor = Unknown (000000)
DEBUG:   [           32931]     Recorder 1 (1): CEC version unknown
DEBUG:   [           32931]     Recorder 1 (1): osd name set to 'Recorder 1'
DEBUG:   [           32931]     Recorder 1 (1): device status changed into 'unknown'
DEBUG:   [           32931]     CLinuxCECAdapterCommunication::Process - CEC_DQEVENT - CEC_EVENT_STATE_CHANGE - log_addr_mask=0000 phys_addr=2000
DEBUG:   [           32931]     CLinuxCECAdapterCommunication::SetLogicalAddresses - ioctl CEC_ADAP_S_LOG_ADDRS - log_addr_mask=0000 num_log_addrs=0
DEBUG:   [           32931]     CLinuxCECAdapterCommunication::SetLogicalAddresses - ioctl CEC_ADAP_S_LOG_ADDRS - log_addr_mask=0000 num_log_addrs=0
DEBUG:   [           32931]     unregistering all CEC clients
DEBUG:   [           32931]     CLinuxCECAdapterCommunication::SetLogicalAddresses - ioctl CEC_ADAP_S_LOG_ADDRS - log_addr_mask=0000 num_log_addrs=0
DEBUG:   [           32936]     CLinuxCECAdapterCommunication::Process - CEC_DQEVENT - CEC_EVENT_STATE_CHANGE - log_addr_mask=0000 phys_addr=2000
DEBUG:   [           33943]     CLinuxCECAdapterCommunication::Process - stopped - m_fd=3
DEBUG:   [           33943]     CLinuxCECAdapterCommunication::Close - m_fd=3

Could someone guide me to the correct direction where to look because now I am clueless…
Thanks,
S

First thing to try is removing the power to the TV and the osmc device for a few minutes. They need to be off and not in stand by

Running CEC-client will break CEC input in Kodi until you reboot the RPi (not just restarting Kodi) just FYI. If this is a clean install then it should have been enabled by default but just in case you might check settings>system>input>peripherals> to be sure.

This is somekind of black magic.

I did what you suggested: turned off, power removed (pi + TV), 5mins, turned back everything.
Thanks a lot for your help, now it works.

ok, good to know. Anyway, when I executed cec-client, libcec didn’t work before either on Kodi.
And yes, I checked. It is enabled on Kodi, enabled on TV.

The solution was the good-old powercycle (with a little rest between trurning off and on). Is the libcec std designed by Microsoft?? :slight_smile:

br,
S

Not really. TV’s sometimes get messed up with the CEC and a hard boot is the only way to get the TV to start fresh with new CEC assignments. In the same way a downstream device can get stuck using a device identifier on the CEC bus that either conflicts or the TV doesn’t know about and rebooting the device is a way to ensure a new poll gets requested.

If you look into the history it is way worse than if it was written by MSFT. The issue with the cec-client is that only piece of software can be controlling CEC at a time and by starting that you take the control away from Kodi.

Apologies, really the correct thread but someone else might find this useful.

I upgraded to a Pi4 and the latest OSMC build. CEC stopped working.
I’ve been here before so tried swapping cables and powering off…
For some reason CEC worked perfectly when I swapped the micro HDMI to the left port. I had it in the right thinking i wanted space between it and the power.

Anyway, left micro HDMI was a winner.

1 Like

After messing around with all the tedious configuration settings and the remove, unplug, reset, restart solutions offered here and elsewhere, THIS ↑↑↑↑ is the one that actually worked. I just moved the micro-HDMI to the left port, next to the power, and rebooted it. Suddenly the remote works.

Hello together,
i installed a fresh osmc on an RPI4 last week, using actual osmc build 2024.10-1 .
I am using a monitor to view pictures with OSMC/Kodi. Unfortunately the cec-client is not working.
With an older version of OSMC, but using an RPI2, it worked without any extra configuration.

I checked Kodi settings>system>input>peripherals> : the driver is visible
I am using the left micro hdmi as already mentioned above.
I disconnected Power from the RPI and the monitor for some minutes.
Within the monitor i did not find any point where i could enable cec.

Would be great to get some help - thanks.

Sending sudo echo “h” | cec-client -s -d 1
following messages appreares…
opening a connection to the CEC adapter…
ERROR: [ 41] CLinuxCECAdapterCommunication::Open - ioctl CEC_S_MODE failed - errno=16
ERROR: [ 41] could not open a connection (try 1)
ERROR: [ 1041] CLinuxCECAdapterCommunication::Open - ioctl CEC_S_MODE failed - errno=16
ERROR: [ 1041] could not open a connection (try 2)
ERROR: [ 2041] CLinuxCECAdapterCommunication::Open - ioctl CEC_S_MODE failed - errno=16
ERROR: [ 2041] could not open a connection (try 3)
ERROR: [ 3041] CLinuxCECAdapterCommunication::Open - ioctl CEC_S_MODE failed - errno=16
ERROR: [ 3041] could not open a connection (try 4)
ERROR: [ 4042] CLinuxCECAdapterCommunication::Open - ioctl CEC_S_MODE failed - errno=16
ERROR: [ 4042] could not open a connection (try 5)
ERROR: [ 5042] CLinuxCECAdapterCommunication::Open - ioctl CEC_S_MODE failed - errno=16
ERROR: [ 5042] could not open a connection (try 6)
ERROR: [ 6043] CLinuxCECAdapterCommunication::Open - ioctl CEC_S_MODE failed - errno=16
ERROR: [ 6043] could not open a connection (try 7)
ERROR: [ 7043] CLinuxCECAdapterCommunication::Open - ioctl CEC_S_MODE failed - errno=16
ERROR: [ 7043] could not open a connection (try 8)
ERROR: [ 8044] CLinuxCECAdapterCommunication::Open - ioctl CEC_S_MODE failed - errno=16
ERROR: [ 8044] could not open a connection (try 9)
ERROR: [ 9044] CLinuxCECAdapterCommunication::Open - ioctl CEC_S_MODE failed - errno=16
ERROR: [ 9044] could not open a connection (try 10)
unable to open the device on port Linux
ERROR: [ 10044] could not start CEC communications

How old is the Pi 2 OSMC installation?

Monitor, like what would typically be used with a computer? These typically don’t have CEC or a remote control. The device that worked was working on this exact same display?

Yes, it is a normal PC-Monitor. I am using a motion detector as a sensor to switch using CEC the monitor between standby (off) and on. The monitor didn’t changed, only the RPI from 2 to 4, the OSMC-version and the hdmi from big to small.

I started in 2016 with 2016.11-1 (http://download.osmc.tv/installers/diskimages/OSMC_TGT_rbp2_20161128.img.gz) and 2016.12-1 using an RPI2. On 11.11. 2023 i tried first time the RPI4.

Those CEC implementations will be completely different, so it’s hard to tell.

I would expect more dicussions about CEC if it would not be supported by OSMC, right?
That means something on the RPI4, or in connection with my monitor could be the reason. I will connect the RPI with my TV, may be the behavior is different.

Yes, CEC is supported

What are you using to connect the Pi4? A Mini HDMI to HDMI cable or an adapter?
Are you sure that cable/adapter supports CEC?

1 Like

I removed the monitor and added a Sony Bravia TV.
As well i changed the hdmi cable to another one.
Sadly nothing changed.

I tried a cable with mini HDMI and HDMI connector. Second i tried a HDMI cable with an adapter.
How can i check if the cables support CEC?

Not trivial but you could measure if Pin 13 is connected through.