Skip to content

Android: bump framework 2026.506.3, remove hw offset cap, fix AAudio description - #306

Merged
winnerspiros merged 5 commits into
masterfrom
copilot/update-audio-sync-issues
May 6, 2026
Merged

Android: bump framework 2026.506.3, remove hw offset cap, fix AAudio description#306
winnerspiros merged 5 commits into
masterfrom
copilot/update-audio-sync-issues

Conversation

Copilot AI commented May 6, 2026

Copy link
Copy Markdown

Copilot AI and others added 2 commits May 6, 2026 20:53
…evert was wrong)

Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/322e2015-e6e1-4699-bae1-84df79b8c0cb

Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
Copilot AI requested a review from winnerspiros May 6, 2026 21:33
@winnerspiros
winnerspiros marked this pull request as ready for review May 6, 2026 22:40
Copilot AI review requested due to automatic review settings May 6, 2026 22:40
@winnerspiros
winnerspiros merged commit 079fd8d into master May 6, 2026
19 checks passed
@gitar-bot

gitar-bot Bot commented May 6, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Android/iOS framework package references to a newer ppy.osu.Framework build intended to include a Vulkan crash fix, and adjusts Android audio settings/help text around hardware latency resync (including removing the previous resync cap behavior).

Changes:

  • Bump ppy.osu.Framework package references (Game / Android / iOS) to 2026.506.4.
  • Update Android audio settings text/tooltips for AAudio/Oboe and hardware resync guidance.
  • Change Android hardware resync to apply the full measured latency (no 15ms cap) and simplify logging.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
osu.iOS.props Bumps ppy.osu.Framework.iOS package version to 2026.506.4.
osu.Android.props Bumps ppy.osu.Framework.Android package version to 2026.506.4.
osu.Game/osu.Game.csproj Bumps ppy.osu.Framework package version to 2026.506.4 and updates the accompanying comment.
osu.Game/Overlays/Settings/Sections/Audio/AndroidAudioSettings.cs Updates Android audio backend descriptions and rewrites resync explanatory text/tooltip.
osu.Android/OsuGameAndroid.cs Removes the resync cap and applies full measured latency as negative AudioOffset; updates log message and inline rationale.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +66 to 84
// Both music and hitsounds travel through the same BASS → Oboe pipeline, so
// they both experience the same hardware latency offset. AudioOffset corrects
// the visual timing so notes appear when they should be hit; the audio output
// for both music and hitsounds shifts together.
//
// IMPORTANT — Bluetooth speakers/headphones:
// The AAudio measurement captures the WIRED audio pipeline only. Bluetooth
// A2DP adds a further ~100–300 ms of wireless transmission delay that AAudio
// The Oboe measurement captures the WIRED audio pipeline only. Bluetooth
// A2DP adds a further ~100–300 ms of wireless transmission delay that Oboe
// cannot see. For BT output, Resync will set a small wired-path value;
// you must further adjust AudioOffset manually (positive = sounds arrive
// late; negative = sounds arrive early) until music and hitsounds feel right.
new SettingsButtonV2
{
Text = "Resync hardware audio offset",
TooltipText = "Measures the device's AAudio pipeline latency over 2 s and applies the result (capped at 15 ms) to the audio offset. "
+ "Shifts VISUAL hit-object timing to match when you hear the music. "
+ "HITSOUND NOTE: any non-zero offset creates an equal hitsound-after-music lag; AudioOffset = 0 keeps hitsounds perfectly in sync with the music. "
+ "If hitsounds feel off after Resync, lower the offset toward 0 manually. "
TooltipText = "Measures the device's Oboe pipeline latency over 2 s and applies the full result as a negative AudioOffset. "
+ "Shifts VISUAL hit-object timing so notes appear on screen when they should be hit. "
+ "Both music and hitsounds travel through the same BASS → Oboe pipeline, so audio timing shifts together. "
+ "For per-song tuning, use the in-game beatmap offset control during gameplay. "
+ "Does NOT include Bluetooth A2DP delay (~100–300 ms extra) — fine-tune manually for BT output.",
Comment on lines +1974 to +1984
// AudioOffset shifts the gameplay clock (visual timing) relative to the audio
// track. Both music and hitsound samples travel through the same
// BASS → OboeAudioRedirector → Oboe → speaker pipeline, so they both experience
// the same hardware latency (hw_latency).
//
// AudioOffset shifts the gameplay clock (visual timing) but NOT the BASS
// track's playback position. Both the music track and hitsound samples go
// through BASS → OboeAudioRedirector → Oboe → speaker, so they share the
// same pipeline latency (hw_latency). A non-zero AudioOffset shifts WHEN
// the user's input arrives in the BASS timeline relative to the music beat:
//
// Beat at BASS position H, hw_latency = L:
// AudioOffset = 0 → input at BASS H → hitsound heard at H+L = music ✓
// AudioOffset = -L → input at BASS H+L → hitsound heard at H+2L, music at H+L → lag = L ✗
//
// In other words, every ms of negative AudioOffset creates exactly 1 ms of
// hitsound-after-music lag. AudioOffset = 0 gives perfect hitsound-music sync.
//
// On MMAP-capable devices (which includes the Galaxy S23/S24 series and most
// modern Snapdragon/Exynos handsets), Oboe achieves 4–8 ms output latency, so
// applying the full measured value creates ≤8 ms of desync — below the human
// JND of ~20 ms, and imperceptible in practice.
//
// On Legacy AAudio / OpenSL ES devices, or devices whose Samsung audio DSP
// reports high pipeline depth, the measured latency can be 30–80 ms. Applying
// -30 ms as AudioOffset causes hitsounds to arrive 30 ms after each music beat,
// which is very audible. We therefore cap the compensation at
// max_hw_compensation_ms so the hitsound-music gap is bounded to that value on
// ALL devices. Users who want to tune the visual-audio gap beyond this cap can
// do so manually via the offset slider during gameplay (BeatmapOffsetControl),
// where the real-time hit-error display gives direct feedback.
// 15 ms = typical MMAP output-latency ceiling on modern Android (Snapdragon 8 Gen 2,
// Exynos 2400, etc.). Anything higher is Samsung/DSP overhead that doesn't affect
// relative music-hitsound timing — applying it would push hitsound-music desync
// above the ~20 ms human JND.
const double max_hw_compensation_ms = 15.0;
double cappedLatency = Math.Min(latency, max_hw_compensation_ms); // capped compensation value (≤15 ms)
double suggested = Math.Clamp(-cappedLatency, audioOffset.MinValue, audioOffset.MaxValue);
// With AudioOffset = -hw_latency, the player taps hw_latency ms later in the
// BASS timeline than they would with AudioOffset = 0. Both the hitsound (fired
// at that later BASS position) and the music beat (fired at the nominal BASS
// position) are delivered through the same Oboe output path and thus reach the
// speaker at consistent times relative to each other. The visual timing is
// corrected so notes appear on screen when they should be hit.
Comment thread osu.Game/osu.Game.csproj
<!--
Explicitly pin `ppy.Veldrid.SPIRV` to the winnerspiros fork build that
`ppy.osu.Framework 2026.506.2` was compiled against.This version is the only
`ppy.osu.Framework 2026.506.4` was compiled against.This version is the only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants