Running cec-client breaks CEC

I have a webos2 tv connected to my RPi 3 running OSMC. Everything works fine and i can control the osmc instance with LG TV remote.

The problem with LG is there is no option to turn it on remotely. So one option is through HDMI CEC.
The problem is - after i run
#echo “on 0” | cec-client -s

The TV turns on without a hitch. But after it is on - I can no longer control OSMC through the LG remote. No responce at all. So looks like cec-client hijacks something and doesn’t return it. Is there a fix for this? Some command line argument maybe for cec-client?

Hi,

Have you tried changing the source/input and then changing back to kodi, does cec work then?

Thanks Tom.

Tried switching to TV (although antenna cable is not connected) than bach to HDMI1 (osmc). No luck.
Switched off the tv manually than back on. Not working…
Only rebooting OSMC helps.

Not sure if it will help but the log…

osmc@osmc:~$ echo "on 0" | cec-client -s
opening a connection to the CEC adapter...
DEBUG:   [              28]     Broadcast (F): osd name set to 'Broadcast'
DEBUG:   [              28]     Open - vc_cec initialised
DEBUG:   [              28]     logical address changed to Free use (e)
NOTICE:  [              28]     connection opened
DEBUG:   [              28]     << Broadcast (F) -> TV (0): POLL
DEBUG:   [              28]     processor thread started
DEBUG:   [              29]     initiator 'Broadcast' is not supported by the CEC adapter. using 'Free use' instead
TRAFFIC: [              29]     << e0
DEBUG:   [              89]     >> POLL sent
DEBUG:   [              89]     TV (0): device status changed into 'present'
DEBUG:   [              89]     << requesting vendor ID of 'TV' (0)
TRAFFIC: [              89]     << e0:8c
TRAFFIC: [             281]     >> 0f:87:00:e0:91
DEBUG:   [             281]     TV (0): vendor = LG (00e091)
DEBUG:   [             281]     >> TV (0) -> Broadcast (F): device vendor id (87)
DEBUG:   [             281]     expected response received (87: device vendor id)
DEBUG:   [             281]     replacing the command handler for device 'TV' (0)
DEBUG:   [             281]     TV (0): CEC version 1.3a
DEBUG:   [             281]     TV (0): menu language set to 'eng'
NOTICE:  [             281]     registering new CEC client - v4.0.2
DEBUG:   [             281]     detecting logical address for type 'recording device'
DEBUG:   [             281]     trying logical address 'Recorder 1'
DEBUG:   [             281]     << Recorder 1 (1) -> Recorder 1 (1): POLL
TRAFFIC: [             281]     << 11
TRAFFIC: [             554]     << 11
DEBUG:   [             975]     >> POLL not sent
DEBUG:   [             975]     using logical address 'Recorder 1'
DEBUG:   [             975]     Recorder 1 (1): device status changed into 'handled by libCEC'
DEBUG:   [             975]     Recorder 1 (1): power status changed from 'unknown' to 'on'
DEBUG:   [             975]     Recorder 1 (1): vendor = Pulse Eight (001582)
DEBUG:   [             975]     Recorder 1 (1): CEC version 1.4
DEBUG:   [             975]     AllocateLogicalAddresses - device '0', type 'recording device', LA '1'
DEBUG:   [             976]     logical address changed to Recorder 1 (1)
DEBUG:   [             976]     Recorder 1 (1): osd name set to 'CECTester'
DEBUG:   [             976]     Recorder 1 (1): menu language set to 'eng'
DEBUG:   [             976]     GetPhysicalAddress - physical address = 1000
DEBUG:   [             976]     AutodetectPhysicalAddress - autodetected physical address '1000'
DEBUG:   [             976]     Recorder 1 (1): physical address changed from ffff to 1000
DEBUG:   [             976]     << Recorder 1 (1) -> broadcast (F): physical address 1000
TRAFFIC: [             976]     << 1f:84:10:00:01
NOTICE:  [            1127]     CEC client registered: libCEC version = 4.0.2, client version = 4.0.2, firmware version = 1, logical address(es) = Recorder 1 (1) , physical address: 1.0.0.0,  compiled on Sat May 27 16:37:50 UTC 2017 by root@compiler2 on Linux 3.16.0-4-amd64 (armv7l), features: P8_USB, DRM, P8_detect, RPi
DEBUG:   [            1127]     Recorder 1 (1): vendor = LG (00e091)
DEBUG:   [            1127]     replacing the command handler for device 'Recorder 1' (1)
DEBUG:   [            1127]     Recorder 1 (1): CEC version 1.3a
DEBUG:   [            1127]     << Recorder 1 (1) -> TV (0): OSD name 'CECTester'
TRAFFIC: [            1127]     << 10:47:43:45:43:54:65:73:74:65:72
DEBUG:   [            1431]     << requesting power status of 'TV' (0)
TRAFFIC: [            1431]     << 10:8f
TRAFFIC: [            1574]     >> 01:90:01
DEBUG:   [            1574]     TV (0): power status changed from 'unknown' to 'standby'
DEBUG:   [            1575]     >> TV (0) -> Recorder 1 (1): report power status (90)
DEBUG:   [            1575]     expected response received (90: report power status)
NOTICE:  [            1575]     << powering on 'TV' (0)
TRAFFIC: [            1575]     << 10:04
DEBUG:   [            1666]     TV (0): power status changed from 'standby' to 'in transition from standby to on'
DEBUG:   [            1666]     unregistering all CEC clients
NOTICE:  [            1666]     unregistering client: libCEC version = 4.0.2, client version = 4.0.2, firmware version = 1, logical address(es) = Recorder 1 (1) , physical address: 1.0.0.0,  compiled on Sat May 27 16:37:50 UTC 2017 by root@compiler2 on Linux 3.16.0-4-amd64 (armv7l), features: P8_USB, DRM, P8_detect, RPi
DEBUG:   [            1666]     Recorder 1 (1): power status changed from 'on' to 'unknown'
DEBUG:   [            1666]     Recorder 1 (1): vendor = Unknown (000000)
DEBUG:   [            1666]     Recorder 1 (1): CEC version unknown
DEBUG:   [            1666]     Recorder 1 (1): osd name set to 'Recorder 1'
DEBUG:   [            1666]     Recorder 1 (1): device status changed into 'unknown'
DEBUG:   [            1666]     unregistering all CEC clients
DEBUG:   [            2029]     UnregisterLogicalAddress - releasing previous logical address
DEBUG:   [            2029]     logical address changed to Broadcast (f)

Hi,

When the lg comes back on, is Simplink still enabled?

Thanks Tom.

Tom, what do you mean by that? In the TV menu under SimpLink i have both options enabled. First one is Simpllink iteself. The seconf one states something like synchronisation of power “if tv turns on the connected equipment does the same e.t.c”

Hi,

I don’t own a lg TV, so I don’t know if SimpLink is still active after coming out of standby. Have you tried disabling both them options and then re-enabling?

Thanks Tom.

Usage of cec-client from command line will interupt the Kodi CEC client.
So you would need to initiate the TV on signal from within Kodi instead of using cec-client.
Like kodi-send --action="CECActivateSource"

Thank you. This explains everything.
kodi-send --action=“CECActivateSource” works flawlessly.

Is there a way to do it via the Kodi JSONRPC API?

Update: ok nevermind. Found alrerady the CEC plugin which enables the JSON API calls

I guess so, try google