Categories
Uncategorized

Slide Advance Alert System (with MIDI)

Here’s a project I did a while ago, but never documented here… At Brown Dog Gadgets we do a lot of video streaming for workshops, and our setup includes one person on camera and another person as the producer who runs the software, monitors the chat window, and does the camera switching and advances the slides.

We started talking about an easy way for the person on camera to let the producer know when to advance to the next slide without having to say “Next slide, please” 20 times each session. Our video software can easily control the slides by using the left and right arrow keys, so we thought about just making a small USB controller the presenter could use to send those key commands, but that only works if the video streaming software has focus as the frontmost application, and since we’re running multiple pieces of presenting software as well as a browser we can’t rely on key commands to work.

So what I came up with is a simple controller that sends MIDI signals to a custom application that plays a sound which the producer can hear through their headphones, and know that it’s time to change the slide. (The application also has a small window that displays “Waiting…”, “Forward”, or “Back” depending on the state of the controls.)

The great thing about MIDI is that it doesn’t rely on a specific application being frontmost… Yes, we could have used serial communications, but we’d need to then select the correct serial port, which changes depending on which USB port you use, hubs, computer, etc.

We’ve got a guide in the Brown Dog Gadgets Project system, and we also dropped it onto Instructables if you want your own Slide Advancement Alerting Device.

This is a niche solution to a niche problem, but that seems to be what I’m good at, so I’m just gonna go with it.

Categories
Uncategorized

Raspberry Pi Slide Show

Slideshow

I’ve been using Raspberry Pi single-board computers for video players for years now, and I’ve also used them as audio players, but I was missing a good way to use them as slide show devices… Until now.

I’ve used Screenly OSE for the MMPIS at Milwaukee Makerspace, and while Screenly is great for what it is (a network-connected, browser-controllable, digital signage device) sometimes you don’t want all the options and features and you don’t have a network. So I needed another solution.

I found fbi, “the Linux framebuffer imageviewer”, which can run at boot up and display a folder full of images at full screen with a configurable delay between changing images. Perfect!

Boot Volume

Now, there’s one more thing… If I’m going to put this somewhere that doesn’t have a network connection (like, in a museum) I want to be able to easily update the slides. The slides won’t be changing daily, but may be changing every month or so. For something like this it’s easy to store the images directly on the /boot volume, which is accessible on the SD card when you pop it in a Mac OS X or Windows computer.

You’ll notice a folder names “slides” and a file named “slideshow.sh”, which do the hard work here. It’s actually ridiculous to call it “hard work” because it’s dead simple. The slides folder contains images which will be displayed in alphabetical order. (Sadly, my screen shot does not reflect this!) In an ideal world you’d name your images 0001.jpg, 0002.png, 0003.jpg, etc. Just name them in order, and they’ll display in order. Easy.

Images

The SD card only has about 40MB of free space for you to put images on, but with JPG compression of photos, you can probably fit plenty of them. OK, so once you’ve got your folder full of images (which you can easily update on the SD card) you’ll need some way to run the slideshow.sh script.

Typically I do a sudo nano /etc/rc.local and add what’s needed to run my script. In this case it’s the /bin/bash /boot/slideshow.sh & you see on line 20. Oh, don’t forget to set the Pi to auto-login at boot. Since it’s been added to recent versions of Raspbian you don’t even have to muck around anymore.

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

/bin/bash /boot/slideshow.sh &

exit 0

So yeah, we’re all set… but you probably want to see the code in slideshow.sh, right? This is it. Right here. Yes, it’s pretty much just two lines. Linux is like that sometimes… It’s not hard implementing something, it’s just hard finding out exactly how to implement something. It can be hard finding those two lines that you need! (The 200 may need adjustment. Longer may be better, but in my testing on a Raspberry Pi 2 Model B it worked well.)

#!/bin/sh

sleep 20

fbi -a -t 6 --blend 200 --readahead --noverbose -T 1 /boot/slides/* >/dev/null 2>&1

There’s some parameters you can set, like -t 6 which sets each slide to display for 6 seconds, and the blend thing, which sort of works. Hey, it’s a slide show, okay!?

I’ll probably work on this more, but I was pleased to find a solution so I thought it was worth sharing.