Introduction: Raspberry Pi Wall Display Without X-Windows
This Instructable will walk through using a Raspberry Pi and a monitor or television to create a digital sign or display. A digital display like this can be used at home, at a company, or at any organization to display upcoming events, notices, calendars, photos, news, etc.
What's different about this is that we won't be using X-Windows on the Raspberry Pi to do this, but instead will be using framebuffer support to display images and video without the overhead of running X-Windows.
Step 1: Raspberry Pi Setup
To begin with we need a Raspberry Pi that is attached to some sort of external display whether that is via HDMI/DVI or composite. You also need some way to interact with a terminal session on the Raspberry Pi. An SSH connection over the network or a serial cable is recommended, since we will be displaying images and video on the console.
Step 2: Configure Raspberry Pi to Boot Without GUI
If your Raspbian install is currently set to boot into the XWindows GUI or Scratch, you can reconfigure to boot to just a text console with raspi-config.
Select "Enable Boot to Desktop/Scratch" then the "Console Text console..." option.
Step 3: Installing Packages
We will be using several packages:
- fbi - linux framebuffer imageviewer
- tvservice - power management for displays
- omxplayer - media player
The current Raspian distribution already includes omxplayer and tvservice but we need to install fbi.
First we’ll update the packages database and apply any updates. If you haven’t updated recently, this may take some time.
sudo apt-get update sudo apt-get upgrade
Then we will install fbi:
sudo apt-get install fbi
Step 4: Displaying Single Images With FBI
To display a single image, we use fbi, the framebuffer image viewer.
sudo fbi -a --noverbose -T 1 image.jpg
The -a option automatically scales the image for the screen. The --noverbose option prevents the display of additional text on the image.
The -T 1 option selects which virtual console the image will display on. Since there is no user logged into the console, the virtual console is owned by root, so we must use sudo or run fbi as root in order for it to use the framebuffer.
pi@raspberrypi ~ $ ls -l /dev/tty1 crw------- 1 root root 4, 1 Jul 1 02:25 /dev/tty1
When fbi is run this way, it remains running in the background. If we run additional fbi commands to display more images, we will end up with multiple copies of fbi running. So before we run another fbi command, we can use killall to kill all processes named fbi.
When the background fbi process is killed, the last image displayed will remain on the framebuffer.
sudo killall fbi
Step 5: Displaying Slideshows With FBI
The fbi tool can also display a slideshow of images.
sudo fbi -a --noverbose -T 1 -t 10 image1.jpg image2.jpg image3.jpg
The -t 10 sets up a looping slideshow that will display each image for 10 seconds.
We can add a -u option to randomize the slideshow order. We can add a -1 option to prevent the slideshow from looping and only display once.
As with a single image, fbi will run in the background until killed.
Step 6: Displaying Videos With OMXPlayer
To display a video, we can use omxplayer.
omxplayer -b video.mp4
The -b option blanks the screen (otherwise some terminal text may appear).
We can add a --loop option to loop the video continuously. We can add a --orientation 180 to flip the video upside down (90 and 270 work as well).
Step 7: Turning the Display Off and On
There are likely times when you would like to turn off the display. One command will turn off both the HDMI and composite displays. Most HDMI displays will power down to save energy but composite displays will likely remain on.
To turn the HDMI display back on:
To turn the composite display back on:
tvservice -c "PAL 4:3"
tvservice -c "NTSC 4:3"
NOTE: turning the HDMI display back on does not restore the framebuffer, so we need a bit of a workaround to get the framebuffer back to a usable state.
fbset -accel true; fbset -accel false
chvt 2; chvt 1
Step 8: Scripting It All
Bringing things together, one script can turn on the HDMI display, display a slideshow of 4 images 15 seconds apart, and then turn the HDMI display back off.
fbset -accel true; fbset -accel false sudo killall fbi sudo fbi -a --noverbose -T 1 -t 15 -1 image1.jpg image2.jpg image3.jpg image4.jpg sudo killall fbi tvservice -o
We have a be nice policy.
Please be positive and constructive.
I am running fbi and omxplayer serially and after fbi statement sufficient sleep by calculating total files multiply by image screen ON time
fbi statement fbi -autozoom -norandom -timeout $timeout -noverbose -blend $blend_time -vt 1 -readahead -cachemem 20 -once -list $filename
sleep $sleepTime_s [calculated and enough seconds to display all images]
and omxplayer by omxplayer -t off -r -b -o hdmi $vfile [in for loop]
omxplayer process running in foreground hence no problem for omxplayer it cannot let next statement run before it complete.
Above setup is working for me but sometimes screen is blank for image while debugging I found that fbi is running and omxplayer is not running, i.e. processes on system are running as required but I am not getting why screen is blank. Once this happen video is working fine while image always bank. On next reboot it may correct but again after sometime it start happening.
Most chance to happen this when video file size is 18mb or above it. Very rare in case of small video files.
Is there a way to set this up so that the slideshow (or one image) is displayed automatically at power up? I need to drive a display for a trade show and am looking for a simple option where the Raspberry Pi would just need to be turned on to get things going.
Congratulations for your project.
It was very useful to me, but now I'm stuck in a situation.
Whenever I press any key from the keyboard when the slideshow is on, it disappears and the command line is shown with the typed keys.
Is it possible to force fbi to "take control" of the video output (HDMI in this case) and keep displaying the image regardless of what is being typed?