Merge "Fix device effect instatiation" into main
diff --git a/services/audioflinger/Effects.cpp b/services/audioflinger/Effects.cpp
index 78e455e..8a29fb2 100644
--- a/services/audioflinger/Effects.cpp
+++ b/services/audioflinger/Effects.cpp
@@ -3534,12 +3534,12 @@
mHalEffect = sp<HwAccDeviceEffectModule>::make(mMyCallback,
const_cast<effect_descriptor_t *>(&mDescriptor), mMyCallback->newEffectId(),
port->id);
+ mHalEffect->configure_l();
if (audio_is_input_device(mDevice.mType)) {
mHalEffect->setInputDevice(mDevice);
} else {
mHalEffect->setDevices({mDevice});
}
- mHalEffect->configure_l();
}
*handle = new EffectHandle(mHalEffect, nullptr, nullptr, 0 /*priority*/,
mNotifyFramesProcessed);
diff --git a/services/audioflinger/Effects.h b/services/audioflinger/Effects.h
index de3de01..5c90176 100644
--- a/services/audioflinger/Effects.h
+++ b/services/audioflinger/Effects.h
@@ -811,7 +811,10 @@
audio_channel_mask_t outChannelMask() const override;
uint32_t outChannelCount() const override;
audio_channel_mask_t hapticChannelMask() const override { return AUDIO_CHANNEL_NONE; }
- size_t frameCount() const override { return 0; }
+ /**
+ * frameCount cannot be zero.
+ */
+ size_t frameCount() const override { return 1; }
uint32_t latency() const override { return 0; }
status_t addEffectToHal(const sp<EffectHalInterface>& effect) override;