Timeline Audio out of sync on a Build

Hi,

I'm having an audio problem. I've setup the audio to work perfectly within play mode of Unity editor. I've got a master audio track pre-done in pro tools which is setup from an initial clap track marker at frame 0 on timeline. So in editor everything works perfectly. However upon creating a build the audio becomes desync'd and is slightly off from the video.

I'm using Game time. I've tried using other settings which either broke the game or didn't help. I'm using 2017.4.1f1 for reference. Am I missing something here? Any suggestions to correct this?

Thanks so much for any help!

Jeff

If you need perfect audio sync, use DSP Time on the playable director. Audio is always scheduled and driven against the DSP clock, and DSP time will drive the timeline time by the DSP clock (as close as possible).

2 Likes

[quote=“seant_unity”, post:2, topic: 733277]
If you need perfect audio sync, use DSP Time on the playable director. Audio is always scheduled and driven against the DSP clock, and DSP time will drive the timeline time by the DSP clock (as close as possible).
[/quote]

Hi DSP for me is broke. In testing in editor it breaks sync in play mode and the audio is delayed half a second or more by default, even though my audio is sync’d to a clap track at frame 0 so I can’t adjust it any further. It should be exact.

Secondly when using DSP setting on a build it totally breaks and no sequence plays at all. It just defaults to a random camera view with no motions or events triggering or playing. DSP in a build is completely broken unless I’m missing some other setting that must go along with it?

[quote=“Revelation_Jeff”, post:3, topic: 733277]
Secondly when using DSP setting on a build it totally breaks and no sequence plays at all. It just defaults to a random camera view with no motions or events triggering or playing. DSP in a build is completely broken unless I’m missing some other setting that must go along with it?
[/quote]

Hey @Revelation_Jeff , did you figure out a way to have DSP work in builds? It breaks on my end as well and I can’t seem to get it working.

Nope. Sadly Unity support abandoned me here lol. The only option may be using game time and then making an execution script which holds your cutscene until completely loaded?

@Revelation_Jeff My apologies - I missed your reply. Wasn't intentionally abandoning you!

If you haven't file'd a bug, I encourage you to do so. Which version of Unity and which platforms are you seeing this behaviour?

1 Like

@seant_unity Hi thanks for getting back to me! =) I've been encountering the issue with Unity 2017.4.1 on a Windows Build. I can try filing a bug report as well.

Filing a bug would be best. There have been many fixes between 2017.4 and now, and I can't recall if that issue has been addressed. Our QA will being able to determine that.

For the record, I am seeing the same thing happen in 2018.4 and 2019.1 as well.

I am loading a second scene and call Play on the PlayableDirector that is at the root of this scene. The director is using DSP clock update mode. Once scene is loaded, I call Play but it plays the first frame and waits for a few minutes before continuing with the rest.

If I unload then reload the same scene again, there isn't a delay and it plays fine this time.

This doesn't happen when I use gametime update mode on the PlayableDirector.

If I check the "play on awake" checkbox and load just this scene (as the first scene in the build), it plays fine.

Does anyone have an idea why it might be the case?

Have been trying a few different things to see to see why the timeline would wait to play the rest without any luck.

1 Like

Having the same issue with 2018.4 and 2019.1.9f1. How long until there's basic audio support in timeline? It seems like a massive oversight.

[quote=“Revelation_Jeff”, post:3, topic: 733277]
e and the audio is delayed half a second or more by default,
[/quote]

I have reported a bug, and it is not related to DSP time mode. Mine used Game Time but the first few samples were obviously missing on each play. I duplicated the same audio clip successively on one TimelineAsset so one Play cause 4 plays separated by some silence.

Only the first time on each PlayableDirector play sounds different with starting samples missing. So it is not a delay, if you place the clip elsewhere that’s not at the beginning it’s instant. (and would be better with DSP time mode)

https://fogbugz.unity3d.com/default.asp?1167289_7t1ofosrlthhs3eo

1 Like

Hey,
if someone has problems with audio sync in timeline and after it in play mode and unity recorder afterwards then check my comment in
https://issuetracker.unity3d.com/issues/audio-track-is-missing-some-samples-if-it-starts-at-the-first-frame-of-a-timeline-in-player

so pls vote on the issue, and maybe someone make perfect check if that magic 4frames do the trick

Apologies for providing speculation and not complete answers. I am aware of this bug, and we've passed it on to Audio for assistance. I strongly suspect it has to do with the fact that timeline starts playing in Awake(). I would be curious if anyone has tried starting the Timeline in Start() via script instead.

We did fix some similar DSP clock issues in 2019.3 where large frame times would result in incorrect DSP clock times and could impact scheduling of audio clips.

The DSP issues will affect all timelines, even if GameTime is used. Audio is always scheduled to play using the DSP clock. The difference between them is the DSP time is used to compute deltaTime for timeline to avoid drift for large audio clips.

1 Like

I was moving the audio track forward, but it didn't work
I trimmed the audio track a bit at the beginning and moved it some seconds ago leaving an empty space
That worked for me

7400504--904376--upload_2021-8-8_22-56-44.png

Worked for me.
God Bless.

7444862--912821--upload_2021-8-24_10-54-11.png

This is really an annoying behavior. I also suspected it was related to the fact the Timeline plays on Awake, but I unticked PlayOnAwake, and instead played it on Start via a script, and the issue is still there.

Here the same issue. I have all the animations perfectly synchronized with the audio executing the timeline without run the scene, even starting the scene all work well. I have selected the DSP Clock as update method, but when I save the render using the Recorder Track utility, the result is totally desynchronized. Sometimes the events ocurrs a bit after or a bit before.

I'm using Unity 2021.3.8

Same problem. My audio is desynched with my activation and animation track in android build but perfect in editor.

  • Strange thing is it work well in one scene;
  • So I duplicated these working timeline in another scene and it became out of sync in these new scene

Does someone fixed the issue. Any news from a Unity team member?

UPDATE (solved):

in import options of my audiofile I checked "preload Audio data" and it solved the desynchonization issue!

Don't know why it wasn't checked but now it works!

1 Like