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 .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
"$CMAKE_BIN" -B "build-native/$ABI" -S osu.Android/Native \
-DCMAKE_TOOLCHAIN_FILE="$NDK_HOME/build/cmake/android.toolchain.cmake" \
-DANDROID_ABI="$ABI" \
-DANDROID_PLATFORM=android-31 \
-DANDROID_PLATFORM=android-33 \
-DCMAKE_BUILD_TYPE=Release
"$CMAKE_BIN" --build "build-native/$ABI" --config Release -j "$(nproc)"
mkdir -p "osu.Android/libs/$ABI"
Expand Down
5 changes: 5 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ Manual work duration reporting (`reportActualWorkDuration`) has been removed fro

## Build Configuration
`OBOE_ENABLE_FLOWGRAPH` is set to `OFF` in `CMakeLists.txt` to minimize binary size, as we perform all mixing in BASS and only use Oboe for final hardware delivery.

## API 33 Upgrade
The project was upgraded to Android API 33 to support APerformanceHint (ADPF) APIs.
Native builds now target android-33 to avoid compilation errors for these high-performance features.
The 'byte' type is defined as 'uint8_t' in native bridges to ensure C# P/Invoke compatibility.
86 changes: 86 additions & 0 deletions build_test/CMakeCache.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# This is the CMakeCache file.
# For build in directory: /app/build_test
# It was generated by CMake: /usr/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.

########################
# EXTERNAL cache entries
########################

//No help, variable specified on the command line.
ANDROID_ABI:UNINITIALIZED=arm64-v8a

//No help, variable specified on the command line.
ANDROID_PLATFORM:UNINITIALIZED=android-33

//Value Computed by CMake.
CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=/app/build_test/CMakeFiles/pkgRedirects

//Value Computed by CMake
CMAKE_PROJECT_DESCRIPTION:STATIC=

//Value Computed by CMake
CMAKE_PROJECT_HOMEPAGE_URL:STATIC=

//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=osu_native

//No help, variable specified on the command line.
CMAKE_TOOLCHAIN_FILE:UNINITIALIZED=/opt/android-sdk/ndk/29.0.14206865/build/cmake/android.toolchain.cmake

//Value Computed by CMake
osu_native_BINARY_DIR:STATIC=/app/build_test

//Value Computed by CMake
osu_native_IS_TOP_LEVEL:STATIC=ON

//Value Computed by CMake
osu_native_SOURCE_DIR:STATIC=/app/osu.Android/Native


########################
# INTERNAL cache entries
########################

//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=/app/build_test
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=28
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=3
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=/usr/bin/cmake
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest
//Name of external makefile project generator.
CMAKE_EXTRA_GENERATOR:INTERNAL=
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
//Generator instance identifier.
CMAKE_GENERATOR_INSTANCE:INTERNAL=
//Name of generator platform.
CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Source directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=/app/osu.Android/Native
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
//Platform information initialized
CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.28
//uname command
CMAKE_UNAME:INTERNAL=/usr/bin/uname
1 change: 1 addition & 0 deletions build_test/CMakeFiles/cmake.check_cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file is generated by cmake for dependency checking of the CMakeCache.txt file
2 changes: 1 addition & 1 deletion osu.Android.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<SupportedOSPlatformVersion>31.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion>33.0</SupportedOSPlatformVersion>
<RuntimeIdentifiers>android-x86;android-arm;android-arm64</RuntimeIdentifiers>
<AndroidPackageFormat>apk</AndroidPackageFormat>
<MandroidI18n>CJK;Mideast;Rare;West;Other;</MandroidI18n>
Expand Down
2 changes: 1 addition & 1 deletion osu.Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="sh.ppy.osulazer" android:installLocation="auto">
<uses-sdk android:minSdkVersion="31" android:targetSdkVersion="36" />
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
<application android:allowBackup="true"
android:supportsRtl="true"
android:label="osu!"
Expand Down
10 changes: 5 additions & 5 deletions osu.Android/Native/OboeAudioBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,10 @@ public void Dispose()

