Since then I’ve been repeatedtly (more than daily) launching the browser, closing it and going back to kodi, etc. without any reboot. No problem occured whatsoever so I guess I’m pretty stable now :). (using 1280x720 btw, for more char readability)
Actually I also thought that instead of using sleep we may also modify the .rc scripts and trigger a reboot and maybe make the transition faster, but I’m not sure. (the reboot phase seems pretty fast on the pi 3)
Last thing (but I think this doesn’t belong on this thread) : The pi emits a constant whistle when I’m on a SABNZBD page (the sabnzbd is installed on my synology NAS). I could check hat th whistle didn’t come from the TV audio (with TV muted it’s all the same) so I wonder what it could be …
@Beignet10 Less then 30 sec is hard, i got it down to 27, but i depends how long time it takes for kodi to close down. That in turn depends on plugins installed etc. 27 sec was with a clean install on a pi2.
Glad you got it to work in 1280x720, did you set it with fbset before X started or edited X-config files or did you set kodi resolution to 1280x720?
I did a try with haveing X running in the background of kodi, but it didn’t change that much of launch time.
thanks, used systemctl stop mediacenter, but if sigterm is quicker and “not to dirty”
got the sleep down to about 12,
doing “sudo systemctl stop mediacenter & sudo pkill kodi” if i just used pkill kodi, i got sadface and restart of medicenter.
It would be great to get kodi to shutdown in a couple of seconds.
@joakim_s is there way to test the method sam mentions.
Where do i put the “sudo systemctl stop mediacenter & sudo pkill kodi” command. Do i have to change the sleep duration in x_init.sh using this command.
X is started before kodi and lays dormant in the background (eating a bit of RAM) and when you start the launcher it still takes 10-12 sec’s to close kodi, and instead of those seconds starting X you get a login screen. I think it isn’t worth saving 2-4 seconds, just to lose RAM and still have to login every time you launch X from kodi.
Don’t remember how it was to exit, might give it a try again later.
Tried increasing sleep. Just went back to sleep 40 which worked previously. I dont mind the waiting its just that if i have a shortcut on my skin to x11 launcher it doesnt display a “please wait buffering” like it does if run it from programs menu.
No worries though grateful to have a browser on pi thanks
Did you try testing sams sigterm method by any chance.
@the_bo strange, the “sudo pkill kodi.bin” part sends a sigterm to kodi process. It changed my kodi close down time from 25-26 secs to 10-11 secs. which in turn made it possible to have just sleep 12.
If you want to try to cut the sleep, check how many seconds that passes between you launch from kodi till you get the black screen with a white underscore. The time it takes from “black screen” till X started you can cut from sleep. That way can you trim the seconds.
Don’t know anything about skins or kodi “magic”, I’m using Confluense, since the mrs learned how to navigate it back when i ran a hp laptop as media center. So i’m sorry cant help you there.
I don’t think SIGTERM sent directly will help. You would have needed to try and reboot the device first. Looking again, we save a chunk of time by only calling CScriptInvocationManager::GetInstance().Uninitialize(); if the user has selected ‘Exit’ and not shutdown:
if (m_ExitCode == EXITCODE_QUIT)
CScriptInvocationManager::GetInstance().Uninitialize();
m_ShuttingDown is only set on TMSG_RESET or TMSG_RESTART. If @joakim_s’s project picks up, we can look at exposing the quicker shutdown via JSON-RPC. Otherwise, with a quick glance, I wouldn’t expect to see a speedup via sigterm.
Something you said about reboot made me check, first time I launch after reboot kodi shut down take longer then 10 secs, ending with a black screen. But if i restart mediacenter again, sshing in and running sudo systemctl start mediacenter. Kodi comes back up, and the fun part is, if I launch x11 again it just takes 12 seconds.
Now i guess you figured as much, but for me it is “magic”
Edit: In short is there a way to trigger an “exit” from bash right now, or is that something you have to add to the code?
What you actually want to do is trigger a fake reboot, or set m_ShuttingDown. This is not yet possible from command line. Maybe I will add a quick way of doing it for quicker updates etc and you can use it then. I will let you know.
Edit: we can probably handle it in SIGTERM and follow quit routines but with a bool like ‘b_quickExit’.
Thanks Sam. I’ll keep this version for now since at least this version works after reboot, i get it to constant shutdown under 12 secs. But as you said, JSON-RPC may be disabled.
Just installed retrosmc and it boots into retropie in a few seconds.
@joakim_s maybe @mcobit might have some tips on how retrosmc works with kodi shutdown.
Would it be possible maybe to display a splash screen of some sort when launching x11 while waiting for kodi to shutdown in background. Would be a nice transition during the wait inside of having the please wait dialogue.