AudioFlinger: allow small requested capacity for FAST path
AudioFlinger used to reject requests for the low latency FAST
path when the capacity was != mPipeFramesP2.
But if the caller requests < mPipeFramesP2 than we can just bump it
up to mPipeFramesP2 because the API allows that.
For example, on Pixel, mPipeFramesP2 is 4096
Bug: 80308183
Test: adb shell input_monitor_callback -pl -b4000 -m1
Test: should see performance mode 12 for LOW_LATENCY
Change-Id: I987067910de3194fb52370d0ea1626cffad6248c
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 59ced26..711a6dd 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -7454,8 +7454,10 @@
// we formerly checked for a callback handler (non-0 tid),
// but that is no longer required for TRANSFER_OBTAIN mode
//
- // frame count is not specified, or is exactly the pipe depth
- ((frameCount == 0) || (frameCount == mPipeFramesP2)) &&
+ // Frame count is not specified (0), or is less than or equal the pipe depth.
+ // It is OK to provide a higher capacity than requested.
+ // We will force it to mPipeFramesP2 below.
+ (frameCount <= mPipeFramesP2) &&
// PCM data
audio_is_linear_pcm(format) &&
// hardware format