Hacking on xbmc/peripherals/devices/PeripheralCecAdapter.cpp
#1
I would like for XBMC to suspend the PC (or at least stop playing) when the TV is turned off. Unfortunately, my TV does not appear to be sending a power off CEC message, so the existing functionality in XBMC to do this doesn't work.

What I would like to try to implement is to poll for the TV's power status and if it's transitioned from on to off, to tell XBMC to stop playing and / or suspend the computer.

I was having a look at xbmc/peripherals/devices/PeripheralCecAdapter.cpp and it seems that there are two threads, a CPeripheralCecAdapter:Tonguerocess and CPeripheralCecAdapterUpdateThread:Tonguerocess. Since I'm new to this code, I'm not entirely sure what each
thread is used for and whether I should try to put my polling code into one of these threads or perhaps make a new one.

Any advice would be much appreciated.
Reply
#2
doesn't your tv send out any message at all when going to standby? please pastebin xbmc's debug log, and indicate where you press the power button of your tv.

CPeripheralCecAdapterUpdateThread:Tonguerocess is just used to send an updated libcec_configuration struct to libCEC
opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
Reply
#3
Thanks for this, I've uploaded my log to http://pastebin.com/W2dZTgPx

In the log, I switch off the TV with the remote towards the end of 09:36.

I then went away for bit and at 9:44:50 I come back and press a key on my USB keyboard, and then I switch the TV back on with the remote. You can see all the CEC messages after that.
Reply
#4
in your tv's settings, there's a "auto standby" option or something similar. that option needs to be enabled, or the tv won't tell us that it went into standby mode
opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
Reply
#5
I have an 'Auto Turn Off' menu item, which does indeed do the trick. The description for the menu item is:

"Turns off Anynet+-equipped HDMI-CEC devices at the same time the TV turns off. And turns off TV when Anynet+-equipped HDMI-CEC device requests power off to the TV"

My TV is a Samsung, about 3 years old now. Model number is LE32C530 and firmware is T-MSX5DEUC-2011.0 which I believe is the latest (2011/03/18_002011).

But the problem is that this setting resets itself from time to time. Looking at http://www.avforums.com/forums/lcd-led-l...-22hd.html it might be that this setting is resetting itself because the TV is checking for a firmware upgrade 2 hours after it enters standby. I've now tried disabling this auto-upgrade "feature" and the setting seems to be sticking!

Interestingly, the TV does respond to CEC commands from the PC to switch it on and off and the status of the TV can be polled accurately. Strange that it won't send the standby event without this setting.

Thanks for your help!
Reply

Logout Mark Read Team Forum Stats Members Help
Hacking on xbmc/peripherals/devices/PeripheralCecAdapter.cpp0