Error resolution or example for webrtcdsp with webrtcechoprobe

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Error resolution or example for webrtcdsp with webrtcechoprobe

ankit
Hello,

I am using calling functionality with rtp. But I am facing issue related to
echo when the call is ongoing.
To prevent this I added feature push to talk on temporary basis.
But to get rid of it, I found that webrtcdsp with webrtcechoprobe is a good
option.

So after integration in my C++ application when I run my app I am getting
errors as below:

GST::  "No echo probe with name webrtcechoprobe0 found."   164
GST::  "../../../gst-plugins-bad-1.12.4/ext/webrtcdsp/gstwebrtcdsp.cpp(523):
gst_webrtc_dsp_start (): /GstPipeline:audio_tx/GstWebrtcDsp:audio_rtc_dsp"

FYI : I have taken two gst elements for webrtcdsp & webrtcechoprobe but I
think when I am linking them at that time I am getting error as above. I am
using Gstreamer 1.12.4.

Please suggest any resolution or example, because on the forum there is not
any example related to webrtcdsp echo cancellation with c++.

Regards,
Ankit




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Error resolution or example for webrtcdsp with webrtcechoprobe

Nicolas Dufresne-5


Le mar. 19 mars 2019 06 h 11, ankit <[hidden email]> a écrit :
Hello,

I am using calling functionality with rtp. But I am facing issue related to
echo when the call is ongoing.
To prevent this I added feature push to talk on temporary basis.
But to get rid of it, I found that webrtcdsp with webrtcechoprobe is a good
option.

So after integration in my C++ application when I run my app I am getting
errors as below:

GST::  "No echo probe with name webrtcechoprobe0 found."   164
GST::  "../../../gst-plugins-bad-1.12.4/ext/webrtcdsp/gstwebrtcdsp.cpp(523):
gst_webrtc_dsp_start (): /GstPipeline:audio_tx/GstWebrtcDsp:audio_rtc_dsp"

FYI : I have taken two gst elements for webrtcdsp & webrtcechoprobe but I
think when I am linking them at that time I am getting error as above. I am
using Gstreamer 1.12.4.

Please suggest any resolution or example, because on the forum there is not
any example related to webrtcdsp echo cancellation with c++.

Have you read:



Appart couple of cast, C or C++ should be identical. Make sure you understand why there is two elements and what's their purpose. You cannot randomly place these in your pipeline.

If you are on Linux with Pulseaudio, I strongly recommend using the PulseAudio integration, as the probe and cancellation is a) in a real time thread and b) much closer to were we communicate with the hardware.


Regards,
Ankit




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Error resolution or example for webrtcdsp with webrtcechoprobe

ankit
Hello Nicolas,

Thanks for reply.

I understand your point and explanation about echo cancel.

Currently I am using below reference pipeline:

gst-launch-1.0 *alsasrc* !
audio/x-raw,format=\(string\)S16LE,rate=16000,channels=1 ! *webrtcdsp* !
audioconvert ! speexenc ! rtpspeexpay pt=111 ! udpsink host=10.102.99.51
port=7078 *udpsrc* port=7078
caps="application/x-rtp,media=\(string\)audio,clock-rate=16000,encoding-name=\(string\)SPEEX,encoding-params=\(string\)1,payload=111"
! rtpspeexdepay ! speexdec ! audioconvert ! *webrtcechoprobe* ! alsasink

With the above pipeline however I am not able to remove echo, also I need to
restart board to use it again(no error occurred while pipeline is running).
If I remove webrtc component from pipeline then it works without reboot.

This same pipeline I have implemented with c++ code so without webrtc
element it works properly but when I try to add that element I am getting
error as mentioned before in my first post.

I hope you can understand my issue.

Regards,
Ankit



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Error resolution or example for webrtcdsp with webrtcechoprobe

Nicolas Dufresne-5
Le mercredi 20 mars 2019 à 01:40 -0500, ankit a écrit :

> Hello Nicolas,
>
> Thanks for reply.
>
> I understand your point and explanation about echo cancel.
>
> Currently I am using below reference pipeline:
>
> gst-launch-1.0 *alsasrc* !
> audio/x-raw,format=\(string\)S16LE,rate=16000,channels=1 ! *webrtcdsp* !
> audioconvert ! speexenc ! rtpspeexpay pt=111 ! udpsink host=10.102.99.51
> port=7078 *udpsrc* port=7078
> caps="application/x-rtp,media=\(string\)audio,clock-rate=16000,encoding-name=\(string\)SPEEX,encoding-params=\(string\)1,payload=111"
> ! rtpspeexdepay ! speexdec ! audioconvert ! *webrtcechoprobe* ! alsasink
>
> With the above pipeline however I am not able to remove echo, also I need to
> restart board to use it again(no error occurred while pipeline is running).
> If I remove webrtc component from pipeline then it works without reboot.

