Echo cancellation with webrtcdsp element across webrtcbins

I’m trying to get echo cancelleation to work with webrtcbin in an MacOS app, but haven’t had much success.

I’m basically trying to do this pipeline via webrtcbin. It works in the terminal:

gst-launch-1.0 osxaudiosrc buffer-time=30000 latency-time=10000 ! \ audio/x-raw,rate=48000,channels=2 ! \ webrtcdsp echo-cancel=true delay-agnostic=true echo-suppression-level=3 ! \ opusenc audio-type=voice ! \ rtpopuspay ! \ rtpopusdepay ! \ opusdec ! \ audioconvert ! \ audio/x-raw,channels=2 ! \ webrtcechoprobe ! \ osxaudiosink buffer-time=30000 latency-time=10000 sync=true

Note that I use two webrtcbins (in the same pipeline) - one for sending and one for receiving. Receiving part is added first with the probe.

I have experimented with adjusting the webrtcbin’s jitter buffers but to no avail. That setting is logged as the ‘delay’ by the webrtcechoprobe.

I have tried getting really low latency, adjusted slave-method, clocks etc.

Should it be possible using two webrtcbins - am I missing something?

​​

​​