Release Artist Slideshow addon (with skin and addon integration)
New Beta Available (3.0.1~beta3)
While trying to make some more changes to reduce CPU usage, I noticed that AS wasn't quitting properly on Kodi exist if running in daemon mode (i.e. in the background all the time).  That's fixed now.  I also made a couple more little tweaks to try and reduce CPU usage.

About the CPU Usage
At this point I think I've done what I can to reduce CPU usage without sacrificing the user experience. AS takes more cycles now because it has to have two threads running (one for the main program and one to control the slideshow) instead of one.  The old version didn't have to control the slideshow because it just sent the skin a folder of images and stopped caring, but the new version has to send one image at a time for it to work with the Kodi 18 artist image folder.  Basically the challenge is that the longer I sleep the threads, the longer the delay for new artist images to show up when you change artists.  I tried sleeping the threads for 5 seconds, but it was very noticeable, so I kept bumping down until I ended up with 1 second sleep cycles.  If this beta still causes too much CPU usage, I can probably bump the sleep cycles to 2 seconds, but after that it's going to look like AS can't keep up with the song changes.

About the Quit at Exit Problem
I'm documenting this here just in case some future programmer is desperately searching the internet for why their Kodi addon with threads won't quit at exit.  It turns out (whether a feature or a bug) that xbmc.Monitor().abortRequested() and (I think anyway) xbmc.Monitor().waitForAbort() will only send their response to one thread, not multiple threads.  So in the case of AS the slideshow thread was catching all the Monitor requests and terminating, but then the main thread just kept going, oblivious to Kodi's pleas for it to quit.  Kodi would eventually force quit the script, but not always.  So I ended up having the main thread monitor the state of the slideshow thread, and if the main thread saw the slideshow thread terminate, the main thread assumed it should quit too.  On of off chance the main thread catches the Monitor stuff, it'll tell the slideshow thread to close, so we're handled in both cases now.  That got the quit time for the script down to about 2 seconds, and with that Kodi was much happier when exiting.

Thanks to everyone for pointing out the issues and helping to test solutions.  As I said before, the update probably won't go into the main repo until after the new year, so use the beta repo (a few posts up) to get the beta version if you're having problems with CPU usage/heat.
Reply


Messages In This Thread
New Test Version Available - by pkscout - 2012-03-08, 16:26
[No subject] - by mardup - 2012-03-10, 12:26
[No subject] - by pkscout - 2012-03-11, 01:35
RE: - by mardup - 2012-03-12, 17:50
RE: - by pkscout - 2012-03-13, 03:22
New Beta Version for Testing - by pkscout - 2012-07-13, 17:54
New Beta Version for Testing - by pkscout - 2012-07-14, 22:50
Pull Request for v1.4 Submitted - by pkscout - 2012-07-20, 23:01
New Beta Version for Testing - by pkscout - 2012-08-10, 03:18
New Frodo BETA Support Files - by pkscout - 2012-11-21, 06:20
New 2.0.0 Beta Coming Soon - by pkscout - 2016-05-12, 02:54
Writing tips - by Parkerbup - 2017-02-03, 14:56
RE: Artist Slideshow addon (with skin and addon integration) - by pkscout - 2019-12-24, 03:38
Add-on Artist Slideshow - by jo26 - 2014-08-08, 22:58
Logout Mark Read Team Forum Stats Members Help
Artist Slideshow addon (with skin and addon integration)5