webrtcdsp echo cancellation not working

Nicolas Dufresne nicolas at ndufresne.ca
Sun Jan 17 23:29:05 UTC 2021


Le dim. 17 janv. 2021 02 h 15, nivanov <2centnik at gmail.com> a écrit :

> Thank you! Buffer-time was definitely the key here. However, I had to set
> the
> buffer-time to 20ms (20000) before I could get semi-acceptable results. And
> it's still just a little bit too much - it catches a good chunk of the
> echo,
> but I can still hear some parts. The size of the parts shrink down as the
> delay goes down, but for some reason, if I set the buffer-time to something
> less than 20000, my stream stops recording altogether. It doesn't crash,
> but
> it does not record any sound whatsoever:
>

The buffer-time must at least be twice the latency-time for things to work.



> gst-launch-1.0 \
> rtpbin name=rtpbin latency=100 \
> udpsrc port=50000 caps="application/x-rtp, media=audio, encoding-name=OPUS,
> clock-rate=48000" ! rtpbin.recv_rtp_sink_0 \
> udpsrc port=50001 caps="application/x-rtcp" ! rtpbin.recv_rtcp_sink_0 \
> rtpbin. ! rtpopusdepay ! queue ! opusdec ! audioresample !
> audio/x-raw,format=S16LE,layout=interleaved,rate=16000,channels=1 !
> webrtcechoprobe ! alsasink \
> alsasrc device=plughw:0,0 buffer-time=20000 !
>

Here you configure the alsasrc, I was particularly aiming at alsasink in my
comment. I realise it wasn't clear.

audio/x-raw,format=S16LE,layout=interleaved,rate=16000,channels=1 !
> webrtcdsp noise-suppression-level=high echo-suppression-level=high ! volume
> volume=10 ! volume volume=3 ! \
> queue ! opusenc ! rtpopuspay ! udpsink host=127.0.0.1 port=8005
>
> Note that I increased the echo-suppresion-level to high and also put the
> volume amplification after the DSP - this allowed me to have the speaker at
> the maximum volume while maintaining acceptable results. Do you know


Any modifications to the stream (volume, resampling format conversion) may
distort the signal and reduce echo cancellation efficiency. So volume after
is just the right and logical thing to do.

 why


>
>
> buffer-time cannot be set below 20000


I also tried enabling delay-

agnosticccccccc,
> but that made things a lot worse - I think I'm better off leaving that flag
> off. Thank you for your help so far!


>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> 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/20210117/dffb91de/attachment-0001.htm>


More information about the gstreamer-devel mailing list