From 6e6704c06d61bc356e30c164081e5bcffb37920c Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Thu, 3 Jul 2014 10:20:00 -0700 Subject: [PATCH] Improve dumpsys for capture threads Show per-track sample rate, and whether there is a fast capture thread Change-Id: If6a08a40d1eeba0690aa8da3c541f845ec101b7f --- services/audioflinger/Threads.cpp | 4 +++- services/audioflinger/Tracks.cpp | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 0f01b02c00..e17aa989e8 100755 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -4783,7 +4783,7 @@ AudioFlinger::RecordThread::RecordThread(const sp& audioFlinger, , mPipeFramesP2(0) // mPipeMemory // mFastCaptureNBLogWriter - , mFastTrackAvail(true) + , mFastTrackAvail(false) { snprintf(mName, kNameLength, "AudioIn_%X", id); mNBLogWriter = audioFlinger->newWriter_l(kLogSize, mName); @@ -4895,6 +4895,7 @@ AudioFlinger::RecordThread::RecordThread(const sp& audioFlinger, // FIXME #endif + mFastTrackAvail = true; } failed: ; @@ -5745,6 +5746,7 @@ void AudioFlinger::RecordThread::dumpInternals(int fd, const Vector& a } else { dprintf(fd, " No active record clients\n"); } + dprintf(fd, " Fast capture thread: %s\n", hasFastCapture() ? "yes" : "no"); dprintf(fd, " Fast track available: %s\n", mFastTrackAvail ? "yes" : "no"); dumpBase(fd, args); diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp index cacb066e80..eb3e6b4d2f 100644 --- a/services/audioflinger/Tracks.cpp +++ b/services/audioflinger/Tracks.cpp @@ -1987,12 +1987,12 @@ void AudioFlinger::RecordThread::RecordTrack::invalidate() /*static*/ void AudioFlinger::RecordThread::RecordTrack::appendDumpHeader(String8& result) { - result.append(" Active Client Fmt Chn mask Session S Server fCount Resampling\n"); + result.append(" Active Client Fmt Chn mask Session S Server fCount SRate\n"); } void AudioFlinger::RecordThread::RecordTrack::dump(char* buffer, size_t size, bool active) { - snprintf(buffer, size, " %6s %6u %3u %08X %7u %1d %08X %6zu %10d\n", + snprintf(buffer, size, " %6s %6u %3u %08X %7u %1d %08X %6zu %5u\n", active ? "yes" : "no", (mClient == 0) ? getpid_cached : mClient->pid(), mFormat, @@ -2001,7 +2001,7 @@ void AudioFlinger::RecordThread::RecordTrack::dump(char* buffer, size_t size, bo mState, mCblk->mServer, mFrameCount, - mResampler != NULL); + mSampleRate); } -- 2.11.0