Enable Wireplumber Policy instance in ivi guest image. 55/27255/12
authorAshok Sidipotu <ashok.sidipotu@collabora.com>
Thu, 17 Feb 2022 13:32:03 +0000 (19:02 +0530)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Fri, 10 Jun 2022 21:18:06 +0000 (21:18 +0000)
-add wireplumber-policy-config-agl recipe to guest, while
 wireplumber-config-agl remains in host.
-add packagegroup-pipewire-base which is needed by the policy recipe.
-mount host pipewire server socket in /var directory in guest image and
 define a PIPEWIRE_RUNTIME_DIR environment variable based on this new mount
 point.
-make the needed service file changes to have wireplumber policy
 instance start on its own with out depending on pipewire service, limit this
 change to lxc layers.
-install wireplumber@policy.service in sockets.targets.want directory,
 this is need for its self start, limit this change to lxc layers

Bug-AGL: SPEC-4100
Signed-off-by: Ashok Sidipotu <ashok.sidipotu@collabora.com>
Change-Id: Ifbd7a026c75a199bb540c1593d5a93f67a4bde02

meta-agl-lxc/dynamic-layers/meta-rcar-gen3/recipes-container/lxc-config/lxc-config-ivi-demo/mount.in
meta-agl-lxc/recipes-container/lxc-config/lxc-config-ivi-demo/environment.in
meta-agl-lxc/recipes-container/lxc-config/lxc-config-ivi-demo/mount.in
meta-agl-lxc/recipes-container/lxc-config/lxc-config-ivi-demo/system.conf.ivi-demo.in
meta-agl-lxc/recipes-multimedia/wireplumber/wireplumber-policy-config-agl_git.bbappend [new file with mode: 0644]
meta-agl-lxc/recipes-multimedia/wireplumber/wireplumber/0001-systemd-wireplumber-to-not-depend-on-the-pipewire-de.patch [new file with mode: 0644]
meta-agl-lxc/recipes-multimedia/wireplumber/wireplumber_git.bbappend [new file with mode: 0644]
meta-agl-lxc/recipes-platform/images/guest-image-ivi-demo.bb
meta-agl-lxc/recipes-platform/images/lxc-host-image-demo.bb

index 536f24d..2fbf419 100644 (file)
@@ -18,3 +18,5 @@ lxc.mount.entry = /dev/input dev/input none bind,optional,create=dir
 lxc.cgroup.devices.allow = c 10:* rwm
 lxc.mount.entry = /dev/pvr_sync dev/pvr_sync none bind,optional,create=file
 
+lxc.mount.entry = /run/pipewire/pipewire-0 var/pipewire-0 none bind,optional,create=file
+
index 374b9c0..632252d 100644 (file)
@@ -4,4 +4,5 @@ lxc.environment = QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/plugins/
 lxc.environment = QML_IMPORT_PATH=/usr/lib/qml/
 lxc.environment = QML2_IMPORT_PATH=/usr/lib/qml/
 lxc.environment = QT_WAYLAND_SHELL_INTEGRATION=xdg-shell
+lxc.environment = PIPEWIRE_RUNTIME_DIR=/var
 
index 83362dd..262f09b 100644 (file)
@@ -14,3 +14,4 @@ lxc.mount.entry = /run/drm-lease-manager/lease-ivi var/display/drm-lease-manager
 
 lxc.cgroup.devices.allow = c 13:* rwm
 lxc.mount.entry = /dev/input dev/input none bind,optional,create=dir
+lxc.mount.entry = /run/pipewire/pipewire-0 var/pipewire-0 none bind,optional,create=file
index 29a49b6..de7c6cd 100644 (file)
@@ -6,3 +6,4 @@ DefaultEnvironment = QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/plugins/
 DefaultEnvironment = QML_IMPORT_PATH=/usr/lib/qml/
 DefaultEnvironment = QML2_IMPORT_PATH=/usr/lib/qml/
 DefaultEnvironment = QT_WAYLAND_SHELL_INTEGRATION=xdg-shell
