AudioFlinger: Add record frames read to dumpsys
Allows comparison to playback frames written for patches.
Test: audioflinger dumpsys
Change-Id: I2ef0ccbc36819d48b05756115de70f5a24a2c2cd
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index cd585f5..f4f48bb 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -6833,6 +6833,7 @@
goto unlock;
}
ALOG_ASSERT(framesRead > 0);
+ mFramesRead += framesRead;
#ifdef TEE_SINK
(void)mTee.write((uint8_t*)mRsmpInBuffer + rear * mFrameSize, framesRead);
@@ -7457,6 +7458,7 @@
audio_input_flags_t flags = input != NULL ? input->flags : AUDIO_INPUT_FLAG_NONE;
dprintf(fd, " AudioStreamIn: %p flags %#x (%s)\n",
input, flags, inputFlagsToString(flags).c_str());
+ dprintf(fd, " Frames read: %lld\n", (long long)mFramesRead);
if (mActiveTracks.isEmpty()) {
dprintf(fd, " No active record clients\n");
}
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h
index 2ab0bee..705efbc 100644
--- a/services/audioflinger/Threads.h
+++ b/services/audioflinger/Threads.h
@@ -1601,6 +1601,8 @@
bool mFastTrackAvail; // true if fast track available
// common state to all record threads
std::atomic_bool mBtNrecSuspended;
+
+ int64_t mFramesRead = 0; // continuous running counter.
};
class MmapThread : public ThreadBase