Hackster's FPGAdventures: FPGA-Driven Video Streaming with the Microchip PolarFire SoC Video Kit

Join us as we take Microchip's PolarFire SoC Video Kit for a spin, using the FPGA fabric and its RISC-V cores to stream live video.

Gareth Halfacree
9 months agoFPGAs / Photos & Video / HW101

Having taken a thorough tour of the board in our last FPGAdventures episode, it's time to see what Microchip's PolarFire SoC Video Kit can do — by firing it up and making use of the pre-loaded demos, installed — as with its predecessor, the Icicle Kit — to the on-board eMMC storage along with a Yocto-based Linux build to provide an out-of-the-box experience.

For those just joining us on the journey, the PolarFire SoC Video Kit is the latest development board to be built around Microchip's PolarFire SoC — a clever combination of application-class RISC-V processor cores and a field-programmable gate array (FPGA), designed to provide a combination of performance and power efficiency for a range of embedded workloads. Where the earlier Icicle Kit, the subject of our first FPGAdventures series, targeted general-purpose experimentation, the Video Kit comes with a pair of 4k-resolulution Sony image sensors and HDMI input and output ports for projects involving moving pictures.

With the board out of the box and the camera module installed, let's see what the Video Kit has in store.

Finding the documentation

As with the Icicle Kit, documentation in the bundle is sparse bordering on non-existent. Rather than printed materials — which, in Microchip's entirely reasonable defense, could go out of date while the hardware sits on a distributor's shelf — you get a single piece of paper linking you to what the company calls the "quickstart card." On this, aside from a note about where to find technical support and a list of global contact numbers, is a link and QR code which take you to the documentation proper.

The product documents are found on the PolarFire SoC Video Kit product page, with the bulk — schematics, board design files, Microchip's statement of volatility, and a 31-page user guide — available for immediate download without registration as DRM-free PDF files. The one exception: the actual quickstart card, which instead offers a browser-based and searchable introduction to the kit, the features of the hardware, the associated software, and instructions on running the primary demo: video capture and FPGA-driven encoding into H.264 for streaming over the network.

The good news is that you can jump straight into the demo without having to go through the torturous process of installing and licensing Libero SoC, a free but annually-renewable "Silver" license for which is included with the hardware. The FPGA comes pre-programmed with the gateware required for the streaming demo, and the eMMC storage likewise preloaded with a Yocto-built Linux distribution and the required software.

From there, though, things get a little trickier. Like the Icicle Kit, the PolarFire SoC Video Kit has a wealth of jumpers for configuring everything from core and auxiliary voltages to how the board is programmed. Rather than being in a single block, these are spread across the board — meaning you'll need to do a bit of hunting to follow the instructions on closing J28 and opening J57, then still more to confirm that the other jumpers are set correctly.

The demo beckons

Once you've done that, you can fire up the PolarFire SoC Video Kit and connect to its serial console, log in, and prepare to run the demo — but the networking part isn't as straightforward as it could be, owing to the recurring problem of Microchip's disparate and oft-contradictory documentation. Rather than connecting the board to a network switch, the quickstart card documentation for running the demo wants you to link it straight to a host PC with an RJ45 crossover cable — which, for anyone with only one Ethernet port on their machine, means disconnecting from your network and setting a static IP which will need to be reverted again when you're finished.

The above is true enough, but only if you haven't updated your Video Kit and it's still running the factory-flashed Linux image on its eMMC. If you, reasonably enough, decided to update the image before trying the demo, you'll find that the static IPs assigned to the two Ethernet ports have been removed in favor of more sensible dynamic assignation via DHCP. You won't find this fact in the quickstart card, though, nor on the Microchip website itself; instead, you'll have to go to the PolarFire SoC GitHub page, find the polarfire-soc-documentation repository, browse to applications-and-demos, then open mpfs-video-kit-h264-demo.md which contains a more up-to-date and detailed write-up than is on the Microchip website proper.

Readers of our earlier FPGAdventures will remember this as a recurring problem with the Icicle Kit: documentation being spread across three different sites, with duplicates often disagreeing with one another depending on which was most recently updated. It was one of the bigger pain points for newcomers to the Icicle Kit, and it's a shame to see that things haven't improved for the Video Kit.

Thankfully, from here things start to go more smoothly. Like the hardware-monitoring demo in the Icicle Kit, the Video Kit's demo includes a web server providing a graphical user interface. Heading to the board's IP in your browser pulls up a simple interface where you can pick the video resolution, adjust the brightness, contrast, and video compression quality target at-will, along with color balance on the red, green, and blue channels. There's no local preview, though, and when you click "start video" you won't see anything playing: instead, you'll get a Session Description Protocol (SDP) file to download.

