Forum

Full Version: RPi3 wont turn off CEC TV with delay from xbian config
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My setup is Xbian RPi3> Pioneer AV Receiver> TV
CEC remote works with no problem with TV remote, also TV and AV Receiver both turns off when in CEC settings set to turn it off when screen saver activate.
But they wont turn off if I disable the "turn of by screen saver" from CEC settings and activate it from xbian config with delay

Code:
20:07:39  97.964935 T:1716802480   DEBUG: XBian : on saver
20:07:39  98.009613 T:1700025264   DEBUG: XBian XBMC-Upstart bridge: got notification for event onScreensaverActivated
20:07:39  98.009842 T:1700025264   DEBUG: XBian XBMC-Upstart bridge: emitting Upstart event: sudo initctl emit -n -q screensaver ACTION=START
20:07:40  98.093918 T:1700025264   DEBUG: XBian XBMC-Upstart bridge: calculated priority: 1, based on monitor.screensaver=True, monitor.library_statuses={'scanning_video': False, 'cleaning_video': False, 'scanning_music': False, 'cleaning_music': False}, player.isPlaying()=0, player.isPlayingLiveTV()=False
20:07:40  98.094231 T:1700025264   DEBUG: XBian XBMC-Upstart bridge: emitting Upstart event: sudo initctl emit -n -q xbmcplevel PREVLEVEL=3 LEVEL=1
20:08:11 129.556473 T:1953329152  NOTICE: Samba is idle. Closing the remaining connections

nothing happens after last line

and here is the log from CEC turn off screen from CEC settings menu :

