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
3 changes: 3 additions & 0 deletions osu.Android/Native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
6 changes: 5 additions & 1 deletion osu.Android/Native/oboe_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "oboe_bridge.h"
#include <oboe/OboeExtensions.h>
#include <oboe/AudioClock.h>
#include <oboe/Process.h>
#include <common/Process.h>
#include <android/log.h>
#include <cstdint>
#include <cstring>
Expand Down Expand Up @@ -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<oboe::LatencyTuner>(*stream_);
Expand Down
Loading