<html dir="ltr"><head></head><body style="text-align:left; direction:ltr;"><div>Hi,</div><div><br></div><div>I'm hoping someone here can help me figure out how to setup my configuration properly.</div><div><br></div><div>I'm trying to output sound through the echo-cancel module but by going through the alsa device. Unfortunately, the application doesn't support pulseaudio for the playback.</div><div><br></div><div>configuration:</div><span style="white-space: pre-wrap;">raspberry pi 4</span><div>ubuntu 20.04</div><div>ffmpeg : <span style="font-family: monospace;">4.2.2-1ubuntu1</span></div><div>pulseaudio : <span style="font-family: monospace;">13.99.1-1ubuntu3.2</span></div><div><span style="font-family: monospace;"><br></span></div><div><br></div><div><br></div><div>In order to do that, i've defined the echo-cancel configuration in /etc/pulse/default.pa:<span style="font-family: monospace;">load-module module-echo-cancel use_master_format=1 aec_method=webrtc aec_args="analog_gain_control=0\ digital_gain_control=1" source_name="echoCancel_source" sink_name="echoCancel_sink" </span></div><span style="font-family:monospace">
<br></span><div><span style="font-family:monospace">It works. I can test it with :</span></div><div><span style="font-family:monospace">ffmpeg -i recording.wav -f pulse -device echoCancel_sink test<br></span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">Now in order to playback through alsa, i've defined a pcm device:</span></div><div><span style="font-family: monospace;">cat /etc/alsa/conf.d/90-echocancel.conf  </span></div><span style="font-family:monospace">pcm.pulse-echo-cancel {
<br>        type pulse
<br>        device "echoCancel_sink"
<br>}
<br>
<br>ctl.pulse-echo-cancel {
<br>        type pulse
<br>        sink "echoCancel_sink"
<br>}<br></span><div></div><div></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">When I try this configuration with:</span></div><div></div><div><span style="font-family:monospace">ffmpeg -i recording.wav -f alsa pulse-echo-cancel<br></span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">Sound is scrambled and super slow.</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">Does anyone know how to make this configuration work?</span></div><div><span style="font-family:monospace">Any pointer would be appreciated.</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">I feel I got the correct overall approach but i am missing something about the rate convertion or specification.</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">Best regards</span></div><div><span style="font-family:monospace"><br></span></div></body></html>