Code:
20:13:49 468.005829 T:1953329152   DEBUG: CAnnouncementManager - Announcement: OnScreensaverActivated from xbmc
20:13:49 468.006134 T:1953329152   DEBUG: GOT ANNOUNCEMENT, type: 4, from xbmc, message OnScreensaverActivated
20:13:49 468.007935 T:1953329152   DEBUG: ------ Window Init () ------
20:13:49 468.008118 T:1953329152   DEBUG: Alloc resources: 0.01ms  (0.00 ms skin load)
20:13:49 468.017456 T:1700025264   DEBUG: XBian XBMC-Upstart bridge: got notification for event onScreensaverActivated
20:13:49 468.017761 T:1700025264   DEBUG: XBian XBMC-Upstart bridge: emitting Upstart event: sudo initctl emit -n -q screensaver ACTION=START
20:13:49 468.039276 T:1716802480   DEBUG: XBian : on saver
20:13:50 468.119232 T:1700025264   DEBUG: XBian XBMC-Upstart bridge: calculated priority: 1, based on monitor.screensaver=True, monitor.library_statuses={'scanning_video': False, 'cleaning_video': False, 'scanning_music': False, 'cleaning_music': False}, player.isPlaying()=0, player.isPlayingLiveTV()=False
20:13:50 468.119507 T:1700025264   DEBUG: XBian XBMC-Upstart bridge: emitting Upstart event: sudo initctl emit -n -q xbmcplevel PREVLEVEL=3 LEVEL=1
20:16:28 626.727600 T:1716802480   DEBUG: XBian-config : xbian-config reboot : ['0']
20:16:33 631.328491 T:1843012528   DEBUG: CecLogMessage - >> 01:44:01
20:16:33 631.328613 T:1843012528   DEBUG: CecLogMessage - SetCurrentButton up (1) D:0ms cur:1
20:16:33 631.328735 T:1843012528   DEBUG: CecLogMessage - key pressed: up (1) current(ff) duration(0)
20:16:33 631.328796 T:1843012528   DEBUG: CecLogMessage - Changed key up (1) D:0ms cur:ff
20:16:33 631.328857 T:1843012528   DEBUG: CecLogMessage - key pressed: up (1, 0)
20:16:33 631.328857 T:1843012528   DEBUG: PushCecKeypress - received key a6 duration 0
20:16:33 631.328918 T:1843012528   DEBUG: CecLogMessage - CheckKeypressTimeout T:631.328
20:16:33 631.328979 T:1843012528   DEBUG: CecLogMessage - Key up: idle (duration:0) (1) timeout:1851829669ms (rel:500,rep:0,prs:500,rel:0)
20:16:33 631.329041 T:1843012528   DEBUG: CecLogMessage - >> TV (0) -> Recorder 1 (1): user control pressed (44)
20:16:33 631.357178 T:1953329152   DEBUG: CAnnouncementManager - Announcement: OnScreensaverDeactivated from xbmc
20:16:33 631.357544 T:1843012528   DEBUG: CecLogMessage - << requesting power status of 'Audio' (5)
20:16:33 631.357666 T:1843012528   DEBUG: CecLogMessage - << 15:8f
20:16:33 631.389160 T:1700025264   DEBUG: XBian XBMC-Upstart bridge: got notification for event onScreensaverDeactivated
20:16:33 631.389465 T:1700025264   DEBUG: XBian XBMC-Upstart bridge: emitting Upstart event: sudo initctl emit -n -q screensaver ACTION=STOP
20:16:33 631.418640 T:1843012528   DEBUG: CecLogMessage - Recorder 1 (1) was already marked as active source
20:16:33 631.418945 T:1843012528   DEBUG: CecLogMessage - >> source activated: Recorder 1 (1)
20:16:33 631.419189 T:1843012528   DEBUG: CecLogMessage - sending active source message for 'Recorder 1'
20:16:33 631.419312 T:1843012528   DEBUG: CecLogMessage - << powering on 'TV' (0)
20:16:33 631.419373 T:1843012528   DEBUG: CecLogMessage - << 10:04
20:16:33 631.429138 T:1716802480   DEBUG: XBian : on saver deactivated
20:16:33 631.429382 T:1716802480   DEBUG: XBian : on saver deactivated END
20:16:33 631.569092 T:1843012528   DEBUG: CecLogMessage - << Recorder 1 (1) -> broadcast (F): active source (1300)
20:16:33 631.569275 T:1843012528   DEBUG: CecLogMessage - << 1f:82:13:00
20:16:33 631.569519 T:1953329152   DEBUG: GOT ANNOUNCEMENT, type: 4, from xbmc, message OnScreensaverDeactivated
20:16:33 631.569763 T:1953329152   DEBUG: OnKey: 166 (0xa6) pressed, screen saver/dpms woken up
20:16:33 631.572144 T:1843012528   DEBUG: CecLogMessage - >> 51:90:00
20:16:33 631.572266 T:1843012528   DEBUG: CecLogMessage - expected response received (90: report power status)
20:16:33 631.572388 T:1843012528   DEBUG: CecLogMessage - 'Audio' (5) is already 'on'
20:16:33 631.572449 T:1843012528   DEBUG: CecLogMessage - >> Audio (5) -> Recorder 1 (1): report power status (90)
20:16:33 631.730042 T:1700025264   DEBUG: XBian XBMC-Upstart bridge: calculated priority: 3, based on monitor.screensaver=False, monitor.library_statuses={'scanning_video': False, 'cleaning_video': False, 'scanning_music': False, 'cleaning_music': False}, player.isPlaying()=0, player.isPlayingLiveTV()=False
20:16:33 631.730347 T:1700025264   DEBUG: XBian XBMC-Upstart bridge: emitting Upstart event: sudo initctl emit -n -q xbmcplevel PREVLEVEL=1 LEVEL=3
20:16:33 631.750305 T:1843012528   DEBUG: CecLogMessage - << Recorder 1 (1) -> TV (0): menu state 'activated'20:16:33 631.750732 T:1843012528   DEBUG: CecLogMessage - << 10:8e:00
20:16:33 631.840820 T:1843012528   DEBUG: CecLogMessage - CheckKeypressTimeout T:631.840
20:16:33 631.840942 T:1843012528   DEBUG: CecLogMessage - Key unknown: idle (duration:512) (ff) timeout:1851829669ms (rel:1000,rep:0,prs:0,rel:0)
20:16:33 631.841064 T:1843012528   DEBUG: CecLogMessage - >> 01:8b:01
20:16:33 631.841125 T:1843012528   DEBUG: CecLogMessage - >> TV (0) -> Recorder 1 (1): vendor remote button up (8B)
20:16:33 631.928650 T:1843012528   DEBUG: CecLogMessage - >> 01:8d:02
20:16:33 631.928894 T:1843012528   DEBUG: CecLogMessage - << Recorder 1 (1) -> TV (0): menu state 'activated'20:16:33 631.929016 T:1843012528   DEBUG: CecLogMessage - << 10:8e:00
20:16:33 631.929077 T:1843012528   DEBUG: CecLogMessage - >> TV (0) -> Recorder 1 (1): menu request (8D)
any helps ?
Unfortunately this function was removed some months ago (the code was in /etc/init/xbmc-screensaver.conf and currently this script does nothing).

I suppose there were 2 reasons doing this:

1) nobody (expect me?) used this function
2) it was announced that future releases of CEC library does not support multiple clients anymore (see here)

So I wrote my own /etc/init/xbmc-screensaver.conf but this requires patched Kodi to make it work again
Thanks for the info
Reference URL's