Hi everyone,
I’m working on integrating the Pulseaudio package into my YOCTO-based system and facing similar issues as discussed in this post. Here is the approach I have taken:
In my local.conf file, I have added the following lines to include Pulseaudio:
IMAGE_INSTALL:append = “ pulseaudio pulseaudio-server pulseaudio-misc”
DISTRO_FEATURES:append = “ pulseaudio”
Additionally, in ./layers/openembedded-core/meta/recipes-multimedia/pulseaudio/pulseaudio.inc, I included the necessary configurations to enable WebRTC audio processing:
EXTRA_OEMESON += “-Dwebrtc-aec=enabled”
EXTRA_OECONF += “--enable-webrtc-aec”
DEPENDS += “webrtc-audio-processing”
RDEPENDS:pulseaudio-server = " \
pulseaudio-module-echo-cancel \
...... \
After building the image and deploying it, Pulseaudio is successfully integrated on the board. Here is the list of available Pulseaudio modules, confirmed by running 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
To run Pulseaudio, I created a non-root user named test. Here are the commands I used:
adduser test
usermod -aG audio test
pulseaudio --kill
pulseaudio --start
I then tested the audio playback using aplay -l as the test user, and it successfully listed the device:
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: imx8mmwm8904 [imx8mm-wm8904], device 0: 30020000.sai-wm8904-hifi wm8904-hifi-0 [30020000.sai-wm8904-hifi wm8904-hifi-0]
Subdevices: 0/1
Subdevice #0: subdevice #0
However, when I run pactl list cards, it doesn’t show any cards:
pactl list cards
Additionally, I noticed the following behavior with audio playback:
- When running aplay test_audio.wav as the test user, I encounter the following error:
ALSA lib ../../../alsa-lib-1.2.6.1/src/pcm/pcm_dmix.c:1032:(snd_pcm_dmix_open) unable to open slave
aplay: main:831: audio open error: Device or resource busy
- When running paplay test_audio.wav as the test user, no sound is heard.
- However, when running aplay test_audio.wav as the root user, the audio plays correctly.
If anyone has further insights or suggestions for optimizing this setup, your input would be greatly appreciated.
Best regards,
Ferran