Webrtc plugin for AEC support

Nicolas Dufresne nicolas at ndufresne.ca
Mon Sep 11 21:50:18 UTC 2017


Le lundi 11 septembre 2017 à 13:17 -0700, be999 a écrit :
> Hi All,
> 
> I am trying to build a 2-way audio application with AEC.
> 
> A simple test application like following transports a sine wave over udp:
> gst-launch-1.0 audiotestsrc \
> ! audio/x-raw, format=S16LE, layout=interleaved, rate=48000, channels=1 \
> ! udpsink host=127.0.0.1 port=5006 sync=false \
> udpsrc port=5006 \
> ! audio/x-raw, format=S16LE, layout=interleaved, rate=48000, channels=1 \
> ! queue ! alsasink sync=false
> 
> As soon as I add the webrtc plugins in the pipeline, the source branch does
> not produce any packets anymore 
> GST_DEBUG=*udp*:6 gst-launch-1.0 audiotestsrc \
> ! audio/x-raw, format=S16LE, layout=interleaved, rate=16000, channels=1 \
> ! webrtcdsp \
> ! udpsink host=127.0.0.1 port=5006 sync=false \

You need async=FALSE here, so that udpsrc does not wait for alsasink to
get a buffer before going to playing. With the proper race, the first
buffer might be missed by the udpsrc (depend on init order and kernel
queues).

> udpsrc port=5006 \
> ! audio/x-raw, format=S16LE, layout=interleaved, rate=16000, channels=1 \
> ! webrtcechoprobe \
> ! alsasink sync=false
> 
> Any idea why this is happening?
> 

Be aware that this pipeline is totally invalid for how the webrtc echo
canceller works. For echo cancelling, you need live source,
synchronization and timestamp. You have a non-live source (try is-
live=1), non synching sink (sync=false) and your transport protocol
(raw over UDP) looses the timestamps (try using RTP encapsulation).

Here's a "corrected" pipeline, note that the fixes wave is pretty hard
for a voice echo canceller, so you'll notice some noise still.

gst-launch-1.0 \
  audiotestsrc is-live=1 ! audio/x-raw,rate=16000,channels=1 \
    ! webrtcdsp ! audioconvert ! rtpL16pay \
    ! udpsink host=127.0.0.1 port=5006 async=FALSE \
  udpsrc port=5006 caps="application/x-rtp,channels=1,clock-rate=16000" \
    ! rtpjitterbuffer latency=10 ! rtpL16depay ! audioconvert \
    ! webrtcechoprobe ! alsasink

regards,
Nicolas
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170911/39e848ec/attachment-0001.sig>


More information about the gstreamer-devel mailing list