Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
135 stars 2 forks source link

Video Players Slowly Lose Synchronization With Their Audio Over Time #1415

Open FlameSoulis opened 7 months ago

FlameSoulis commented 7 months ago

Describe the bug?

While watching longer YouTube videos, over time, the audio will become desynced from the video. It can range from 1 second to 5 seconds over the course of 10 minutes or more. The framerate of the viewer also seems to cause this to act wildly and the delay amount is not universal for all users, with some reporting no issues and some reporting different delays.

However, the video images do appear to be synced.

To Reproduce

  1. Import a long video with audio that is synced to the video (this means no long music videos; find some long let's play)
  2. Play the video in VR (VR framerate is seriously unstable, while desktop seems usually not have the issue occur often).
  3. Keep an eye on the video after 10 minutes have passed. At this point, audio will be desynced or will be fine, depending on the stability of the client. This may require multiple users in the same environment to fully test.

Expected behavior

Audio is synced with the video. Simple.

Screenshots

Screenshots won't really work here. I'll try to replicate a video at some point and update the ticket accordingly.

Resonite Version Number

2024.2.12.1430

What Platforms does this occur on?

Windows

What headset if any do you use?

Valve Index, Quest Pro

Log Files

N/A

Additional Context

This has been known by the community for a long while, with solutions usually being to duplicate the video and then resume play to force a sync. This sometimes works, but sometimes it doesn't.

Additionally, switching from VR to Desktop also can solve it.

Overall, it feels like the video's feed is being synced via a timestamp, but the audio is being left behind. As a result, the video is synced for all, but not the audio.

Reporters

Flame Soulis (flamesoulis), Pyroboy5000 (pyroboy), Liny (Liny_Fox)

EDIT: Removed (@) due to username conflicts. We really need some way to note the username/Discord username situation.

TisFoolish commented 7 months ago

Overall, it feels like the video's feed is being synced via a timestamp, but the audio is being left behind. As a result, the video is synced for all, but not the audio.

Weird, I've noticed that it's the video desyncing from the audio, with the video falling behind the audio.

FlameSoulis commented 7 months ago

So an update on how I've been able to make this occur almost all the time: if you are in desktop mode, it just never happens, and seems to actually force some kind of resync. If you are in VR, after 20 minutes, the video will be desynced by about 1 second in an area with an average FPS of 100/144 (Valve Index). I'm wondering if the fluxuating FPS numbers in VR are a partial culprit.

To comply with the logs, I did test this without mods and can confirm they do not alter the results. Unfortunately, I also had a rarer bug happen... but I wasn't in the active session when it happened. I'll report on that when I can.

shiftyscales commented 7 months ago

I'm fairly certain this just happens in general anytime the client stutters/hitches. I believe this can also be seen in the CurrentClockError seen on the VideoTextureProvider.

This issue itself seems like something that would probably be covered under the eventual VLC upgrade.

shiftyscales commented 6 months ago

@Geenz stood up an issue for the VLC upgrade here: #1476.