Integrating Pulseaudio with YOCTO Recipe

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 Ferran,

Integrating PulseAudio into a Yocto-based system and ensuring it works correctly with your hardware can indeed present some challenges. Based on the details you’ve provided, it seems like you’ve successfully integrated PulseAudio into your system, but are encountering issues with device recognition and audio playback under a non-root user.

Here are a few suggestions and insights that might help you optimize your setup:

  1. PulseAudio Configuration for Non-Root Users: PulseAudio is designed to run per-user, not system-wide by default, although it can be configured to run system-wide if necessary. Since you’re starting PulseAudio as a non-root user (test), ensure that the user has the correct permissions to access the audio devices. You’ve already added the user to the audio group, which is a good step. Also, verify that the home directory for the user test is properly set up and that PulseAudio’s user configuration files are correctly placed in the user’s home directory.

  2. Device or Resource Busy Error: This error typically indicates that the audio device is being used by another process. Since PulseAudio is running, it might be taking exclusive control of the audio device, preventing aplay from accessing it directly. This is expected behavior when PulseAudio is in use, as applications should communicate with PulseAudio rather than directly with ALSA. Ensure that PulseAudio is correctly configured to manage the device and that applications use PulseAudio for playback.

  3. No Sound with paplay: If paplay doesn’t produce sound, it could be due to PulseAudio not correctly recognizing or configuring the audio hardware. This might be related to the issue with pactl list cards not showing any cards. Ensure that PulseAudio is correctly configured to recognize and use your audio hardware. You might need to manually configure PulseAudio modules for your specific hardware in /etc/pulse/default.pa or ~/.config/pulse/default.pa (for the test user).

  4. PulseAudio Module Configuration: Since you’re using specific PulseAudio modules for WebRTC audio processing and echo cancellation, ensure these modules are correctly loaded and configured. You can manually load a module using pactl load-module <module-name> and verify its status with pactl list modules short. This might help in diagnosing why the audio cards are not listed.

  5. Debugging PulseAudio: PulseAudio offers extensive debugging capabilities. You can increase the

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

Audio (Linux) | Toradex Developer Center.