v17 -  Kodi 17 Krypton RC4-17.1 RC1 - Unusable Function CustomShutdownTimer / Change Request

My appreciations for the latest Kodi 17 RC4 release!
I grabbed the source code from git, compiled it and checked all the latest efforts in bug-fixing and improving this wonderful piece of software.
Thank you for your amazing work! Cool

Is there any possibility to change the custom shutdown timer into custom EXIT timer if the user with which Kodi is started has no shutdown privileges? Until Kodi 17 03 beta it has worked, actually it was a bug that I'd used as a feature. I don't want to shutdown the computer I'm running Kodi on but only exit and let the Monitor/TV enter the sleep mode.
Furthermore, this timer is a de facto feature on every Multimedia device (including ancient TV Sets) and its location in the Exit Menu is rather uninspired - one needs to simulate an Exit to reach it. I'd suggest to put it together with a suggestive icon inside the contextual (the one immediately accessible while watching some content in Kodi) Options Menu.

My monologue on this:

I've also tried the service.sleeptimer and I wasn't really impressed by it, not to mention that to reach its settings page is even harder than to simulate an exit.
Thread moved to feature requests, although it's too late for Krypton 17.0
| Banned add-ons (wiki) | Forum rules (wiki) | VPN policy (wiki) | First time user (wiki) | FAQs (wiki) | Troubleshooting (wiki) | Add-ons (wiki) | Free content (wiki) | Debug Log (wiki) | Free Movies/TV Shows |
Oh well, so I'm stuck with Kodi 17 03 beta, as Kodi 17 RC4 (final) is not really usable, what a pity.
I just burned a DVD with the compiled package / source code and required addons for Kodi 17 03 Beta.

Maybe I'll get lucky with the next Kodi 18 alpha version - I'll check the popcornmix releases from now on.

Thanks anyway!
It is said that you'll find what you're looking after in the last place you'd search for it. I was looking on GIT after the pull requests between Krypton 17.03 BETA and 17 Final and couldn't find anything related to the changes made for the Shutdown Countdown Timer.
Apparently the source code related with the PowerDown/Reboot permissions checking is located in the folder:

In order to override the checking I had to butcher (sorry - last time I was coding in cpp was 20 years ago) some source files and the first one was:
where I commented the conditional statement (comment-here):

void CPowerManager::SetDefaults()
int defaultShutdown = CSettings::GetInstance().GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNSTATE);

switch (defaultShutdown)
// assume we can shutdown if --standalone is passed
// comment-here if (g_application.IsStandAlone())
defaultShutdown = POWERSTATE_SHUTDOWN;

Additionally, in the folder:
I had to butcher several other source files that were checking for PowerOff permissions in the ConsoleKit, UPower, Logind subsystems.
Basically, I had to delete some checking functions and define default true values for the boolean vars.
Example - from:
bool CConsoleDeviceKitPowerSyscall::CanPowerdown()
return m_CanPowerdown;


bool CConsoleDeviceKitPowerSyscall::CanPowerdown()
return true;

I'm keeping my RaspberryPi always on, since it's a really powerful little toy and I use it for a lot of other purposes besides Kodi. Therefore I just didn't want to kill it by exiting Kodi.
I have assigned a button on my remote to start Kodi through irexec (lircd) and here is my start&stop script - in case someone else needs some inspiration:
cat /home/kodi/kodi-script
export PATH="$PATH:/opt/java/bin"
#Turn On Display
/opt/vc/bin/vcgencmd display_power 1
#Run TVHeadend
#Wait a while untill TVHeadend actually starts and updates its EPG DB
sleep 5
#Set PulseAudio env crap
DBUS_SESSION_BUS_PID=`cat /var/run/dbus/dbus.pid`
#Run Kodi
#After Kodi-Exit Turn Off Display
/opt/vc/bin/vcgencmd display_power 0
#Kill TVHeadend

cat /usr/local/etc/lirc/irexec.conf
#Start Kodi from remote button HILFE2

prog = irexec
remote = Technisat_TTS35AI.conf
button = HILFE2
config = su kodi -c /home/kodi/kodi-start
repeat = 0

cat /home/kodi/kodi-start
nohup /home/kodi/kodi-script 2>&1 | tee /home/kodi/kodi.log &

I'd suggest to keep the actual conditional checks in the /xbmc/powermanagement/ as they are, they look consistent/well designed and just add an additional Exit Countdown Timer function in the Kodi GUI. As suggested in my previous posts - there should be an icon in the Contextual Menu and not in the Exit Menu for this kind of Exit/Shutdown Countdown Timer.

I'm happy now with my source code butchering and hope to see some positive changes in the next Kodi versions.
Thread Rating:
  • 0 Vote(s) - 0 Average

Logout Mark Read Team Forum Stats Members Help
Kodi 17 Krypton RC4-17.1 RC1 - Unusable Function CustomShutdownTimer / Change Request00