Audio 40ms forerunning on passthrough

Hello again,

We’re running Caspar Sever 2.1.11 NRK with Decklink Quad2.
The client allows clip playout and passthrough of video from the video-in.
The video-in is looped through the server and loaded to a layer.
We’re measuring a difference of 40ms between the video and audio (audio prior video) in passthrough mode (live-in).
Latency is configured “low”. We’re using embedded audio in 16ch layout.

Any idea how to get rid of the delay? :thinking:

Thanks.

Ingo

Can you please explain better. Passthrough has a delay of at least one frame (40ms in 1080i50).
So are you saying that AV coming in over SDI is out of sync when it comes out? Do you have the same sync issue without CCG?

Hi hreinnbeck,

sorry. My explanation was obviously not precise enough.
We’re running CCG to either play out a clip from the harddrive or pass through video and audio from video-in to video-out (plus html5-lower-third-template in both cases). The production format is 1080i50.
The problem is as you suggested that video and audio run out of sync (40ms as our soundengineer stated). So audio is 40 ms prior video when switched to live video (video-in → video-out).
On the other hand I’m not sure what “latency” in the config file exactly means. As far as I could see it has no influence to AV sync…

Ingo

Do you mean to set keying to internal and measure again?

Ingo

I thought by passthrough you meant you were using internal.

So you are playing the decklink device on a layer? E.g.
PLAY 1-10 DECKLINK DEVICE 2 FORMAT 1080i50 CHANNEL_LAYOUT passthru?

