The Raspberry Pi line of single-board computer systems are nice little gadgets, they usually can do nice issues with cameras and video. Nevertheless, there is usually a good bit of latency concerned in these duties relying on the board you’re utilizing and simply what you’re doing. You must have issues arrange simply so to get peak efficiency. [MattKC] has tangled with this situation in a private venture, and lately had considerably of a breakthrough.
The problem got here up throughout [MattKC’s] work on cloning the WiiU gamepad. The concept was to obtain the video stream from the WiiU console and show it utilizing a Raspberry Pi Zero 2W. He had some issues with latency, whereby there was a wierd 3 frames of latency within the video pipeline that simply wouldn’t go away. Even substituting in some dummy frames into the pipeline and ignoring them at output time didn’t work—the latency caught round. Finally, [MattKC] realized the delay wasn’t a couple of sure variety of frames—it was about time. About 50 milliseconds, in truth.
Drilling down additional revealed that there was an issue in the best way frames have been being fed into and obtained from the decoder. The primary body would take about 50 ms to decode, whereas later frames would take far much less—as little as 5ms. Nevertheless, [MattKC’s] code wasn’t set as much as seize frames as quickly as they have been completed, so the lag carried ahead. The video explains it in larger element, and the way polling the decoder usually helped remedy the problem. The ultimate consequence was a Raspberry Pi Zero 2W that might course of and show the WiiU video feed as shortly as the unique Nintendo WiiU gamepad.
In case you dug this, it’s price going again and testing the place the WiiU gamepad venture began, too. Video after the break.


