AudioFlinger: do not enter standby on offload stream when underrunning
When an offloaded track has been underrunning long enough for the
stream to enter standby, do not enter standby: entering standby will
release DSP resources and cause problems if we resume after recovering
from the underrun.
Bug: 322874013
Fixes: 333970720
Test: offload playback test with forced underrrun
Change-Id: I942fd3f401c226977f4f0684ed0e5a7a03db735d
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index 8fa4b06..c40f795 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -1881,6 +1881,12 @@
signalClientFlag(CBLK_DISABLED);
}
+bool Track::isDisabled() const {
+ audio_track_cblk_t* cblk = mCblk;
+ return (cblk != nullptr)
+ && ((android_atomic_release_load(&cblk->mFlags) & CBLK_DISABLED) != 0);
+}
+
void Track::signalClientFlag(int32_t flag)
{
// FIXME should use proxy, and needs work