Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gameplay may skip/stutter briefly at the start of beatmap when lead-in time is used #22488

Open
Tracked by #24811
VisMGA opened this issue Feb 1, 2023 · 16 comments
Open
Tracked by #24811
Assignees
Labels
area:gameplay audio priority:1 Very important. Feels bad without fix. Affects the majority of users.

Comments

@VisMGA
Copy link

VisMGA commented Feb 1, 2023

Type

Performance

Bug description

I've occasionally noticed a slight lag at the beginning of certain maps.
Looking at my footage frame by frame, my cursor still moves, but approach circles slow down or freeze briefly.
I've only noticed it on maps that have hit objects very close to the beginning of the map.
Some maps:
https://osu.ppy.sh/beatmapsets/1129015#osu/2359641
https://osu.ppy.sh/beatmapsets/418202#osu/905342
https://osu.ppy.sh/beatmapsets/770023#osu/1618984
Harder to tell if it appears on this map as well, but I think it might.
https://osu.ppy.sh/beatmapsets/1095785#osu/2290176

Screenshots or videos

lazerlag.mp4

Version

2023.123.0-lazer

Logs

performance.log
performance-audio.log
performance-draw.log
performance-input.log
performance-update.log
runtime.log
updater.log
database.log
input.log
network.log

@Theighlin
Copy link

Same issue as described in #16515, and more visible in the video of the last reply https://www.youtube.com/watch?v=FNnIlO2X9sE

@peppy
Copy link
Member

peppy commented Feb 2, 2023

Probably best to leave this open if there's not already an issue tracking this.

Don't really have a solution in mind yet, beyond adding empty space to the start of the track as part of the byte stream (could work quite well, but would be a bit fiddly to implement).

For what it's worth, stable has the same issue for any beatmaps where the first hitobject is very close to the start of the audio track.

@peppy peppy changed the title Playfield objects appear to lag at the beginning of certain maps. Audio progression may skip briefly at the start of the audio track Feb 2, 2023
@peppy peppy changed the title Audio progression may skip briefly at the start of the audio track Gameplay may skip/stutter briefly at the start of beatmap when lead-in time is used Sep 20, 2023
@peppy
Copy link
Member

peppy commented Oct 13, 2023

In the latest release, the effect of this should have been greatly reduced. If anyone was experiencing this, could you please check how it's feeling these days?

I do have a forward path to reduce this down to zero, but it requires a bit more work, so it would be good to know how we're doing to better prioritise the follow-up work. In local testing, things are feeling pretty good (still noticeable but not as jarring/distracting), but this could be per-system and per-platform.

@Theighlin
Copy link

Stutter seems to be the same for me from the few beatmaps i've tried.

@Xerbly
Copy link

Xerbly commented Dec 12, 2023

I can still recreate this issue on a few maps, in version 2023.1130.0. Also, switching audio outputs somehow fixes the issue temporarily. Here is a video:

2023-12-12.21-54-57.online-video-cutter.com.mp4

Also logs if you need them.
performance-update.log
runtime.log
input.log
performance.log
performance-draw.log
database.log

@Maxwell-lt
Copy link

I've been able to consistently reproduce what looks like the same issue on the latest release (2023.1223.0-lazer). I've recorded a few plays that have this issue, and in all cases recordings made with OBS show that there is a pause of about 133-150ms (9 total frames with the same position of approach circles/slider snaking, recorded at 60FPS).

This happens consistently for each of the beatmaps I've observed this issue on, which includes all four of the beatmaps listed in the original issue description. However, I was not able to reproduce the issue on the beatmap @Xerbly used https://osu.ppy.sh/beatmapsets/1621390#osu/3310382. (Nor did switching audio outputs have any effect for me.)

This occurs in all four game modes, per my testing on https://osu.ppy.sh/beatmapsets/1530096#osu/3370765

My scenario appears to be more severe than what's been previously reported, as it causes the audio to play >100ms ahead of the gameplay timing (most easily observed when using the Auto mod), requiring the circles to be clicked very offbeat for an optimal judgement.

Once a break happens, the audio and gameplay regain sync.

I've tried windowed, borderless, and fullscreen screen modes, as well as multiple frame limiter settings (tried VSync, 4x, and unlimited), and both multi and single thread modes. This issue was reproducible in each of those scenarios.

