How to reduce LoopThrough latency?

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

peter.hill

  • Posts: 3
  • Joined: Sun Aug 16, 2020 12:30 pm
  • Real Name: Peter Hill

How to reduce LoopThrough latency?

PostThu Apr 01, 2021 4:27 pm

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 ]
Offline

nick summers

  • Posts: 2
  • Joined: Thu Apr 08, 2021 1:26 pm
  • Real Name: Nick

Re: How to reduce LoopThrough latency?

PostThu Apr 08, 2021 1:30 pm

Try to find a software engineer. For example, I work with one company... I liked their agile project management approach and commitment to quality. They have designed and developed a hybrid mobile app for our company that works great.
Offline

Cameron Nichols

Blackmagic Design

  • Posts: 337
  • Joined: Mon Sep 04, 2017 4:05 am

Re: How to reduce LoopThrough latency?

PostFri Apr 09, 2021 4:03 am

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
Offline

peter.hill

  • Posts: 3
  • Joined: Sun Aug 16, 2020 12:30 pm
  • Real Name: Peter Hill

Re: How to reduce LoopThrough latency?

PostSat Apr 10, 2021 10:13 pm

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?

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 3 guests