Skip to content

Commit 688f460

Browse files
authored
Merge pull request #301 from winnerspiros/copilot/fix-vulkan-glitches-and-performance
bump osu-framework to 2026.504.3
2 parents 0795a4f + 9681894 commit 688f460

7 files changed

Lines changed: 75 additions & 5 deletions

File tree

osu.Android.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
</PropertyGroup>
100100

101101
<ItemGroup>
102-
<PackageReference Include="ppy.osu.Framework.Android" Version="2026.504.2" />
102+
<PackageReference Include="ppy.osu.Framework.Android" Version="2026.504.3" />
103103
<!-- `ppy.osu.Framework.NativeLibs` is a transitive dependency of `ppy.osu.Framework`
104104
that ships desktop-only natives (Linux/macOS/Windows) under `runtimes/<rid>/native/`
105105
— including a bare Linux `libbass.so`/`libbass_fx.so`/`libbassmix.so` for linux-arm64.

osu.Android/OsuGameActivity.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ namespace osu.Android
4949
"application/x-osu-replay",
5050
})]
5151
[IntentFilter(new[] { Intent.ActionView }, Categories = new[] { Intent.CategoryBrowsable, Intent.CategoryDefault }, DataSchemes = new[] { "osu", "osump" })]
52+
// Samsung Game Launcher / Game Booster discovery for sideloaded APKs.
53+
// Apps installed via Play Store/Galaxy Store are auto-discovered as games via the
54+
// PACKAGE_ADDED broadcast + server-side category database. Sideloaded APKs bypass
55+
// this path entirely. Adding the Samsung game category to an intent-filter on the
56+
// main activity is the supported way to signal to Samsung's Game Launcher package
57+
// scanner that this activity is a game entry point — it scans for activities with
58+
// this category during app install and on periodic rescans.
59+
[IntentFilter(new[] { Intent.ActionMain }, Categories = new[] { "com.samsung.intent.category.GAME" })]
5260
public class OsuGameActivity : AndroidGameActivity, ISurfaceHolderCallback
5361
{
5462
private static readonly string[] osu_url_schemes = { "osu", "osump" };
@@ -458,6 +466,32 @@ protected override void OnCreate(Bundle? savedInstanceState)
458466
catch (Exception e) { Debug.WriteLine($"[osu!] Failed to load ruleset assembly {asm}: {e.Message}"); }
459467
}
460468

469+
// Samsung Game Launcher self-registration for sideloaded APKs.
470+
//
471+
// Play Store / Galaxy Store installs are auto-discovered by Samsung Game Launcher
472+
// through the PACKAGE_ADDED broadcast it receives at install time, plus its server-side
473+
// game database. Sideloaded APKs bypass both paths entirely — Game Launcher may never
474+
// add the app unless the user manually taps "+" in the Game Launcher UI.
475+
//
476+
// Sending a targeted broadcast to com.samsung.android.game.gameLauncher on every
477+
// launch requests an immediate rescan of our package. Since Android 8.0 implicit
478+
// broadcasts are blocked, we target the package explicitly via setPackage() — the
479+
// broadcast is silently dropped on non-Samsung devices where Game Launcher is absent.
480+
//
481+
// This is a best-effort signal; Game Launcher may still require one manual "Add"
482+
// on very old One UI builds that pre-date the REQUEST_ADD_PACKAGE handler.
483+
try
484+
{
485+
var gameLauncherIntent = new Intent("com.samsung.android.game.gameLauncher.REQUEST_ADD_PACKAGE");
486+
gameLauncherIntent.SetPackage("com.samsung.android.game.gameLauncher");
487+
gameLauncherIntent.PutExtra("packageName", PackageName);
488+
SendBroadcast(gameLauncherIntent);
489+
}
490+
catch
491+
{
492+
// Samsung Game Launcher not present (non-Samsung device) or broadcast failed — not an error.
493+
}
494+
461495
CrashDiagnostics.WriteAliveMarker("Activity.OnCreate exit");
462496
}
463497

osu.Android/OsuGameAndroid.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,6 +2194,16 @@ private void updateOrientation()
21942194
/// so a user who later prefers a different mode from Settings → Graphics → Renderer
21952195
/// is not fought on every launch.
21962196
/// </para>
2197+
///
2198+
/// <para>
2199+
/// Field observations: 27fps at 9ms CPU frame time and 30fps at 1.7ms CPU frame time are
2200+
/// both present-queue stall patterns — the CPU is finishing frames quickly but the Vulkan
2201+
/// FIFO present queue cannot drain fast enough. IMMEDIATE mode resolves this by bypassing
2202+
/// the vblank synchronisation barrier entirely, so every finished frame goes straight to
2203+
/// the display engine. VSync or Limit1x (FIFO) amplify the stall during texture-upload
2204+
/// storms (100-300 queued uploads logged during song select), making them the wrong choice
2205+
/// for this rendering workload.
2206+
/// </para>
21972207
/// </summary>
21982208
private void applyAndroidFrameSyncMigrationOnce(FrameworkConfigManager frameworkConfig)
21992209
{
@@ -2221,6 +2231,13 @@ private void applyAndroidFrameSyncMigrationOnce(FrameworkConfigManager framework
22212231
LocalConfig.SetValue(OsuSetting.AndroidStartupFrameSyncV2MigrationApplied, true);
22222232
}
22232233

2234+
// v3 migration: FrameSync.Limit1x was removed from the framework enum in
2235+
// osu-framework 2026.504.3 — any stored Limit1x config value is now treated
2236+
// as unknown and will fall back to the framework default on next load.
2237+
// Nothing to do here; just stamp the flag so the guard is not re-evaluated.
2238+
if (!LocalConfig.Get<bool>(OsuSetting.AndroidStartupFrameSyncV3MigrationApplied))
2239+
LocalConfig.SetValue(OsuSetting.AndroidStartupFrameSyncV3MigrationApplied, true);
2240+
22242241
return;
22252242
}
22262243

