From 26526f15e3996fb8acd132e2a402e6e4afd5158c Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Fri, 12 May 2023 13:51:06 -0700 Subject: [PATCH] audio: Update hardwired configuration Fill in address for remote submix devices. Specify correct connection type for the remote submix output. Avoid logging entire HAL Engine Config. Bug: 205884982 Test: atest VtsHalAudioCoreTargetTest Change-Id: I246435e4d3b848b5d0ad9810d13f650603eac76d --- audio/aidl/default/Config.cpp | 6 +++++- audio/aidl/default/Configuration.cpp | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/audio/aidl/default/Config.cpp b/audio/aidl/default/Config.cpp index 87c0ace6d2..e87af071a2 100644 --- a/audio/aidl/default/Config.cpp +++ b/audio/aidl/default/Config.cpp @@ -47,10 +47,14 @@ ndk::ScopedAStatus Config::getEngineConfig(AudioHalEngineConfig* _aidl_return) { LOG(WARNING) << __func__ << mAudioPolicyConverter.getError(); } } + // Logging full contents of the config is an overkill, just provide statistics. + LOG(DEBUG) << "getEngineConfig: number of strategies parsed: " + << engConfig.productStrategies.size() + << ", default strategy: " << engConfig.defaultProductStrategyId + << ", number of volume groups parsed: " << engConfig.volumeGroups.size(); return engConfig; }(); *_aidl_return = returnEngCfg; - LOG(DEBUG) << __func__ << ": returning " << _aidl_return->toString(); return ndk::ScopedAStatus::ok(); } } // namespace aidl::android::hardware::audio::core diff --git a/audio/aidl/default/Configuration.cpp b/audio/aidl/default/Configuration.cpp index e1e1f79376..d41ea67329 100644 --- a/audio/aidl/default/Configuration.cpp +++ b/audio/aidl/default/Configuration.cpp @@ -81,6 +81,8 @@ static AudioPortExt createDeviceExt(AudioDeviceType devType, int32_t flags, deviceExt.device.address = "bottom"; } else if (devType == AudioDeviceType::IN_MICROPHONE_BACK && connection.empty()) { deviceExt.device.address = "back"; + } else if (devType == AudioDeviceType::IN_SUBMIX || devType == AudioDeviceType::OUT_SUBMIX) { + deviceExt.device.address = "0"; } deviceExt.device.type.connection = std::move(connection); deviceExt.flags = flags; @@ -365,8 +367,10 @@ std::unique_ptr getRSubmixConfiguration() { // Device ports - AudioPort rsubmixOutDevice = createPort(c.nextPortId++, "Remote Submix Out", 0, false, - createDeviceExt(AudioDeviceType::OUT_SUBMIX, 0)); + AudioPort rsubmixOutDevice = + createPort(c.nextPortId++, "Remote Submix Out", 0, false, + createDeviceExt(AudioDeviceType::OUT_SUBMIX, 0, + AudioDeviceDescription::CONNECTION_VIRTUAL)); rsubmixOutDevice.profiles.push_back( createProfile(PcmType::INT_24_BIT, {AudioChannelLayout::LAYOUT_STEREO}, {48000})); c.ports.push_back(rsubmixOutDevice);