[DllImport(lib_name)]
private static extern void nOboeSetProvider(IntPtr ptr, IntPtr provider);
[DllImport(lib_name)] public static extern byte nSetThreadAffinity(int coreMask);
[DllImport(lib_name)] public static extern IntPtr nADPFCreateSession(long targetDurationNanos);
[DllImport(lib_name)] public static extern void nADPFReportActualDuration(IntPtr sessionPtr, long actualDurationNanos);
[DllImport(lib_name)] public static extern void nADPFUpdateTargetDuration(IntPtr sessionPtr, long targetDurationNanos);
[DllImport(lib_name)] public static extern void nADPFCloseSession(IntPtr sessionPtr);
[DllImport(lib_name)] internal static extern byte nSetThreadAffinity(int coreMask);
[DllImport(lib_name)] internal static extern IntPtr nADPFCreateSession(long targetDurationNanos);
[DllImport(lib_name)] internal static extern void nADPFReportActualDuration(IntPtr sessionPtr, long actualDurationNanos);
[DllImport(lib_name)] internal static extern void nADPFUpdateTargetDuration(IntPtr sessionPtr, long targetDurationNanos);
[DllImport(lib_name)] internal static extern void nADPFCloseSession(IntPtr sessionPtr);
}
}
2 changes: 1 addition & 1 deletion osu.Android/Native/oboe_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <cstring>
#include <vector>
#include <algorithm>
typedef uint8_t byte;

#define LOG_TAG "osu!native"
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
Expand Down Expand Up @@ -394,7 +395,6 @@ OSU_EXPORT intptr_t nADPFCreateSession(int64_t targetDurationNanos) {
auto manager = APerformanceHint_getManager();
if (!manager) return 0;

// We use the current thread as the initial thread for the session.
int32_t thread_id = gettid();
return reinterpret_cast<intptr_t>(APerformanceHint_createSession(manager, &thread_id, 1, targetDurationNanos));
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Catch.Tests.Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- using a different name because package name cannot contain 'catch' -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Catch_Tests.Android" android:installLocation="auto">
<uses-sdk android:minSdkVersion="31" android:targetSdkVersion="36" />
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!catch Test" />
</manifest>
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Mania.Tests.Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Mania.Tests.Android" android:installLocation="auto">
<uses-sdk android:minSdkVersion="31" android:targetSdkVersion="36" />
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!mania Test" />
</manifest>
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Osu.Tests.Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Osu.Tests.Android" android:installLocation="auto">
<uses-sdk android:minSdkVersion="31" android:targetSdkVersion="36" />
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!standard Test" />
</manifest>
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Taiko.Tests.Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Taiko.Tests.Android" android:installLocation="auto">
<uses-sdk android:minSdkVersion="31" android:targetSdkVersion="36" />
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!taiko Test" />
</manifest>
2 changes: 1 addition & 1 deletion osu.Game.Tests.Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Tests.Android" android:installLocation="auto">
<uses-sdk android:minSdkVersion="31" android:targetSdkVersion="36" />
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!visual Test" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ protected override void LoadComplete()
textbox.OnCommit += onCommit;

channel = channelManager?.JoinChannel(new Channel { Id = room.ChannelID, Type = ChannelType.Multiplayer, Name = $"#lazermp_{room.RoomID}" });
if (channel != null)
channel.NewMessagesArrived += onNewMessagesArrived;
channel?.NewMessagesArrived += onNewMessagesArrived;
}

private void onCommit(TextBox sender, bool newText)
Expand Down Expand Up @@ -184,8 +183,7 @@ protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);

if (channel != null)
channel.NewMessagesArrived -= onNewMessagesArrived;
channel?.NewMessagesArrived -= onNewMessagesArrived;
}

private partial class ChatTextBox : StandAloneChatDisplay.ChatTextBox
Expand Down
Loading