Home›Industry News›ALINX runs three-way video source switching on a single Zynq board, and the hard part isn't capture
← Back to Industry News
Tutorial

ALINX runs three-way video source switching on a single Zynq board, and the hard part isn't capture

TutorialALINX runs three-wayvideo source switchingon a single Zynq…fpga.love
Illustration

There are plenty of multi-source video switching demos, but unifying MIPI, USB, and a test color bar into one V4L2 and DRM pipeline, then layering a QML menu on top, exposes what is actually difficult in embedded video systems: format conversion and layer management. The value of the example ALINX provides on the AXU4EVB_E is that it walks this entire chain end to end.

Three sources, one management interface

The experiment connects a MIPI camera and a USB camera, with the test color bar generated by the application layer. The MIPI path is captured on the PL side at 1920×1080 and about 30 fps; the USB path goes through the PS-side USB controller and the UVC protocol, measured at about 5 fps. Under Linux the two cameras map to /dev/video0 and /dev/video1 respectively, while the color bar creates no node. The application performs start, stop, and switching uniformly across the three sources, with four-buffer rotation between capture and display. This means that when swapping or adding a source, changes stay concentrated in the management module and the display path does not need to be rewritten. The USB path's frame rate is clearly lower than MIPI's; the official material does not explain why, but UVC overhead on embedded platforms is never negligible.

YUV422 conversion handed to the GPU shader

The cameras output YUV422 in YUYV packing, where two adjacent pixels share one set of U and V. Rather than converting pixel by pixel on the CPU, the experiment uploads the raw data as a texture and has the Mali-400 fragment shader read Y, U, and V to perform the conversion to RGB, sampling with nearest-neighbor interpolation to avoid color mixing between adjacent pixels. The material also mentions a detail: Mali-400 texture coordinate precision is limited, and treating a full 1080p frame as one large texture produces fine striping, so the image is split horizontally into multiple strips that are uploaded and drawn separately. The real issue is that this kind of precision limitation is an inherent constraint of older GPUs; strip splitting works around it, not eliminates it.

PrincipleSetupVerify
Illustration

Menu as a separate layer, DP driven by the PS

The menu and status bar are drawn with QML as an independent layer on top of the video, with Qt handling the logic and property bindings keeping the UI state in sync. On the display side, the PS-side internal display controller is in charge; the PL cannot drive DP directly. The application outputs through the DRM/KMS interface, and the DP DMA fetches frames from PS DDR to send to the monitor. All video sources are first written to PS DDR and then read back, and this path dictates that PL capture and PS display must go through a memory round trip. For engineers working on boards and interfaces, this architectural constraint is more worth noting than the switching feature itself: DP hangs off the PS side, and the PL serves only as the capture front end.

Three takeaways
  • MIPI is captured on the PL, USB goes through PS-side UVC, and both are managed as V4L2 nodes
  • YUYV-to-RGB conversion is done by the Mali-400 fragment shader, not pixel by pixel on the CPU
  • DP output is handled by the PS display controller; the PL cannot drive it directly

What it means for us

This example targets embedded Linux video applications on the Zynq platform, and teams in China working on industrial cameras, medical displays, and automotive multi-channel video can compare it directly against their own pipeline designs. What is reusable is the V4L2 plus DRM/KMS software framework and the four-buffer management approach, which are decoupled from the specific board; what is limited is Mali-400 texture precision and the PL's inability to drive DP directly, both inherent constraints of the platform that cannot be avoided when changing solutions. If a project needs higher-frame-rate USB input or direct PL display output, this architecture needs to be re-evaluated rather than copied as is.

ZynqV4L2DRM/KMSvideo overlayMIPI
fpga.love

Subscribe to fpga.love

Daily Briefing · Weekly Digest · Monthly Deep Dive