Create your own GPL movie PiWall
- Category: General Information
- Published: Sunday, 08 September 2013 17:22
- Written by Alex
- Hits: 138512
Disclaimer of warranty
This software is provided on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE WORK IS WITH YOU.
Limitation of liability
Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the we be liable to anyone for any direct, indirect, special, incidental, or consequential damages of any character arising as a result of the use of this software including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses.
A master computer, which can be either a Raspberry Pi or a Linux PC, is in control of the wall and plays video files. This communicates to all the Raspberry Pi 'tiles' of the wall via an ethernet network. Each tile displays part of the picture on its screen, and the screens together form the 'wall'.
The combination of master and tiles together forms a PiWall video wall system. The PiWall can be either fully stand-alone or the master can be connected to an external network via an additional wired or wireless network adapter, thus enabling the system to be controlled remotely.
Please note that all Raspberry Pi computers used within a PiWall must be the model B version and not the cheaper model A that doesn't include an ethernet network interface.
You will need:
- a master computer, which can be a Raspberry Pi or a Linux PC;
- at least one Raspberry Pi "tile" computer for each screen in your PiWall;
- an ethernet switch with at least as many ports as you have Pis - this can be omitted if you are only going to test with a single tile/screen;
- a suitable screen and HDMI lead for each tile;
- associated network cables and power supplies;
- for each tile, an SD card with a capacity of at least 2GB - check http://elinux.org/RPi_SD_cards for compatible SD cards;
- if the master is a Raspberry Pi you will also need;
- another SD card with a capacity of at least 2GB - but you may well need a considerably larger card, depending on the number and size of video files you want to play;
- (optional) a screen and keyboard;
- (optional) a USB-ethernet adapter - check http://elinux.org/RPi_USB_Ethernet_adapters for compatible devices;
- (optional) a USB sound card - check http://elinux.org/RPi_VerifiedPeripherals#USB_Sound_Cards for compatible devices;
- (optional) a powered USB hub - check http://elinux.org/RPi_Powered_USB_Hubs for compatibility.
Note that it is possible to try out the system without the full number of tiles that you eventually intend to have - for example, you may just want to test with a single tile before committing to purchasing a full 4-screen system. (With a single tile, it is possible to dispense with the ethernet switch and use a crossover ethernet cable instead, but that is outside the scope of this guide.)
Installing the software
Note: you may wish to perform the relevant network configuration steps from the next section for each master and tile Raspberry Pi as you install the software otherwise you will have to reconnect screens and keyboards.
If the master is a Raspberry Pi then perform the following actions:
- Download the latest Raspbian image and follow the associated instructions to write the image to the SD card.
- Insert the SD card into the master, connect a keyboard and screen and boot the computer.
- Follow the standard instructions and connect to your home network so you can browse the Internet.
- From a terminal window enter the command "sudo apt-get install libav-tools".
- Now perform the network configuration for the master from the network configuration section.
For each Raspberry Pi tile follow the first three actions from the above Raspberry Pi master list then do the following actions:
- Use the Midori browser to navigate to this page and continue following these instructions
- Click here to download the pwlibs package and just "save" it.
- From a terminal window type "sudo dpkg -i /home/pi/pwlibs1_1.1_armhf.deb"
- Click here to download the pwomxplayer package and just "save" it.
- From a terminal window type "sudo dpkg -i /home/pi/pwomxplayer_20130815_armhf.deb"
- Now perform the network configuration for the tile from the network configuration section.
Each Pi needs to have a different IP address (obviously!) and you almost certainly want these to be statically assigned. For this Guide we'll assume a private address range of 192.168.0.* if you need to use another set of addresses, then adjust accordingly.
In a production environment, you may want to connect the master Pi to an existing network - this is best achieved by adding a USB ethernet or WiFi adapter as a second interface to the master. Configuring this second network interface is beyond the scope of this document.
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 the network is completely private then it doesn't really matter, but in this Guide we'll use one of the "administratively scoped" addresses, 18.104.22.168. If you plan to use a real, shared network, then speak to your network administrator to agree an address.
If you are using a Linux PC as your master and don’t want to permanently alter your network configuration then execute the following commands after you have connected to the private PiWall network.
“sudo ifconfig eth0 192.168.0.??? netmask 255.255.255.0 up”
“sudo route add -net 22.214.171.124 netmask 240.0.0.0 eth0”
Note that this enables the full multicast address range, even though we'll only be using a single address within that range.
To make this routing permanent on a Raspberry Pi master or tile, edit the network interface stanza in "/ etc/network/interfaces", e.g.
iface eth0 inet static
up route add -net 126.96.36.199 netmask 240.0.0.0 eth0
We usually use an address of 100 for the master and number the tiles from 1, upwards.
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 pen drive that contains a movie that the standard omxplayer can display. Find the path of the USB pen drive, from the command line type "df" this will list all the file systems on your Pi. In the right hand column, look for the entry that has a path that starts with "/media/", on my system it is "/media/18DA-7CE4". Prepend this path to the "movie.avi" argument in the following commands. Confirm that the movie can be played by the standard omxplayer provided with the Raspbian image by typing "omxplayer movie.avi" at the command prompt. Next verify that pwomxplayer can play the movie by typing "pwomxplayer movie.avi". Finally check that pwomxplayer can show a section of the video by typing "pwomxplayer --tile-code=42 movie.avi" which should display just the top right corner of the original movie, but magnified to fill the whole screen.
Now you're ready to test the master in conjunction with one or more tiles. On each Raspberry Pi tile type "pwomxplayer --tile-code=$n udp://188.8.131.52:1234?buffer_size=1200000B" (where $n=41 is the top left, 42 is the top right, 43 is the bottom left and 44 is the bottom right for a 4 screen PiWall). On the master type "avconv -re -i movie.avi -vcodec copy -f avi -an udp://184.108.40.206:1234"
The "--tile-code" configuration doesn't provide bezel compensation, for that you will need to provide a detailed PiWall configuration file. That will be the subject of a further guide to be published later this week.
- If you want to play consecutive movies that have different resolution settings then you will either have to
- stop & start all the pwomxplayers between movies with different resolutions or
- re-encode all your movies to use the same resolution settings.
The first port of call for support for this GPL software is the Forum. We will regularly monitor the Forum and encourage other knowledgeable members to help out where possible.
We will make new versions of the software available whenever there are fixes or updates.