Remove the volume flag if no volume support for any sub-effect in proxy
Bug: 303565339
Test: m
Test: Enable AIDL and run CTS, run audio effect on Pixel
Change-Id: Ifc8df20c4273fa026dbccf9636a03427ca5962bc
diff --git a/media/libaudiohal/impl/EffectProxy.cpp b/media/libaudiohal/impl/EffectProxy.cpp
index 1099b6d..aee42a9 100644
--- a/media/libaudiohal/impl/EffectProxy.cpp
+++ b/media/libaudiohal/impl/EffectProxy.cpp
@@ -162,7 +162,11 @@
Descriptor::Common EffectProxy::buildDescriptorCommon(
const AudioUuid& uuid, const std::vector<Descriptor>& subEffectDescs) {
- Descriptor::Common common;
+ // initial flag values before we know which sub-effect to active (with setOffloadParam)
+ // align to HIDL EffectProxy flags
+ Descriptor::Common common = {.flags = {.type = Flags::Type::INSERT,
+ .insert = Flags::Insert::LAST,
+ .volume = Flags::Volume::CTRL}};
for (const auto& desc : subEffectDescs) {
if (desc.common.flags.hwAcceleratorMode == Flags::HardwareAccelerator::TUNNEL) {
@@ -174,14 +178,12 @@
common.flags.deviceIndication |= desc.common.flags.deviceIndication;
common.flags.audioModeIndication |= desc.common.flags.audioModeIndication;
common.flags.audioSourceIndication |= desc.common.flags.audioSourceIndication;
+ // Set to NONE if any sub-effect not supporting any Volume command
+ if (desc.common.flags.volume == Flags::Volume::NONE) {
+ common.flags.volume = Flags::Volume::NONE;
+ }
}
- // initial flag values before we know which sub-effect to active (with setOffloadParam)
- // same as HIDL EffectProxy flags
- common.flags.type = Flags::Type::INSERT;
- common.flags.insert = Flags::Insert::LAST;
- common.flags.volume = Flags::Volume::CTRL;
-
// copy type UUID from any of sub-effects, all sub-effects should have same type
common.id.type = subEffectDescs[0].common.id.type;
// replace implementation UUID with proxy UUID.