alsasink default latency is configured to 200ms, this is way too high
for the webrtcdsp algorithm. Try reducing it (buffer-time) to something
like 80ms. The algo works best if the probe ss close in term of delays
to the playback (hence my pulseaudio comment).

>
> This same pipeline I have implemented with c++ code so without webrtc
> element it works properly but when I try to add that element I am getting
> error as mentioned before in my first post.
>
> I hope you can understand my issue.
>
> Regards,
> Ankit
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Error resolution or example for webrtcdsp with webrtcechoprobe

ankit
Hello Nicolas,

Thanks for the answer.

For the question related to C++ implementation
I am able to resolve the issue.
I have not defined the "probe" property in webrtcdsp element, which was the
main cause of the issue.

Example:
    dsp = gst_element_factory_make("webrtcdsp","dsp");
    dspechoprobe =
gst_element_factory_make("webrtcechoprobe","dspechoprobe");
    g_object_set(dsp, "probe", "dspechoprobe", NULL);

Hope this will help others.

Now about echo cancellation:
I have tried with your suggestions with 80ms & 70ms but still I am facing
echo issue.
However noise cancellation works with the same.
Do you have any suggestion for this?

Regards,
Ankit



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Error resolution or example for webrtcdsp with webrtcechoprobe

Nicolas Dufresne-5
Le lundi 25 mars 2019 à 10:36 -0500, ankit a écrit :

> Hello Nicolas,
>
> Thanks for the answer.
>
> For the question related to C++ implementation
> I am able to resolve the issue.
> I have not defined the "probe" property in webrtcdsp element, which was the
> main cause of the issue.
>
> Example:
>     dsp = gst_element_factory_make("webrtcdsp","dsp");
>     dspechoprobe =
> gst_element_factory_make("webrtcechoprobe","dspechoprobe");
>     g_object_set(dsp, "probe", "dspechoprobe", NULL);

Indeed, if you give your probe a custom name you have to tell the dsp
element about it. If you had set the probe name to NULL, then the
default would have worked.

>
> Hope this will help others.
>
> Now about echo cancellation:
> I have tried with your suggestions with 80ms & 70ms but still I am facing
> echo issue.
> However noise cancellation works with the same.
> Do you have any suggestion for this?

Maybe your ALSA driver isn't exactly of the quality you need ? Maybe
you didn't really configure 80ms the right way ? Please share a little
more information and we may be able to help.

I can suggest trying the experimental delay-agnostic feature, but
without context, I'm proposing you some plaster which may lead to sub-
optimal performance. To validate your latency, I strongly recommend
using audiolatency element.

It works better when you wire the signal back in a close loop, but
should also work with a mic facing speaker. You simply run this, and it
will measure the roundtrip latency for you (with the appropriate setup
added of course).

  alsasrc ! audiolatency ! alsasink buffer-time=80000

>
> Regards,
> Ankit
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Error resolution or example for webrtcdsp with webrtcechoprobe

Nicolas Dufresne-5
Le lundi 25 mars 2019 à 12:17 -0400, Nicolas Dufresne a écrit :

> Le lundi 25 mars 2019 à 10:36 -0500, ankit a écrit :
> > Hello Nicolas,
> >
> > Thanks for the answer.
> >
> > For the question related to C++ implementation
> > I am able to resolve the issue.
> > I have not defined the "probe" property in webrtcdsp element, which was the
> > main cause of the issue.
> >
> > Example:
> >     dsp = gst_element_factory_make("webrtcdsp","dsp");
> >     dspechoprobe =
> > gst_element_factory_make("webrtcechoprobe","dspechoprobe");
> >     g_object_set(dsp, "probe", "dspechoprobe", NULL);
>
> Indeed, if you give your probe a custom name you have to tell the dsp
> element about it. If you had set the probe name to NULL, then the
> default would have worked.
>
> > Hope this will help others.
> >
> > Now about echo cancellation:
> > I have tried with your suggestions with 80ms & 70ms but still I am facing
> > echo issue.
> > However noise cancellation works with the same.
> > Do you have any suggestion for this?
>
> Maybe your ALSA driver isn't exactly of the quality you need ? Maybe
> you didn't really configure 80ms the right way ? Please share a little
> more information and we may be able to help.
>
> I can suggest trying the experimental delay-agnostic feature, but
> without context, I'm proposing you some plaster which may lead to sub-
> optimal performance. To validate your latency, I strongly recommend
> using audiolatency element.
>
> It works better when you wire the signal back in a close loop, but
> should also work with a mic facing speaker. You simply run this, and it
> will measure the roundtrip latency for you (with the appropriate setup
> added of course).
>
>   alsasrc ! audiolatency ! alsasink buffer-time=80000

** audiolatency print-latency=1

>
> > Regards,
> > Ankit
> >
> >
> >
> > --
> > Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> > _______________________________________________
> > gstreamer-devel mailing list
> > [hidden email]
> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Error resolution or example for webrtcdsp with webrtcechoprobe

