Decklink audio output returning E_FAIL

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

Baldur Gislason

  • Posts: 11
  • Joined: Sat Jan 06, 2018 7:55 pm

Decklink audio output returning E_FAIL

PostWed Apr 10, 2019 5:09 pm

I have an application that outputs video on a Decklink card. Everything worked perfectly until I decided to add audio.
I call EnableAudioOutput like so after I have called EnableVideoOutput and that returns S_OK
Code: Select all
result = g_deckLinkOutput->EnableAudioOutput(bmdAudioSampleRate48kHz, bmdAudioSampleType16bitInteger, 2, bmdAudioOutputStreamTimestamped);


Then I start playback like so and that goes fine
Code: Select all
        BMDTimeValue frameDuration;
        BMDTimeScale frameTimescale;

        displayMode->GetFrameRate(&frameDuration, &frameTimescale);


        result = g_deckLinkOutput->StartScheduledPlayback(0, frameTimescale, 1.0);


But in my main loop, where I successfully run ScheduleVideoFrame , if I try to run ScheduleAudioSamples that just returns E_FAIL which does not leave me with any clue about what failed. I have tried both using the same timescale for audio and video as well as using the time scale 48000 for the audio, makes no difference. I have also tried using continuous audio instead of time stamped, makes no difference.
Only thing I have not tried is prerolling, and since this is a low latency application and the manual explicitly states prerolling is optional I do not really want to completely rethink the way I do clocking in this application just to try it.
Baldur Gislason
Offline

Baldur Gislason

  • Posts: 11
  • Joined: Sat Jan 06, 2018 7:55 pm

Re: Decklink audio output returning E_FAIL

PostWed Apr 24, 2019 7:29 pm

Revisited this and the problem was that the SDK documentation wrongly states that prerolling is optional. Only way to get any audio samples out on the wire is to first preroll a bunch of them before calling StartScheduledPlayback. If I start playback after just prerolling a few frames worth of audio samples it will stop accepting more audio samples as soon as I start playback.
This is unfortunate because it introduces a huge delay in the output so I currently have a choice between either having real time output with no audio or about a second of delay and audio that works perfectly. It's not such a huge deal since the audio output is not for monitoring purposes, I have other channels for audio monitoring. The broadcaster receiving the signal does not care if there is a delay in their signal but they need audio and I can just output signals without audio for my monitors.
Baldur Gislason

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 4 guests