class ClockSyncPipelineTest
Defined at line 37 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc
Protected Members
TypedFormat format_
VirtualOutput<ASF::FLOAT> * output_
AudioRendererShim<ASF::FLOAT> * renderer_
static const int32_t kFrameRate
static const int64_t kPayloadFrames
static const int64_t kPacketFrames
static audio_stream_unique_id kUniqueId
Protected Methods
void ClockSyncPipelineTest ()
Defined at line 50 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc
void Init (int32_t clock_slew_ppm, int64_t num_frames_input)
int64_t ConvergenceFrames ()
double NumFramesOutput (int32_t clock_slew_ppm, int64_t num_frames_input)
void TearDown ()
Defined at line 52 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc
AudioBuffer<ASF::FLOAT> Impulse (float value, int64_t pre_silence_frames, int64_t post_silence_frames)
Defined at line 64 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc
AudioBuffer<ASF::FLOAT> SilentBuffer (int64_t frames)
Defined at line 71 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc
AudioBuffer<ASF::FLOAT> FillBuffer (int64_t frames, float value)
Defined at line 75 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc
int64_t PreRampFrames ()
For a signal change occurring at frame T, how far BEFORE that frame will the effects of that
change be reflected in the output. We use no effects; this comes from SincSampler only.
Defined at line 85 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc
int64_t PostRampFrames ()
For a signal change occurring at frame T, how far AFTER that frame will the output reflect some
effect of the previous signal. We use no effects; this comes from SincSampler only.
Defined at line 94 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc
int64_t TotalRampFrames ()
Maximum number of frames needed for a transition between two adjacent signals. At the beginning
of this interval, the output begins to reflect the new signal; only at the end of this interval
is the full effect shown. During this interval, the output is a cross-fading mixture of the
preceding signal and the new signal. We use no effects; this comes from SincSampler only.
These are SOURCE frames, but rates are so near unity that we safely use them interchangeably.
Defined at line 105 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc
int64_t OffsetFrames ()
Offset of the first audio sample. This should be greater than TotalRampFrames() so that there
is silence and then transitional frames at the start of the output, following by the signal.
These are SOURCE frames, but rates are so near unity that we safely use them interchangeably.
Defined at line 110 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc
AudioBuffer<ASF::FLOAT> SnapshotRingBuffer (int64_t offset_before_output_start)
Capture the ring buffer and rotate it leftward by the given offset, so the output starts at [0]
Defined at line 119 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc
Peak FindPeak (AudioBufferSlice<ASF::FLOAT> slice)
Return the index of the peak sample, relative to the first frame in the slice.
Defined at line 132 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc
void CheckClockRate (const zx::clock & clock, int32_t clock_slew_ppm)
Verify that the clock for this renderer is running at the expected rate
Defined at line 147 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc
void RunImpulseTest (int32_t clock_slew_ppm, int64_t frames_between_impulses)
Send two impulses separated by frames_between_impulses, using a reference clock with the given
slew. The output should contain two impulses separated by NumFramesOutput.
This test validates that time is correctly translated between the two clocks.
This test validates the following, with two 1-frame impulses during clock synchronization:
A, The impulses are peak-detected in the output, with expected magnitudes;
B. The impulse-to-impulse interval is the expected number of frames;
C. The renderer clock is running at the expected rate.
All measurements use tolerance ranges except where explicitly stated as exact.
Defined at line 172 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc
void RunStepTest (int32_t clock_slew_ppm, int64_t num_frames_input)
Send a flat signal (step function) of size num_frames_input, using a reference clock with the
given slew. The output should contain an equivalent step function of size NumFramesOutput.
Note, the exact values are not important. The primary goal of this test is to ensure the output
does not have any dropped frames. A buggy mixer might drop frames if there is a gap between mix
calls, specifically when the destination clock is running faster than the source clock.
This test validates the following, rendering a step function during clock synchronization:
A. The output step signal starts at the expected frame;
B. The output step signal has the expected magnitude for its entirety (no dropouts);
C. The output step signal ends at the expected frame;
D. Subsequent output signal (after PostRampFrames) is precisely zero;
E. The renderer clock is running at the expected rate.
All measurements use tolerance ranges except where explicitly stated as exact.
Defined at line 259 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc
void RunSineTest (int32_t clock_slew_ppm, int64_t num_frames_to_analyze, int32_t input_freq)
Send a sine wave using a clock with given slew. The output should be a sine wave at slewed
frequency. Each sinusoidal period contains (num_frames_to_analyze / input_freq) frames.
This test validates the following, rendering a sinusoid during clock synchronization:
A. The output signal's magnitude is essentially unattenuated (within tolerance);
B. The output signal's center frequency is shifted by exactly the expected amount;
C. No other frequencies exceed the noise floor threshold (with a few exceptions);
D. The above-noise-floor frequencies are clustered around the primary output frequency;
E. The width of that cluster (from leftmost to rightmost) is below a certain "peak width";
F. The renderer clock is running at the expected rate (within a certain tolerance).
Defined at line 364 of file ../../src/media/audio/audio_core/test/api/audio_clock_pipeline_test.cc