Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Timeline Audio out of sync on a Build

Discussion in 'Timeline' started by Revelation_Jeff, Feb 23, 2019.

  1. Revelation_Jeff

    Revelation_Jeff

    Joined:
    Jul 17, 2012
    Posts:
    141
    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
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    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).
     
    NIOS likes this.
  3. Revelation_Jeff

    Revelation_Jeff

    Joined:
    Jul 17, 2012
    Posts:
    141
    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?
     
  4. LargoSama

    LargoSama

    Joined:
    Jul 31, 2015
    Posts:
    10
    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.
     
  5. Revelation_Jeff

    Revelation_Jeff

    Joined:
    Jul 17, 2012
    Posts:
    141
    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?
     
  6. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    @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?
     
    Revelation_Jeff likes this.
  7. Revelation_Jeff

    Revelation_Jeff

    Joined:
    Jul 17, 2012
    Posts:
    141
    @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.
     
  8. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    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.
     
  9. hasandogu

    hasandogu

    Joined:
    May 31, 2016
    Posts:
    1
    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.
     
    mr_blahblah likes this.
  10. mr_blahblah

    mr_blahblah

    Joined:
    Jan 15, 2016
    Posts:
    38
    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.
     
  11. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    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
     
    CaioMGA_ likes this.
  12. poliman

    poliman

    Joined:
    Feb 5, 2015
    Posts:
    29
  13. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    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.
     
    JoRangers likes this.
  14. HernandoNJ

    HernandoNJ

    Joined:
    May 13, 2018
    Posts:
    75
    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

    upload_2021-8-8_22-56-44.png
     
  15. CaioMGA_

    CaioMGA_

    Joined:
    Sep 6, 2014
    Posts:
    2
    Worked for me.
    God Bless.

    upload_2021-8-24_10-54-11.png
     
  16. sergiobd

    sergiobd

    Joined:
    May 14, 2014
    Posts:
    37
    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.
     
  17. JCorfer

    JCorfer

    Joined:
    Apr 22, 2016
    Posts:
    16
    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
     
  18. wtetotew

    wtetotew

    Joined:
    Apr 12, 2020
    Posts:
    68
    Same problem. My audio is desynched with my activation and animation track in android build but perfect in editor.

    1. Strange thing is it work well in one scene;
    2. 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!
     
    Last edited: Mar 10, 2024