Add audio attributes info when starting aaudio tracks on MMAP mix.
In aaudio, when adding tracks to mixed stream, it is needed to update
audio attributes to HAL whenever the tracks are added or removed.
Currently, only the audio attributes used to open the stream will be
sent to the HAL. In that case, adding audio attributes of the clients
when starting the stream can help solve the problem. In audio flinger,
the client's audio attributes will be used to create MmapTrack.
Test: play multiple aaudio tracks, add log
Bug: 77279923
Change-Id: Ic1c536049e194a2bb7513425ee4828d52769d27f
diff --git a/services/oboeservice/AAudioService.cpp b/services/oboeservice/AAudioService.cpp
index af8c67b..aba8e08 100644
--- a/services/oboeservice/AAudioService.cpp
+++ b/services/oboeservice/AAudioService.cpp
@@ -310,14 +310,15 @@
}
aaudio_result_t AAudioService::startClient(aaudio_handle_t streamHandle,
- const android::AudioClient& client,
- audio_port_handle_t *clientHandle) {
+ const android::AudioClient& client,
+ const audio_attributes_t *attr,
+ audio_port_handle_t *clientHandle) {
sp<AAudioServiceStreamBase> serviceStream = convertHandleToServiceStream(streamHandle);
if (serviceStream.get() == nullptr) {
ALOGE("%s(), illegal stream handle = 0x%0x", __func__, streamHandle);
return AAUDIO_ERROR_INVALID_HANDLE;
}
- aaudio_result_t result = serviceStream->startClient(client, clientHandle);
+ aaudio_result_t result = serviceStream->startClient(client, attr, clientHandle);
return checkForPendingClose(serviceStream, result);
}