Skip to content

Raspberry Photo Frame

A live photo frame is just a linux system that automatically logs in and launches a full screen slide show. The goal is to make it boot quickly, maybe with a nice plymouth splash screen or no terminal output with a blank boot up. A Raspberry Pi photo frame project can be accomplished countless ways, like with real picture frames around a display. Do you need a display attached to your pi? Are you using this with a television?

Want to reload the xserver so we can test new commands? Kill the xserver and start it up again with startx

killall xinit
wait 3
source .profile

Dependencies

sudo apt install xorg i3 xfce4-terminal imagemagick vlc

vlc - If you want to drive .mp4 videos

feh - Build from source to get webp support, instructions in docs here

Zero W

Yes it is possible to set this up on a little Zero

Raspberry Pi Zero W Rev 1.1 - Architecture: armv6l

Clock speeds: CPU: 1000 - Core: 400 - RAM: 450

Boot

Without really digging in the boot time is pretty much what it will be. You can systemd-analyze or systemd-analyze blame or plot to .svg graphic with systemd-analyze plot > graph.svg

Settings

Whatever way you decide to build your photo frame the one thing we want is for it to boot quickly and quietly.

/boot/firmware/cmdline.txt
console=tty3 loglevel=3 quiet splash logo.nologo vt.global_cursor_default=0
/boot/firmware/config.txt
disable_splash=1
/etc/systemd/system/getty@tty1.service.d/autologin.conf
ExecStart=
ExecStart=-/sbin/agetty --skip-login --noclear --noissue --login-options "-f pi" %I $TERM

At the end of local .profile file startx

~/.profile
if [ $(tty) == /dev/tty1 ]; then
     exec startx -- -nocursor  >/dev/null 2>&1
fi

You can exclude the -- -nocursor if you are not making a photo frame.

Storage

Performance doesn't justify the extra complexity and size. The original Pi Zero W is limited to USB 2.0 speeds. We are better off optimizing our photo resolution and compression. I opted to go 1920x1080 and use webp compression on the images. This did require building a newer version of feh image viewer to render the more efficient webp format files. This also supports .gifs for live photos.

SD Card

HDParm                    Disk Read                 21.42 MB/sec
HDParm                    Cached Disk Read          21.33 MB/sec
DD                        Disk Write                15.6 MB/s
FIO                       4k random read            2164 IOPS (8656 KB/s)
FIO                       4k random write           867 IOPS (3471 KB/s)
IOZone                    4k read                   7333 KB/s
IOZone                    4k write                  2525 KB/s
IOZone                    4k random read            6147 KB/s
IOZone                    4k random write           3390 KB/s

USB SSD ⚡️

You need to use a powered USB hub if you want to use an external SSD for the / partition.

HDParm                    Disk Read                 27.43 MB/sec
HDParm                    Cached Disk Read          27.31 MB/sec
DD                        Disk Write                26.7 MB/s
FIO                       4k random read            877 IOPS (3510 KB/s)
FIO                       4k random write           628 IOPS (2515 KB/s)
IOZone                    4k read                   3915 KB/s
IOZone                    4k write                  2617 KB/s
IOZone                    4k random read            4094 KB/s
IOZone                    4k random write           3902 KB/s

Files

If you have a massive photo collection I'm trying to figure a way to load them efficiently on a lower powered pi. For now I just grab a random selection of photos and dump them into my ~/frame/ folder.

shuf -zn50 -e ~/Pictures/1080p/*.webp | xargs -0 cp -vt ~/frame/ will copy a random 50 photos that are webp formated and drop them into the frame folder

Load Time

Original Command: feh --quiet --preload --randomize --reload 60 --hide-pointer --slideshow-delay 10.0 /home/pi/frame

From i3 desktop to first photo shown we clocked in at 1:57 with 108 webp formatted photos that are 1920x1080

Load time for gallery is linked to quantity of photos. I gave up at 18 minutes with 1740 photos since feh never appeared.

Squeaky Wheel

feh --start-at /path/to/a/photo.webp solves all the startup issues. Rather than loading the whole directory and shuffling, it selects one photo and shuffles from there.