mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge changes from topic "cuttlefish_aidl_audio-3" into main
* changes: Revert "Add remote submix direct paths" audio: Add test configs for effects VTS tests
This commit is contained in:
@@ -32,7 +32,6 @@ using aidl::android::media::audio::common::AudioDeviceType;
|
||||
using aidl::android::media::audio::common::AudioFormatDescription;
|
||||
using aidl::android::media::audio::common::AudioFormatType;
|
||||
using aidl::android::media::audio::common::AudioGainConfig;
|
||||
using aidl::android::media::audio::common::AudioInputFlags;
|
||||
using aidl::android::media::audio::common::AudioIoFlags;
|
||||
using aidl::android::media::audio::common::AudioOutputFlags;
|
||||
using aidl::android::media::audio::common::AudioPort;
|
||||
@@ -322,25 +321,20 @@ std::unique_ptr<Configuration> getPrimaryConfiguration() {
|
||||
//
|
||||
// Mix ports:
|
||||
// * "r_submix output", maximum 10 opened streams, maximum 10 active streams
|
||||
// - profile PCM 16-bit; STEREO; 8000, 11025, 16000, 32000, 44100, 48000, 192000
|
||||
// - profile PCM 16-bit; STEREO; 8000, 11025, 16000, 32000, 44100, 48000
|
||||
// * "r_submix input", maximum 10 opened streams, maximum 10 active streams
|
||||
// - profile PCM 16-bit; STEREO; 8000, 11025, 16000, 32000, 44100, 48000, 192000
|
||||
// * "r_submix output direct", DIRECT|IEC958_NONAUDIO, 1 max open, 1 max active
|
||||
// - profile PCM 16-bit; STEREO; 8000, 11025, 16000, 32000, 44100, 48000, 192000
|
||||
// * "r_submix input direct", DIRECT, 1 max open, 1 max active
|
||||
// - profile PCM 16-bit; STEREO; 8000, 11025, 16000, 32000, 44100, 48000, 192000
|
||||
|
||||
// - profile PCM 16-bit; STEREO; 8000, 11025, 16000, 32000, 44100, 48000
|
||||
//
|
||||
// Routes:
|
||||
// "r_submix output", "r_submix output direct" -> "Remote Submix Out"
|
||||
// "Remote Submix In" -> "r_submix input", "r_submix input direct"
|
||||
// "r_submix output" -> "Remote Submix Out"
|
||||
// "Remote Submix In" -> "r_submix input"
|
||||
//
|
||||
std::unique_ptr<Configuration> getRSubmixConfiguration() {
|
||||
static const Configuration configuration = []() {
|
||||
Configuration c;
|
||||
const std::vector<AudioProfile> remoteSubmixPcmAudioProfiles{
|
||||
createProfile(PcmType::INT_16_BIT, {AudioChannelLayout::LAYOUT_STEREO},
|
||||
{8000, 11025, 16000, 32000, 44100, 48000, 192000})};
|
||||
{8000, 11025, 16000, 32000, 44100, 48000})};
|
||||
|
||||
// Device ports
|
||||
|
||||
@@ -365,41 +359,13 @@ std::unique_ptr<Configuration> getRSubmixConfiguration() {
|
||||
rsubmixOutMix.profiles = remoteSubmixPcmAudioProfiles;
|
||||
c.ports.push_back(rsubmixOutMix);
|
||||
|
||||
// Adding a DIRECT flag to rsubmixInMix breaks the mixer paths, so we need separate
|
||||
// non direct and direct paths. It is added because for IEC61937 encapsulated over PCM, we
|
||||
// need the DIRECT and IEC958_NONAUDIO flags as AudioFlinger adds them.
|
||||
AudioPort rsubmixOutDirectMix =
|
||||
createPort(c.nextPortId++, "r_submix output direct",
|
||||
makeBitPositionFlagMask({
|
||||
AudioOutputFlags::DIRECT,
|
||||
AudioOutputFlags::IEC958_NONAUDIO}),
|
||||
false /* isInput */,
|
||||
createPortMixExt(1 /* maxOpenStreamCount */,
|
||||
1 /* maxActiveStreamCount */));
|
||||
rsubmixOutDirectMix.profiles = remoteSubmixPcmAudioProfiles;
|
||||
c.ports.push_back(rsubmixOutDirectMix);
|
||||
|
||||
AudioPort rsubmixInMix =
|
||||
createPort(c.nextPortId++, "r_submix input", 0, true, createPortMixExt(10, 10));
|
||||
rsubmixInMix.profiles = remoteSubmixPcmAudioProfiles;
|
||||
c.ports.push_back(rsubmixInMix);
|
||||
|
||||
// Adding a DIRECT flag to rsubmixInMix breaks the capture paths, so we need separate
|
||||
// non direct and direct paths. It is added because for IEC61937 encapsulated over PCM, we
|
||||
// need the DIRECT flag for the capability so AudioFlinger can find a DIRECT input match.
|
||||
AudioPort rsubmixInDirectMix =
|
||||
createPort(c.nextPortId++, "r_submix input direct",
|
||||
makeBitPositionFlagMask({AudioInputFlags::DIRECT}),
|
||||
true /* isInput */,
|
||||
createPortMixExt(1 /* maxOpenStreamCount */,
|
||||
1 /* maxActiveStreamCount */));
|
||||
rsubmixInDirectMix.profiles = remoteSubmixPcmAudioProfiles;
|
||||
c.ports.push_back(rsubmixInDirectMix);
|
||||
|
||||
c.routes.push_back(createRoute(
|
||||
{rsubmixOutMix, rsubmixOutDirectMix}, rsubmixOutDevice));
|
||||
c.routes.push_back(createRoute({rsubmixOutMix}, rsubmixOutDevice));
|
||||
c.routes.push_back(createRoute({rsubmixInDevice}, rsubmixInMix));
|
||||
c.routes.push_back(createRoute({rsubmixInDevice}, rsubmixInDirectMix));
|
||||
|
||||
return c;
|
||||
}();
|
||||
|
||||
@@ -90,10 +90,6 @@ ndk::ScopedAStatus ModuleRemoteSubmix::setAudioPortConfig(const AudioPortConfig&
|
||||
ndk::ScopedAStatus ModuleRemoteSubmix::createInputStream(
|
||||
StreamContext&& context, const SinkMetadata& sinkMetadata,
|
||||
const std::vector<MicrophoneInfo>& microphones, std::shared_ptr<StreamIn>* result) {
|
||||
if (context.getFormat().type != AudioFormatType::PCM) {
|
||||
LOG(DEBUG) << __func__ << ": not supported for format " << context.getFormat().toString();
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
|
||||
}
|
||||
return createStreamInstance<StreamInRemoteSubmix>(result, std::move(context), sinkMetadata,
|
||||
microphones);
|
||||
}
|
||||
@@ -101,10 +97,6 @@ ndk::ScopedAStatus ModuleRemoteSubmix::createInputStream(
|
||||
ndk::ScopedAStatus ModuleRemoteSubmix::createOutputStream(
|
||||
StreamContext&& context, const SourceMetadata& sourceMetadata,
|
||||
const std::optional<AudioOffloadInfo>& offloadInfo, std::shared_ptr<StreamOut>* result) {
|
||||
if (context.getFormat().type != AudioFormatType::PCM) {
|
||||
LOG(DEBUG) << __func__ << ": not supported for format " << context.getFormat().toString();
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
|
||||
}
|
||||
return createStreamInstance<StreamOutRemoteSubmix>(result, std::move(context), sourceMetadata,
|
||||
offloadInfo);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ cc_defaults {
|
||||
"-Werror",
|
||||
"-Wthread-safety",
|
||||
],
|
||||
test_config_template: "VtsHalAudioTargetTestTemplate.xml",
|
||||
test_suites: [
|
||||
"general-tests",
|
||||
"vts",
|
||||
@@ -71,7 +72,6 @@ cc_test {
|
||||
"VtsHalAudioCoreConfigTargetTest.cpp",
|
||||
"VtsHalAudioCoreModuleTargetTest.cpp",
|
||||
],
|
||||
test_config: "VtsHalAudioCoreTargetTest.xml",
|
||||
}
|
||||
|
||||
cc_test {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<configuration description="Runs VtsHalAudioCoreTargetTest.">
|
||||
<configuration description="Runs {MODULE}.">
|
||||
<option name="test-suite-tag" value="apct" />
|
||||
<option name="test-suite-tag" value="apct-native" />
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
|
||||
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
|
||||
<option name="cleanup" value="true" />
|
||||
<option name="push" value="VtsHalAudioCoreTargetTest->/data/local/tmp/VtsHalAudioCoreTargetTest" />
|
||||
<option name="push" value="{MODULE}->/data/local/tmp/{MODULE}" />
|
||||
</target_preparer>
|
||||
|
||||
<test class="com.android.tradefed.testtype.GTest" >
|
||||
<option name="native-test-device-path" value="/data/local/tmp" />
|
||||
<option name="module-name" value="VtsHalAudioCoreTargetTest" />
|
||||
<option name="module-name" value="{MODULE}" />
|
||||
<option name="native-test-timeout" value="10m" />
|
||||
</test>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user