diff options
Diffstat (limited to 'meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia')
8 files changed, 165 insertions, 0 deletions
diff --git a/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire-conf-agl/client.env b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire-conf-agl/client.env new file mode 100644 index 000000000..9b44cee01 --- /dev/null +++ b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire-conf-agl/client.env @@ -0,0 +1,10 @@ +# This file contains environment variables that will apply +# to pipewire clients started by the application framework + +# libpipewire by default tries to obtain real-time scheduling +# for the streaming thread. This is only useful on the desktop, disable here. +DISABLE_RTKIT=1 + +# Uncomment to enable libpipewire debug for clients +# 1=error, 2=warning, 3=info, 4=debug, 5=trace +#PIPEWIRE_DEBUG=4 diff --git a/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire-conf-agl/pipewire.conf.in b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire-conf-agl/pipewire.conf.in new file mode 100644 index 000000000..6c055bcff --- /dev/null +++ b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire-conf-agl/pipewire.conf.in @@ -0,0 +1,17 @@ +# daemon config file for PipeWire version "0.2.9" +# distributed by Automotive Grade Linux + +add-spa-lib audio.convert* audioconvert/libspa-audioconvert +add-spa-lib api.alsa.* alsa/libspa-alsa +add-spa-lib api.v4l2.* v4l2/libspa-v4l2 +add-spa-lib api.bluez5.* bluez5/libspa-bluez5 + +load-module libpipewire-module-protocol-native +load-module libpipewire-module-spa-node-factory +load-module libpipewire-module-client-node +load-module libpipewire-module-client-device +load-module libpipewire-module-access same-sec-label-mode=1 +load-module libpipewire-module-adapter +load-module libpipewire-module-link-factory +load-module libpipewire-module-session-manager +exec /usr/bin/wireplumber diff --git a/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire-conf-agl/server.env b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire-conf-agl/server.env new file mode 100644 index 000000000..c74b941d6 --- /dev/null +++ b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire-conf-agl/server.env @@ -0,0 +1,12 @@ +# This file contains environment variables that will apply +# to the pipewire daemon as well as its session manager + +# Disable rtkit for wireplumber, which is also a client +DISABLE_RTKIT=1 + +# Uncomment to enable wireplumber debug +#G_MESSAGES_DEBUG=all + +# Uncomment to enable pipewire debug +# 1=error, 2=warning, 3=info, 4=debug, 5=trace +#PIPEWIRE_DEBUG=4 diff --git a/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire-conf-agl_git.bb b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire-conf-agl_git.bb new file mode 100644 index 000000000..a28c6534e --- /dev/null +++ b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire-conf-agl_git.bb @@ -0,0 +1,43 @@ +SUMMARY = "AGL configuration file for pipewire" +HOMEPAGE = "https://pipewire.org" +BUGTRACKER = "https://jira.automotivelinux.org" +AUTHOR = "George Kiagiadakis <george.kiagiadakis@collabora.com>" +SECTION = "multimedia" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = " \ + file://pipewire.conf.in \ + file://client.env \ + file://server.env \ + " + +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install_append() { + # enable optional features in the config + BLUEZ5=${@bb.utils.contains('DISTRO_FEATURES', 'bluez5', '', '#', d)} + sed -e "s/#IF_BLUEZ5 /${BLUEZ5}/" ${WORKDIR}/pipewire.conf.in > ${WORKDIR}/pipewire.conf + + # install our custom config + install -d ${D}/${sysconfdir}/pipewire/ + install -m 0644 ${WORKDIR}/pipewire.conf ${D}${sysconfdir}/pipewire/pipewire.conf + + # install environment variable files + install -d ${D}/${sysconfdir}/afm/unit.env.d/ + install -m 0644 ${WORKDIR}/client.env ${D}/${sysconfdir}/afm/unit.env.d/pipewire + install -m 0644 ${WORKDIR}/server.env ${D}${sysconfdir}/pipewire/environment +} + +FILES_${PN} = "\ + ${sysconfdir}/pipewire/* \ + ${sysconfdir}/afm/unit.env.d/* \ +" +CONFFILES_${PN} += "\ + ${sysconfdir}/pipewire/* \ + ${sysconfdir}/afm/unit.env.d/* \ +" + +RPROVIDES_${PN} += "virtual/pipewire-config" diff --git a/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire/pipewire@.service b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire/pipewire@.service new file mode 100644 index 000000000..e116dc1fa --- /dev/null +++ b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire/pipewire@.service @@ -0,0 +1,24 @@ +[Unit] +Description=Multimedia Service for user %i +Requires=pipewire@%i.socket + +[Install] +Also=pipewire@%i.socket + +[Service] +Type=simple +Restart=on-failure +ExecStart=/usr/bin/pipewire + +Environment=XDG_RUNTIME_DIR=/run/user/%i +Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%i/bus +EnvironmentFile=-/etc/pipewire/environment + +User=%i +Slice=user-%i.slice +SmackProcessLabel=System::Pipewire +SupplementaryGroups=audio +UMask=0077 +CapabilityBoundingSet= +SystemCallFilter=@basic-io @file-system @io-event @ipc \ + @memlock @network-io @process @resources @signal diff --git a/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire/pipewire@.socket b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire/pipewire@.socket new file mode 100644 index 000000000..10cb32276 --- /dev/null +++ b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire/pipewire@.socket @@ -0,0 +1,19 @@ +[Unit] +Description=Multimedia Service socket for user %i +Requires=afm-user-setup@%i.service +After=afm-user-setup@%i.service + +[Socket] +Priority=6 +Backlog=5 +ListenStream=/run/user/%i/pipewire-0 +Service=pipewire@%i.service +SmackLabel=* +SmackLabelIPIn=System +SmackLabelIPOut=System +SocketUser=%i +SocketGroup=%i +SocketMode=0660 + +[Install] +WantedBy=afm-user-session@%i.target diff --git a/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire/smack-pipewire b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire/smack-pipewire new file mode 100644 index 000000000..8d5b541ff --- /dev/null +++ b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire/smack-pipewire @@ -0,0 +1,8 @@ +System System::Pipewire rwxa-- +System::Pipewire System -wx--- +System::Pipewire System::Shared r-x--- +System::Pipewire System::Run rwxat- +System::Pipewire System::Log rwxa-- +System::Pipewire _ r-x--l +System::Pipewire User::Home r-x--l +System::Pipewire User::App-Shared rwxat- diff --git a/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire_git.bbappend b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire_git.bbappend new file mode 100644 index 000000000..8c9abf23e --- /dev/null +++ b/meta-pipewire/dynamic-layers/meta-app-framework/recipes-multimedia/pipewire/pipewire_git.bbappend @@ -0,0 +1,32 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/pipewire:" + +SRC_URI_append= "\ + file://pipewire@.service \ + file://pipewire@.socket \ + file://smack-pipewire \ + " + +do_install_append() { + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + # remove the original user unit files shipped by pipewire + rm -rf ${D}${systemd_unitdir} + + # install our own system-level templates + mkdir -p ${D}${systemd_system_unitdir}/ + install -m 0644 ${WORKDIR}/pipewire@.service ${D}${systemd_system_unitdir}/pipewire@.service + install -m 0644 ${WORKDIR}/pipewire@.socket ${D}${systemd_system_unitdir}/pipewire@.socket + + # enable the socket to start together with afm-user-session + mkdir -p ${D}${systemd_system_unitdir}/afm-user-session@.target.wants + ln -sf ../pipewire@.socket ${D}${systemd_system_unitdir}/afm-user-session@.target.wants/pipewire@.socket + + # install smack rules + mkdir -p ${D}${sysconfdir}/smack/accesses.d + install -m 0644 ${WORKDIR}/smack-pipewire ${D}${sysconfdir}/smack/accesses.d/pipewire + fi +} + +FILES_${PN}_append = "\ + ${systemd_system_unitdir}/* \ + ${sysconfdir}/smack/accesses.d/* \ +" |