aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Burk <philburk@mobileer.com>2024-05-02 16:52:13 -0700
committerGitHub <noreply@github.com>2024-05-02 16:52:13 -0700
commit2d6295cfd2ff4d81acbb015914772e4dab158bc3 (patch)
tree9857620b53ec2849678feda74a9154963dd149fe
parent573bc0ba96ea63e1a4b1535ee6ef4a95ed0fb70b (diff)
downloadoboe-2d6295cfd2ff4d81acbb015914772e4dab158bc3.tar.gz
OboeTester: test in_channels=3 and SessionId (#2013)
Added to Data Paths to catch b/270535408 Fixes #2001
-rw-r--r--apps/OboeTester/app/src/main/java/com/mobileer/oboetester/BaseAutoGlitchActivity.java5
-rw-r--r--apps/OboeTester/app/src/main/java/com/mobileer/oboetester/TestDataPathsActivity.java27
2 files changed, 31 insertions, 1 deletions
diff --git a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/BaseAutoGlitchActivity.java b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/BaseAutoGlitchActivity.java
index e19b5eff..0c462a68 100644
--- a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/BaseAutoGlitchActivity.java
+++ b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/BaseAutoGlitchActivity.java
@@ -80,6 +80,7 @@ public class BaseAutoGlitchActivity extends GlitchActivity {
public final int mmapUsed;
public final int performanceMode;
public final int sharingMode;
+ public final int sessionId;
public TestStreamOptions(StreamConfiguration configuration, int channelUsed) {
this.channelUsed = channelUsed;
@@ -89,6 +90,7 @@ public class BaseAutoGlitchActivity extends GlitchActivity {
mmapUsed = configuration.isMMap() ? 1 : 0;
performanceMode = configuration.getPerformanceMode();
sharingMode = configuration.getSharingMode();
+ sessionId = configuration.getSessionId();
}
int countDifferences(TestStreamOptions other) {
@@ -100,6 +102,7 @@ public class BaseAutoGlitchActivity extends GlitchActivity {
count += (mmapUsed != other.mmapUsed) ? 1 : 0;
count += (performanceMode != other.performanceMode) ? 1 : 0;
count += (sharingMode != other.sharingMode) ? 1 : 0;
+ count += (sessionId != other.sessionId) ? 1 : 0;
return count;
}
@@ -112,6 +115,7 @@ public class BaseAutoGlitchActivity extends GlitchActivity {
text.append(TestDataPathsActivity.comparePassedField(prefix,this, passed, "mmapUsed"));
text.append(TestDataPathsActivity.comparePassedField(prefix,this, passed, "performanceMode"));
text.append(TestDataPathsActivity.comparePassedField(prefix,this, passed, "sharingMode"));
+ text.append(TestDataPathsActivity.comparePassedField(prefix,this, passed, "sessionId"));
return text.toString();
}
@Override
@@ -236,6 +240,7 @@ public class BaseAutoGlitchActivity extends GlitchActivity {
+ ", ID = " + String.format(Locale.getDefault(), "%2d", config.getDeviceId())
+ ", Perf = " + StreamConfiguration.convertPerformanceModeToText(
config.getPerformanceMode())
+ + ((config.getSessionId() > 0) ? (", sessionId = " + config.getSessionId()) : "")
+ ",\n ch = " + channelText(channel, config.getChannelCount())
+ ", cm = " + convertChannelMaskToText(config.getChannelMask());
}
diff --git a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/TestDataPathsActivity.java b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/TestDataPathsActivity.java
index bfe4b83d..f0936eca 100644
--- a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/TestDataPathsActivity.java
+++ b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/TestDataPathsActivity.java
@@ -17,6 +17,7 @@
package com.mobileer.oboetester;
import static com.mobileer.oboetester.IntentBasedTestSupport.configureStreamsFromBundle;
+import static com.mobileer.oboetester.StreamConfiguration.UNSPECIFIED;
import static com.mobileer.oboetester.StreamConfiguration.convertChannelMaskToText;
import android.app.Instrumentation;
@@ -37,6 +38,8 @@ import com.mobileer.audio_device.AudioDeviceInfoConverter;
import java.lang.reflect.Field;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
import java.util.Locale;
/**
@@ -572,6 +575,8 @@ public class TestDataPathsActivity extends BaseAutoGlitchActivity {
requestedOutConfig.setDeviceId(outputDeviceInfo.getId());
resetChannelConfigurations(requestedInConfig, requestedOutConfig);
+ testBug_270535408(inputDeviceInfo, outputDeviceInfo);
+
if (mCheckBoxAllChannels.isChecked()) {
runOnUiThread(() -> mCheckBoxAllChannels.setEnabled(false));
testOutputChannelCounts(inputDeviceInfo, outputDeviceInfo);
@@ -695,7 +700,7 @@ public class TestDataPathsActivity extends BaseAutoGlitchActivity {
private void testOutputChannelCounts(AudioDeviceInfo inputDeviceInfo, AudioDeviceInfo outputDeviceInfo) throws InterruptedException {
logSection("Output Channel Counts");
- ArrayList<Integer> channelCountsTested =new ArrayList<Integer>();
+ ArrayList<Integer> channelCountsTested = new ArrayList<Integer>();
StreamConfiguration requestedInConfig = mAudioInputTester.requestedConfiguration;
StreamConfiguration requestedOutConfig = mAudioOutTester.requestedConfiguration;
@@ -767,6 +772,26 @@ public class TestDataPathsActivity extends BaseAutoGlitchActivity {
}
}
+ // b/270535408 | no input when channels=3 and sessionId is allocated
+ private void testBug_270535408(AudioDeviceInfo inputDeviceInfo,
+ AudioDeviceInfo outputDeviceInfo) throws InterruptedException {
+ int[] inputChannelCounts = inputDeviceInfo.getChannelCounts();
+ if (findLargestChannelCount(inputChannelCounts) >= 3) {
+ logSection("Bug 270535408, 3ch + SessionId");
+ StreamConfiguration requestedInConfig = mAudioInputTester.requestedConfiguration;
+ StreamConfiguration requestedOutConfig = mAudioOutTester.requestedConfiguration;
+ requestedInConfig.setChannelCount(3);
+ requestedInConfig.setSessionId(AudioManager.AUDIO_SESSION_ID_GENERATE);
+ requestedInConfig.setPerformanceMode(StreamConfiguration.PERFORMANCE_MODE_LOW_LATENCY);
+ requestedOutConfig.setPerformanceMode(StreamConfiguration.PERFORMANCE_MODE_LOW_LATENCY);
+ testCurrentConfigurations();
+ // Now test without a sessionId so we have a passing test to compare with.
+ requestedInConfig.setSessionId(-1); // AAUDIO_SESSION_ID_NONE
+ testCurrentConfigurations();
+ requestedInConfig.setChannelCount(UNSPECIFIED);
+ }
+ }
+
private void testPerformancePaths() throws InterruptedException {
StreamConfiguration requestedInConfig = mAudioInputTester.requestedConfiguration;
StreamConfiguration requestedOutConfig = mAudioOutTester.requestedConfiguration;