Audio keeps going out of sync after prolonged sessions

Hey,

Does anyone else have a problem with audio going out of sync as a session progresses?
Playing videos immediately after opening casparcg will play ok, but after playing some videos over a period of a couple hours, the last videos being played will have audio out of sync by at least 500ms, maybe more.

Channel is 1080i50, media being played is 1080i50.
I have tried with 1080p25 media, but still the problem pops up.
This affects all of casparcg: decklink outputs and display outputs.

Progressive output is out of the question for now because I need to feed CG to a TriCaster TC1 system running a 1080i50 session.

What version of CasparCG server do you use?

2.2.0 stable

Do you need any of the new functionality? I ask, because I still use 2.0.7 in production and never had such an issue. So as long as you only need to play out videos to Decklink I would go with this (rather old) version.

Does 2.0.7 have html producer? AFAIK it has.
Is the performance ok?

It does but it is Chromium version 33.0.1750.170 which is quiet old. The newer version of Caspar uses
Chromium version 63.0.3239.132. I would recommend using Can I Use to compare Chromium versions.

What audio sample rate are your clips using? There are some known problems with 44.1khz audio in 2.2, which are mostly fixed in 2.3 (master)

But yes, there is an ancient html producer in 2.0

Just checked, every clip is 48khz.
EDIT: before dropping down to 2.2 I had the same issues with 2.3.0 7829b13b Dev

Also of note: Hardware is a Dell XPS9570. Intel GPU + nvidia 1050Ti Max-Q

Another detail: server was let running empty for about 30 minutes, when resuming activity the first video played without audio at first and at an apparent framerate of over 3 or 4x the normal speed.

When stopped, video stops immediatly, audio keeps playing for a few seconds.

No idea why…

Debugging this I found out that window.close() won’t remove my html producer layers from the stack.
Maybe this was causing memory leak issues and I didn’t notice?..

Switched over to the NRK fork.

window.close() works, destroying the producer correctly.
I have been using casparcg every night over the last week for 1h30 long broadcasts, and yesterday was the first day I didn’t have any issues with audio going out of sync.
Kept an eye on the DIAG window, and producers were coming and going as they should.

Maybe this was my issue all along…

TLDR: There’s a bug with v2.2 where the html producer isn’t destroyed. This causes memory leaks.

Would you please post this on our GitHub page?

address this issue, AFAIK

Still having issues with audio drifting.
After some time of running the server, and issuing PLAY, audio starts playing and then after 1000ms or more the video comes in lagging after the audio.

Should I always be using LOADBG?
Is it not recommended to just PLAY videos?

Hi there
I know this is an old thread. Nevertheless we have the problem with embedded audio drifting over time using version 2.3.
Did you find a solution back then…?

Hi Jach,

I had a similar issue before and I fixed it in my application by encoding the file to another format or similar using handbrake. Ensuring to click a specific parameter inside handbrake. Do not remember the name right now. Will check if it is interesting as a solution.

1 Like

Thanks Simon
I am curious to know what parameter you changed to fix the issue. Could you check for me? That would be much appreciated.
Jacob

It was the “constant framerate” option in the video tab.

1 Like