Search Unity

Timeline de-syncs with audio on Android

Discussion in 'Timeline' started by angusmf, Nov 4, 2018.

  1. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    261
    I have a project where several Timeline-d scenes play under a single piece of music, making a music video of sorts. I'm having a problem with it on Android that I haven't seen on Windows or WebGL running on a desktop.

    There's a main "start" timeline that plays a song and loads and unloads scenes containing more timelines and animation using activation tracks. Unfortunately, on Android, the music starts playing, but the first scene does not seem to be loaded yet. The animation winds up offset from the music by the load time. Interestingly, if I leave the app and come back (lock screen or task switcher for example) things are then synced.

    I figured this is just part of mobile reality and I have to work around if possible. I've had some ideas for fixing things that would require pretty big changes, and I'm not sure they'll work. Example: I've already tried cutting huge chunks of the scene out and disabling front-loaded scripts so it will load faster, but at best, I'm reducing the de-sync by a small amount. My next idea is to trigger the music from the loading of the first scene, but subsequent scenes will then run into the same problem. Help? Is this even possible?
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Hmm.....are you playing the timelines with the time update mode set to DSPClock? That should keep the audio and animation synced.
     
  3. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    261
    I just tried that, but the behavior is the same.
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    The only alternative I can see is waiting for the scene to be loaded before playing the timeline, but I'm not sure that is feasible in your use-case.

    If you have a repro case, I'd suggest filing a bug through the bug reporter. It's hard to say for sure, but it sounds like a scheduling issue caused by a large delay (caused by the scene loading).
     
  5. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    261
    Thank you. I'll put together a repro case if possible. Not sure what you all could do to fix it though. Loads will always take however long they take, so what could you do other than tweak the audio playback? That would produce audible artifacts instead.
    Next thing to try on this end is pre-loading the problem scenes in some sort of disabled state well before they're needed, then enable at the correct time.