Pulseaudio + Systemd

Hello,

I’m having problem to enable the Pulseaudio with systemd.
I’m trying to adapt the recipe from [meta-genivi][1] to enable the Pulseaudio at system start.
(in my image I’m running with --system).

I’m using the console-trdx-image as image base, I have pulseaudio enabled in the DISTRO_FEATURES

The main reason to run pulseaudio is because the QT/QML Application need pulseaudio and I will use the echo cancelling plugin from pulseaudio.

Someone has an advice?

DISTRO_FEATURES_DEFAULT="alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11"
DISTRO_FEATURES="alsa argp ext2 ipv4 ipv6 irda largefile nfs pam pci pcmcia smbfs systemd usbgadget usbhost vfat wifi xattr zeroconf tk **pulseaudio** opengl ipv4 ipv6 libc-backtrace libc-big-macros libc-bsd libc-cxx-tests libc-catgets libc-charsets libc-crypt libc-crypt-ufc libc-db-aliases libc-envz libc-fcvt libc-fmtmsg libc-fstab libc-ftraverse libc-getlogin libc-idn libc-inet-anl libc-libm libc-locales libc-locale-code libc-memusage libc-nis libc-nsswitch libc-rcmd libc-rtld-debug libc-spawn libc-streams libc-sunrpc libc-utmp libc-utmpx libc-wordexp libc-posix-clang-wchar libc-posix-regexp libc-posix-regexp-glibc libc-posix-wchar-io ld-is-gold"

Thank you!

Regards,

Caio Pereira

meta-genivi
[1]: http://git.projects.genivi.org/?p=meta-genivi-demo.git;a=tree;f=meta-genivi-demo/recipes-multimedia/pulseaudio;hb=HEAD

Sorry, but I guess we have no experience running such evil stuff as pulseaudio on an Embedded Linux system.

Besides DISTRO_FEATURE you at least need to add pulseaudio to the image, e.g. using IMAGE_INSTALL_append in your local.conf:

IMAGE_INSTALL_append = " pulseaudio"

@Stefan.agner

I already fix it, there’s no recipe to use the pulseaudio and systemd. But I fix it with an pulseaudio append and using some configuration from meta-agl

pulseaudio_%.bbappend

RDEPENDS_pulseaudio-module-systemd-login += "systemd"

RDEPENDS_pulseaudio-server += "\
    ${@base_contains('PACKAGECONFIG', 'systemd', 'pulseaudio-module-systemd-login', '', d)} \
    pulseaudio-module-switch-on-port-available \
    pulseaudio-module-cli \
    pulseaudio-module-esound-protocol-unix \
    pulseaudio-module-dbus-protocol \
    pulseaudio-module-echo-cancel \
    pulseaudio-module-loopback \
    pulseaudio-module-pipe-sink \
    pulseaudio-module-pipe-source \
    pulseaudio-module-native-protocol-tcp \
    pulseaudio-module-remap-sink \
    pulseaudio-module-alsa-sink \
    pulseaudio-module-alsa-source \
"


CACHED_CONFIGUREVARS_append_mx6 = " ax_cv_PTHREAD_PRIO_INHERIT=no"

FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"

SRC_URI_append_mx6 = " file://client_conf.patch \
                       file://daemon_conf.patch \
                       file://am_poc.pa \
                       file://pulseaudio_user.service \
"


do_install_append() {
    cp ${WORKDIR}/am_poc.pa ${D}/etc/pulse
    mkdir -p ${D}//etc/systemd/user
    cp ${WORKDIR}/pulseaudio_user.service ${D}/etc/systemd/user/pulseaudio.service
    mkdir -p ${D}/etc/systemd/user/default.target.wants
    ln -sf /etc/systemd/user/pulseaudio.service ${D}/etc/systemd/user/default.target.wants/pulseaudio.service
}


PACKAGE_ARCH_mx6 = "${MACHINE_SOCARCH}"
PACKAGE_ARCH_mx6ul = "${MACHINE_SOCARCH}"
PACKAGE_ARCH_mx7 = "${MACHINE_SOCARCH}"

Today my biggest problem is enable the echo cancellation in the pulseaudio
In the theory is very easy just enabling the echo-cancel (load-module module-echo-cancel source_name=echosource) but is not working yet. I’m trying to compile the webrtc module, reviewing my mechanical parts (mic and speaker position).

Thank you.

Best Regards.

Caio Pereira

@Marcel.ziswiler

I do not like to use pulseaudio, but I needed to test the WebRTC algorithm.
I also tested the echo cancellation with Alsa using speex, but did not succeed.

Enabling echo cancelling using pulseaudio

Before open the application you will need export this var: export

PULSE_PROP="filter.want=echo-cancel"

Loading the pulseaudio plugin

load-module module-echo-cancel source_name=echosource sink_name=echosink aec_method=webrtc channels=1 rate=8000  sink_properties=device.description="Noise_Reduction" aec_args="analog_gain_control=0\ digital_gain_control=0\ drift_compensation=1 save_aec=1"

hi @caiortp

Did you use WebRTC with Firefox on Colibri iMX6?

Best regards,
Jaski

Hello @stefan.tx !

I’m trying to compile the webrtc module, reviewing my mechanical parts (mic and speaker position).

You did it? (WebRTC in Yocto)

HI @Yedid

As already said, we don’t have any experience with WebRTC.

Best regards,
Jaski

@Yedid ,
No, I didn’t. I built the application in Qt (softphone).