audio: Fix AudioRecordTest#testTimestamp CTS on CF

After experimenting, it seems that the input poll
is more stable after the PCM input on CF has just
been opened. Since calling 'flush' on an input
stream puts it into the 'STANDBY' state, explicitly
call 'StreamAlsa::standby' after 'flush' in the
primary input stream implementation.

Bug: 340899868
Bug: 362852052
Bug: 372951987
Test: atest CtsMediaAudioTestCases
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ic1df6835ce00323ca3f0905ea46d3bc151e05fc4
This commit is contained in:
Mikhail Naganov
2024-10-11 13:55:54 -07:00
parent 25876eb8d1
commit 05fc6aa383

View File

@@ -56,7 +56,9 @@ StreamPrimary::StreamPrimary(StreamContext* context, const Metadata& metadata)
}
::android::status_t StreamPrimary::flush() {
return isStubStreamOnWorker() ? mStubDriver.flush() : StreamAlsa::flush();
RETURN_STATUS_IF_ERROR(isStubStreamOnWorker() ? mStubDriver.flush() : StreamAlsa::flush());
// TODO(b/372951987): consider if this needs to be done from 'StreamInWorkerLogic::cycle'.
return mIsInput ? standby() : ::android::OK;
}
::android::status_t StreamPrimary::pause() {