This repository contains the scripts and instructions to build a lightweight and minimal playout server.
To display trailers or other information the OSCAR Student Cinema needed a playout simple and cheap server to feed two sub-1080p projectors. To keep things simple I opted for a used Dell Wyse 3040 Thinclient with ubuntu server installed. When a USB stick is inserted it is automatically mounted in /media/
. When a volume with the label PLAYOUT
is detected it a script automatically plays back the video files on the USB-stick
To use the finished playout server just insert a USB stick formatted in exfat and named PLAYOUT
. Depending on how many Displays should be fed, corresponding folders should be created on the volume named SCREEN1
, SCREEN2
, and so on. If a special background should be displayed when no video files are in a folder for a screen, this image can be dropped in the root directory with the name and extension background.png
.
The videos in the folders will be played back alphabetically, starting again from the beginning when the last ended. When the USB stick is pulled while the device is on, the background image should be displayed. The playback should automatically start again when the USB is reconnected.
There are still problems I haven't fixed yet:
- Analog Front Audio doesn't work
- Screen tearing when playing back video
If the BIOS password was not modified the BIOS can be unlocked with the default password Fireport
. In the BIOS the ubuntu server USB stick can be selected to start the installation.
As only 8GB of flash memory is included in a Wyse 3040 ThinClient I opted for a minimalized ubuntu install. The Network interface can be set to a specific IP (For example 192.168.10.1/24
) to ease modification in the field because the system will not be connected to a network by default.
As space is limited I manually reformated the 8GB flash and added a gpt partition in the ext4 format. This automatically creates a 500 MB boot partition that I shrunk to 250 MB. The main partition can be resized to the maximum after shrinking the boot partition.
To aid in setting up the playout server I recommend installing OpenSSH.
The script and the instructions expect the main username to be sysadmin
, so please use that as the username.
To update the system and install the necessary software use these commands:
sudo apt update && sudo apt upgrade -y
sudo apt install intel-gpu-tools mpv htop nano dialog xorg feh xterm openbox alsa-utils
To automatically mount USB drives I followed this guide: https://serverfault.com/questions/766506/automount-usb-drives-with-systemd
First the mount script needs to be created:
sudo nano /usr/local/bin/usb-mount.sh
The content can be found in the repository. To make the script executable using this command:
sudo chmod +x /usr/local/bin/usb-mount.sh
Secondly, the automount service needs to be created:
sudo nano /etc/systemd/system/usb-mount@.service
The content of this file should be the following:
[Unit]
Description=Mount USB Drive on %i
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/local/bin/usb-mount.sh add %i
ExecStop=/usr/local/bin/usb-mount.sh remove %i
To automatically run the script when a USB drive is inserted a udev rule needs to be created:
sudo nano /etc/udev/rules.d/99-local.rules
Inside this file this needs to be pasted:
KERNEL=="sd[a-z][0-9]", SUBSYSTEMS=="usb", ACTION=="add", RUN+="/bin/systemctl start usb-mount@%k.service"
KERNEL=="sd[a-z][0-9]", SUBSYSTEMS=="usb", ACTION=="remove", RUN+="/bin/systemctl stop usb-mount@%k.service"
To Restart the services use these commands:
sudo udevadm control --reload-rules
sudo systemctl daemon-reload
Past or copy the script from the repository in /home/sysadmin
and name it script.sh
To make the script executable run:
chmod +x script.sh
To automatically start the script at boot, a service needs to be created:
sudo nano /etc/systemd/system/playout_script.service
[Unit]
Description=Playout Script
[Service]
ExecStart=/home/sysadmin/script.sh
User=root
Group=root
[Install]
WantedBy=multi-user.target
After the Service is created, the service can be enabled (so it starts on boot) and started:
sudo systemctl daemon-reload
sudo systemctl enable playout_script.service
sudo systemctl start playout_script.service
If you want to check for problems, use this command:
sudo systemctl status playout_script.service
sudo systemctl disable systemd-networkd-wait-online.service
sudo systemctl mask systemd-networkd-wait-online.service
sudo nano /etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "TearFree" "true"
EndSection
The playout server defined in this repository doesn't always follow best practices in terms of security with the root user. As a result, the server is not intended to be used with a permanent network connection and should not hold any sensitive information.