webrtcdsp / webrtcechoprobe on macos
Nicolas Dufresne
nicolas at ndufresne.ca
Fri Mar 3 18:06:01 UTC 2023
Hi,
Le jeudi 02 mars 2023 à 20:04 +0100, jordi domenech flores via gstreamer-devel a
écrit :
> Hi!
> I've been trying for a while to run a simple hello world with webrtcdsp /
> webrtcechoprobe without success. tbh I'm far from an expert, just trying to
> study and understand gst, sorry if I'm being too naive...
>
> I'm on macos M1 using latest stable (1.22) and the pipeline is:
>
> gst-launch-1.0 -v \
> osxaudiosrc buffer-time=20000 ! \
Unlikely to be the problem, but the latency on audio src is controlled by
latency-time. Normally changing latency-time (size of captured chunk) and
buffer-time (how many chunk the src holds before loosing data) happens in
tandem, we try to maintain some sort of 3/4x multiplier.
> queue ! \
> webrtcdsp ! \
> webrtcechoprobe ! \
> osxaudiosink buffer-time=20000
> Also tried the bare minimal:
>
> gst-launch-1.0 -v \
> osxaudiosrc ! \
> webrtcdsp ! \
> webrtcechoprobe ! \
> osxaudiosink
>
> Actually, it's just a "port" of docs:
> https://gstreamer.freedesktop.org/documentation/webrtcdsp/webrtcdsp.html?gi-language=c#example-launch-line
>
> No matter what I do, I always get infinte echo until distortion. What's
> wrong?!
> Hope somebody can explain what's the problem... In any case, thanks for your
> time!
The webrtcdsp/webrtcechoprobe in default configuration relies on very accurate
latency reporting from the element, or a very low latency, but this is never the
case with GStreamer. Also, it will not function if the rountrip latency is
beyond 400ms. I can't tell what's wrong on MacOS, could be software bug, bad
documentation interpretation, but if the latency is wrong, you may try your luck
with delay-agnostic mode (its a property you can turn on). Its maybe leak some
echo initially, but with higher CPU usage, it tends to figure-out the delay by
itself. I recommend that you combine this with AGC or your own kind of noise
gate.
Note that I did some basic verification here on Linux, just in case there would
be a recent regression, but with the following synthetic test, echo stops passed
about 1-2 line, I was using USB microphone and native speakers so that I have
two devices on different clocks (a worst case).
gst-launch-1.0 pulsesrc device=... ! webrtcdsp ! webrtcechoprobe ! pulsesink
device=...
And with delay-agnostic set, it task at least 15s to lock in. Note that with
such a synthetic test you are looking for a single echo on every try.
Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230303/d75538df/attachment.htm>
More information about the gstreamer-devel
mailing list