Option to put TV on standby through CEC, even while playing music
#1
My goal is to be able to use my XBMC as a music player as well. For obvious reasons I want the TV to turn off when the device is not being controlled. The libCEC setting "put devies in standby mode when activating screensaver" supports this. However the XBMC implementation disables this option when music is being played.

See this relevant code in xbmc/peripherals/devices/PeripheralCecAdapter.cpp

Code:
else if (flag == GUI && !strcmp(sender, "xbmc") && !strcmp(message, "OnScreensaverActivated") && m_bIsReady)
  {
    // Don't put devices to standby if application is currently playing
    if ((!g_application.IsPlaying() && !g_application.IsPaused()) && m_configuration.bPowerOffScreensaver == 1)
    {
      m_screensaverLastActivated = CDateTime::GetCurrentDateTime();
      // only power off when we're the active source
      if (m_cecAdapter->IsLibCECActiveSource())
        StandbyDevices();
    }
  }

Why was this restriction ever put in place? To me it doesn't seem like a good idea to hard-code it like this. I understand for some users putting the TV on standby also put's their audio output on standby, but that is just some users. Not enough reason to hardcode this. I suggest this should be a setting.

For the meanwhile, does anybody got an idea how to fix this? I wouldn't know how to compile XBMC (for windows) so making my own fork isn't an option. Maybe somebody knows a good workaround?
Reply
#2
xbmc currently doesn't make any difference between audio or video playing. if anything is playing, then the TV won't be put in standby. the assumption is that HDMI audio is being used, and putting the TV in standby will disable the audio input too.
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
Not necessarily true. I use HDMI audio and can (manually) put my TV on standby and have XBMC keep playing audio. I just like to have this automated but the current assumptions don't allow for it. That is why I would like to have this made into a setting.
Reply
#4
Oddly enough, I already have this feature/bug on my installation. I am using HDMI for both video/audio output, and according to what I see here, my monitor shouldnt enter suspend with audio playing? But this is exactly what happens at the moment + the audio playback stops. Is this a bug worth reporting or am I missing something.

23:04:19 T:3038279424 DEBUG: DPMS: supported power-saving modes: SUSPEND OFF STANDBY
...
02:28:52 T:3038279424 INFO: DPMS: enabled power-saving mode SUSPEND
Reply
#5
That might be due to your power saving settings(which in windows stops your display device and also all hdmi audio). Not related to what I'm talking about, which is the option to use CEC to set your device on standby when the screensaver starts.
Reply
#6
Thanks for clarification. Yes, I have been playing with the power saving settings. So that setting is not taking *any media* into account, just video? I would like to have a reasonable suspend value, like 15min. But its not feasible if it cuts the audio while its playing, instead going to suspend after media playback has ended + 15min would be preferred. If that is doable I will add it as a feature request.
Reply
#7
I finally resorted to creating my own fork. I hoped to prevent this. Here is the relevant commit if anybody is interested:
https://github.com/jaapp/xbmc/commit/c32...bdfd217578

I also updated the "how to compile XBMC on windows"-wiki page, so anybody else who is compiling it shouldn't run in as many issues as I have.


(2013-02-20, 14:58)odt_x Wrote: Thanks for clarification. Yes, I have been playing with the power saving settings. So that setting is not taking *any media* into account, just video? I would like to have a reasonable suspend value, like 15min. But its not feasible if it cuts the audio while its playing, instead going to suspend after media playback has ended + 15min would be preferred. If that is doable I will add it as a feature request.
Still not what this thread is about and already possible (set screensaver to 15 minutes and configure libCec to go on standby on screensaver. Or just use the power options to power off the TV)


(2013-02-20, 13:16)dushmaniac Wrote: xbmc currently doesn't make any difference between audio or video playing.

It does. Kinda. "g_application.IsPlayingVideo()" tells you wether it's playing video. The only other option is audio.
Reply
#8
Please correct me if I am wrong, but the screensaver is not activated during video playback at all, is it? It is only activated after the specified period of inactivity during audio-only playback and so the possibility to send the cec-standby request would be really nice to save power.
Reply
#9
That is correct. The screensaver never activates while playing video. But still even if it would the commit I linked to earlier checks if there is no video playing.
Reply

Logout Mark Read Team Forum Stats Members Help
Option to put TV on standby through CEC, even while playing music0