DisplayVideoFrameSync with scheduled audio playback

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

zwang135

  • Posts: 13
  • Joined: Fri May 04, 2018 1:30 am
  • Real Name: Zicheng Wang

DisplayVideoFrameSync with scheduled audio playback

PostFri Oct 12, 2018 9:59 am

Can I use DisplayVideoFrameSync method with scheduled audio playback? Thanks!
Offline

Cameron Nichols

Blackmagic Design

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

Re: DisplayVideoFrameSync with scheduled audio playback

PostThu Oct 18, 2018 4:26 am

Hi Zicheng,

When not using scheduled playback, the preferred flow is to use IDeckLinkOutput::WriteAudioSamplesSync.

Can I understand the use-case for your request?

Regards
Cameron
Offline

zwang135

  • Posts: 13
  • Joined: Fri May 04, 2018 1:30 am
  • Real Name: Zicheng Wang

Re: DisplayVideoFrameSync with scheduled audio playback

PostMon Oct 22, 2018 2:26 am

Cameron Nichols wrote:Hi Zicheng,

When not using scheduled playback, the preferred flow is to use IDeckLinkOutput::WriteAudioSamplesSync.

Can I understand the use-case for your request?

Regards
Cameron

Hi Cameron,

I tried WriteAudioSamplesSync but the output sounded discontinuous, then I changed both video and audio to scheduled playback. Now I'm having a problem that GetBufferedAudioSampleFrameCount returns E_ACCESSDENIED sometimes, how do I avoid this?

Thanks!
Zicheng Wang
Offline

zwang135

  • Posts: 13
  • Joined: Fri May 04, 2018 1:30 am
  • Real Name: Zicheng Wang

Re: DisplayVideoFrameSync with scheduled audio playback

PostThu Oct 25, 2018 2:21 am

zwang135 wrote:Hi Cameron,

I tried WriteAudioSamplesSync but the output sounded discontinuous, then I changed both video and audio to scheduled playback. Now I'm having a problem that GetBufferedAudioSampleFrameCount returns E_ACCESSDENIED sometimes, how do I avoid this?

Thanks!
Zicheng Wang

An update of the issue:

This happens when I stop capturing and start playback immediately. My capture and playback work fine separately, just when switching from capture to playback it crashes sometimes. I guess it might be because the playback starts before the capture actually stops sometimes? When switching from playback to capture my program works fine, since I put my start-capture method in the ScheduledPlaybackHasStopped callback, but I don't see a similar callback for capture.

Can I have some advice for this problem? Or is it better not to use scheduled playback? Thanks!
Offline

Cameron Nichols

Blackmagic Design

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

Re: DisplayVideoFrameSync with scheduled audio playback

PostWed Oct 31, 2018 1:03 am

Hi Zicheng,

As a followup from my previous post, the preferred mechanism for having scheduled audio playback is to use IDeckLinkOutput::ScheduleVideoFrame, called once with a single frame that will remain to screen, then you can safely use RenderAudioSamples.

You should not put calls to the DeckLinkAPI within the context of ScheduledPlaybackHasStopped callback. Instead you should add a mutex/conditional variable and make your calls to StartStreams outside of the callback context.

We have updated SignalGenerator/TestPattern samples in Desktop Video SDK 10.11.4 to demonstrate correct stop playback synchronisation.

Regards
Cameron

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 20 guests