Slice picture slideshow now working with 25,000 pictures & random mp3 audio


I bought my Slice to run image slideshows from my library of 25,000 photographs and play mp3 music, but was very disappointed to discover that when given a few thousand pictures, Slice [Kodi] constantly crashed, locked up solid and required a power-recycle to reboot.

After some experiments I have managed to get the slideshow to run using all 25,000 of my photos (almost).
Hope this may help anyone needing a similar solution.


  • Exclude photos > 6mb
  • Remove any photos that fail Perl::Exif parsing
  • Break photos into 31 ‘daily’ directories
  • Only run slideshow on the current ‘days’ photo directory (!> 830 pics per day’s slideshow)
  • Set slideshow Time to display each image to !< 20 seconds


Usual caveats apply if you want to try this yourself!
Not all these steps may be necessary to get this to work but this is what I did and it’s now working for me.

I limited the maximum size of photos to 6mb, it seemed to work and I don’t have many over that size.

I found around 40 of my photos would cause Perl’s Image::Exif parser to crash [completely - no return], so assuming that they might crash Kodi, I identified them and removed them from the slideshow.

On the Slice I randomly split my 25,000 photos into 31 ‘daily’ directories [ 1 … 31 ], each containing 830 unique photos.

Create an file so the Slice automatically runs a random slideshow on that [numbered] days picture directory when booted up.

Create a cron job so the Slice reboots daily, at midnight, thus loading the new day’s slideshow.

Set the slideshow Time to display each image to 20 seconds. It might be possible to lower this with experimentation but even with the limits above, the box crashed very quickly if the Time to display each image was set to 1 second.

This setup has now been running ok for 2 days without a problem, bearing in mind the nightly reboot, for me, this is a fix.

I still need to find a way to switch to the audio player while the auto-loaded slideshow is running and be able to pause and next track the audio without interrupting the slide show.

If I can get that to work, I’ll buy another Slice for the living room!


Autostart Kodi slideshow on Slice reboot

File location:

# import required modules
import xbmc, datetime

# get today's day in month number
today =
d =

# stringify
day_of_month ="%d")

# set path to current day's slideshow
slideshow_path ='/media/Slice-HD/31_days_pictures/'+day_of_month

# run slide show

Reboot Slice 01:01 nightly

File location:

01 01 * * * /usr/sbin/reboot


Good news, are you running the original Compute Module or the CM3?

The reason for asking is that I reported a reboot issue with the CM and playlists containing 4 or more CDs worth of tracks. A very quick test with the shiny new CM3 and all was well with a playlist of 6CDs. If the issues are related maybe it is the CM being slow and the Libreelec or Kodi hitting a time-out type issue causing the reboot

I need to do further testing with the CM3 to see if the issue has “gone away”. I suspect it is still there but the CM3 can work fast enough to stop the trigger condition being reached.



Sorry, not sure which I have - newly purchased (3 week old) unmodified Slice.



Then it will be the original compute module. The implication of my thought is that an upgrade may make the problem go away. We will need someone to do some tests on slideshow to see if it breaks with CM but is OK with CM3.

Since you have found a work-around, and there is no firm indication that an upgrade will fix the problem, I am not suggesting you upgrade (unless you want to), and if there is a problem with the software running on the original CM then it should be fixed. I am pretty sure that it will rematerialise on CM3 at some point in a heavily loaded Slice.



UPDATE: Slideshow now with random music.

Now have random mp3 tracks playing in background of slideshow and the Slice remote now controls the following while the slideshow is playing:
add controls.xml to /storage/.kodi/userdata/keymaps/

          <key id="61568">VolumeUp</key>                    # Vol + = up arrow
          <key id="61569">VolumeDown</key>                  # Vol - = down arrow
          <key id="61528">Mute</key>                        # Mute = stop
          <key id="61510">PlayerControl(Next)</key>         # Next mp3 = Fast forward
          <key id="61522">PlayerControl(Previous)</key>     # Prev mp3 = Rewind
          <key id="61472">PlayerControl(Play)</key>         # Play/pause = Play / Pause

updated for random mp3 playing with slideshow
Mp3 files are broken into 31 separate directories as was the jpgs.

import xbmc, datetime

today =
d =
day_of_month ="%d")

slideshow_path ='/media/Slice-HD/31_days_pictures/'+day_of_month

music_path ='/media/Slice-HD/31_days_music/'+day_of_month


xbmc.executebuiltin( "PlayMedia("+music_path+",isdir)" )
xbmc.executebuiltin( "PlayerControl(RandomOn)" )

It still reboots now and then but immediately drops back into slideshow with music.

Second pi Slice now on order :slight_smile:


Nice job, it’s quite an extendable system!