audio: Fix remote submix behavior with multiple inputs
Align the behavior of the new implementation with the legacy
implementation in the case when the client opens multiple
input streams on the same remote submix device.
Reduce the HAL buffer size to match legacy behavior.
Bug: 264712385
Test: atest CtsVirtualDevicesTestCases --test-filter=".*VirtualAudioTest.*"
(cherry picked from commit a83c8a5518234d0744f7453222db3cf2d8b876c2)
Change-Id: I6f5e6a2c133059c66269b1bdd8a30392db282c4d
diff --git a/audio/aidl/default/r_submix/ModuleRemoteSubmix.cpp b/audio/aidl/default/r_submix/ModuleRemoteSubmix.cpp
index 3e8dd7c..2f42889 100644
--- a/audio/aidl/default/r_submix/ModuleRemoteSubmix.cpp
+++ b/audio/aidl/default/r_submix/ModuleRemoteSubmix.cpp
@@ -112,7 +112,7 @@
static constexpr int32_t kMaxLatencyMs =
(r_submix::kDefaultPipeSizeInFrames * 1000) / r_submix::kDefaultSampleRateHz;
static constexpr int32_t kMinLatencyMs = kMaxLatencyMs / r_submix::kDefaultPipePeriodCount;
- return (kMaxLatencyMs + kMinLatencyMs) / 2;
+ return kMinLatencyMs;
}
} // namespace aidl::android::hardware::audio::core