How to avoid TD halting on long "Waiting for Audio Read"

Hello!

I’m trying to use best practices for seamless video switching as explained here.

It works well for video only applications and most videos with audio as well.
However on some videos with audio I get an excruciatingly long frame, effectively freezing TD for up to half a second, where (I assume) the Audio Movie CHOP is “Waiting for Audio Read”:
image
It is not happening on the same video if I disable this CHOP. My setup is waiting for the video to be preloaded before switching to it as described in aforementioned guide, so none of it is affecting my TD playback, except when I use its audio, leading me to believe that preload() does not take audio tracks into consideration.

I’d assume that “Open Timeout” parameter would allow to avoid this by setting it to a very low value, but it does not help my case at all or seem to have any effect whatsoever.

I also apply same principles that I use on the Movie File In tops for the Audio Movie CHOPs as well, disabling their preview, toggling “Play” off while their videos are being preloaded, etc…

I’d appreciate any help with this, suggestions for workarounds, or just knowing that this is in fact a shortcoming of the Audio Movie CHOP :stuck_out_tongue:

If there are specific files that suffer from this, could you share one with me to look at?

Hi malcolm,

It seems to happen more frequently on video files that have their audio encoded with Opus (in webm container), but not only.
I will DM you a link to one of the files.

To clarify, I am not so much seeking help in making audio tracks load faster, but more in allowing it to load asynchronously for as long as it needs without interrupting the main TD thread, either by playing the video mute until it catches up or preloading the audio together with video.
On a “lazy” HDD it can even last seconds:
image

I won’t be able to control all video files that come into my setup in the end and I am okay with some of them taking unusually long to properly load as long as I can handle that gracefully in TD.

Thanks, likely something to do with seeking around the file trying to find the right audio samples to play. I’ll take a look

1 Like