1 (edited by Materdaddy 2013-04-03 09:50:37)

Topic: Infocast SDL Slideshow

I have always thought that digital picture frames were overpriced for an LCD that reads from an SD card, especially when I could get an Infocast for only a little more.  I envisioned a system wherein I could upload pictures from home and automatically sync pictures on picture frames.  This enables my wife and I to "post" pictures of our kids, and our parents can automagically get pictures of the grandkids on picture frames at their house.

This all works without having to unplug any memory card, plug it into a computer, and putting it back into the frame.

Since the chumby/infocast devices have wifi, it can all happen automatically.

My project is now up and running (in it's most basic form).  I have an I8 at work, two at home, one at my mom's house, and one at the in-laws.

Startup

I have everything self-contained on a USB stick and run from a debugchumby script.  If both /psp/network_configs and /psp/network_config are missing, it attempts to create one based on hard-coded values for the network where they're located.  Any place that needs custom information in my scripts is switched based on the hostname of the device since those are unique.

I also do a few things like adding SSH key fingerprints to the known_hosts if that is missing, install my
crontab, disable the control panel, and finally kick off my slideshow.

Syncing

The crontab runs a syncing script every 15 minutes.  The syncing script uses rsync (which I cross-compiled and is on the USB stick) and some other things to sync.  It doesn't sync just the images, it syncs the entire USB stick.  This is because I might update the slideshow software, helper scripts, etc.  I also have a file to control the crontab version, and reboot count.  This is so I can force a reboot or crontab update by changing these files.  If there are new images I restart the slideshow (by killing it & restarting it, and I check the files for crontab/reboot and act on those as well if needed.  I had to cross-compile rsync (and dependencies) which are on the USB stick and use LD_LIBRARY_PATH to get their shared libraries.

Slideshow

The slideshow itself was written using SDL.  I took the work of ChumbyLurker (see this thread) and compiled SDL for the chumby as well as SDL_Image to do the JPEG decode.  This code was inspired by Perigee Slideshow which I originally tried using.  I had it working, but when adding features I wanted (reading exif data for rotating images, reloading images using signal handlers) I ran into issues.  I was having problems where it would get killed and I couldn't determine why.  It wasn't OOM killer so it wasn't out of memory, but it would simply be killed.  I never got to the bottom of it, so I simply started from scratch and wrote "ISS".  The source for this I published here: ISS.  You will need SDL/SDL_Image cross-compiled for the chumby to get this working.

I purposely didn't publish anything except the slideshow because it contains many details of my network infrastructure as well as "ways in" that can be exploited with the SSH keys therein.  If there is enough interest I can re-work some of it to pull out the private bits and publish something, however it's not pretty, and won't necessarily be easy to set up.

That being said, if you have any questions let me know and I'll answer them.

Linux Guy - Occasional Chumby Hacker

Re: Infocast SDL Slideshow

Nice work!

Re: Infocast SDL Slideshow

Thanks Duane!

Linux Guy - Occasional Chumby Hacker

Re: Infocast SDL Slideshow

Matterdaddy,
Thanks for your contribution. It sounds very interesting to me.
Although I had my chumby one for 3 or more years, I just now started to look into how it works, for the obvious reason that it's not working anymore. Basically I am totally new to chumby software development (or any linux dev for that matter). But I would like to learn and your app sounds like a good start. Do you happen to have (or can you point me to) a step-by-step tutorial on how to build and deploy your app?
Thanks in advance.
FlorinC

Re: Infocast SDL Slideshow

Unfortunately I don't have step-by-step for everything.  A lot of getting something like this working takes a lot of knowledge of linux, cross compilation, scripting, and the chumby filesystem infrastructure.  I'm including some "copy/paste" howto type instructions on some aspects like cross-compiling, and running the application, however many other things can be found with specific searches, other links, etc.  I will give you some links for specific things I know where to find good information on.

# Before starting, install toolchain per: http://wiki.blueocty.com/index.php?title=GNU_Toolchain
#
# Build/Install SDL
git clone git://github.com/xobs/chumby-sdl.git
pushd chumby-sdl.git
./configure --host=arm-linux --prefix=/mnt/usb --enable-video-fbcon --enable-input-events --enable-alsa --disable-video-directfb --disable-video-opengl --without-x --disable-esd --oldincludedir=/mnt/usb/include --includedir=/mnt/usb/include --enable-input-tslib --disable-screensaver --disable-pulseaudio --disable-arts CPPFLAGS=-I/mnt/usb/include LDFLAGS=-L/mnt/usb/lib
make && make install
popd

#
# Build/Install libjpeg
wget http://files.chumby.com/source/silvermoon/silvermoon-1.8.1/jpeg-6b.tar.gz
tar xzpvf jpeg-6b.tar.gz
pushd jpeg-6b
wget -O- http://files.chumby.com/source/silvermoon/silvermoon-1.8.1/jpeg-6b.tar.gz.patch | patch -p1
./configure --host=arm-linux --prefix=/mnt/usb
make && make install
popd

#
# Build/Install SDL_Image
wget http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12.tar.gz
tar xzpvf SDL_image-1.2.12.tar.gz
pushd SDL_image-1.2.12
./configure --host=arm-linux --prefix=/mnt/usb --with-sdl-prefix=/mnt/usb --oldincludedir=/mnt/usb/include --includedir=/mnt/usb/include --disable-png --disable-tif --disable-webp --enable-jpg --enable-jpg-shared CPPFLAGS=-I/mnt/usb/include
make && make-install
popd

#
# Build/Install iss
git clone git@github.com:Materdaddy/iss.git
pushd iss
make
cp slide /mnt/usb/bin/

Note that I haven't actually tested/run that as a script, it's going off notes, and build logs.

Then you should be able to copy everything in /mnt/usb on your build computer to a usb stick, throw it in the chumby and run it something like this via SSH:

ssh root@chumby
stop_control_panel
export LD_LIBRARY_PATH=/mnt/usb/lib
/mnt/usb/bin/slide

If something here doesn't work, or you have specific questions, just ask!

Linux Guy - Occasional Chumby Hacker