stepmania icon indicating copy to clipboard operation
stepmania copied to clipboard

Suspected sync drift with V-Sync enabled

Open shadowvfx opened this issue 4 years ago • 4 comments

I think there may be an issue with chart sync drifting with V-sync enabled on SM5. I can't confirm this in any measurable way (I'm not sure how I could), but I have played two sessions this week with V-Sync on, and I feel like the sync starts off good at the beginning of a chart, but by the end of the song (~2 min), I feel like I am having to intentionally hit a little bit later to maintain a Fantastic combo. If I had to guess, the drift is small (Maybe 2 to 5 ms by the end of the chart). I'm sure the vast majority of people wouldn't even notice this since most play with V-Sync turned off, but I've been playing for nearly 20 years and I am an extremely audio-centric accuracy player and I feel like there may be an issue here.

I posted a more in-depth description of the situation here in case anyone wants to know my reasons for running V-Sync. https://www.facebook.com/groups/180601838781725/permalink/1704084759766751/?comment_id=1704151943093366

shadowvfx avatar Sep 26 '20 16:09 shadowvfx

I won't close this without some investigation, but this is *incredibly *unlikely as video timings don't have any interactions elsewhere that should be able to cause sync drift in any way. It's also perfectly sane to play with VSync on (and I'd expect the vast, vast majority of users and cabs to be using it), although you'll want your visual delay set appropriately.

On Sat, Sep 26, 2020 at 9:45 AM shadowvfx [email protected] wrote:

I think there may be an issue with chart sync drifting with V-sync enabled on SM5. I can't confirm this in any measurable way (I'm not sure how I could), but I have played two sessions this week with V-Sync on, and I feel like the sync starts off good at the beginning of a chart, but by the end of the song (~2 min), I feel like I am having to intentionally hit a little bit later to maintain a Fantastic combo. If I had to guess, the drift is small (Maybe 2 to 5 ms by the end of the chart). I'm sure the vast majority of people wouldn't even notice this since most play with V-Sync turned off, but I've been playing for nearly 20 years and I am an extremely audio-centric accuracy player and I feel like there may be an issue here.

I posted a more in-depth description of the situation here in case anyone wants to know my reasons for running V-Sync.

https://www.facebook.com/groups/180601838781725/permalink/1704084759766751/?comment_id=1704151943093366

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stepmania/stepmania/issues/2058, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABVS5XZB63QEEMFF5SSD6LSHYLEPANCNFSM4R273CLA .

shakesoda avatar Sep 26 '20 17:09 shakesoda

I appreciate you looking into this. I tried to ask if anyone else had this issue on FB, but got very little response for or against it. It's interesting that you say the vast majority use V-Sync, a Google search regarding V-Sync on SM5 yields mixed results, but the majority of what I read said to disable V-Sync. I also know that TJ's SM5 image (a popular turn-key image to get SM5 onto arcade hardware) has V-Sync disabled by default. So I'm not certain the majority of people play with V-Sync these days.

Regardless, thank you for giving it some attention. I am curious to see what comes of any investigations into this.

shadowvfx avatar Sep 28 '20 21:09 shadowvfx

(Partly opinion, partly technical knowledge) Really the only reasons to disable are

  • If your system can't hit the screen's refresh rate (60Hz unless you're rich)
  • If you specifically need low latency rendering - vsync delays presentation by ~a frame, adding a few ms

Obviously here we care about latency, but with sm high latency isn't an issue as long as it's stable. Purely anecdotal but I've played with vsync on for a while, never noticed a drift besides long stamina charts often having sync issues in the chart. Setup plays fine with it off as well but due to hitting ~400fps it gets horrible tearing on a 60Hz screen (plus linux, yay screen tearing land).

Actually testing/resolving something like this will come down to being able to reproduce it on other setups. Recommend you gather all relevant specs/setup here, nail down just how to make it happen, and try to get a 2nd system to do the same. Get that and maybe folks will be able to investigate (Couldn't see anything on the facebook link, would be good to copy info over here even if it's all there)

geefr avatar Sep 28 '20 21:09 geefr

As requested, here is a copy/paste of my original post on the FB group for Private Dance Game Owners. Like I said, I didn't get much feedback for or against this. It very well may be my perception bias.

_``` Has anyone experienced sync drift issues with V-Sync enabled on SM5? Please read my entire post before replying. I have TJ's SM5 image running on my dedicab and modern PC hardware. Like most, I had been playing with V-Sync OFF (200+ FPS during gameplay), but I noticed that I was getting micro stutters on the arrows when some bg videos played. It wasn't all videos, just certain ones. Even after I compressed the videos down to a small file size and low bitrate, the stutters remained. My FPS wasn't dropping, so it wasn't my PC struggling to keep up. I searched online on this issue and saw recommendations to make some adjustments to SoundDrivers and SoundDevice in Preferences.ini. I made these changes and the stuttering arrow issue persisted. The same places that recommended the above fixes also noted running with V-Sync on. So, I enabled V-sync and the problem is solved. My arrows run smooth as silk and the game play is great.

However, I think there may be an issue with chart sync drifting with V-sync enabled on SM5. I can't confirm this in any measurable way, but I have played two sessions this week with V-Sync on, and I feel like the sync starts off good at the beginning of a chart, but by the end of the song (~2 min), I feel like I am having to intentionally hit a little bit later to maintain a Fantastic combo. If I had to guess, the drift is small (Maybe 2 to 5 ms). I'm sure the vast majority of people wouldn't even notice this, but I've been playing for nearly 20 years and I am an extremely audio-centric accuracy player and I feel like there may be an issue here.

In addition to my above observation, I noted in a previous post here that if SM5 is running with V-Sync OFF, some BG videos that are encoded at less than 30 FPS (20 FPS as an example) will de-sync from the song near the end of the chart. This wasn't noticeable in shorter songs, but on a 3 or 4 minute song, it's pronounced. The only solutions I found were to either re-encode the video at 30 FPS or enable V-Sync, which for some reason brought the chart and video back into alignment. My perception of drift in addition to the measurable BG video sync issue noted above makes me wonder if SM5 has a sync drift issue when V-Sync is enabled? Has anyone else felt or experienced this? I know the vast majority of people play with V-Sync off and without background videos enabled. But, as someone who is trying to play with the original "arcade-like" experience of DDR/ITG, turning off BG Videos or having choppy arrows due to BG Videos being displayed isn't a permanent solution for me. V-Sync solves my issues with stutters and videos, but I'm concerned there may be a drift/sync issue somewhere in the code that hasn't been addressed yet.

shadowvfx avatar Sep 28 '20 22:09 shadowvfx