Pulseaudio and module-echo-cancel YOCTO recipe

I have the same problem as shown in this post and I am trying to integrate the webrtc echo canceller from pulseaudio package into my system.
I have included the following lines in local.conf

IMAGE_INSTALL:append = “ pulseaudio pulseaudio-server pulseaudio-misc”
DISTRO_FEATURES:append = “ pulseaudio”

I have included the following lines in ./layers/openembedded-core/meta/recipes-multimedia/pulseaudio/pulseaudio.inc

EXTRA_OEMESON += “-Dwebrtc-aec=enabled”
EXTRA_OECONF += “--enable-webrtc-aec”
DEPENDS += “webrtc-audio-processing”
RDEPENDS:pulseaudio-server = " \
    pulseaudio-module-echo-cancel \
    ...... \

The result is that we have pulseaudio on board but not the echo canceller. The list of available modules is as follows.

pactl list modules short
0       module-device-restore
1       module-stream-restore
2       module-card-restore
3       module-augment-properties
4       module-switch-on-port-available
5       module-udev-detect      tsched=0
6       module-native-protocol-unix
7       module-default-device-restore
9       module-always-sink
10      module-null-sink        sink_name=auto_null sink_properties='device.description="Dummy Output"'
11      module-intended-roles
12      module-suspend-on-idle
13      module-position-event-sounds
14      module-role-cork
15      module-filter-heuristics
16      module-filter-apply

If I try to load the echo cancellation module I get an error but the module-echo-cancel.so library is located in the path /usr/lib/pulse-15.0/modules/module-echo-cancel.so.

pactl load-module module-echo-cancel
Failure: Module initialization failed

could you help me with the recipe?

Best regards,

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:

Hello Julian,

Integrating the WebRTC echo canceller from the PulseAudio package into your system and encountering issues with the echo cancellation module not being recognized or initialized correctly can be challenging. Based on the information you’ve provided, it seems you have taken the correct steps to include PulseAudio and its echo cancellation module in your Yocto build. However, the module initialization failure suggests there might be a missing dependency or a configuration issue.

Here are a few steps and checks to ensure the echo cancellation module is correctly integrated and functional:

  1. Verify Dependencies: Ensure that all dependencies required by the echo cancellation module are correctly included in your build. The webrtc-audio-processing package is crucial, but double-check if there are any other dependencies specific to your version of PulseAudio.

  2. PulseAudio Version Compatibility: Verify that the version of PulseAudio you are using supports the WebRTC echo canceller with the configuration options you are using. Sometimes, newer or older versions might have different requirements or support different features.

  3. Configuration Options: The options -Dwebrtc-aec=enabled and --enable-webrtc-aec you’ve used seem correct, but it’s worth checking the PulseAudio documentation or the ./configure --help output to ensure these options are valid for enabling the WebRTC echo canceller in your PulseAudio version.

  4. Module Path: The error message you encountered when trying to load the echo cancellation module suggests a possible issue with the module’s path or with the module itself. Verify that the path /usr/lib/pulse-15.0/modules/module-echo-cancel.so is correct and that the module file has the correct permissions.

  5. PulseAudio Configuration: Check the PulseAudio configuration files to ensure they are set up to load the echo cancellation module correctly. Sometimes, manual edits to configuration files are necessary to enable specific modules.

  6. Debugging PulseAudio: You can try running PulseAudio in verbose mode to get more detailed error messages that might help identify the problem. Use the command pulseaudio -vvvv to start PulseAudio in verbose mode, then attempt to load the module again.

  7. Check for SELinux/AppArmor: If your system uses SELinux or AppArmor, ensure that these security modules are not preventing PulseAudio or its modules from functioning correctly. You might need to adjust policies to allow the echo cancellation module to load and operate.

If after these checks the issue persists, it might be helpful to consult the Pulse

Please, also check if these links can help you solve your problem:

How to Setup Bluetooth Audio Profiles (Linux) | Toradex Developer Center.

Hello @jbruno,

We are looking into the issue you linked.
I will coordinate with the team working on this and try to reproduce the echo canceller issue to hopefully find a solution.

When there are further updates I will send them here.

Best Regards,