AudioPolicy: several spatializer output management fixes
Apply several fixes for spatializer output management when
the spatializer can be attached to two hardware modules (for instance
the primary and Bluetooth hardware modules).
- in getSpatializerOutput() open the output with
openOutputWithProfileAndDevice() to properly create the duplicating
output if needed and handle dynamic audio profiles.
- in openOutputWithProfileAndDevice(), do not open a duplicating output
for outputs opened on the primary module.
- in closeOutput(), clear mSpatializerOutput if this is the output being
closed.
- Allow canBeSpatialized() to ignore config matching with opened mSpatializerOutput
when not required.
- Force multichannel mixer mask in SwAudioOutputDescriptor::open() when
opening a spatializer output and the mixer config is not specified.
Bug: 210803914
Test: spatializer over Bluetooth A2DP
Change-Id: I1c5ca3ce0a230d674f3a22fcb1fe1d904665efe9
diff --git a/services/audiopolicy/service/Spatializer.cpp b/services/audiopolicy/service/Spatializer.cpp
index 0fdbe20..54d9094 100644
--- a/services/audiopolicy/service/Spatializer.cpp
+++ b/services/audiopolicy/service/Spatializer.cpp
@@ -227,12 +227,8 @@
if (status != NO_ERROR) {
return status;
}
- status = getHalParameter<true>(effect, SPATIALIZER_PARAM_SUPPORTED_CHANNEL_MASKS,
+ return getHalParameter<true>(effect, SPATIALIZER_PARAM_SUPPORTED_CHANNEL_MASKS,
&mChannelMasks);
- if (status != NO_ERROR) {
- return status;
- }
- return NO_ERROR;
}
/** Gets the channel mask, sampling rate and format set for the spatializer input. */