Skip to content

Commit

Permalink
optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaji Khan committed Jun 5, 2024
1 parent 6ce5aca commit 083baf6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
2 changes: 2 additions & 0 deletions app/src/main/cpp/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/com/shajikhan/ladspa/amprack/Rack.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/latency_tuner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
android:id="@+id/latency"
android:padding="10dp"
android:fontFamily="@font/gruppo"
android:text="20ms"
android:text=""
android:textSize="34dp"/>

<Button
Expand Down

0 comments on commit 083baf6

Please sign in to comment.