diff --git a/app/src/main/cpp/CMakeLists.txt b/app/src/main/cpp/CMakeLists.txt index 53408450..557720ca 100644 --- a/app/src/main/cpp/CMakeLists.txt +++ b/app/src/main/cpp/CMakeLists.txt @@ -130,4 +130,5 @@ target_link_libraries(camera_textureview dl android log m camera2ndk mediandk) # optimize target_compile_options(amprack PRIVATE -Wall -Ofast) -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Ofast") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_RELEASE}") diff --git a/app/src/main/cpp/Engine.cpp b/app/src/main/cpp/Engine.cpp index 33e3ce80..07166500 100644 --- a/app/src/main/cpp/Engine.cpp +++ b/app/src/main/cpp/Engine.cpp @@ -180,6 +180,8 @@ oboe::Result Engine::openStreams() { // mRecordingStream->setBufferSizeInFrames(mRecordingStream->getFramesPerBurst()); // mPlayStream->setBufferSizeInFrames(mPlayStream->getFramesPerBurst()); + mRecordingStream->setBufferSizeInFrames(mRecordingStream->getFramesPerBurst() * 2); + mPlayStream->setBufferSizeInFrames(mPlayStream->getFramesPerBurst() * 2); mFullDuplexPass.setInputStream(mRecordingStream); mFullDuplexPass.setOutputStream(mPlayStream); diff --git a/app/src/main/java/com/shajikhan/ladspa/amprack/Rack.java b/app/src/main/java/com/shajikhan/ladspa/amprack/Rack.java index 28c185e3..5733ac37 100644 --- a/app/src/main/java/com/shajikhan/ladspa/amprack/Rack.java +++ b/app/src/main/java/com/shajikhan/ladspa/amprack/Rack.java @@ -1186,6 +1186,8 @@ public void onClick(View v) { if (mainActivity.running) latency.performClick(); + else + Toast.makeText(mainActivity, "Turn on the audio engine to use Latency Tuner", Toast.LENGTH_SHORT).show(); Button ato = linearLayout.findViewById(R.id.autofix); ato.setOnClickListener(new View.OnClickListener() { @@ -1233,10 +1235,12 @@ public void onClick(View v) { Runnable r = new Runnable() { @Override public void run() { - latency.performClick(); + if (mainActivity.running) + latency.performClick(); handler.postDelayed(this, 500); } }; + handler.postDelayed(r, 500); builder.setOnDismissListener(new DialogInterface.OnDismissListener() { diff --git a/app/src/main/res/layout/latency_tuner.xml b/app/src/main/res/layout/latency_tuner.xml index cfaa701f..585f30c6 100644 --- a/app/src/main/res/layout/latency_tuner.xml +++ b/app/src/main/res/layout/latency_tuner.xml @@ -13,7 +13,7 @@ android:id="@+id/latency" android:padding="10dp" android:fontFamily="@font/gruppo" - android:text="20ms" + android:text="" android:textSize="34dp"/>