Commit 03573630 authored by henrika's avatar henrika

Adding more detailed UMA histogram for detection of output audio glitches.

BUG=NONE
TEST=Manual test of WebRTC clients under heavy load.
R=asvitkine@chromium.org, tommi@chromium.org

Review URL: https://codereview.chromium.org/534533002

Cr-Commit-Position: refs/heads/master@{#293099}
parent 0db57093
......@@ -9,12 +9,32 @@
#include "base/command_line.h"
#include "base/memory/shared_memory.h"
#include "base/metrics/histogram.h"
#include "base/strings/stringprintf.h"
#include "content/browser/renderer_host/media/media_stream_manager.h"
#include "content/public/common/content_switches.h"
#include "media/audio/audio_buffers_state.h"
#include "media/audio/audio_parameters.h"
using media::AudioBus;
namespace {
// Used to log if any audio glitches have been detected during an audio session.
// Elements in this enum should not be added, deleted or rearranged.
enum AudioGlitchResult {
AUDIO_RENDERER_NO_AUDIO_GLITCHES = 0,
AUDIO_RENDERER_AUDIO_GLITCHES = 1,
AUDIO_RENDERER_AUDIO_GLITCHES_MAX = AUDIO_RENDERER_AUDIO_GLITCHES
};
void LogAudioGlitchResult(AudioGlitchResult result) {
UMA_HISTOGRAM_ENUMERATION("Media.AudioRendererAudioGlitches",
result,
AUDIO_RENDERER_AUDIO_GLITCHES_MAX + 1);
}
} // namespace
namespace content {
AudioSyncReader::AudioSyncReader(base::SharedMemory* shared_memory,
......@@ -47,6 +67,18 @@ AudioSyncReader::~AudioSyncReader() {
100.0 * renderer_missed_callback_count_ / renderer_callback_count_;
UMA_HISTOGRAM_PERCENTAGE(
"Media.AudioRendererMissedDeadline", percentage_missed);
// Add more detailed information regarding detected audio glitches where
// a non-zero value of |renderer_missed_callback_count_| is added to the
// AUDIO_RENDERER_AUDIO_GLITCHES bin.
renderer_missed_callback_count_ > 0 ?
LogAudioGlitchResult(AUDIO_RENDERER_AUDIO_GLITCHES) :
LogAudioGlitchResult(AUDIO_RENDERER_NO_AUDIO_GLITCHES);
std::string log_string = base::StringPrintf(
"ASR: number of detected audio glitches=%ld",
renderer_missed_callback_count_);
MediaStreamManager::SendMessageToNativeLog(log_string);
DVLOG(1) << log_string;
}
// media::AudioOutputController::SyncReader implementations.
......
......@@ -11067,6 +11067,14 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary>
</histogram>
<histogram name="Media.AudioRendererAudioGlitches" enum="AudioGlitchResult">
<owner>henrika@chromium.org</owner>
<summary>
Captures if render-side audio glitches are detected or not. Sampled when a
low-latency output audio stream is destructed.
</summary>
</histogram>
<histogram name="Media.AudioRendererEvents" enum="AudioRendererEvents">
<owner>scherkus@chromium.org</owner>
<summary>Captures statistics for various AudioRendererImpl events.</summary>
......@@ -37779,6 +37787,11 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<int value="8" label="k1920"/>
</enum>
<enum name="AudioGlitchResult" type="int">
<int value="0" label="No audio glitches"/>
<int value="1" label="Audio glitches"/>
</enum>
<enum name="AudioInputSilenceReport" type="int">
<int value="0" label="No measurement"/>
<int value="1" label="Only audio"/>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment