diff --git a/osu.Android/Native/CMakeLists.txt b/osu.Android/Native/CMakeLists.txt index 3ae7d08e7dc2..d6d30ee9ed5e 100644 --- a/osu.Android/Native/CMakeLists.txt +++ b/osu.Android/Native/CMakeLists.txt @@ -46,6 +46,9 @@ add_library(osu_native SHARED vulkan_bridge.cpp ) +# Add Oboe internal headers to include path for Process.h (CPU affinity). +target_include_directories(osu_native PRIVATE ${oboe_SOURCE_DIR}/src) + target_link_libraries(osu_native ${OBOE_LIB} ${vulkan-lib} diff --git a/osu.Android/Native/oboe_bridge.cpp b/osu.Android/Native/oboe_bridge.cpp index 34f3012e3ad5..1dc646825fef 100644 --- a/osu.Android/Native/oboe_bridge.cpp +++ b/osu.Android/Native/oboe_bridge.cpp @@ -4,7 +4,7 @@ #include "oboe_bridge.h" #include #include -#include +#include #include #include #include @@ -68,6 +68,10 @@ bool OboeBridge::open(int32_t sampleRate) { // Enable ADPF (Android Dynamic Performance Framework) hint support. stream_->setPerformanceHintEnabled(true); + // Set buffer size to 2x burst size for initial stability. + // LatencyTuner will then attempt to shrink it if stable. + stream_->setBufferSizeInFrames(stream_->getFramesPerBurst() * 2); + // Initialise LatencyTuner for dynamic buffer management. // This allows us to start at 1x burst and only grow if underruns occur. tuner_ = std::make_unique(*stream_);