This is not an issue that I can reproduce on osu!stable. I tried https://osu.ppy.sh/beatmapsets/1002234#osu/2097830 (see video below for behavior on osu!lazer) on stable and did not encounter a stutter or audio timing issues.

System details

Kernel: Linux 6.1.65
OS: NixOS 24.05.20231204.2c7f3c0
Desktop Environment: KDE Plasma 5.27.9
Window Manager: KWin (Wayland)
Audio Backend: Pipewire
CPU: AMD Ryzen 9 7950X3D
GPU: AMD Radeon RX 6950 XT

Videos

Video showing a stutter near start of approach circle on https://osu.ppy.sh/beatmapsets/1002234#osu/2097830
(at 00:09 in video)

stutter.mp4

Video showing a stutter near end of approach circle then audio sync becoming correct after a break on https://osu.ppy.sh/beatmapsets/1530096#osu/3435055
(at 00:06 in video)

stutter2.mp4

Video showing a stutter with the frame statistics overlay visible on https://osu.ppy.sh/beatmapsets/211586#osu/497556
(at 00:05 in video)

stutter3.mp4

Logs

Exported after a single play with this issue

compressed-logs.zip

@peppy
Copy link
Member

peppy commented Dec 23, 2023

Thanks for the report, but we're already aware of how to repro this and we are just waiting on having enough time to fix it.

@Theighlin
Copy link

Heads up that ppy/osu-framework#6088 fixes the issue for me (Tested on more than 1 map and even a couple from OP)
Release

2023-12-25.10-48-15.mp4

PR

2023-12-25.10-42-46.mp4

@peppy
Copy link
Member

peppy commented Dec 25, 2023

I suspect the top level audio mixer does heavy lifting here, and may solve the issue on other platforms when we do the same there (although it's arguably worse on window than anywhere else, so this is already a relief).

@peppy peppy added the priority:1 Very important. Feels bad without fix. Affects the majority of users. label Dec 27, 2023
@peppy peppy self-assigned this Dec 27, 2023
@mattborkin
Copy link

mattborkin commented Apr 23, 2024

This happens to me with the lazer release when playing Osu! mania as well.

I believe I read above that the issue happens when the notes start right away without an empty space ahead of it. That being the case, could a quick fix be to simply somehow add blank space and silence before every track automatically?

@peppy
Copy link
Member

peppy commented Apr 23, 2024

could a quick fix be to simply somehow add blank space and silence before every track automatically?

Touched upon in #22488 (comment).

@mattborkin
Copy link

could a quick fix be to simply somehow add blank space and silence before every track automatically?

Touched upon in #22488 (comment).

Good call, thank you!

@frenzibyte
Copy link
Member

Leaving it as a reference for when a fix is explored for this, BASS seems to offer an option to delay the start of a track via BASS_Mixer_StreamAddChannelEx. I'm not sure how reliable it is and whether it will help here but probably worth mentioning it at least.

@peppy
Copy link
Member

peppy commented Nov 28, 2024

Leaving it as a reference for when a fix is explored for this, BASS seems to offer an option to delay the start of a track via BASS_Mixer_StreamAddChannelEx. I'm not sure how reliable it is and whether it will help here but probably worth mentioning it at least.

This doesn't say anything about initialising the playback during that delay. It seems to be more about queueing it. Have you actually tested this to improve the issue here?

@frenzibyte
Copy link
Member

I haven't, I only stated it for reference as I found it on passing. I didn't think it's something I can test on a whim.

@ProjWyrd
Copy link

ProjWyrd commented Jan 13, 2025

I'm just going to add some info here which was in my issue but didn't realize it was a duplicate.

I've found that this is still somewhat of an issue despite the many updates but there is a few things I've found.

  1. The issue doesn't occur on the first run of opening lazer but rather after doing about 10 or so the issue becomes present and more pronounced
  2. When the issue occured it seemed as if there was some additional offset on the sound resulting in a bugged and normal run sounding completely identical but the input timing to be way off. (look at the videos on Aproach circle lags on start of map #31497 to better understand)

Edit:
I also never had this issue on stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:gameplay audio priority:1 Very important. Feels bad without fix. Affects the majority of users.
Projects
None yet
Development

No branches or pull requests

8 participants