[gstreamer-bugs] [Bug 591934] timestamp drift in audioresample

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Aug 18 01:41:13 PDT 2009


http://bugzilla.gnome.org/show_bug.cgi?id=591934



--- Comment #5 from Kipp <kcannon at ligo.caltech.edu> 2009-08-18 08:41:10 UTC ---
Here's a before and after comparison of the resampler (plots to follow).  I ran
the following pipeline without and without the patch.  The "nxydump" element is
a thing we've got going locally that converts an audio stream into an ascii,
n-column, "time val val val ..." dump that can be plotted with grace.  I should
probably consider proposing it for inclusion in gstreamer (-bad?) because it's
a useful debugging tool.

Anyway, what's going on here is the sample rates of 16384 Hz and 4096 Hz mean
that individual samples don't fall on integer nanosecond boundaries (some do,
but not all), and in particular with 10 samples per buffer the buffer
boundaries don't fall on integer nanoseconds.  The current version of the
resampler drifts its timestamps when fed a stream like this.  The patch fixes
it by using the integer sample count as the clock for the stream (always tells
the right time because sample count really is an integer), and computes
timestamps and durations for each buffer from that with rounding.

Note in particular that the patch should assign durations to each buffer that
are rounded so that any downstream element that does the "silly" thing of
keeping a running total of buffer durations actually knows the correct total
elapsed time in the stream (to the nearest nanosecond).

gst-launch \
        audiotestsrc wave=0 freq=1024 samplesperbuffer=10 num-buffers=1000000 \
        ! audio/x-raw-float, channels=1, width=64, rate=16384 \
        ! tee name=input \
        ! audioresample \
        ! audio/x-raw-float, rate=4096 \
        ! lal_nxydump start-time=0 stop-time=1000000000000 \
        ! queue ! filesink buffer-mode=2 location="dump_out.txt" \
        input. \
        ! lal_nxydump start-time=0 stop-time=1000000000000 \
        ! queue ! filesink buffer-mode=2 location="dump_in.txt"

-- 
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.




More information about the Gstreamer-bugs mailing list