<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The quotation marks are stripped already by the shell, and pactl isn't<br>
smart enough to automatically add quotation marks when it sees that a<br>
module argument was passed with a space in it. The arguments are<br>
concatenated into a single string that will then be parsed by the<br>
server, and since the string doesn't contain any quotation marks at<br>
that point, the server can't know that comfort_noise=1 is actually a<br>
part of the aec_args argument. This should work better:<br>
<br>
$ pactl load-module module-echo-cancel aec_method=webrtc aec_args="\"mobile=1 comfort_noise=1\""<span class="gmail-"><br></span></blockquote><br>Adding the extra quotation marks works thanks!<br><div class="gmail_extra"><br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">pactl doesn't ignore them, module-echo-cancel does that. It looks like<br>
it doesn't at least currently support manually configuring the format,<br>
rate and channels. You can pass use_master_format=true, though, which<br>
should make the filter sink and source use the master sink and source<br>
parameters. The webrtc canceller has some constraints of its own,<br>
though, which you can see in webrtc_ec_fixate_spec() in<br>
src/modules/echo-cancel/<wbr>webrtc.cc. For example, it will force the<br>
sample format to be float.</blockquote><div><br></div><div>You are right, webrtc is limited to 8, 16, 32 or 48 kHz. Adding rate=48000 works.<br>use_master_format=true does the trick for using 2 channel sources and sinks.<br></div><br></div><div class="gmail_extra">I now use<br></div><div class="gmail_extra">$ pactl load-module module-echo-cancel use_master_format=true rate=48000<br></div><div class="gmail_extra"><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Do you mean the errors at the end of the log? I don't know what causes<br>
it. I suspect a resync is a fairly normal thing, and shouldn't be<br>
logged as an error.</blockquote><div><br></div><div>I added the log to show how PulseAudio processed the load-module command. But it is fixed now with the use_master_format parameter. <br></div><br></div><div class="gmail_extra">Thanks for the help!<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">All the best,<br></div><div class="gmail_extra">Koenraad<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 6 May 2017 at 18:58, Tanu Kaskinen <span dir="ltr"><<a href="mailto:tanuk@iki.fi" target="_blank">tanuk@iki.fi</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Thu, 2017-05-04 at 15:35 +0200, Koenraad Verheyden wrote:<br>
> Hey all,<br>
><br>
> I'm using the module-echo-cancel using webrtc. I'm having two problems<br>
> loading the module:<br>
><br>
> 1) I can't figure out how to pass multiple aec_args. When I do<br>
><br>
> $ pactl load-module module-echo-cancel aec_method=webrtc aec_args="mobile=1<br>
> comfort_noise=1"<br>
><br>
> I get the following logs:<br>
><br>
> E: [pulseaudio] module-echo-cancel.c: Failed to parse module arguments.<br>
> E: [pulseaudio] module.c: Failed to load module "module-echo-cancel"<br>
> (argument:"aec_method=webrtc aec_args=mobile=1 comfort_noise=1"):<br>
> initialization failed.<br>
><br>
> It seems pactl strips away the quotation marks around the arguments? Both<br>
> arguments are recognized if I only supply them separately, so I know they<br>
> are correct.<br>
<br>
</span>The quotation marks are stripped already by the shell, and pactl isn't<br>
smart enough to automatically add quotation marks when it sees that a<br>
module argument was passed with a space in it. The arguments are<br>
concatenated into a single string that will then be parsed by the<br>
server, and since the string doesn't contain any quotation marks at<br>
that point, the server can't know that comfort_noise=1 is actually a<br>
part of the aec_args argument. This should work better:<br>
<br>
$ pactl load-module module-echo-cancel aec_method=webrtc aec_args="\"mobile=1 comfort_noise=1\""<br>
<span class="gmail-"><br>
> 2) pactl load-module seems to ignore format, rate and channels arguments.<br>
> When I execute<br>
<br>
</span>pactl doesn't ignore them, module-echo-cancel does that. It looks like<br>
it doesn't at least currently support manually configuring the format,<br>
rate and channels. You can pass use_master_format=true, though, which<br>
should make the filter sink and source use the master sink and source<br>
parameters. The webrtc canceller has some constraints of its own,<br>
though, which you can see in webrtc_ec_fixate_spec() in<br>
src/modules/echo-cancel/<wbr>webrtc.cc. For example, it will force the<br>
sample format to be float.<br>
<div><div class="gmail-h5"><br>
> $ pactl load-module module-echo-cancel aec_method=webrtc<br>
> source_name=echo_cancel_source sink_name=echo_cancel_sink format=s16le<br>
> rate=44100 channels=2<br>
><br>
> The module loads successfully. But when I check the sinks and sources, my<br>
> sources are not stereo or 44,1 kHz.<br>
> The sample rate isn't really an issue, but I have to use stereo AEC.<br>
><br>
> 4 echo_cancel_source module-echo-cancel.c float32le 2ch 32000Hz<br>
> SUSPENDED<br>
> 5 echo_cancel_sink.monitor module-echo-cancel.c float32le 1ch<br>
> 32000Hz SUSPENDED<br>
><br>
> 2 echo_cancel_sink module-echo-cancel.c float32le 1ch 32000Hz<br>
> SUSPENDED<br>
><br>
> And I get the following log:<br>
><br>
> I: [pulseaudio] module-echo-cancel.c: Using AEC engine: webrtc<br>
> I: [pulseaudio] module-echo-cancel.c: Sample rates of play and out stream<br>
> differ. Adjusting rate of play stream.<br>
> I: [pulseaudio] source.c: Created source 4 "echo_cancel_source" with sample<br>
> spec float32le 2ch 32000Hz and channel map front-left,front-right<br>
> I: [pulseaudio] source.c: device.master_device =<br>
> "alsa_input.usb-Burr-Brown_<wbr>from_TI_USB_Audio_CODEC-00.<wbr>analog-stereo"<br>
> I: [pulseaudio] source.c: device.class = "filter"<br>
> I: [pulseaudio] source.c: device.intended_roles = "phone"<br>
> I: [pulseaudio] source.c: device.description = "USB Audio CODEC Analog<br>
> Stereo (echo cancelled with USB Audio CODEC Analog Stereo)"<br>
> I: [pulseaudio] source.c: device.icon_name = "audio-input-microphone"<br>
> I: [pulseaudio] sink.c: Created sink 2 "echo_cancel_sink" with sample spec<br>
> float32le 1ch 32000Hz and channel map mono<br>
> I: [pulseaudio] sink.c: device.master_device =<br>
> "alsa_output.usb-Burr-Brown_<wbr>from_TI_USB_Audio_CODEC-00.<wbr>analog-stereo"<br>
> I: [pulseaudio] sink.c: device.class = "filter"<br>
> I: [pulseaudio] sink.c: device.intended_roles = "phone"<br>
> I: [pulseaudio] sink.c: device.description = "USB Audio CODEC Analog<br>
> Stereo (echo cancelled with USB Audio CODEC Analog Stereo)"<br>
> I: [pulseaudio] sink.c: device.icon_name = "audio-card"<br>
> I: [pulseaudio] source.c: Created source 5 "echo_cancel_sink.monitor" with<br>
> sample spec float32le 1ch 32000Hz and channel map mono<br>
> I: [pulseaudio] source.c: device.description = "Monitor of USB Audio<br>
> CODEC Analog Stereo (echo cancelled with USB Audio CODEC Analog Stereo)"<br>
> I: [pulseaudio] source.c: device.class = "monitor"<br>
> I: [pulseaudio] source.c: device.icon_name = "audio-input-microphone"<br>
> I: [pulseaudio] source-output.c: Trying to change sample rate<br>
> I: [pulseaudio] alsa-source.c: Updating rate for device front:1, new rate<br>
> is 48000<br>
> I: [pulseaudio] source.c: Changed sampling rate successfully<br>
> I: [pulseaudio] source-output.c: Rate changed to 48000 Hz<br>
> I: [alsa-source-USB Audio] alsa-source.c: Trying resume...<br>
> I: [alsa-source-USB Audio] alsa-source.c: Resumed successfully...<br>
> I: [alsa-source-USB Audio] alsa-source.c: Starting capture.<br>
> I: [pulseaudio] source-output.c: Created output 1 "Echo-Cancel Source<br>
> Stream" on<br>
> alsa_input.usb-Burr-Brown_<wbr>from_TI_USB_Audio_CODEC-00.<wbr>analog-stereo with<br>
> sample spec float32le 2ch 32000Hz and channel map front-left,front-right<br>
> I: [pulseaudio] source-output.c: <a href="http://media.name" rel="noreferrer" target="_blank">media.name</a> = "Echo-Cancel Source<br>
> Stream"<br>
> I: [pulseaudio] source-output.c: media.role = "filter"<br>
> I: [pulseaudio] source-output.c: <a href="http://module-stream-restore.id" rel="noreferrer" target="_blank">module-stream-restore.id</a> =<br>
> "source-output-by-media-role:<wbr>filter"<br>
> I: [alsa-sink-USB Audio] alsa-sink.c: Trying resume...<br>
> I: [alsa-sink-USB Audio] alsa-sink.c: Resumed successfully...<br>
> I: [alsa-sink-USB Audio] alsa-sink.c: Starting playback.<br>
> I: [pulseaudio] resampler.c: Resampler 'ffmpeg' cannot do variable rate,<br>
> reverting to resampler 'auto'.<br>
> I: [pulseaudio] remap_neon.c: Using ARM NEON mono to stereo remapping<br>
> I: [pulseaudio] speex.c: Choosing speex quality setting 1.<br>
> I: [pulseaudio] sink-input.c: Created input 2 "Echo-Cancel Sink Stream" on<br>
> alsa_output.usb-Burr-Brown_<wbr>from_TI_USB_Audio_CODEC-00.<wbr>analog-stereo with<br>
> sample spec float32le 1ch 32000Hz and channel map mono<br>
> I: [pulseaudio] sink-input.c: <a href="http://media.name" rel="noreferrer" target="_blank">media.name</a> = "Echo-Cancel Sink Stream"<br>
> I: [pulseaudio] sink-input.c: media.role = "filter"<br>
> I: [pulseaudio] sink-input.c: <a href="http://module-stream-restore.id" rel="noreferrer" target="_blank">module-stream-restore.id</a> =<br>
> "sink-input-by-media-role:<wbr>filter"<br>
> I: [pulseaudio] module.c: Loaded "module-echo-cancel" (index: #19;<br>
> argument: "aec_method=webrtc source_name=echo_cancel_source<br>
> sink_name=echo_cancel_sink format=s16le rate=44100 channels=2").<br>
> E: [alsa-source-USB Audio] module-echo-cancel.c: Doing resync<br>
> E: [alsa-source-USB Audio] module-echo-cancel.c: Playback too far ahead<br>
> (96683), drop source 24744<br>
><br>
> Do you have any idea what causes this?<br>
<br>
</div></div>Do you mean the errors at the end of the log? I don't know what causes<br>
it. I suspect a resync is a fairly normal thing, and shouldn't be<br>
logged as an error. I have never used module-echo-cancel seriously, but<br>
often when I've loaded it to investigate some bug, I've seen the resync<br>
error messages too. Arun might know better.<br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
--<br>
Tanu<br>
<br>
<a href="https://www.patreon.com/tanuk" rel="noreferrer" target="_blank">https://www.patreon.com/tanuk</a><br>
</font></span></blockquote></div><br></div></div>