Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OboeTester: Test both with and without Oboe SRC in test disconnect #1964

Merged
merged 2 commits into from
Feb 21, 2024
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
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
Loading