rtpbin: ts adjustment needs filtering/smoothing
Nicolas Dufresne
nicolas at ndufresne.ca
Sat Oct 17 17:13:21 UTC 2020
Le sam. 17 oct. 2020 13 h 00, <charleslaub at sbcglobal.net> a écrit :
> >Perhaps you didn't notice the default slave-method, which is skew. Skew
> will remove or fill with silence the audio stream to fix the
> synchronization >between the audio card clock and the NTP clock. As it does
> that naively, you will ear ticks and pop. You'll also notice the resample
> method, which in >theory should work, but in practice the resampler there
> is buggy and the adjustment too aggressive. Some work is needed there to
> make it work.
>
> As you say "buggy" is an understatement - it is TERRIBLE. It's essentially
> unlistenable because the "over aggressive" action introduces a warble to
> the music, like you are listening underwater.
>
> So, the only solution that comes to mind is custom slaving, which is not
> available to the general public? Hmmmm.
>
Would be nice to tone down a little. The code is open source, the hard work
of plumbing this is in place, but no one felt like contributing a fix for
this (resampling is expensive, so mostly for desktop, were audio deamon
already do a much better job). And we are aware it never worked.
As for the custom slaving mode, it's publicly available, but you need audio
HW with a controllable PLL, and the rounding + smoothing in such case will
always be HW specific.
> Perhaps in place of the buggy ALSA resampler, you could implement
> asynchronous resampling? This was
This is pure C, there is no ALSA there. It is about 50 line of code. We
have another resampler now, but no one looked it up to see if it can be
used more dynamicly then how it is used in audioresample element.
brought up in a post a couple of days ago in this list under the subject
> "Adaptive resampling in gstaudiobasesink.c". I think it would be very
> worthwhile and would really improve the audio performance of Gstreamer in
> general.
>
> Could you or someone follow up on that topic?
>
I'm sorry, I don't remember this thread. Do you have links ? Perhaps a
merge request would get more attention.
> -Charlie
>
> -----Original Message-----
> From: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> On
> Behalf Of Nicolas Dufresne
> Sent: Saturday, October 17, 2020 10:50 AM
> To: Discussion of the development of and with GStreamer <
> gstreamer-devel at lists.freedesktop.org>
> Subject: Re: rtpbin: ts adjustment needs filtering/smoothing
>
> Perhaps you didn't notice the default slave-method, which is skew. Skew
> will remove or fill with silence the audio stream to fix the
> synchronization between the audio card clock and the NTP clock. As it does
> that naively, you will ear ticks and pop. You'll also notice the resample
> method, which in theory should work, but in practice the resampler there is
> buggy and the adjustment too aggressive. Some work is needed there to make
> it work.
>
> Well known companies using GStreamer have introduced the "custom"
> slave-method. Along with
> gst_audio_base_sink_set_custom_slaving_callback(), you get notified per
> units of the drift. These vendor controlls the HW, so instead of
> resampling, they will adjust the audio clock PLL in order to lock the audio
> to the system/ntp/ptp/etc. clock in use.
> >
> > I would be happy to provide my pipelines if that would be helpful,
> > provide measurement data, or any other info that might lead to a
> > solution.
> >
> > -Charlie
> >
> > _______________________________________________
> > gstreamer-devel mailing list
> > gstreamer-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20201017/c299b575/attachment-0001.htm>
More information about the gstreamer-devel
mailing list