Page 1 of 1

How to reduce LoopThrough latency?

PostPosted: Thu Apr 01, 2021 4:27 pm
by peter.hill
Hello!

My task is to get a frame from the input, process it, and display it on the output.
I used a Keyer to test the lowest possible hardware latency, and I got ~0.5 frame at 30 fps with genlock.
Unfortunately, the Keyer is not suitable for my task, and I have to process the frame on GPU (Metal 2).

Simple implementation via:
VideoInputFrameArrived -> do nothing -> DisplayVideoFrameSync
gave a delay of ~3 frames at 30 fps with genlock.

What makes this delay of 3 frames? Are there any ways to reduce this latency?

Thank you!

[ macOS 10.14.6, SDK 11.6, DeckLink Quad 2 ]

Re: How to reduce LoopThrough latency?

PostPosted: Fri Apr 09, 2021 4:03 am
by Cameron Nichols
Hi Peter,

Could you try running the SDK sample InputLoopThrough (Desktop Video SDK 11.5 or later) to check whether improvements could be possible. This sample is optimised for running at low latency and provides a rolling average for input, processing and output latency.

You can adjust the constants kProcessingAdditionalTimeMean and kProcessingAdditionalTimeStdDev to insert additional delay to simulate your GPU frame processing time.

Regards
Cameron

Re: How to reduce LoopThrough latency?

PostPosted: Sat Apr 10, 2021 10:13 pm
by peter.hill
I run InputLoopThrough and got 2 frames delay with it (with the same test conditions).
Well, it looks like I have a bug in my code, it's good that now I know about it, thank you.

But is it possible to further reduce the latency, eg by GPUDirect/DirectGMA?
What is the bottleneck now - buffering on the Quad2, PCIe throughput, or anything else?