Kodi Community Forum

Full Version: [OSMC 17.12-1] CECActivateSource() works, but CECStandby() doesn't
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi folks,

before I go deep trying to troubleshoot this I figured i'd post.

Setup is OSMC on an rPi2 with a Vizio D series (super cheap)

I am working on a python script which (at the end) turns off my TV via CEC. Unfortunately, the command to turn it off (cecstandby) doesn't seem to work. Of course, there are millions of reason that cec might not work, BUT...
  1. CEC from the TV->Kodi works great (remote can move around in menus, etc)
  2. the command to the the tv ON (cecactivatesource) does work!

I have a script that just hits each command in order:
python:
time.sleep(10)
xbmc.executebuiltin('XBMC.CECActivateSource')
time.sleep(10)
xbmc.executebuiltin('XBMC.CECToggleState')
time.sleep(10)
xbmc.executebuiltin('XBMC.CECStandby')
time.sleep(10)
quit()

And, here is the log: (timestamps help sync it up w/ my script)

Code:
16:28:10.212 T:1925683712 DEBUG: ToggleDeviceState - waking up CEC device...
16:28:10.213 T:1765798656 DEBUG: CecLogMessage - Recorder 1 (1) was already marked as active source
16:28:10.213 T:1765798656 DEBUG: CecLogMessage - >> source activated: Recorder 1 (1)
16:28:10.214 T:1765798656 DEBUG: CecLogMessage - sending active source message for 'Recorder 1'
16:28:10.214 T:1765798656 DEBUG: CecLogMessage - << powering on 'TV' (0)
16:28:10.214 T:1765798656 DEBUG: CecLogMessage - << 10:04
16:28:10.274 T:1765798656 DEBUG: CecLogMessage - << Recorder 1 (1) -> broadcast (F): active source (1000)
16:28:10.274 T:1765798656 DEBUG: CecLogMessage - << 1f:82:10:00
16:28:10.394 T:1765798656 DEBUG: CecLogMessage - << Recorder 1 (1) -> TV (0): menu state 'activated'
16:28:10.395 T:1765798656 DEBUG: CecLogMessage - << 10:8e:00
16:28:10.641 T:1765798656 DEBUG: CecLogMessage - >> 01:46
16:28:10.641 T:1765798656 DEBUG: CecLogMessage - << Recorder 1 (1) -> TV (0): OSD name 'Kodi'
16:28:10.641 T:1765798656 DEBUG: CecLogMessage - << 10:47:4b:6f:64:69
16:28:10.641 T:1765798656 DEBUG: CecLogMessage - >> TV (0) -> Recorder 1 (1): give osd name (46)
16:28:20.167 T:1925683712 DEBUG: ToggleDeviceState - putting CEC device on standby...
16:28:20.171 T:1765798656 DEBUG: CecLogMessage - << putting 'TV' (0) in standby mode
16:28:20.172 T:1765798656 DEBUG: CecLogMessage - << 10:36
16:28:28.355 T:1521738496 DEBUG: Thread JobWorker 1521738496 terminating (autodelete)
16:28:28.355 T:1695544064 DEBUG: Thread JobWorker 1695544064 terminating (autodelete)
16:28:29.599 T:1712321280 DEBUG: script.module.osmcsetting.updates : - blurp 370 - DialogBusy.xml
16:28:30.231 T:1925683712 DEBUG: ToggleDeviceState - putting CEC device on standby...
16:28:30.234 T:1765798656 DEBUG: CecLogMessage - << putting 'TV' (0) in standby mode
16:28:30.234 T:1765798656 DEBUG: CecLogMessage - << 10:36
16:28:40.193 T:1530913536 INFO: CPythonInvoker(11, /home/osmc/.kodi/addons/plugin.program.cectester/addon.py): script aborted
16:28:40.222 T:1530913536 INFO: Python script stopped

When the first part of the script runs, I see the TV's OSD pop up (showing that it has been activated), or if the TV is off it will actually turn it on again. But, the toggle state and standby command do nothing.
I suspect that everything in the CEC configuration is fine, but the TV just doesn't support being put into standby from CEC. Will someone else agree with me so I dont go down a huge rabbit hole? :  )
well this is interesting, just checked the manual and it specifically claims that it is able to power "on/off" with CEC...I'll keep the thread updated if I figure anything out!

Image
Is there a reason to stay on this older version of OSMC?
There have been some libCEC improvements and some OSMC fixes for CEC in newer versions. It's worth updating if you are able.
bah, sorry - was a typo in the title (fixed now) - I am on the latest (17.12-1)

It's also worth mentioning that sending manual commands with cec-client is the same - activate source turns the tv on, but standby does nothing. No error, just doesn't do anything. : (
I faced this problem first on Krypton and after upgrading to Leia, I was not able to shutdown with "CECStandby".
Solution what worked for me on OSMC:
Edit the value "standby_devices" in userdata/peripheral_data/rpi_2708_1001_CEC_Adapter.xml from "231" to "36037". But I had the problem that the value automatically changed on reboot, making the file write protected and CECStandby is working again.

I found the solution on https://discourse.osmc.tv/t/control-tv-o...ns/3638/12
This was fixed some time ago I believe; but GMC may need to check his CEC patches.

Sam