Clicking the button to download the SDP file gives you what you need to connect a video renderer, like VLC, to the Video Kit over the network. At default settings, it's functional but noticeably laggy — something Microchip blames on VLC rather than the encoder running on the PolarFire SoC. To reduce the lag, the company recommends a few tweaks to VLC's configuration — including reducing the network cache, disabling hardware acceleration and direct rendering, and tweaking some "speed tricks."

Trial period

While the demo is an entirely functional way to showcase the capabilities of the PolarFire SoC for real-time video encoding and transmission, if you're planning to use it as a jumping-off point for your own creations there's a very large catch: the Video Kit does not include a permanent license for the H.264 I-frame encoder IP block used to create the video stream from the camera sensor data. The encoder block pre-loaded into the FPGA's gateware is functional but time-limited, and for evaluation purposes only: after an hour, the stream will automatically stop.

For those who deal with FPGAs professionally, this won't come as news. The need to license IP, whether for use in an FPGA or for building an application-specific integrated circuit (ASIC), is well understood — it's this which has propelled Arm, best known for its processor IP, into being one of the biggest technology companies in the world.

For makers and tinkerers, though, it's likely to come as a blow: the Video Kit isn't cheap, but its cost pales into insignificance in comparison to how much you'll pay for the H.264 IP block: whether you choose node-locked or floating license options, you'll be shelling out $30,000 — a figure Microchip defends as "pretty competitive" against other providers of similar IP, but one which means there's little chance of an individual maker finding a use for the Video Kit's demonstrated capabilities in single-unit deployments.

The demo, then, can be discouraging — though it does its job perfectly in positioning the Video Kit as more of an evaluation platform than a discrete piece of hardware in its own right, primarily focused on providing a means for professionals to develop and test designs for commercial products which would launch, Microchip hopes, with a PolarFire SoC at their heart. It's a shame, though, that the demo doesn't use the full 4k resolution of the camera sensor — and ignores the second sensor completely.

Industrial automation

It's also the only demo discussed in the online quickstart card — with the user guide not even bringing up the topic of demonstrations at all. It's not the only demo Microchip has developed, however: going back to the GitHub repository again, you'll find a more complex example dubbed the "MPFS OPC-UA Industrial Edge Demo," for which you'll need both a PolarFire SoC Video Kit and the earlier Icicle Kit — plus a stepper motor connected to a MIKROE Stepper Motor Click board, neither of which are supplied with the Video Kit nor Icicle Kit.

In this demo, the Open Platform Communications Unified Architecture (OPC UA) is used to set up machine-to-machine communication between the Video Kit and the Icicle Kit as a means of showcasing the PolarFire SoC's suitability for industrial use. Here again, though, you're bounced from place to place: unlike the video streaming example, this demo is only briefly documented on GitHub with the reader being sent back to the Microchip website to download AN4977, the "OPC-UA Industrial Edge Application Note," a 35-page PDF with step-by-step instructions.

Once you have the relevant document, you can proceed by running through a checklist of requirements most of which, bar the Click Board and stepper motor, you should already have. For full interaction with the demo, though, you'll also need UA Expert, Unified Automation's OPC UA client software — and while a link is provided for a Windows download, it requires (free, at least) registration on the UA website. Linux, oddly, isn't even mentioned, despite a Linux version of the software being available, and Microchip confirms the demo is only tested under Microsoft's operating system.

This time around, you'll be expected to program the FPGA rather than using the pre-loaded gateware. Thankfully, you still won't have to worry about Libero SoC — that comes later — as the demo is provided as a job file compatible with the considerably simpler FlashPro Express. Just load the software, open the job file, and blast it across to the board's FPGA over the built-in FlashPro 6 programmer. Use a disk imager to replace the Linux image on the eMMC, and you're ready to make a servo motor wiggle — and to watch what you did on the Video Kit's camera.

The actual payoff of the demo is a little underwhelming, given the effort involved, but it's deceptive: what's going on under the hood is considerably more complex than the little whirring servo motor would suggest. For makers happy with traditional methods of inter-board communication, it's unlikely to hold much interest — but for those looking to dive into an industrial-grade approach the demo serves as a solid hands-on introduction to OPC UA.

Join us next time as our FPGAdventures take us deeper into what's possible with the Microchip PolarFire SoC Video Kit.

More information on the PolarFire SoC Video Kit is available on the Microchip website, and can be found on Avnet's product page as well.

Read the rest of FPGAdventures Series 2: The Microchip PolarFire SoC Video Kit below:

Read the whole of FPGAdventures Series 1: The Microchip PolarFire SoC Icicle Kit:

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles