aboutsummaryrefslogtreecommitdiffstats
path: root/meta-ivi-common
diff options
context:
space:
mode:
authorManuel Bachmann <mbc@iot.bzh>2016-07-20 15:52:27 +0000
committerManuel Bachmann <mbc@iot.bzh>2016-07-20 15:52:27 +0000
commiteb97aa262140951ee881d9dced2e90baab2abf41 (patch)
tree900184c9a142b8616290eccfb7d4d111a447ecb4 /meta-ivi-common
parentd0de03bb94678140e149e6923c7321db8a71b40c (diff)
Add PulseAudio server and systemd service
This commit adds the PulseAudio server to the image, and a related systemd service for automatic startup. This change is motivated by an Audio Routing model involving a PulseAudio plugin and a AudioManager interface, as described on: https://wiki.automotivelinux.org/ eg-ui-graphics-req-audiorouting . PulseAudio server is launched in user mode. ("paplay <file>.wav" may verify the functionality) Change-Id: I12e2bfb2af5494e530e29bda77b0d88999cf7b4b Signed-off-by: Manuel Bachmann <mbc@iot.bzh>
Diffstat (limited to 'meta-ivi-common')
-rw-r--r--meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-multimedia.bb2
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend28
2 files changed, 30 insertions, 0 deletions
diff --git a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-multimedia.bb b/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-multimedia.bb
index 40cd116dd..75e496290 100644
--- a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-multimedia.bb
+++ b/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-multimedia.bb
@@ -14,6 +14,8 @@ ALLOW_EMPTY_${PN} = "1"
RDEPENDS_${PN} += "\
alsa-lib \
alsa-utils \
+ pulseaudio-server \
+ pulseaudio-misc \
agl-audio-plugin \
gstreamer1.0-meta-base \
"
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend
new file mode 100644
index 000000000..9964a8bd8
--- /dev/null
+++ b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend
@@ -0,0 +1,28 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
+
+inherit systemd
+
+do_install_append() {
+ # Install pulseaudio systemd service
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -m 644 -p -D ${WORKDIR}/build/src/pulseaudio.service ${D}${systemd_user_unitdir}/pulseaudio.service
+ install -m 644 -p -D ${WORKDIR}/pulseaudio-6.0/src/daemon/systemd/user/pulseaudio.socket ${D}${systemd_user_unitdir}/pulseaudio.socket
+
+ # Execute these manually on behalf of systemctl script (from systemd-systemctl-native.bb)
+ # because it does not support systemd's user mode.
+ mkdir -p ${D}/home/root/.config/systemd/user/sockets.target.wants/
+ ln -sf ${systemd_user_unitdir}/pulseaudio.socket ${D}/home/root/.config/systemd/user/sockets.target.wants/pulseaudio.socket
+
+ mkdir -p ${D}/home/root/.config/systemd/user/default.target.wants/
+ ln -sf ${systemd_user_unitdir}/pulseaudio.service ${D}/home/root/.config/systemd/user/default.target.wants/pulseaudio.service
+ fi
+ mkdir -p ${D}/${bindir}
+ install -m 755 -p -D ${WORKDIR}/build/src/.libs/pacat ${D}/${bindir}/
+}
+
+FILES_${PN} += " \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/pulseaudio.socket', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '/home/root/.config/systemd/user/sockets.target.wants/pulseaudio.socket', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/pulseaudio.service', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '/home/root/.config/systemd/user/default.target.wants/pulseaudio.service', '', d)} \
+"