Kodi/SPMC aware of the Shield's sleepstate?
#1
Is or can Kodi/SPMC be made aware of the Shield's sleep state?

The Shield does not go to sleep like 'normal' devices do. To my knowledge it presumably throttles down, shuts down video and audio output but remains active.
Kodi also remains fully working. This can be checked by remote controlling the Shield with appropriate software -> Kodi remains functional.

Thing is, I noticed a lot of issues arise (i.e. audio out of sync) when the Shield (and Kodi) resume from sleep. These issues seem to magically disappear when I subsequently manually close and restart Kodi.

So my question is: Is Kodi even aware of the Shield's sleep state and if so, can Kodi restart itself (as an option) when the Shield resumes from sleep to avoid those issues? As a workaround I mapped the Kodi command 'RestartApp' to a remote control button, which works fine for now(confirmed on SPMC). It would be nice if Kodi would restart automatically.
Reply
#2
Anyone? Can a (Android) developer shed any light on this. Or is there any other way for Kodi/SPMC to interact when resuming from sleep?
Reply
#3
May be it's releated to: https://forum.kodi.tv/showthread.php?tid=327333 ?
Kodi 18: Nvidia Shield TV (main device) and LibreELEC on Raspberry Pi 2 and Odroid C2
TV: Panasonic TX-55EZ950E (OLED)
AVR: Onkyo TX-NR509 (HDMI ARC)
Reply
#4
That's exactly my point!

To avoid a some current or future issues (be it on stable, nightlies, kodi or spmc), I'd like Kodi to restart every time the Shield resumes from sleep. It is my experience that a freshly started Kodi has fewer issues.

It's not the ideal solution but it helps....
Reply
#5
First, if you are having issues, then to receive any meaningful help you need to provide a Debug log (wiki).  Though I can not personally reproduce those issues with v18.

Second, the linked issue is specific to v18, which is still in the pre-Alpha phase.

Third, there is already a way to exit Kodi automatically by using the shutdown timer.  Just go to Settings > System > Power savings & set the amount of time you want Kodi to Quit after no activity.  You will have to restart Kodi manually though as I don't believe there is a way to restart after sleep and why apps like Launch on Boot can't do this either.

Quote:Felker Tech October 7, 2017
Unfortunately there's nothing that can be done. Android TVs do not send a "wakeup" event, just if it boots or if it exits a screensaver.
Forum Rules (wiki) | Banned add-ons (wiki) | Wiki (wiki) | Quick start guide (wiki)
Reply
#6
Sad 
I'm fully aware of the importance of debug logs. There are too many variables to consider. Not just for Kodi but also the attached hardware. But the issues are not the point. Issues have been there and are always going to be there. I'm just experiencing the same as any Shield+Kodi user. I'm using SPMC, by the way because on SPMC, the command 'RestartApp' works. Also running v18 nightlies side by side but as said, it's not even alpha.

The fresh start works for me. My receiver correctly sees the appropriate video refresh rate again, instead of 60hz for all content after resume and audio stays in sync.
I only wanted to know if Kodi/SPMC could respond to wake-up events, but I guess not Undecided
Reply
#7
And as I said, without at least providing a Debug log you are not going receive any help with any of the issues you have.  If you are aware of the importance of the log then you should provide it.

We are not going to put in hacks to work around issues.  If there IS a problem then it needs to be fixed directly, either in Kodi or in the firmware if that is the cause.
Forum Rules (wiki) | Banned add-ons (wiki) | Wiki (wiki) | Quick start guide (wiki)
Reply
#8
For the last 9 years I've been using XBMC/Kodi. On every device from Apple TV to OSX to Windows to Android it has never worked properly when coming out of sleep. A restart has always been needed.

@DragonFly Dragonfly, how do you map the restart command to a button?
Reply
#9
(2018-01-23, 22:25)Tinwarble Wrote: First, if you are having issues, then to receive any meaningful help you need to provide a Debug log (wiki).
Ok, debug log provided as well as some additional information:

Hardware part:
Shield 2015 model
set at 3840x2160 @59,94hz, screensaver set at 5 mins (backdrop), sleep set at 20 mins. Connect by a HDMI 2.0a cable to an
Onkyo Receiver TX-L50.
This receiver has an upscale mode (1080 -> 4k) which default is on, this disabled. Speakers at 4.1 ch (I have no center speaker enabled). The receiver is connect by a HDMI 2.0a cable to a
Philips 65PUS7601 4k HDR TV
with the ‘HDMI ultra HD’ option set to UHD 4:4:4/4:2:2

All controls are done via CEC

Software part:
SPMC as per as Wiki settings for a 1080p GUI:
Resolution set at 1920x1080 1024 @59,94hz
Audio Pass-through: ON, all capabilities ticked
Adjust display refresh rate: On start/Stop

Before resuming from sleep:
On the UI main screen and no content playing, the receiver shows in an information overlay:

Kodi debug-log overlay:
FPS 59,5/60,5
Receiver overlay:
Audio input PCM 2.0ch 48Khz, Output Dolby Surround 4.1 ch
Video: HDMI 1, 1920x1080p 59 hz YCbCr422 24bit