Do you get the same result with 2.3?
Are you routing the decklink input between channels (e.g PLAY 1-10 route://2-10)?

In 2.3 adding an audio filter might work for you (haven’t tested/used this - and it’s not available in NRK 2.1):
PLAY 1-10 DECKLINK DEVICE 2 FORMAT 1080i50 AF "adelay=delays=40:all=1"

To understand you right: You play the incoming video to a layer in Caspar (PLAY 1-10 DECKLINK…) including the embedded audio and play it out on a channel. And you get one frame (40ms) of picture behind audio? That should not be. Or does the audio not pass trough Caspar?

Switching to internal keying would prevent you from playing clips with audio.

Hi hreinnbeck,

PLAY 1-10 DECKLINK DEVICE 2 FORMAT 1080i50 CHANNEL_LAYOUT passthru?

Yes, that’s what I’m doing except the format part because it’s all set to 1080i50 in configfile.

Do you get the same result with 2.3?
Are you routing the decklink input between channels (e.g PLAY 1-10 route://2-10)?#

I can’t tell because we’re already broadcasting with 2.1.11. I can’t change server version
We always route video-in1 to video-out1.

PLAY 1-10 DECKLINK DEVICE 2 FORMAT 1080i50 AF “adelay=delays=40:all=1”

2.1.11 accepts the command but that doesn’t change anything

Ingo

Hi Didi,

that’s exactly what I’m doing and what happened.

Ingo

That is weird. Do you get the same delay, when you play a video clip with audio from Caspar?

Hi Didi,

I’m not sure about that.
I have to think a scenario to figure that out.
The clips we’re using only delivers a background music. I need to get an audio sync signal (ValiD) from a clip…

Ingo

In that case just tell the audio guy to add a delay of 40ms to your audio.

Hi Didi,

that’s not that easy.
We’re talking about twelve channels… :grinning:

Ingo

2 Likes

I liked the idea of hreinnbeck:

AF “adelay=delays=40:all=1”

Is there any chance to do this in v. 2.1.11 NRK?

Just to be sure that I do not make any dumb mistake.

Config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <paths>
    <media-path>D:/CasparCG/_media/</media-path>
    <log-path>D:/CasparCG/_log/</log-path>
    <data-path>D:/CasparCG/_data/</data-path>
    <template-path>D:/CasparCG/_templates/</template-path>
    <thumbnail-path>D:/CasparCG/_thumbnails/</thumbnail-path>
  </paths>
  <log-level>info</log-level>
    <accelerator>auto</accelerator>
  <flash>
    <buffer-depth>auto</buffer-depth>
  </flash>
  <html>
    <remote-debugging-port>0</remote-debugging-port>
    <enable-gpu>true</enable-gpu>
  </html>
  <thumbnails>
    <generate-thumbnails>true</generate-thumbnails>
    <width>256</width>
    <height>144</height>
    <video-grid>2</video-grid>
    <scan-interval-millis>5000</scan-interval-millis>
    <generate-delay-millis>2000</generate-delay-millis>
    <video-mode>1080i5000</video-mode>
    <mipmap>true</mipmap>
  </thumbnails>
  <channel-grid>false</channel-grid>
  <channels>
    <channel>
        <video-mode>1080i5000</video-mode>
	    <channel-layout>16ch</channel-layout>
        <straight-alpha-output>false</straight-alpha-output>
	  <consumers>
             <decklink>
                <device>5</device>
                <embedded-audio>true</embedded-audio>
                <channel-layout>16ch</channel-layout>
                <latency>normal</latency>
                <keyer>default</keyer>
                <key-only>false</key-only>
                <buffer-depth>3</buffer-depth>
            </decklink>
        </consumers>		
	</channel>
	<channel>
        <video-mode>1080i5000</video-mode>
		<channel-layout>16ch</channel-layout>
        <straight-alpha-output>false</straight-alpha-output>
	  <consumers>
	           <decklink>
                <device>6</device>
                <embedded-audio>true</embedded-audio>
                <channel-layout>16ch</channel-layout>
                <latency>normal</latency>
                <keyer>default</keyer>
                <key-only>false</key-only>
                <buffer-depth>3</buffer-depth>
            </decklink>
        </consumers>		
	</channel>
	<channel>
        <video-mode>1080i5000</video-mode>
		<channel-layout>16ch</channel-layout>
        <straight-alpha-output>false</straight-alpha-output>
	  <consumers>
           <decklink>
                <device>7</device>
                <embedded-audio>true</embedded-audio>
                <channel-layout>16ch</channel-layout>
                <latency>normal</latency>
                <keyer>default</keyer>
                <key-only>false</key-only>
                <buffer-depth>3</buffer-depth>
            </decklink>
          </consumers>		
	</channel>
	<channel>
        <video-mode>1080i5000</video-mode>
		<channel-layout>16ch</channel-layout>
        <straight-alpha-output>false</straight-alpha-output>
	  <consumers>
          <decklink>
                <device>8</device>
                <embedded-audio>true</embedded-audio>
                <channel-layout>16ch</channel-layout>
                <latency>normal</latency>
                <keyer>default</keyer>
                <key-only>false</key-only>
                <buffer-depth>3</buffer-depth>
            </decklink>
         </consumers>		
	</channel>
</channels>
  <controllers>
    <tcp>
        <port>5250</port>
        <protocol>AMCP</protocol>
    </tcp>
	<tcp>
      <port>3250</port>
      <protocol>LOG</protocol>
    </tcp>
  </controllers>
  	<amcp>
        <media-server>
            <host>127.0.0.1</host>
            <port>8000</port>
        </media-server>
    </amcp>
	<osc>
		<default-port>6250</default-port>
		<predefined-clients>
			<predefined-client>
				<address>127.0.0.1</address>
				<port>6250</port>
			</predefined-client>
		</predefined-clients>
	</osc>
<audio>
  <channel-layouts>
	<channel-layout name="passthru"    type="16ch"        num-channels="16" />
	<channel-layout name="16ch"    type="16ch"        num-channels="16" />
  </channel-layouts>
</audio>
</configuration>

Server-Command:

LOADBG 1-5 DECKLINK 1 MIX 12 CHANNEL_LAYOUT 16ch

2.1 never had support for video or audio filters on decklink input IIRC. You could backport the code from 2.3.

Config seems fine.

Note that I’d just have the decklink input constantly running on a layer and mute/hide it with something like MIXER 1-5 VOLUME 0 and MIXER 1-5 OPACITY 0.

Thanks hreinnbeck,

I’ll rework the client with your suggestions after the Soccer-EM. We’re currently broadcasting from the system so I only have minimum time slots for adaptations in the code.

Ingo

At NRK we are using 2.1.11 and believe have not found any audio sync issues. However we are using routes heavily, so there is a chance that it is off and we are accidentally correcting it…

Another trick you could use is to do:
PLAY 1-10 DECKLINK DEVICE 2 FORMAT 1080i50
MIXER 1-10 VOLUME 0
MIXER 1-11 OPACITY 0
PLAY 1-11 ROUTE 1-10

I believe the route will add only a single frame of delay (unless you tell it to delay longer)

1 Like

Hi Julusian,

Thanks for your answer.
However I didn’t get to the point of your trick.
You’re suggesting to load the Decklink video in to a layer but leave it invisible and inaudible?
Then you route this to another layer?
Is that what you’re intending?

Ingo

Routing a layer doesn’t include MIXER settings - so you have it constantly running hidden and muted on 1-10 but can always play it on 1-11 (where default MIXER would be with opacity 1 and volume 1).

I am suggesting you have the video playing from 1-10 muted, with the audio being routed and played out of 1-11 (video set to opacity 0). That way only the audio gets fed through a route, which will give it a frame of delay