Adaptive resampling in gstaudiobasesink.c

Nicolas Dufresne nicolas at ndufresne.ca
Sun Oct 18 13:23:44 UTC 2020


Le sam. 17 oct. 2020 17 h 30, <charleslaub at sbcglobal.net> a écrit :

> Nicolas, this is the message/thread on adaptive resampling that I
> mentioned.
> -Charlie
>

I see, so he was proposing a new version of the callback, that would let
app implement their own. To preserve API, this would simply imply adding a
second callback. Certainly straight forward, but I think the approach does
not cover your (and my) concern about having something to Open Source
directly available.

I'd rather suggest looking into replacing the resampling code in the sink,
using GStreamer resampler or an external one, that is up to the author
really. Such contribution will be very welcome, it would with a decent cpu
allow easy and professional synchronized playback by anyone.


> -----Original Message-----
> From: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> On
> Behalf Of Pavel Hofman
> Sent: Wednesday, October 14, 2020 4:12 AM
> To: gstreamer-devel at lists.freedesktop.org
> Subject: Adaptive resampling in gstaudiobasesink.c
>
> Hi,
>
> Please do I understand correctly that the slave clock alignment methods in
> gstaudiobasesink.c never touch the actual samples and handle only various
> ways of adjusting pointers into the ringbuffer? Including the
> GST_AUDIO_BASE_SINK_SLAVE_CUSTOM method.
>
> Calculation of the master/slave clock difference is already available in
> gstaudiobasesink.c. Adaptive resampling (like used in PA, alsaloop,
> etc.) would require having two buffers with input and resampled samples:
> in -> resampling -> out. If the out buffer were available, calling e.g.
> src_process of libsamplerate would not be so difficult, IMO.
>
> Please how complicated would be to add the out buffer and let the
> implementations for specific audio outputs (e.g. GstAlsaSink) use it
> instead
> of the buffer with incoming data? I am afraid it is not trivial due to the
> "inheritance" within the code
>
> struct _GstAlsaSink {
>    GstAudioSink    sink;
> ..
>
> } .
>
> Perhaps the ring buffer would become the "out" buffer and the resampling
> code had to read from another buffer written by the "input" side of the
> plugin.
>
> Thanks a lot for any suggestions and comments.
>
> Best regards,
>
> Pavel.
> _______________________________________________
> 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/20201018/a5a7d6bb/attachment.htm>


More information about the gstreamer-devel mailing list