Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion osu.Android.props
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ppy.osu.Framework.Android" Version="2026.501.1" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2026.501.2" />
<!-- `ppy.osu.Framework.NativeLibs` is a transitive dependency of `ppy.osu.Framework`
that ships desktop-only natives (Linux/macOS/Windows) under `runtimes/<rid>/native/`
— including a bare Linux `libbass.so`/`libbass_fx.so`/`libbassmix.so` for linux-arm64.
Expand Down
45 changes: 29 additions & 16 deletions osu.Android/OsuGameActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,25 +253,38 @@ protected override void OnCreate(Bundle? savedInstanceState)

if (holder != null)
{
// Request RGBA8888 on the Android SurfaceHolder unconditionally BEFORE
// registering our callback. Without this, Android defaults to RGB565
// for the SurfaceView when no renderer explicitly requests a different
// format — SDL3 only calls setFormat(RGBA8888) for OpenGL, not Vulkan,
// so Vulkan sessions receive an RGB565 ANativeWindow. An RGB565 swapchain
// is incompatible with our 8-bit-per-channel rendering pipeline and
// causes a black screen followed by a native Draw-thread crash on Adreno
// GPUs (evidenced by SDL_PIXELFORMAT_RGB565 + "drawable size 3088×1440"
// in the runtime log for every Vulkan crash session). RGBA8888 is what
// OpenGL already uses and is the correct baseline for all renderers.
// Calling SetFormat before AddCallback ensures the format is stamped
// on the SurfaceHolder before SDL creates the VkAndroidSurfaceKHR.
try
// Only request RGBA8888 on the SurfaceHolder when the configured
// renderer is Vulkan. SDL3 already calls setFormat(RGBA8888) for
// OpenGL/GLES from its own EGL surface initialization, and calling
// setFormat() a second time AFTER SDL has bound its EGL surface
// forces Android to recreate the surface (surfaceDestroyed →
// surfaceCreated → surfaceChanged) mid-frame. That:
// 1. Trips the 250ms drawThreadAcknowledgedTeardown wait in
// AndroidGameSurface.SurfaceDestroyed (visible warning in HUD).
// 2. Leaves SDL's EGL surface bound to a destroyed ANativeWindow,
// causing eglSwapBuffers to silently no-op → permanent black
// screen while Update/Audio/Input keep running.
// SDL3 does NOT call setFormat on the Vulkan path, so Vulkan still
// needs this stamping to avoid the RGB565 default that crashes Adreno.
bool isVulkan = false;
try { isVulkan = LogManagement.IsVulkanConfigured(); }
catch (Exception e) { Debug.WriteLine($"[osu!] SurfaceHolder format gate: IsVulkanConfigured failed, defaulting to skip SetFormat: {e.Message}"); }

if (isVulkan)
Comment on lines +269 to +273

Copilot AI May 1, 2026

Copy link

Choose a reason for hiding this comment

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

The surface-format gate only checks LogManagement.IsVulkanConfigured(), which returns true only when framework.ini contains Renderer=Vulkan. If a user has Renderer=Automatic and the framework resolves that to Vulkan (which LogManagement.NormaliseFrameworkIniRendererDefault()’s XML docs state is the Android default), this will skip SetFormat() and the Vulkan path can still inherit RGB565. Consider treating Automatic as Vulkan here (or introduce a helper like LogManagement.ShouldForceRgba8888Surface() that covers both Vulkan and Automatic when Vulkan is actually in use), so Vulkan-by-automatic doesn’t regress.

Copilot uses AI. Check for mistakes.
{
holder.SetFormat(global::Android.Graphics.Format.Rgba8888);
try
{
holder.SetFormat(global::Android.Graphics.Format.Rgba8888);
Logger.Log("[osu!] SurfaceHolder.SetFormat(Rgba8888) applied (Vulkan renderer).", LoggingTarget.Runtime, LogLevel.Important);
}
catch (Exception e)
{
Debug.WriteLine($"[osu!] Failed to request RGBA8888 surface format: {e.Message}");
}
}
catch (Exception e)
else
{
Debug.WriteLine($"[osu!] Failed to request RGBA8888 surface format: {e.Message}");
Logger.Log("[osu!] SurfaceHolder.SetFormat skipped (OpenGL/Auto renderer — SDL3 handles format).", LoggingTarget.Runtime, LogLevel.Important);
}
Comment on lines +277 to 288

Copilot AI May 1, 2026

Copy link

Choose a reason for hiding this comment

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

These Logger.Log(..., LogLevel.Important) messages will be emitted on every startup (including the non-Vulkan path). Given that Important-level logs are user-visible in the in-game log overlay, this is likely to create persistent on-screen noise. Suggest lowering these to LogLevel.Verbose/Debug (or removing the non-Vulkan log entirely), keeping Important reserved for actionable warnings like the RGB565+Vulkan guard below.

Copilot uses AI. Check for mistakes.

holder.AddCallback(this);
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/osu.Game.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Realm" Version="20.1.0" />
<PackageReference Include="ppy.osu.Framework" Version="2026.501.1" />
<PackageReference Include="ppy.osu.Framework" Version="2026.501.2" />
<!--
Explicitly pin `ppy.Veldrid.SPIRV` to the winnerspiros fork build that
`ppy.osu.Framework 2026.501.1` was compiled against. This version is the only
Expand Down
2 changes: 1 addition & 1 deletion osu.iOS.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework.iOS" Version="2026.501.1" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2026.501.2" />
</ItemGroup>
</Project>
Loading