Skip to content

Commit

Permalink
OboeTester: Test both with and without Oboe SRC in test disconnect (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
robertwu1 authored Feb 21, 2024
1 parent 23736ab commit 24004f8
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
Expand Down Expand Up @@ -334,8 +336,9 @@ private void testConfiguration(boolean isInput,
requestedConfig.setPerformanceMode(perfMode);
requestedConfig.setSharingMode(sharingMode);
requestedConfig.setSampleRate(sampleRate);

if (sampleRate != 0) {
requestedConfig.setRateConversionQuality(StreamConfiguration.RATE_CONVERSION_QUALITY_MEDIUM);
requestedConfig.setRateConversionQuality(sampleRateConversionQuality);
}

log("========================== #" + mAutomatedTestRunner.getTestCount());
Expand Down Expand Up @@ -492,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,
Expand All @@ -512,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
Expand All @@ -535,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) {
Expand Down

0 comments on commit 24004f8

Please sign in to comment.