aaudio: fix CTS for MMAP mode
Improve calculation of buffer capacity based on requested minimum.
Adjust timing of start() to reduce underflows.
Track ServiceEndpoints based on requested deviceId.
Fix getFramesRead() and flush() behavior.
Fix timeouts due to ClockModel lateness bug.
Misc cleanup.
Bug: 37755299
Test: test_aaudio.cpp
Change-Id: I637c16e87fbe14b6f28c60aeea0b9dfed965ecd0
diff --git a/services/oboeservice/AAudioServiceEndpoint.h b/services/oboeservice/AAudioServiceEndpoint.h
index 50bf049..c271dbd 100644
--- a/services/oboeservice/AAudioServiceEndpoint.h
+++ b/services/oboeservice/AAudioServiceEndpoint.h
@@ -48,6 +48,7 @@
aaudio_result_t stopStream(AAudioServiceStreamShared *sharedStream);
aaudio_result_t close();
+ int32_t getRequestedDeviceId() const { return mRequestedDeviceId; }
int32_t getDeviceId() const { return mStreamInternal->getDeviceId(); }
aaudio_direction_t getDirection() const { return mStreamInternal->getDirection(); }
@@ -81,6 +82,7 @@
AudioStreamInternal *mStreamInternal = nullptr;
int32_t mReferenceCount = 0;
+ int32_t mRequestedDeviceId = 0;
};
} /* namespace aaudio */