audioflinger and hal: Compatibility fixes for Treble
1. Treat both reply size being 0 and reply buffer being NULL
as an indication that the reply isn't needed.
2. Synchronize both input and output effect chain buffers,
and avoid excessive copies when the input buffer is the same as
the output buffer.
3. Improve effect chain debug dump by showing both
"external" and "allocated" pointers for effect audio data buffers.
Bug: 34368451
Change-Id: I56aba6908408b5fce3f15c8d29138555101e8720
Test: volume controls works when both Bass Boost and EQ effects enabled
diff --git a/media/libaudiohal/EffectHalHidl.cpp b/media/libaudiohal/EffectHalHidl.cpp
index 6cf6412..d74ef8a 100644
--- a/media/libaudiohal/EffectHalHidl.cpp
+++ b/media/libaudiohal/EffectHalHidl.cpp
@@ -172,7 +172,7 @@
}
status_t status;
uint32_t replySizeStub = 0;
- if (replySize == nullptr) replySize = &replySizeStub;
+ if (replySize == nullptr || pReplyData == nullptr) replySize = &replySizeStub;
Return<void> ret = mEffect->command(cmdCode, hidlData, *replySize,
[&](int32_t s, const hidl_vec<uint8_t>& result) {
status = s;