Display pipe underrun counters in dumpsys
The normal mixer writes it's submix to a pipe, which is read by the fast
mixer. Now dumpsys media.audio_flinger display the raw underrun counters
when fast mixer tries to pull from the pipe but doesn't get enough frames.
Change-Id: I72505f149f9e12802784da654a651d43734e1c79
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 9383864..7e15823 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1579,6 +1579,12 @@
}
}
write(fd, result.string(), result.size());
+
+ // These values are "raw"; they will wrap around. See prepareTracks_l() for a better way.
+ FastTrackUnderruns underruns = getFastTrackUnderruns(0);
+ fdprintf(fd, "Normal mixer raw underrun counters: partial=%u empty=%u\n",
+ underruns.mBitFields.mPartial, underruns.mBitFields.mEmpty);
+
return NO_ERROR;
}
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 8820a92..de3561d 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -1170,8 +1170,7 @@
public:
virtual bool hasFastMixer() const { return mFastMixer != NULL; }
virtual FastTrackUnderruns getFastTrackUnderruns(size_t fastIndex) const {
- ALOG_ASSERT(0 < fastIndex &&
- fastIndex < FastMixerState::kMaxFastTracks);
+ ALOG_ASSERT(fastIndex < FastMixerState::kMaxFastTracks);
return mFastMixerDumpState.mTracks[fastIndex].mUnderruns;
}
};