When Playing content (no fancy DTS or something)
Kodi debug-log overlay:
FPS 23,4/24,4
Receiver overlay:
Audio input: PCM 2.0ch 48Khz, Output: Dolby Surround 4.1 ch
Video: HDMI 1, 1920x1080p 23 hz YCbCr422 24bit

Unfortunately, I can’t mimic the natural order of events because with the debug log ON, the Shield won’t go to sleep as it would without debug on (after 5 mins showing the backdrop pictures and sleeping after 20). I forced the Shield to go to sleep, but the effect remains the same.  Anyway, after resuming from sleep and playing the same content:

Kodi debug-log overlay:
FPS 59,5/60,5
Receiver overlay:
Audio input: PCM 2.0ch 48Khz, Output: Dolby Surround 4.1 ch
Video: HDMI 1, 1920x1080p 59 hz YCbCr422 24bit

To Recap: after resuming from sleep, Kodi's output seems to be fixed at ~ 60hz. As a result, while playing content there is a slight but noticeable audio delay and some tearing appears while playing. I've tried numerous settings, and Kodi/SMPC releases, but the issue remains.

debug.log
Reply
#10
(2018-01-25, 16:52)T800 Wrote: For the last 9 years I've been using XBMC/Kodi. On every device from Apple TV to OSX to Windows to Android it has never worked properly when coming out of sleep. A restart has always been needed.

@DragonFly Dragonfly, how do you map the restart command to a button?
 You must have some add-on within your Kodi install that is causing this, as I've used both Windows and Android (Shield TV both 2015 original and 2017 pro), and have never had issues with sleep causing me to restart Kodi.
Reply
#11
--
Reply
#12
(2018-01-25, 16:52)T800 Wrote: For the last 9 years I've been using XBMC/Kodi. On every device from Apple TV to OSX to Windows to Android it has never worked properly when coming out of sleep. A restart has always been needed.

@DragonFly Dragonfly, how do you map the restart command to a button?
By using the keyboard.xml in \userdata\keymaps. However, If you control the Shield using supplied remote/controler or some other IR-remote, the number of buttons recognized by Kodi are VERY limited.

Fortunately, I can control the Shield through CEC using my TV's original remote. This way more buttons become available for mapping. In my case I used the rarely used red record button for the build-in restart command. You can find your own key id using the Kodi's Keymap-editor add-on

Code:
<keymap>
  <Global>
    <keyboard>
      <key id="61638">RestartApp</key>     <!-- Record button-->
    </keyboard>
  </Global>
</keymap>
Reply
#13
(2018-01-25, 17:58)Powerhouse Wrote: You must have some add-on within your Kodi install that is causing this,....
 My test scenario is done on a pretty basic SPMC (Krypton alpha, but tried Krypton final also) install with a few addons:

metadata.common.allmusic.com\
metadata.common.fanart.tv\
metadata.common.imdb.com\
metadata.common.themoviedb.org\
metadata.themoviedb.org\
metadata.tvdb.com\
resource.language.nl_nl\
script.autoruns\
script.cu.lrclyrics\
script.module.beautifulsoup\
script.module.beautifulsoup4\
script.module.certifi\
script.module.chardet\
script.module.googleapi\
script.module.httplib2\
script.module.idna\
script.module.oauth2client\
script.module.requests\
script.module.six\
script.module.uritemplate\
script.module.urllib3\
script.module.yaml\
script.openweathermap.maps\
script.xbmcbackup\
service.libraryautoupdate\
service.subtitles.addic7ed\
service.subtitles.opensubtitles_by_opensubtitles\
service.subtitles.podnapisi\
service.subtitles.subscene\
service.subtitles.supersubtitles\
skin.confluence\
weather.gismeteo\
webinterface.chorus\

Mainly some extra subtitles plugins, because I'm Dutch and the service.libraryautoupdate because otherwise the library won't update (because kodi default only updates on start). All other module where added by addons. If there is some addon responsible for the issues mentioned, I would gladly disable or remove it.

Then again, no configuration is the same. The are numerous different, receivers, TV's and even more different ways to connect them with each other. That is way I also added some connected hardware info.

It could be caused by an add-on, but nothing really changes for Kodi while the Shield is in its sleep state, as Kodi is probably not even aware. In fact, Kodi or its add-ons might not even causing the issue. After all it's the Shield that resumes from sleep, not Kodi......
Reply
#14
(2018-01-23, 23:35)Tinwarble Wrote: And as I said, without at least providing a Debug log you are not going receive any help with any of the issues you have.  If you are aware of the importance of the log then you should provide it.

We are not going to put in hacks to work around issues.  If there IS a problem then it needs to be fixed directly, either in Kodi or in the firmware if that is the cause.
Well, did my part... It's been some time but has someone addressed this issue?
Reply
#15
(2018-02-02, 21:58)DragonFly Wrote: Well, did my part... It's been some time but has someone addressed this issue? 

Except posting in the right place. You are using SPMC and this is not a SPMC forum. If you want help with it then you need to post the debug log on Git: https://github.com/koying/SPMC/issues

If you're having the same issue with Kodi, then you need to post a debug log for it.
Forum Rules (wiki) | Banned add-ons (wiki) | Wiki (wiki) | Quick start guide (wiki)
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi/SPMC aware of the Shield's sleepstate?0