Media/WebRTC Audio Perf: Difference between revisions
No edit summary |
No edit summary |
||
| Line 46: | Line 46: | ||
== Ongoing Work == | == Ongoing Work == | ||
== Audio Performance Framework | == Audio Performance Framework == | ||
{{Bug|909524}} is ongoing effort to provide minimal components that serves as a good starting point | <p>{{Bug|909524}} is ongoing effort to provide minimal components that serves as a good starting point | ||
for carrying out Peer Connection audio quality analysis as part of Mozilla's Talos framework | for carrying out Peer Connection audio quality analysis as part of Mozilla's Talos framework.</p> | ||
Below picture captures the test setup for reporting Perceptual Evaluation of Speech Quality (PESQ) | Below picture captures the test setup for reporting Perceptual Evaluation of Speech Quality (PESQ) | ||
scores for audio played through the Peer Connection. | scores for audio played through the Peer Connection. | ||
| Line 58: | Line 59: | ||
Following sub-sections explain in details the various components for this setup. | Following sub-sections explain in details the various components for this setup. | ||
=== Talos === | === Talos === | ||
[[Talos]] is Mozilla's python performance testing framework that is usable on Windows, Mac and Linux. | <p>[[Talos]] is Mozilla's python performance testing framework that is usable on Windows, Mac and Linux. | ||
Talos provides automated way to start/stop Firefox , perform tests and capture results to be reported to the Mozilla's graphing server across various Firefox builds. | Talos provides automated way to start/stop Firefox , perform tests and capture results to be reported to the Mozilla's graphing server across various Firefox builds.</p> | ||
Talos is used in our setup to run media tests along with other start-up and page-loader performance tests. | <p>Talos is used in our setup to run media tests along with other start-up and page-loader performance tests.</p> | ||
=== MozCaptureStream and Peer Connection === | === MozCaptureStream and Peer Connection === | ||
Once we have the framework figured out to run automated media-tests, | <p>Once we have the framework figured out to run automated media-tests, the next step is deciding on how do we insert | ||
input audio file into WebRTC Peer Connection. For this purpose Mozilla's MediaStreamProcessing API '''mozCaptureStreamUntilEnded''' enables the <audio> element to produce MediaStream that consists | input audio file into the WebRTC Peer Connection.</p> | ||
of whatever the <audio> element is playing. Thus the stream produced by the <audio> element in this | <p>For this purpose Mozilla's MediaStreamProcessing API '''mozCaptureStreamUntilEnded''' enables the <audio> element to produce MediaStream that consists of whatever the <audio> element is playing. Thus the stream produced by the <audio> element in this fashion replaces the function of obtaining the media stream via the WebRTC GetUserMedia API. Finally, | ||
fashion replaces the function of obtaining the media stream via the WebRTC GetUserMedia API. Finally, | |||
the generated MediaStream is added to the local Peer Connection element via the addStream() API as shown | the generated MediaStream is added to the local Peer Connection element via the addStream() API as shown | ||
below | below.</p> | ||
<a | <code> | ||
// localAudio is an <audio> , localPC is a PeerConnection Object | |||
localAudio.src = "input.wav"; | |||
localAudioStream = localAudio.mozCaptureStreamUnitlEnded(); | |||
localAudio.play() | |||
localPC.addStream(localAudioStream) | |||
</code> | |||
<br> | |||
=== Audio Tools - PulseAudio, Sox, PESQ === | === Audio Tools - PulseAudio, Sox, PESQ === | ||
From the previous 2 sub-sections we have the following <br> | |||
*A way to run automated browser tests using Talos | |||
*A way a feeding audio from an input audio file audio input to the Peer Connection without having to use the GetUserMedia() API | |||
In order to record the output Audio and compute PESQ scores, | |||
=== Summary === | === Summary === | ||
Revision as of 01:19, 10 December 2013
Note: A lot of things described in here is still a Work in Progress and is expected to change over time.
Introduction
This efforts aims at building tools and frameworks for analyzing audio and video quality for the Firefox WebRTC implementation. WebRTC involves peer-to-peer rich multimedia communications across variety of end-user devices and network conditions. The framework must be able to provide necessary means to simulate/emulate these usage configurations in order to analyze the behavior of WebRTC implementation in the firefox.
Background
Typical WebRTC Media Pipeline
Below picture captures various components involved in the flow of
media captured from mic/camera till it gets transported. The reverse direction
follows a similar path back till the RTP packets gets delivered as raw media for
rendering.
With several moving components in the pipeline, it becomes necessary to analyze the impact these might have on the overall quality of the media being transmitted or rendered. For instance, the parts of the pipeline highlighted ( marked star) has potential to induce latency and impact quality of the encoded media. Thus, having possibilities to measure, analyze and account these impact has potential to improve the performance of the Firefox WebRTC implementation.
Not to forget, the pipeline doesn't capture impacts of latency induced due to network bandwidth, latency and congestion scenarios.
Scope
Following is wishlist of functionalities that the framework must be able to support eventually.
- Audio and Video Quality Analysis
- Quantitative measurements
- Qualitative measurements
- Latency Impact Analysis
- End to End Latency
- Latency impacts due to local processing
- Latency impacts under simulated constrained network conditions
- RTCP based analysis
- Codec Configuration Variability Analysis
- Sample Rate, Input and Output Channels, Reverse Channels, Echo Cancellation, Gain Control, Noise Suppression, Voice Activity Detection, Level Metrics, Delay, Drift compensation, Echo Metrics
- Video Frame-rate, bitrate, resolutions
- Hardware and Platform Variability Analysis
Ongoing Work
Audio Performance Framework
bug 909524 is ongoing effort to provide minimal components that serves as a good starting point for carrying out Peer Connection audio quality analysis as part of Mozilla's Talos framework.
Below picture captures the test setup for reporting Perceptual Evaluation of Speech Quality (PESQ) scores for audio played through the Peer Connection.
The idea here is to compute PESQ scores between the input audio file fed into the local Peer Connection and output audio audio file recorded at the play-out of the remote Peer Connection in a fully automated fashion. Following sub-sections explain in details the various components for this setup.
Talos
Talos is Mozilla's python performance testing framework that is usable on Windows, Mac and Linux. Talos provides automated way to start/stop Firefox , perform tests and capture results to be reported to the Mozilla's graphing server across various Firefox builds.
Talos is used in our setup to run media tests along with other start-up and page-loader performance tests.
MozCaptureStream and Peer Connection
Once we have the framework figured out to run automated media-tests, the next step is deciding on how do we insert input audio file into the WebRTC Peer Connection.
For this purpose Mozilla's MediaStreamProcessing API mozCaptureStreamUntilEnded enables the <audio> element to produce MediaStream that consists of whatever the <audio> element is playing. Thus the stream produced by the <audio> element in this fashion replaces the function of obtaining the media stream via the WebRTC GetUserMedia API. Finally, the generated MediaStream is added to the local Peer Connection element via the addStream() API as shown below.
// localAudio is an <audio> , localPC is a PeerConnection Object
localAudio.src = "input.wav";
localAudioStream = localAudio.mozCaptureStreamUnitlEnded();
localAudio.play()
localPC.addStream(localAudioStream)
Audio Tools - PulseAudio, Sox, PESQ
From the previous 2 sub-sections we have the following
- A way to run automated browser tests using Talos
- A way a feeding audio from an input audio file audio input to the Peer Connection without having to use the GetUserMedia() API
In order to record the output Audio and compute PESQ scores,
Summary
Open Issues
TODO Feature List
Analysis of tools and techniques for measuring WebRTC Audio Performance. This page is under construction. please come back later for more complete information
Background
Chrome Audio Perf
Following are the specific tests in Chrome that attempt to measure audio performance.
Audio Processing Per 10ms Analysis
This test instruments WebRTC's AudioProcessing Module under various configurations to measure mic to render audio processing for a 10ms audio frames. APM can be configured on the following
Sample Rate, Input and Output Channels, Reverse Channels, Echo Cancellation, Gain Control, Noise Suppression, Voice Activity Detection, Level Metrics, Delay, Drift compensation, Echo Metrics
Logic:
For every Input AudioFrame
time ProcessStream()
also apply component configuration
For every Output AudioFrame
time AnalyzeReverseStream()
Calculate Execution Time as average for all the 10ms frames processed and analyzed.
Audio Quality Voice Engine - E2E Code:run_audio_test.py
third_party/webrtc/tools/e2e_quality
This uses PulseAudio to setup virtual devices followed by comparison tool to measure the quality. This is based on VoiceEngine loopback call
WebRTC Recording Time
Code: webrtc_audio_device_unittest.cc
This uses VoEMediaProcess::Process() callback to act as interceptor
to audio frames at the recording path to time the recoding setup time
WebRTC Playout Setup Time This uses VoEMediaProcess::Process() callback to act as interceptor to audio frames before playback to time the setup time
WebRTC Loopback With Signal Processing WebRTC Loopback Without Signal Processing Both the tests uses loopback call with/without APM enabled. this loopback runs for 100 AudioFrames.