@@ -2237,6 +2254,7 @@ private void applyAndroidFrameSyncMigrationOnce(FrameworkConfigManager framework
22372254

22382255
LocalConfig.SetValue(OsuSetting.AndroidStartupFrameSyncMigrationApplied, true);
22392256
LocalConfig.SetValue(OsuSetting.AndroidStartupFrameSyncV2MigrationApplied, true);
2257+
LocalConfig.SetValue(OsuSetting.AndroidStartupFrameSyncV3MigrationApplied, true);
22402258
}
22412259
catch (Exception e)
22422260
{

osu.Game/Configuration/OsuConfigManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ protected override void InitialiseDefaults()
278278
SetDefault(OsuSetting.AndroidVulkanProbe, false);
279279
SetDefault(OsuSetting.AndroidStartupFrameSyncMigrationApplied, false);
280280
SetDefault(OsuSetting.AndroidStartupFrameSyncV2MigrationApplied, false);
281+
SetDefault(OsuSetting.AndroidStartupFrameSyncV3MigrationApplied, false);
281282

282283
// --- Android startup-safety toggles ---
283284
//
@@ -582,6 +583,7 @@ public enum OsuSetting
582583
AndroidVulkanProbe,
583584
AndroidStartupFrameSyncMigrationApplied,
584585
AndroidStartupFrameSyncV2MigrationApplied,
586+
AndroidStartupFrameSyncV3MigrationApplied,
585587
AndroidCleanupStaleRealmFifos,
586588
AndroidDeferStartupNativeInit,
587589
AndroidStartupFrameSyncMigrationEnabled,

osu.Game/Overlays/Settings/Sections/Audio/AndroidAudioSettings.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,26 @@ private void load(OsuConfigManager config, OsuGame? game)
5959
//
6060
// After a resync the restore button below becomes active so users can undo
6161
// if the hardware measurement doesn't match their perception.
62+
//
63+
// IMPORTANT — Bluetooth speakers/headphones:
64+
// The AAudio measurement captures the device's internal audio pipeline
65+
// latency (DAC + driver buffer). It does NOT include Bluetooth A2DP
66+
// transmission time, which adds a further ~100–300 ms of device-to-device
67+
// wireless delay that AAudio cannot observe. For BT output, resync will
68+
// give a partially-correct value; you must further adjust the audio offset
69+
// manually (positive = audio arrives later than visuals; negative = earlier)
70+
// until hit sounds and music land where they feel right in your ears.
71+
//
72+
// Note: AudioOffset shifts the ENTIRE gameplay clock — audio track, hit
73+
// object visual timing, and hit sound effects all move together. This keeps
74+
// everything internally consistent regardless of the offset value you choose.
6275
new SettingsButtonV2
6376
{
6477
Text = "Resync hardware audio offset",
65-
TooltipText = "Measures the device's reported hardware output latency over a 2 s window and applies the median to the audio offset above. Previous offset is saved and can be restored.",
78+
TooltipText = "Measures the device's AAudio pipeline latency over 2 s and applies the median to the audio offset. "
79+
+ "NOTE: does NOT include Bluetooth transmission delay (~100–300 ms extra). "
80+
+ "For Bluetooth speakers/headphones, resync first, then fine-tune the offset manually until music and hit sounds feel right. "
81+
+ "The offset shifts the entire game clock — audio, hit objects, and effects all move together.",
6682
Action = () => game?.ResyncHardwareAudioOffset(),
6783
Keywords = new[] { @"resync", @"recalibrate", @"offset", @"hardware", @"latency", @"calibration" },
6884
},

osu.Game/osu.Game.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3939
</PackageReference>
4040
<PackageReference Include="Realm" Version="20.1.0" />
41-
<PackageReference Include="ppy.osu.Framework" Version="2026.504.2" />
41+
<PackageReference Include="ppy.osu.Framework" Version="2026.504.3" />
4242
<!--
4343
Explicitly pin `ppy.Veldrid.SPIRV` to the winnerspiros fork build that
44-
`ppy.osu.Framework 2026.504.2` was compiled against. This version is the only
44+
`ppy.osu.Framework 2026.504.3` was compiled against. This version is the only
4545
one whose `runtimes/android-arm64/native/libveldrid-spirv.so` is aligned to 16 KB
4646
pages (required by Android 16+). It lives only as a release asset on
4747
<https://github.com/winnerspiros/veldrid-spirv/releases/tag/1.0> and is vendored

osu.iOS.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
3434
</PropertyGroup>
3535
<ItemGroup>
36-
<PackageReference Include="ppy.osu.Framework.iOS" Version="2026.504.2" />
36+
<PackageReference Include="ppy.osu.Framework.iOS" Version="2026.504.3" />
3737
</ItemGroup>
3838
</Project>

0 commit comments

Comments
 (0)