I decided to create a video wall using the Piwall approach outlined by the folks at http://www.piwall.co.uk/. The UK project was started in 2013 (or so). There have been lots of changes since. There are also many places on the web where there is info on how to build a Piwall using the Raspberry Pi. However, there was much that didn’t work with the current HW/SW. I have just gone through the rather exhausting process of buying the parts and then getting the system to run. Many of the online posts about this were helpful, but nowhere did I find an accurate set of instructions that told me how to do everything. So, this is intended to be a documentation of the steps that were needed to make my Piwall work.
I have a collection of 17 inch VGA monitors that were going to be scrapped. These instructions detail creating a 3x2 video wall. Since the Pi has HDMI video out, I used a cheap Amazon HDMI to VGA conversion cable. Worked fine.
First, I used the current version of Raspbian, named Stretch (as of 1 October, 2018). I imagine there is a version number associated with it, but I didn’t find that (with a rather cursory check). I also used Raspberry Pi 3 Model B’s.
Much of what follows are instructional posts from other places with corrections (which I imagine were needed because of HW/SW changes).
I am totally new to the Raspberry and to Linux. So things that are obvious to many were not obvious to me. I have tried to add some level of help for those as ignorant as me.
Some Linux info
The editor in Raspbian is nano. So, when you enter ‘nano’ you are opening the editor. It is followed by a file name which will open the file if it exists in the current directory, or create it if it doesn’t. To write out the file, enter cntrl o, CR. To exit nano enter cntrl x.
Some commands require supervisory privileges. This is provided by typing ‘sudo’ before the command. So, to edit a file that requires supervisory privilege, you would enter
sudo nano filename
If you are at the command line, the command to shut down is
shutdown –h now
If you running in command line mode (not just as an open window on the desk top) and wish to go back to the Raspbian desktop, the command is
Installing the software
Note 1 You may wish to perform the relevant network configuration steps from the next section for each master and tile Pi as you install the software. Otherwise, you will have to reconnect screens and keyboards. To be clear, I did not do it this way- I laid out all of my Pi’s in front of a TV, plugged into power strips, and constantly switched my keyboard/mouse/HDMI from Pi to Pi each time I wanted to modify one. That worked best for me, but not necessarily everyone.
Note 2 You must have your HDMI source plugged into your Pi when booting it up (you boot the Pi by plugging in it’s power supply.) If you do not plug in your HDMI first, your Pi will not adapt to the resolution of the screen you later plug in to. You can also set the resolution manually once the Pi desktop is displayed. You also must have a properly formatted card to boot correctly (explained in the following steps.)
If the master is not a Raspberry Pi then install ffmpeg on your Linux machine.
For all of your Pi’s, use the following instructions:
Insert your micro-SD card into a PC and format it to a FAT32 format. If you format to exFat or another format, your Pi will not boot. NOTE: The SD cards that I bought were already formatted to FAT32, and they worked out of the box.
Download the latest Raspbian image and follow the associated instructions to write the image to the SD card. (Use the NOOBS option, as it’s easier.) I did this on a Windows base PC. I downloaded the zip file, extracted it and copied all extracted files and folders to the SD card.
Insert the SD card into the Pi, connect a keyboard and screen, and plug in your power to boot the Pi.
Follow the standard setup process; this will install your operating system and let you connect to your home network (you can connect via WiFi or ethernet) so you can browse the Internet. Let the system have a user of pi, and no password. This is important in the autostart function described later.
Open Terminal, and type the following command, then press enter (This string installs the video converter necessary to play your video):
sudo apt-get install libav-tools
Once done with that, update your Pi by entering these additional commands:
sudo apt-get update
sudo apt-get install libavcodec-extra-52
sudo apt-get install libgl1-mesa-dev
At this point, for the master, move on to network configuration in the Network Configuration section of this guide.
For each Raspberry Pi tile, perform these actions:
Plug in the peripherals (keyboard/mouse/HDMI) and boot your Pi. Open the stock web browser and navigate to this page to continue following these instructions.
Click here to download the pwlibs package and just "save" it.
From a terminal window, enter:
sudo dpkg -i /home/pi/Downloads/pwlibs1_1.1_armhf.deb
Click here to download the pwomxplayer package and just "save" it.
From a terminal window, enter:
sudo dpkg -i /home/pi/Downloads/pwomxplayer_20130815_armhf.deb
sudo apt-get install libegl1-mesa-dev
Now perform the network configuration for each tile from the Network Configuration section.
Each Pi needs to have a different IP address, and you want these to be static addresses. (If you do not change your IP’s to static addresses, your computer will randomly change them, which will make communicating between PI’s on a network impossible.) For this guide, we'll assume a private address range of 192.168.0.*. (Replacing the * with the number of your choice).
For my Pi’s, I used the following:
Pi 1: 192.168.0.101
Pi 2: 192.168.0.102
Pi 3: 192.168.0.103
Pi 4: 192.168.0.104
Pi 5: 192.168.0.105
Pi 6: 192.168.0.106
To configure the IP address in Raspbian all you need to do is edit the dhcpcd.config file. To do this, enter:
sudo nano /etc/dhcpcd.conf
Append the following text to the end of that file (do not delete anything in that document).
up route add -net 184.108.40.206 netmask 240.0.0.0 eth0
The static ip_address number should be the IP address you want to assign to the device. For a 4 screen system I used 192.168.1.101, 192.168.1.102, 192.168.1.103, and 192.168.1.104 for the tiles, and 192.168.1.100 for the master. I don’t really know what the /24 is.
In order for the master to communicate efficiently with the tiles, it uses multicast addressing (where each packet sent by the master is received by all the tiles). The rules and guidelines for using multicast addresses are complex. If you are like me, don’t mess with them. Just use what comes next in this Guide. We'll use the address 220.127.116.11. More on that in a bit.
Each tile and the master must be connected to an Ethernet switch which is isolated (not connected to the internet).
Reboot to use the new IP address
Testing the software
First, test a tile to ensure that it is working correctly. Start by connecting a keyboard to the tile and attaching a USB flash drive that contains a movie that the standard omxplayer can display. I have tried .mp4, .mov and.avi successfully. With the file manager, find the USB drive. Then just copy the video file to the /home/pi/Videos folder.
Now check that the video plays. Command is
Next verify that pwomxplayer can play the movie by typing
Finally check that pwomxplayer can show a section of the video by typing
pwomxplayer --tile-code=42 /home/pi/Videos/movie.avi
This should display just the top right corner of the original movie, but magnified to fill the whole screen.
Note: for the following testing, use a 2x2 configuration only. The pwomxplayer defaults to that if there are no configuration files present. If you try anything else you will get a message that says ‘Have a nice day -)”.
Now, you’re ready to test the master in conjunction with one or more tiles. To set up the tiles, enter on each the following string (the colors are just to help with identification in the next steps):
pwomxplayer --tile-code=$n –o local udp://18.104.22.168:1234?buffer_size=2000000B
Replace $n. Make $n=41 for the top left tile, 42 for the top right, 43 for the bottom left, and 44 for the bottom right. This configuration is for a 4-screen PiWall. The ‘-o local’ parameter enables sound to the . Some posts suggested the buffer size number to be 1200000. I used 2000000. For the network’s IP address, just use the 22.214.171.124:1234 from above.
If you need bezel compensation or are using other than the 2x2 wall, the instruction are covered later in the ‘Configuration File’ section.
On the master type:
avconv -re -i movie.avi -vcodec copy -f avi -an udp://126.96.36.199:1234
Note: if the tiles are not successfully connected to the Ethernet switch, you will get the ‘Have a Nice Day -)’ error message.
The Pi can output audio on both the HDMI port and an AV 3.5 mm jack. My monitors were VGA and had no speakers, so I needed to use the AV jack. I used a cable that is used to take the audio and video from a 3.5 mm jack. There are at least 2 sets of pin definitions, so you need to get the right one. To see the definition of the AV jack, Look here. To enable the AV audio, I selected that on the desktop (upper right corner). I’m not sure this is necessary.
Since there is a significant delay between when the master sends a screen and the tile displays it, the audio needs to be taken from one of the tiles so that it will be synched to the video.
The ‘-o local’ command in the pwomxplayer command tells the tile to output the audio to the AV jack. Use ‘-o HDMI’ to output on the HDMI cable (I think, didn’t test that).
For the master, there is an ‘-an’ parameter that is in some of the posts. That option disables audio, so it must not be in the command. I only mention it in case you copy the avconv command from some other place.
Autostart with no keyboard attached
Obviously, you want the tile Pi’s to autostart without requiring any action other than application of power. This took me quite some time to find a solution that worked consistently. There is much written about this in general, but nothing that I found written really worked. So, here is my solution. You may be able to do better, but this works dependably.
On each tile enter the following (this will create the file startup.sh):
echo start pwomxplayer
pwomxplayer --tile-code=41 -o local udp://188.8.131.52:1234?buffer_size=1200000B
Save and exit.
The above creates the startup file for the top left, --tile-code=41, tile. You need to modify this for each tile with the correct tile number for that tile.
#!/bin/bash line is required by Linux.
The sleep 2 was the secret to making it work. Apparently there are asynchronous things going on during power up, and this was necessary to make it work correctly.
The echo command will show ‘start pwomxplayer’ on the screen when the startup file runs
Now we need to make this file executable with:
chmod –x startup.sh
This has created an executable file, starup.sh, which can be run at startup to call pwomxplayer. Now we need call it during the startup sequence. Do this by:
sudo nano ~/.bashrc
go to the bottom of the file and add:
Save and exit.
One more thing, we need the system to boot to the control line, not the GUI. So, select the Raspberry icon on the upper left, then Preferences, Configuration, Select Boot CLI.
Now, test the tile. Disconnect the keyboard and mouse. Restart. It should finally end with ‘start pwomxplayer’ showing on the screen. BTW, it will need to be connected to the Ethernet switch or you will get an error message.
Should you wish to go back to the GUI, you can enter startx, which will start the Raspbian GUI desktop.
I spent some time getting this to all work. I am going to list what I did. I would suggest that you use the same naming conventions that I have. I tried doing several others, and they did not work for reasons which are not at all clear to me.
You need to create a configuration file that contains the basic configuration for the total wall. This file is named .piwall (notice the .). The exact same file goes on each tile in the /home/pi/ folder. It does not need to be placed on the master.
There is another file, .pitile (again note the .). This goes on each tile, but is unique to each tile. It contains the definition for that tile. This file is simplest to create, so let’s do it first. It is done with:
This is the correct file for the first tile. Leave the text as it is. You use [title]. Do not put some other label in the brackets. You need to do a file like it but with the correct id for each tile. So tile 2 looks like
Now for the .piwall file. I am going to list my configuration file. This contains the appropriate dimensions for my 6 displays. There is a very good description of how to get the correct sizes here (near the end, labeled ‘Tile Configuration’). A more thorough explanation is here.
This exact same file is to be placed on each of the tiles in the /home/pi/ folder.
#tile 1 definition
#tile 2 definition
#tile 3 definition
#tile 4 definition
#tile 5 definition
#tile 6 definition
The command on the master is:
avconv -re -i /home/pi/SampleVideo.mp4 -vcodec copy -f avi udp://184.108.40.206:123456
If you are running ffmpeg on a Linux PC, the command is exactly the same, except substitute ffmpeg for avconv.
The command on each tile is:
pwomxplayer -o local --config=6bez udp://220.127.116.11:123456?buffer_size=2000000B
Once you have it working, you will need to change the startup.sh file to this new command.
1. If you want to play consecutive movies that have different resolution settings then you will either have to
o stop & start all the pwomxplayers between movies with different resolutions or
o re-encode all your movies to use the same resolution settings.
2. The system doesn’t stop and restart gracefully. You can stop the master with a Cntrl c. Then wait for a bit. All the tiles will freeze with the last frame. Now, if you restart the master, the tiles will begin displaying images. Sometimes they are in sync and sometimes not.
3. There is no fast forward or start in the middle of a file. You must start at the beginning.
~ $ sudo apt-get install libav-toolsReading package lists... DoneBuilding dependency treeReading state information... DonePackage libav-tools is not available, but is referred to by another package.This may mean that the package is missing, has been obsoleted, oris only available from another sourceHowever the following packages replace it:ffmpegE: Package 'libav-tools' has no installation candidate