Visor Display Driver Ready


This was the first time I was able to get the displays working. They each work by displaying a video file or image file on an RGB matrix display powered by a phone battery.

The displays are Adafruit 64×32 RGB LED Matrix displays, 3 mm pitch, with their back plates removed. They are driven by a Raspberry Pi Zero 2W with an Adafruit RGB LED Matrix Bonnet and powered via a phone battery connected by a USB-A to DC 5V Barrel adapter.

I used the code on the rpi-rgb-led-matrix project by hzeller to drive the displays, specifically using a slightly modified version of video-viewer.cc

I created a video file which was approximately 15 seconds long, of my protogen face blinking once every 6 seconds. The video file was encoded at 128×32 in a lossless format to avoid artifacts being introduced.


To enable the video file to run endlessly, as soon as the Pi started up, I created this systemd service.

/etc/systemd/system/protogen.service
[Unit]
Description=Protogen Management System
Before=basic.target
After=local-fs.target sysinit.target
DefaultDependencies=no

[Service]
Nice=-20
PrivateTmp=true
Type=simple
PIDFile=/var/run/protogen/%i.pid
ExecStart=protogen -f --led-gpio-mapping=adafruit-hat --led-cols=64 --led-rows=32 --led-chain=2 /usr/local/share/protogen/themes/default/idle.avi

[Install]
WantedBy=multi-user.target
Systemd Unit

Notice line 12; this is the actual command the system executes to display the video.

Type=simple
PIDFile=/var/run/protogen/%i.pid
ExecStart=protogen -f --led-gpio-mapping=adafruit-hat --led-cols=64 --led-rows=32 --led-chain=2 /usr/local/share/protogen/themes/default/idle.avi

[Install]
  • -f tells the driver to loop forever.
  • --led-gpio-mapping=adafruit-hat is required to make this work with the Adafruit Bonnet I was using. Without this line, the video data would be garbled.
  • The --led-rows and --led-cols sections are both to tell the driver how many rows and columns each individual display has.
  • --led-chain is used to tell the driver how many displays to expect.
    • With 1 supplied, a single video will be copied to each display, but with more than one supplied, a single video will be split across each display.
    • This allows one video to be used to asymmetrically control each display. A frame of the video can be found below showing how to format the video for a --led-chain value of 2.

I then ran the following to enable this service to start automatically on reboot, and to start immediately.

# systemctl enable --now protogen.service

Et Voilà, it would then endlessly display the protogen face!