<div dir="ltr"><div><div><div><div><div>Hello Arun,<br><br></div>Finally I got some good results.<br><br>I'm loading the AEC echo cancell module using this cmd line.<br><br>pactl load-module module-echo-cancel source_name=echosource sink_name=echosink aec_method=webrtc channels=1 rate=8000 sink_properties=device.description="Noise_Reduction" aec_args="analog_gain_control=0\ digital_gain_control=0\ drift_compensation=1 save_aec=1"<br><br>OBS: I tried to use save_aec but I did not succeed, the files are created in the /tmp but all the files were with lenght=0 bytes.<br><br><br>@Arun<br>These underflows sound bad. Does capture work fine without AEC?<br></div><div>The capture works good without AEC, I fix the capture with AEC using tsched=0.<br></div><div><br>I configured the rate and audio format in gstreamer and pulse to format=S16LE and rate=8000. I used the tsched=0 to "fix" the audio crackling, I don't know if is the best option to do, but works. I would like to know if is a good choice.<br></div></div></div><br><br></div><a href="http://am_poc.pa">am_poc.pa</a><br><br>.nofail<br><br>.fail<br><br>load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1<br><br>load-module module-alsa-sink sink_name=mastersink device=hw:0,0 tsched=0<br><br>load-module module-alsa-source source_name=mastersource device=hw:0,0 tsched=0<br><br>load-module module-filter-heuristics<br>load-module module-filter-apply<br><br>set-default-source mastersource<br>set-default-sink mastersink<br><div><br><div><div><br>voip_script.sh<br><br>#!/bin/sh<br><br>IPDEST=$1<br><br>case "$2" in<br> start)<br> echo "Starting gstlaunch"<br> export PULSE_PROP="filter.want=echo-cancel"<br> gst-launch-1.0 -v \<br> pulsesrc ! "audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)8000, channels=(int)1" ! \<br> alawenc ! rtppcmapay ! queue ! udpsink port=4000 host=$IPDEST sync=true &<br> gst-launch-1.0 -v udpsrc caps="application/x-rtp,media=(string)audio,clock-rate=(int)8000,encoding-name=(string)PCMA" port=4000 ! \<br> rtppcmadepay ! alawdec ! \<br> pulsesink sync=true\<br> &<br> ;;<br> stop)<br> echo "Stopping gstlaunch"<br> killall gst-launch-1.0<br> ;;<br> *)<br> echo "Usage: $0 <ipaddress> start|stop"<br> exit 1<br> ;;<br>esac<br></div><div><div><br><br></div><div>Pulse daemon.conf<br><br>exit-idle-time = -1<br>resample-method = trivial<br>flat-volumes = no<br>default-sample-format = s16le <br>default-sample-rate = 8000 <br></div><div><div><br><div><div><div><div>Thank you very much!<br><br></div><div>Regards,<br><br></div><div>Caio Pereira<br><br></div><div><div class="gmail_quote"><div dir="ltr">Em qua, 1 de jun de 2016 às 07:10, Arun Raghavan <<a href="mailto:arun@arunraghavan.net">arun@arunraghavan.net</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On Sat, 28 May 2016, at 12:05 AM, Caio wrote:<br>
> I forgot the pulseaudio log.<br>
><br>
><br>
> Jan 01 05:39:46 colibri-imx6 pulseaudio[1230]: E: [alsa-source-HiFi<br>
> wm8962-0] module-echo-cancel.c: Doing resync<br>
> Jan 01 05:39:46 colibri-imx6 pulseaudio[1230]: E: [alsa-source-HiFi<br>
> wm8962-0] module-echo-cancel.c: Playback after capture (-1705478), drop<br>
> sink 109170<br>
> Jan 01 05:39:46 colibri-imx6 pulseaudio[1230]: E: [alsa-source-HiFi<br>
> wm8962-0] module-echo-cancel.c: Playback too far ahead (261821), drop<br>
> source 16756<br>
> Jan 01 05:39:48 colibri-imx6 pulseaudio[1230]: E: [alsa-source-HiFi<br>
> wm8962-0] module-echo-cancel.c: Playback after capture (-168495), drop<br>
> sink<br>
> 10802<br>
> Jan 01 05:48:55 colibri-imx6 pulseaudio[1230]: E: [alsa-source-HiFi<br>
> wm8962-0] module-echo-cancel.c: Doing resync<br>
> Jan 01 05:48:55 colibri-imx6 pulseaudio[1230]: E: [alsa-source-HiFi<br>
> wm8962-0] module-echo-cancel.c: Playback after capture (-2897082), drop<br>
> sink 185432<br>
<br>
What is the sink device in this case? It looks like there is a lot of<br>
drift between the two. You could try setting drift_compenasation=1 in<br>
the aec_args for the webrtc canceller.<br>
<br>
><br>
> 2016-05-27 15:28 GMT-03:00 Caio <<a href="mailto:caiortp@gmail.com" target="_blank">caiortp@gmail.com</a>>:<br>
><br>
> > Arun,<br>
> ><br>
> > Sorry for the delay.<br>
> ><br>
> > Thanks for the answers.<br>
> ><br>
> > "I'm not sure I follow correctly -- you're saying that if you do things<br>
> > this way, the AEC works fine?"<br>
> ><br>
> > Yes, I follow correcty your instruction is working very good.<br>
> ><br>
> ><br>
> ><br>
> > But Now I'm trying to avoid the "audio underrun" (the audio is cracking).<br>
> > When I use the paplay the audio is ok and the cpu is around 14%, when I<br>
> > start the test the cpu goes to 26% and the audio start to cracking.<br>
> > I'm having difficult to configure the pulseaudio.<br>
> ><br>
> ><br>
> > Thank you very much.<br>
> ><br>
> > The gstreamer log:<br>
> ><br>
> > root@colibri-imx6-jfl:~/wavs# ./teste_pulseaudio_echo.sh input.48.wav<br>
> > Setting pipeline to PAUSED ...<br>
> > 0:00:00.093887667 1258 0x1bac100 WARN basesrc<br>
> > /home/icchw/oe-core/build/out-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/gstreamer1.0/1.4.1-r0/gstreamer-1.4.1/libs/gst/base/gstbasesrc.c:3460:gst_base_src_start_complete:<filesrc0><br>
> > pad not activated yet<br>
> > 0:00:00.094892667 1258 0x1bb5750 FIXME default<br>
> > /home/icchw/oe-core/build/out-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/gstreamer1.0/1.4.1-r0/gstreamer-1.4.1/gst/gstutils.c:3643:gst_pad_create_stream_id_internal:<wavparse0:src><br>
> > Creating random stream-id, consider implementing a deterministic way of<br>
> > creating a stream-id<br>
> > Pipeline is live and does not need PREROLL ...<br>
> > Setting pipeline to PLAYING ...<br>
> > New clock: GstPulseSrcClock<br>
> > 0:00:00.098627667 1258 0x1bb5780 FIXME default<br>
> > /home/icchw/oe-core/build/out-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/gstreamer1.0/1.4.1-r0/gstreamer-1.4.1/gst/gstutils.c:3643:gst_pad_create_stream_id_internal:<pulsesrc0:src><br>
> > Creating random stream-id, consider implementing a deterministic way of<br>
> > creating a stream-id<br>
> > 0:00:01.350294000 1258 0x1bb5750 WARN audiobasesink<br>
> > /home/icchw/oe-core/build/out-glibc/work/armv7at2hf-vfp-neon-mx6qdl-angstrom-linux-gnueabi/gstreamer1.0-plugins-base/1.4.1-r0/gst-plugins-base-1.4.1/gst-libs/gst/audio/gstaudiobasesink.c:1288:gst_audio_base_sink_skew_slaving:<pulsesink0><br>
> > correct clock skew 22728553 > 20000000<br>
> > 0:00:01.904267667 1258 0x1bb5750 WARN audiobasesink<br>
> > /home/icchw/oe-core/build/out-glibc/work/armv7at2hf-vfp-neon-mx6qdl-angstrom-linux-gnueabi/gstreamer1.0-plugins-base/1.4.1-r0/gst-plugins-base-1.4.1/gst-libs/gst/audio/gstaudiobasesink.c:1288:gst_audio_base_sink_skew_slaving:<pulsesink0><br>
> > correct clock skew 21428670 > 20000000<br>
> > 0:00:03.019438001 1258 0x1bb5750 WARN audiobasesink<br>
> > /home/icchw/oe-core/build/out-glibc/work/armv7at2hf-vfp-neon-mx6qdl-angstrom-linux-gnueabi/gstreamer1.0-plugins-base/1.4.1-r0/gst-plugins-base-1.4.1/gst-libs/gst/audio/gstaudiobasesink.c:1288:gst_audio_base_sink_skew_slaving:<pulsesink0><br>
> > correct clock skew 20980685 > 20000000<br>
> > 0:00:03.947815667 1258 0x1bcb5a0 WARN pulse<br>
> > /home/icchw/oe-core/build/out-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/gstreamer1.0-plugins-good/1.4.1-r0/gst-plugins-good-1.4.1/ext/pulse/pulsesink.c:678:gst_pulsering_stream_underflow_cb:<pulsesink0><br>
> > Got underflow<br>
<br>
These underflows sound bad. Does capture work fine without AEC?<br>
<br>
-- Arun<br>
_______________________________________________<br>
pulseaudio-discuss mailing list<br>
<a href="mailto:pulseaudio-discuss@lists.freedesktop.org" target="_blank">pulseaudio-discuss@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss</a><br>
</blockquote></div></div></div></div></div></div></div></div></div></div></div>