From f8ac1c6a37310f399ff4997716b69ded15d32029 Mon Sep 17 00:00:00 2001 From: Robert Wu <85952307+robertwu1@users.noreply.github.com> Date: Fri, 16 Feb 2024 14:05:10 -0800 Subject: [PATCH 1/2] OboeTester: Remove sample rate conversion in test disconnect --- .../java/com/mobileer/oboetester/TestDisconnectActivity.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/TestDisconnectActivity.java b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/TestDisconnectActivity.java index 9e4d880d2..373951982 100644 --- a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/TestDisconnectActivity.java +++ b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/TestDisconnectActivity.java @@ -334,9 +334,6 @@ private void testConfiguration(boolean isInput, requestedConfig.setPerformanceMode(perfMode); requestedConfig.setSharingMode(sharingMode); requestedConfig.setSampleRate(sampleRate); - if (sampleRate != 0) { - requestedConfig.setRateConversionQuality(StreamConfiguration.RATE_CONVERSION_QUALITY_MEDIUM); - } log("========================== #" + mAutomatedTestRunner.getTestCount()); log("Requested:"); From 1be1f5ebe14fdf8df0f8ce71cf60b71d2c03f5c4 Mon Sep 17 00:00:00 2001 From: Robert Wu <85952307+robertwu1@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:52:59 -0800 Subject: [PATCH 2/2] test both with and without Oboe SRC --- .../oboetester/StreamConfiguration.java | 19 ++++++++++ .../oboetester/TestDisconnectActivity.java | 36 ++++++++++++++----- 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/StreamConfiguration.java b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/StreamConfiguration.java index 1f3301e1c..5c1f32b75 100644 --- a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/StreamConfiguration.java +++ b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/StreamConfiguration.java @@ -591,6 +591,25 @@ public static String convertChannelMaskToText(int channelMask) { } } + static String convertRateConversionQualityToText(int quality) { + switch(quality) { + case RATE_CONVERSION_QUALITY_NONE: + return "None"; + case RATE_CONVERSION_QUALITY_FASTEST: + return "Fastest"; + case RATE_CONVERSION_QUALITY_LOW: + return "Low"; + case RATE_CONVERSION_QUALITY_MEDIUM: + return "Medium"; + case RATE_CONVERSION_QUALITY_HIGH: + return "High"; + case RATE_CONVERSION_QUALITY_BEST: + return "Best"; + default: + return "?=" + quality; + } + } + public static int convertTextToChannelMask(String text) { return mChannelMaskStringToIntegerMap.get(text); } diff --git a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/TestDisconnectActivity.java b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/TestDisconnectActivity.java index 373951982..b74c3b104 100644 --- a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/TestDisconnectActivity.java +++ b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/TestDisconnectActivity.java @@ -257,7 +257,8 @@ private String getConfigText(StreamConfiguration config) { + ", Perf = " + StreamConfiguration.convertPerformanceModeToText( config.getPerformanceMode()) + ", " + StreamConfiguration.convertSharingModeToText(config.getSharingMode()) - + ", " + config.getSampleRate(); + + ", " + config.getSampleRate() + + ", SRC = " + StreamConfiguration.convertRateConversionQualityToText(config.getRateConversionQuality()); } private void log(Exception e) { @@ -281,6 +282,7 @@ private void testConfiguration(boolean isInput, int perfMode, int sharingMode, int sampleRate, + int sampleRateConversionQuality, boolean requestPlugin) throws InterruptedException { if ((getSingleTestIndex() >= 0) && (mAutomatedTestRunner.getTestCount() != getSingleTestIndex())) { mAutomatedTestRunner.incrementTestCount(); @@ -335,6 +337,10 @@ private void testConfiguration(boolean isInput, requestedConfig.setSharingMode(sharingMode); requestedConfig.setSampleRate(sampleRate); + if (sampleRate != 0) { + requestedConfig.setRateConversionQuality(sampleRateConversionQuality); + } + log("========================== #" + mAutomatedTestRunner.getTestCount()); log("Requested:"); log(getConfigText(requestedConfig)); @@ -489,11 +495,20 @@ private void testConfiguration(boolean isInput, } private void testConfiguration(boolean isInput, int performanceMode, - int sharingMode, int sampleRate) throws InterruptedException { + int sharingMode, int sampleRate, + int sampleRateConversionQuality) throws InterruptedException { boolean requestPlugin = true; // plug IN - testConfiguration(isInput, performanceMode, sharingMode, sampleRate, requestPlugin); + testConfiguration(isInput, performanceMode, sharingMode, sampleRate, + sampleRateConversionQuality, requestPlugin); requestPlugin = false; // UNplug - testConfiguration(isInput, performanceMode, sharingMode, sampleRate, requestPlugin); + testConfiguration(isInput, performanceMode, sharingMode, sampleRate, + sampleRateConversionQuality, requestPlugin); + } + + private void testConfiguration(boolean isInput, int performanceMode, + int sharingMode, int sampleRate) throws InterruptedException { + testConfiguration(isInput, performanceMode, sharingMode, sampleRate, + StreamConfiguration.RATE_CONVERSION_QUALITY_NONE); } private void testConfiguration(boolean isInput, int performanceMode, @@ -509,9 +524,10 @@ private void testConfiguration(int performanceMode, } private void testConfiguration(int performanceMode, - int sharingMode, int sampleRate) throws InterruptedException { - testConfiguration(false, performanceMode, sharingMode, sampleRate); - testConfiguration(true, performanceMode, sharingMode, sampleRate); + int sharingMode, int sampleRate, + int sampleRateConversionQuality) throws InterruptedException { + testConfiguration(false, performanceMode, sharingMode, sampleRate, sampleRateConversionQuality); + testConfiguration(true, performanceMode, sharingMode, sampleRate, sampleRateConversionQuality); } @Override @@ -532,7 +548,11 @@ public void runTest() { testConfiguration(StreamConfiguration.PERFORMANCE_MODE_LOW_LATENCY, StreamConfiguration.SHARING_MODE_SHARED); testConfiguration(StreamConfiguration.PERFORMANCE_MODE_LOW_LATENCY, - StreamConfiguration.SHARING_MODE_SHARED, 44100); + StreamConfiguration.SHARING_MODE_SHARED, 44100, + StreamConfiguration.RATE_CONVERSION_QUALITY_NONE); + testConfiguration(StreamConfiguration.PERFORMANCE_MODE_LOW_LATENCY, + StreamConfiguration.SHARING_MODE_SHARED, 44100, + StreamConfiguration.RATE_CONVERSION_QUALITY_MEDIUM); } catch (InterruptedException e) { log("Test CANCELLED - INVALID!"); } catch (Exception e) {