Hi! It’s taken a while, but finally getting a chance to make a post as I have a topic I need a bit of space to explain :D

So, I work for a cable/internet/phone company, with a lot of my job related to IPTV television service. We’re constantly testing our different software versions on our Android set top boxes, along with our app on Fire TV sticks, Apple TV, smart TVs, mobile devices, etc. Most of those devices plug into a tv via HDMI, and I have way more of these test devices than my tv can handle. I didn’t want to keep swapping cables, and I also needed a decent way to get screenshots or small video clips other than shaky cellphone snaps. You know, try to be all professional and shit. So, at this point this is the current solution:

Diagram of tv setup, full description follows in blog text

The center of the system is a Monoprice 8x1 HDMI switch, model HRM-2218F. It’s a beefy metal box that accepts 8 HDMI inputs (max 1080p resolution) and redirects the selected input to an HDMI output. Which input can be selected via push buttons on the front, a little infrared remote control I lost pretty much immediately, or via commands sent via RS232 serial port.

In the diagram the blue arrows show the HDMI connections. I have five Android set top boxes, a Fire TV stick, an Apple TV device, and a single-board computer plugged into the 8 HDMI ports. The five set top boxes are one test-lab box, two old model boxes running the current code and newest test code, and two new model boxes also running the current code and newest test code. The current code boxes are so I can check issues that the customers might be seeing, the test code boxes are to test fixes and compare changes to the current code.

HDMI out from the switcher goes into a special little 2-way HDMI splitter. This thing serves two purposes. The first is the obvious, split the input so I can send it to the TV and a capture device at the same time. The second is it intercepts the HDCP copy protection on the HDMI connection, so the video capture device can actually work. Without it, the set top boxes refuse to put out an HDMI signal, making it impossible to get a screenshot or video of bugs to submit to the developers.

For video capture, I’m using the Avermedia Live Gamer Mini. It’s a USB device so I can use it with my laptop if needed, or with pretty much any computer in a more permanent setup like this. Originally I was using a Raspberry Pi 4 which was perfectly capable, but recently switched to a LattePanda Alpha 864s which is a tiny but powerful Intel based single-board computer.

The LattePanda is the heart of the whole setup. It has a USB->Serial adapter that connects it to the control port on the HDMI switch, along with the Avermedia HDMI-> USB capture. It’s running Ubuntu with a full LAMP stack, Docker, Plex, and a few other things. It’s also Bluetooth capable, and I currently kinda have it paired with a remote control for quick and easy* (more below) use of the whole system.

It took a while to dig up the protocols for the RS232 interface on the HDMI switch, but I lucked out and someone shared them in an Amazon review of all places. With that info it was easy to knock together a perl script I called tune that lets me move from one HDMI input to the next. I also knocked together scripts to grab a screenshot and a short video clip, so while working I can SSH into it and quickly switch from box to box to get captures. I also have ADB installed, which lets me pull logs from the set tops and with some fiddling I can send simulated remote signals to the boxes as well.

Everything is on wifi back to a hub dedicated for all this. I have IPs statically assigned to all the set tops, tv, etc so I can always find them without worrying about if they’ve changed IP. That plus the scripts let me do higher level automation like switch to the box on HDMI 6, send it remote codes to switch to channel 117, take a screenshot of the channel banner that pops up, record 10 seconds of video to show how the banner goes away and if there’s any video glitches, pull log files from the box, copy the video to a directory on my plex server so I can share it with coworkers, then zip everything up and email it to myself. With cron added in, I can switch HDMI to a set top as a specific time, simulate a few remote presses to clear any screensavers and get to live video, simulate pressing the “guide” button, then alternate between taking a screenshot and pressing channel down until it’s scrolled thru the whole guide listing for the channels and get pictures of it all so we can verify there’s no empty entries or “no data available” blocks showing.

Some portions of this are more developed right now than others, but it’s all basically working. The remote control is good when it works, annoying when it isn’t. I can use the 1 thru 8 buttons to switch HDMI inputs, and the A B C buttons tell it to take a screenshot, capture 30 seconds of video, and grab the current boxes log files respectively. The problem is the remote I’m using LOVES to go into deep power save. When it does it is no longer seen by the LattePanda or Raspberry Pi, the script loses input from the bluetooth device, and when the remote wakes up none of that reconnects so I lose it until I SSH in and fix things. Thats an “in the future” fix, I haven’t had the patience to hunt down a solution yet :D

So that’s it in a nutshell! It’s a nasty mess of power bricks and cables right now, I’m considering what to do for next steps like building a dedicated 3D printed stand to hold the set tops etc nicely on top of the HDMI switch, and convert a PC power supply’s 5V rail with relays to power everything and give me a way to remotely turn things on and off, but that’ll be another time :D Have a great day everyone!