ankit
In reply to this post by Nicolas Dufresne-5
Hello Nicolas,

> Maybe your ALSA driver isn't exactly of the quality you need ? Maybe
> you didn't really configure 80ms the right way ? Please share a little
> more information and we may be able to help.

I am not getting this about quality. Current implementation works good
without dsp implementation.
Let me know in terms of what you are asking.

> I can suggest trying the experimental delay-agnostic feature, but
> without context, I'm proposing you some plaster which may lead to sub-
> optimal performance. To validate your latency, I strongly recommend
> using audiolatency element.
>
> It works better when you wire the signal back in a close loop, but
> should also work with a mic facing speaker. You simply run this, and it
> will measure the roundtrip latency for you (with the appropriate setup
> added of course).
>
>   alsasrc ! audiolatency ! alsasink buffer-time=80000

As I am working on openembedded(yocto) platform which don't provide
audiolatency plugin.
I also tried to enable delay-agnostic in webrtcdsp but output result is the
same with echo.

Let me know if more information required.

Regards,
Ankit



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Error resolution or example for webrtcdsp with webrtcechoprobe

Nicolas Dufresne-5


Le mar. 26 mars 2019 08 h 55, ankit <[hidden email]> a écrit :
Hello Nicolas,

> Maybe your ALSA driver isn't exactly of the quality you need ? Maybe
> you didn't really configure 80ms the right way ? Please share a little
> more information and we may be able to help.

I am not getting this about quality. Current implementation works good
without dsp implementation.
Let me know in terms of what you are asking.

As for every embedded system, drivers aren't made for multiple purpose. They are generally written in a rush for a specific use case. Whenever you deviate from the original use case, it often fail or miss-behave. In this case, with the echo canceller you now have a hard dependency on correct latency reporting, and a round-trip latency being less the. 200ms.

Also, it may not be latency, maybe it picks a different a different rate or format, and your driver might not be handling it properly. A large amount of android audio drivers ignores the rate and always assume 48kHz as an example.

You could also simply have a fpu that is too slow for this library. Remember that this is a PC solution. So you need PC like fpu to make it work.


> I can suggest trying the experimental delay-agnostic feature, but
> without context, I'm proposing you some plaster which may lead to sub-
> optimal performance. To validate your latency, I strongly recommend
> using audiolatency element.
>
> It works better when you wire the signal back in a close loop, but
> should also work with a mic facing speaker. You simply run this, and it
> will measure the roundtrip latency for you (with the appropriate setup
> added of course).
>
>   alsasrc ! audiolatency ! alsasink buffer-time=80000

As I am working on openembedded(yocto) platform which don't provide
audiolatency plugin.
I also tried to enable delay-agnostic in webrtcdsp but output result is the
same with echo.

Let me know if more information required.

It is really easy to bump your GST version in Yocto, so that should not be an argument to not use the latest debugging tools available. audiolatency have not external depency, you could even build it on the side using a simple gcc call in its sub-directory.


Regards,
Ankit



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Error resolution or example for webrtcdsp with webrtcechoprobe

ankit
>As for every embedded system, drivers aren't made for multiple purpose. They
are generally written in a rush for a specific use case. Whenever you
deviate from the original use case, it often fail or miss-behave. In this
case, with the echo canceller you now have a hard dependency on correct
latency reporting, and a round-trip latency being less the. 200ms.
>Also, it may not be latency, maybe it picks a different a different rate or
format, and your driver might not be handling it properly. A large amount of
android audio drivers ignores the rate and always assume 48kHz as an
example.
>You could also simply have a fpu that is too slow for this library.
Remember that this is a PC solution. So you need PC like fpu to make it
work.
I am not aware of fpu part. Do you mean to libav? How to check with that?

>It is really easy to bump your GST version in Yocto, so that should not be
an argument to not use the latest debugging tools available. audiolatency
have not external depency, you could even build it on the side using a
simple gcc call in its sub-directory.
I am able to port audiolatency with Yocto. But when I run the pipeline
suggested by you it is giving me error.

root@dev:~# gst-launch-1.0 alsasrc ! audiolatency print-latency=true !
alsasink buffer-time=80000
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
ERROR: from element /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: Internal
data stream error.
Additional debug info:
../../../../gstreamer-1.12.4/libs/gst/base/gstbasesrc.c(2939):
gst_base_src_loop (): /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0:

After that I have tried with random buffer-time
With value 10000, 25000, 50000 = Sound is distorted and not audible
With value 65000, 80000, 100000 = Sound ok but with echo(echo is maybe minor
less but still echo is there)
Do you have any idea?





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Error resolution or example for webrtcdsp with webrtcechoprobe

ankit
Hello Nicolas/All,

Any suggestion on this?

Regards,
Ankit



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel