ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.09k stars 2.24k forks source link

Timing Issue Offsync #18652

Closed BurningFlames2314 closed 2 years ago

BurningFlames2314 commented 2 years ago

Type

Game behaviour

Bug description

When playing certain beatmaps, there is a offsync between the song and hitnotes... Not sure about how many songs this affects but the one I found is this ranked map.

https://osu.ppy.sh/beatmapsets/440650#osu/1573659

In the regular osu! the timing is fine but in lazer for some reason the hit notes slowly gets more off beat the longer I play it (I've check both in edit mode and playing mode)

Screenshots or videos

No response

Version

2022.612.0-lazer

Logs

legacy-ipc.log network.log performance.log runtime.log updater.log database.log

BurningFlames2314 commented 2 years ago

edit: edit mode timing when you skip parts of the song becomes f***ed up... playing from start to finish doesnt seem to cause this bug. but when pausing during breaks (for some period of time not sure how long, i usually pause for a couple of minutes in breaks to check messages etc.) it causes the rest of the map to desync just like in edit mode.

edit 2: this happens as well when pausing mid song and continuing ... doesnt have to be on a break. oh yeah, forgot to mention it happens to all songs for me after exiting a pause, all notes desync and appear later than the beat... I tried in on a map i had a 120UR and mostly 300s and a few 100s.. after the pause, I had to significantly delay my taps as if I was playing with -30ms+ offset more than usual. Depending on where you pause, the desync isnt that bad, from what i experienced, the desync get worse the further into the song you pause... if paused at the beginning its barely noticeable

edit 3: happens with replays and autoplay too when skipping

frenzibyte commented 2 years ago

Can't seem to reproduce on macOS, may be a platform-specific/Windows-only shortcoming caused by https://github.com/ppy/osu-framework/pull/5238. Abstaining from marking this as p0 until we can reproduce this.

peppy commented 2 years ago

I haven't seen this happen on windows, so potentially unrelated.

@BurningFlames2314 Could you please install the previous release and see if you can reproduce? Note that it will auto-update to the newest release when you restart it, so you will need to run the installer each time to revert back.

BurningFlames2314 commented 2 years ago

up let me try that, ill also record a video of it just in case... give a bit of time

peppy commented 2 years ago

Also to rule out any doubt, after trying this please also update back to the latest and confirm it happens there again, using the same testing flow.

BurningFlames2314 commented 2 years ago

I have updated back to latest driver and the bug still persist...

Current release video: https://youtu.be/h4kgcKF8Mfg <iframe width="560" height="315" src="https://www.youtube.com/embed/h4kgcKF8Mfg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Previous release video: Does not produce the bug https://youtu.be/Kv-lmRCZFZk <iframe width="560" height="315" src="https://www.youtube.com/embed/Kv-lmRCZFZk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

never tried embedding videos on this... hopefully im doing it right lol

BurningFlames2314 commented 2 years ago

nvm xD embedded doesnt work

peppy commented 2 years ago

Seems like a potential regression then. Interesting that no one else has reported issues yet. I'll try to repro on native windows later today.

@BurningFlames2314 what kind of HDD/SSD are you running on?

Deezelchonk commented 2 years ago

I wanted to report with an issue that makes osu!lazer on mobile ALMOST impossible to get a clear on a map but since I don’t have pc, I can’t report it (I only have a phone)

peppy commented 2 years ago

I think you may be in the wrong place, unless you're referring specifically to a regression in the latest release only.

BurningFlames2314 commented 2 years ago

SSD = ADATA SX8200PNP HDD = WDC WD40EZAZ-00SF3B0

MaxKruse commented 2 years ago

As asked in #18659 i tried reproducing this.

Quick Testing methodology:

  1. Play map, pause after "lag" spike, then continue play
  2. Play map, then pause, tab out, and tab back in to play
  3. Open the editor and skip around in the timeline a few times (5-6 times is enough on my machine)

Here are my results:

Pausing and tabbing in and out does not seem to cause this issue.

My very naive guess is that samples are internally being tracked as being played, when they were unloaded by some mechanism before. From my very short testing, it seems that the music playback is ahead what the game thinks, by about 70-90ms in my test runs (assuming having to tap basically at the start of hitobject's hitwindow being active to achieve the desired effect of hitsounds being played to the music, as opposed to later).

This is to say, the hitsounds themselves dont get delayed, the timing at which the objects are being placed in the playback is wrong.

peppy commented 2 years ago

As one more data point, I've tested with two of the beatmaps mentioned above and all the repro scenarios and cannot reproduce any changes in audio sync... for the best or worst.

Could you peoples also list what your audio hardware is (just what it says in device manager should be helpful)?

MaxKruse commented 2 years ago

The audio device in my case is a FiiO USB DAC-E10

BurningFlames2314 commented 2 years ago

Mine is the Scarlett Solo USB

25pwn commented 2 years ago

I'm getting the same issue on Windows, I'll test linux later. Happens after breaks, pauses and replay rewinds.

25pwn commented 2 years ago

Can confirm it's a threading issue because turning off multithreading prevents this from happening(unless a lag spike occurs). Doesn't happen on Linux(Wayland+Pipewire).

peppy commented 2 years ago

Can confirm it's a threading issue because turning off multithreading prevents this from happening(unless a lag spike occurs). Doesn't happen on Linux(Wayland+Pipewire).

Can you also confirm that the previous release fixes the issue for you on both threading modes? I'm still trying to understand what the causation of the issue is so would appreciate if each user chiming in on this thread can confirm this.

Also can everyone confirm whether they can feel the issue when playing with hitsounds disabled? This will confirm whether it is an issue with playback of samples, or whether the fundamentals of audio clock timing are off.

I'm also going to prepare a release without the one change we made to bass configuration and will post here for further testing.

peppy commented 2 years ago

For anyone experiencing this issue, could you please try this release and see if you can still reproduce the issue?

Once done testing, restarting the release will mean it will have updated back to the latest release automatically. If you need to test again, re-run the install.exe

BurningFlames2314 commented 2 years ago

tried out the test release, initial observations looks good, the bug doesnt seem to appear anymore, Ill get back to you in a bit and try a few more things out.

peppy commented 2 years ago

I'd also appreciate testing on the broken release with effect volume zero.

BurningFlames2314 commented 2 years ago

yep, im working on it, ill give the details in a bit

BurningFlames2314 commented 2 years ago

Current release update: Did 4 attempts on https://osu.ppy.sh/beatmapsets/1773106#osu/3630306 Not classic Extra dif 2 attempts with pause (1 with hitsound and one without) Both attempts shows significant increase in 100s and hitcircles gets delayed average intial UR before pause 120 and after UR 180 2 attempts without pause (same with above) Average UR 110

osu_2022-06-15_13-46-08 From top to bottom () P = Pause HS =Hitsound

  1. No P + HS
  2. No P + No HS
  3. P + HS
  4. P + No HS TLDR hitcircles are the one getting delayed, not the hitsounds
peppy commented 2 years ago

Thanks a lot. We're going to push out a hotfix for this (and this thread will be closed) but please keep a watch on this thread as I may require more diagnostics in the future, since I cannot reproduce this bug and we will want to report it to the developer that maintains the audio library we use.

BurningFlames2314 commented 2 years ago

should i mark it as closed then?

Wieku commented 2 years ago

I know the issue is closed but just wanted to chime in with my observations.

It seems to appear that recently something got broken between BASS <-> Windows.

I've been using BASS_ASYNCFILE flag in danser for quite a while, using the same BASS version (2.4.16.1) since and only just recently (since like 2 weeks ago) I started getting reports that hitobjects get off-sync compared to music if music has been seeked. It's also not deterministic, it happens randomly. And I couldn't reproduce it as well. For people affected the issue disappeared with ASYNC flag removal like here.

Initially I thought that's a Windows issue, but my Windows build is 19043, my audio device is Scarlett Solo, same as OP. The only difference is that I have Intel CPU, OP seems to have AMD one (by looking at thread count).

peppy commented 2 years ago

@Wieku if you happen to beat us in reporting it to Un4seen, please link the report thread here. It's on my todo list but also quite low priority since we have a workaround for now.

Wieku commented 2 years ago

Tried my best to explain the issue: https://www.un4seen.com/forum/?topic=19806.0