+DefaultEnvironment = PIPEWIRE_RUNTIME_DIR=/var
diff --git a/meta-agl-lxc/recipes-multimedia/wireplumber/wireplumber-policy-config-agl_git.bbappend b/meta-agl-lxc/recipes-multimedia/wireplumber/wireplumber-policy-config-agl_git.bbappend
new file mode 100644 (file)
index 0000000..fe6dab8
--- /dev/null
@@ -0,0 +1,8 @@
+do_install:append() {
+    config_dir="${D}${sysconfdir}/wireplumber/"
+    systemd_dir="${D}${sysconfdir}/systemd/system/sockets.target.wants"
+
+    # enable additional systemd services
+    install -d ${systemd_dir}
+    ln -s ${systemd_system_unitdir}/wireplumber@.service ${systemd_dir}/wireplumber@policy.service
+}
diff --git a/meta-agl-lxc/recipes-multimedia/wireplumber/wireplumber/0001-systemd-wireplumber-to-not-depend-on-the-pipewire-de.patch b/meta-agl-lxc/recipes-multimedia/wireplumber/wireplumber/0001-systemd-wireplumber-to-not-depend-on-the-pipewire-de.patch
new file mode 100644 (file)
index 0000000..0da0bfb
--- /dev/null
@@ -0,0 +1,64 @@
+From a2d324c75057f0ddd66cbe5b5e419fddda213cc2 Mon Sep 17 00:00:00 2001
+From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
+Date: Mon, 28 Feb 2022 06:46:19 +0530
+Subject: [PATCH] systemd: changes to run wireplumber instances in containers
+
+- remove the pipewire daemon dependencies so that
+only wireplumber policy daemon can run in containers.
+- remove pipewire user
+---
+ src/systemd/system/wireplumber@.service.in | 8 +++-----
+ src/systemd/user/wireplumber@.service.in   | 5 ++---
+ 2 files changed, 5 insertions(+), 8 deletions(-)
+
+ Inappropriate [configuration]
+
+diff --git a/src/systemd/system/wireplumber@.service.in b/src/systemd/system/wireplumber@.service.in
+index ba8eefe..e4b985b 100644
+--- a/src/systemd/system/wireplumber@.service.in
++++ b/src/systemd/system/wireplumber@.service.in
+@@ -5,8 +5,7 @@
+ # wireplumber@policy.service loads policy.conf, etc.
+ [Unit]
+ Description=Multimedia Service Session Manager (%i)
+-After=pipewire.service
+-BindsTo=pipewire.service
++After=sockets.target
+ Conflicts=pipewire-media-session.service
+ [Service]
+@@ -19,9 +18,8 @@ SystemCallFilter=@system-service
+ Type=simple
+ ExecStart=@WP_BINARY@ -c %i.conf
+ Restart=on-failure
+-User=pipewire
+-Environment=PIPEWIRE_RUNTIME_DIR=%t/pipewire
++Environment=PIPEWIRE_RUNTIME_DIR=/var
+ Environment=GIO_USE_VFS=local
+ [Install]
+-WantedBy=pipewire.service
++WantedBy=multi-user.target
+diff --git a/src/systemd/user/wireplumber@.service.in b/src/systemd/user/wireplumber@.service.in
+index 9dbceff..7e21194 100644
+--- a/src/systemd/user/wireplumber@.service.in
++++ b/src/systemd/user/wireplumber@.service.in
+@@ -5,8 +5,7 @@
+ # wireplumber@policy.service loads policy.conf, etc.
+ [Unit]
+ Description=Multimedia Service Session Manager (%i)
+-After=pipewire.service
+-BindsTo=pipewire.service
++After=sockets.target
+ Conflicts=pipewire-media-session.service
+ [Service]
+@@ -23,4 +22,4 @@ Slice=session.slice
+ Environment=GIO_USE_VFS=local
+ [Install]
+-WantedBy=pipewire.service
++WantedBy=multi-user.target
+-- 
+2.35.1
+
diff --git a/meta-agl-lxc/recipes-multimedia/wireplumber/wireplumber_git.bbappend b/meta-agl-lxc/recipes-multimedia/wireplumber/wireplumber_git.bbappend
new file mode 100644 (file)
index 0000000..6a73503
--- /dev/null
@@ -0,0 +1,5 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/wireplumber:"
+
+SRC_URI += "\
+    file://0001-systemd-wireplumber-to-not-depend-on-the-pipewire-de.patch \
+"
index 9cb495a..22a5911 100644 (file)
@@ -24,4 +24,7 @@ IMAGE_INSTALL += " \
     ttf-dejavu-mathtexgyre \
     ttf-dejavu-common \
     ca-certificates \
-"
+    wireplumber \
+    packagegroup-pipewire-base \
+    wireplumber-policy-config-agl \
+"
\ No newline at end of file
index fd7e559..aace83a 100644 (file)
@@ -12,6 +12,7 @@ IMAGE_INSTALL += " \
     alsa-utils \
     packagegroup-pipewire \
     pipewire-ic-ipc \
+    wireplumber-config-agl \
     ${@bb.utils.contains('AGL_FEATURES', 'agl-drm-lease', 'drm-lease-manager', '', d)} \
 "