Audio delay

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

i_friedlnad

  • Posts: 2
  • Joined: Mon Feb 28, 2022 2:15 pm
  • Real Name: Israel friedland

Audio delay

PostMon Jun 06, 2022 3:09 pm

Hi
I am using decklink 4k mini monitor with the SDK.
I measured the video delay and it's around 2-3 frames (with scheduled frames), but the audio is around 6-8 frames (the scheduling of the audio is without timestamp, just fill the buffer), maybe you can tell me how to improve that behavior?

Thanks
Offline

Cameron Nichols

Blackmagic Design

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

Re: Audio delay

PostFri Jun 17, 2022 6:49 am

Hi Isreal,

Check that before you commence playback with IDeckLinkOutput::StartScheduledPlayback, that you have sufficient prerolled video frames and equivalent number of audio samples (48KHz*preroll/fps).

You may not have sufficient audio in the scheduling queue when requested for the SDI frame, resulting in delay in audio when it does get output. You can check this by logging the output of IDeckLinkOutput::GetBufferedAudioSampleFrameCount.

You should also monitor the completion result (BMDOutputFrameCompletionResult) in the IDeckLinkVideoOutputCallback::ScheduledFrameCompleted callback. If you are seeing scheduled frames have been dropped, then it may result in some misalignment.

It may also be worth checking behaviour of audio by switching to timestamped output - in IDeckLinkOutput::EnableAudioOutput, set stream type to bmdAudioOutputStreamTimestamped. For simplicity, use timescale of 48000 and increment stream time by the packet sample count. Check output video and audio for any discontinuity.

Regards
Cameron

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 13 guests