audiotestsrc: Improvements to the "ticks" wave
authorCarlos Rafael Giani <dv@pseudoterminal.org>
Sat, 29 Dec 2018 09:28:10 +0000 (11:28 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 10 Jan 2019 16:15:47 +0000 (16:15 +0000)
commitc656cfb170bfa988abf4d69e7432d2c35b528c73
treedda854b72e6cadc0ee20dd4c48604631e6c84f6f
parenta52ad2078a782f358d917174ca4fe1f4a35b41d3
audiotestsrc: Improvements to the "ticks" wave

(Initially discussed in
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/305)

The ticks waveform can be useful for audio synchronization diagnostics
and other cases where the time offset between waveforms is important.
However, in its current form, it is too limited, and has problems with
discontinuities, which result in severe artifacts when this waveform
is output by a DAC.

This patch fixes some discontinuities and considerably expand the ticks
waveform's flexibility. They also introduce the notion of a "marker tick";
every Nth tick can have a different amplitude (usually one that is larger
than the others). This is useful for combining frequent oscilloscope
triggering with large time offset detection. For example, without marker
ticks, the tick intervals must not be too small, otherwise the maximum time
offset that can be unambiguously detected is quite small (for example, if
the interval is 50ms, then no time offset larger than 25ms can be
unambiguously recognized). If the tick intervals are too far apart, then
no sudden changes can be clearly observed, since the oscilloscope is not
updated quickly enough. But with marker ticks, this is not an issue: If
there's for example a tick every 100 ms, then the oscilloscope can be
triggered every 100 ms. And, if every 20th tick is a marker tick, then
time offsets of up to 1 second can be discovered, even though the time
between ticks is 100 ms.

The patch also applies some minor cleanup to the audiotestsrc documentation.
gst/audiotestsrc/gstaudiotestsrc.c
gst/audiotestsrc/gstaudiotestsrc.h