From 4b6d23485d23dad66b2e5572cdedacca5c1f6362 Mon Sep 17 00:00:00 2001 From: Ashok Sidipotu Date: Wed, 20 Dec 2023 01:05:41 +0100 Subject: pipewire: Update PipeWire to v1.0.0 and WirePlumber to v0.4.17 The PipeWire project is immensely proud to announce the 1.0 release of PipeWire. Highlights of Pipewire. - Fix a memfd/dmabuf leak when uploading buffers while shutting down. - Handle concurrent jack_port_get_buffer() calls because ardour seems to be doing this. - Improve time reporting (less jitter) in ALSA when using IRQ. - Many doc improvements Highlights of wireplumber. - Fixed a reference counting issue in the object managers that could cause crashes due to memory corruption (#534) - Fixed an issue with filters linking to wrong targets, often with two sets of links (#536) - Fixed a crash in the endpoints policy that would show up when log messages were enabled at level 3 or higher Bug-AGL: SPEC-5022 Change-Id: Ibeff85f7f4b02b8b667e4c6caf6beab4487854bc Signed-off-by: Ashok Sidipotu Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/29546 Tested-by: Jenkins Job builder account ci-image-build: Jenkins Job builder account ci-image-boot-test: Jenkins Job builder account Reviewed-by: Jan-Simon Moeller --- .../0002-gst-avoid-reporting-error-twice.patch | 62 ---- ...src-break-out-of-wait_started-also-on-STA.patch | 38 --- .../recipes-multimedia/pipewire/pipewire_0.3.83.bb | 328 -------------------- .../pipewire/pipewire_0.3.83.bbappend | 27 -- .../recipes-multimedia/pipewire/pipewire_1.0.0.bb | 329 +++++++++++++++++++++ .../pipewire/pipewire_1.0.0.bbappend | 25 ++ ...dpoint-device.lua-fix-dangling-logs-issue.patch | 47 --- .../wireplumber/wireplumber_git.bb | 7 +- 8 files changed, 357 insertions(+), 506 deletions(-) delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-gst-avoid-reporting-error-twice.patch delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-gstpipewiresrc-break-out-of-wait_started-also-on-STA.patch delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.83.bb delete mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.83.bbappend create mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bb create mode 100644 meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bbappend delete mode 100644 meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-policy-endpoint-device.lua-fix-dangling-logs-issue.patch (limited to 'meta-pipewire') diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-gst-avoid-reporting-error-twice.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-gst-avoid-reporting-error-twice.patch deleted file mode 100644 index fa123a07f..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-gst-avoid-reporting-error-twice.patch +++ /dev/null @@ -1,62 +0,0 @@ -From cbb12450c2f258ef3ac8239889784e1a97dfeaa8 Mon Sep 17 00:00:00 2001 -From: George Kiagiadakis -Date: Wed, 8 Nov 2023 18:12:59 +0200 -Subject: [PATCH 1/2] gst: avoid reporting error twice - -First, make the error permanent by calling pw_stream_set_error() -and when this emits an error state again, report that to GStreamer. - -Do the same in pipewiresink, which didn't even have the -pw_stream_set_error() call before, so the stream wasn't really going -into an error state at all. - -Upstream-Status: Pipewire MR1763 merged ---- - src/gst/gstpipewiresink.c | 9 +++++++-- - src/gst/gstpipewiresrc.c | 10 +++++++--- - 2 files changed, 14 insertions(+), 5 deletions(-) - -diff --git a/src/gst/gstpipewiresink.c b/src/gst/gstpipewiresink.c -index 36d158095..001ede9d5 100644 ---- a/src/gst/gstpipewiresink.c -+++ b/src/gst/gstpipewiresink.c -@@ -532,8 +532,13 @@ on_state_changed (void *data, enum pw_stream_state old, enum pw_stream_state sta - pw_stream_trigger_process (pwsink->stream); - break; - case PW_STREAM_STATE_ERROR: -- GST_ELEMENT_ERROR (pwsink, RESOURCE, FAILED, -- ("stream error: %s", error), (NULL)); -+ /* make the error permanent, if it is not already; -+ pw_stream_set_error() will recursively call us again */ -+ if (pw_stream_get_state (pwsink->stream, NULL) != PW_STREAM_STATE_ERROR) -+ pw_stream_set_error (pwsink->stream, -EPIPE, "%s", error); -+ else -+ GST_ELEMENT_ERROR (pwsink, RESOURCE, FAILED, -+ ("stream error: %s", error), (NULL)); - break; - } - pw_thread_loop_signal (pwsink->core->loop, FALSE); -diff --git a/src/gst/gstpipewiresrc.c b/src/gst/gstpipewiresrc.c -index 0514e4caa..e473338ba 100644 ---- a/src/gst/gstpipewiresrc.c -+++ b/src/gst/gstpipewiresrc.c -@@ -681,9 +681,13 @@ on_state_changed (void *data, - case PW_STREAM_STATE_STREAMING: - break; - case PW_STREAM_STATE_ERROR: -- pw_stream_set_error (pwsrc->stream, -EPIPE, "%s", error); -- GST_ELEMENT_ERROR (pwsrc, RESOURCE, FAILED, -- ("stream error: %s", error), (NULL)); -+ /* make the error permanent, if it is not already; -+ pw_stream_set_error() will recursively call us again */ -+ if (pw_stream_get_state (pwsrc->stream, NULL) != PW_STREAM_STATE_ERROR) -+ pw_stream_set_error (pwsrc->stream, -EPIPE, "%s", error); -+ else -+ GST_ELEMENT_ERROR (pwsrc, RESOURCE, FAILED, -+ ("stream error: %s", error), (NULL)); - break; - } - pw_thread_loop_signal (pwsrc->core->loop, FALSE); --- -2.41.0 - diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-gstpipewiresrc-break-out-of-wait_started-also-on-STA.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-gstpipewiresrc-break-out-of-wait_started-also-on-STA.patch deleted file mode 100644 index 29bc50472..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-gstpipewiresrc-break-out-of-wait_started-also-on-STA.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 4fb8417b201033ae2de20032b44d52cae1394ff8 Mon Sep 17 00:00:00 2001 -From: George Kiagiadakis -Date: Wed, 8 Nov 2023 18:23:02 +0200 -Subject: [PATCH 2/2] gstpipewiresrc: break out of wait_started() also on - STATE_UNCONNECTED - -When the session manager sends an error to the client, it typically -also destroys the node after the error, which causes the stream to go -to STATE_UNCONNECTED via proxy_removed(). In that case, make sure -we exit the loop early, otherwise it will take 30 seconds to unblock -gst_element_set_state() - -Upstream-Status: Pipewire MR1763 merged ---- - src/gst/gstpipewiresrc.c | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/src/gst/gstpipewiresrc.c b/src/gst/gstpipewiresrc.c -index e473338ba..e3b86b373 100644 ---- a/src/gst/gstpipewiresrc.c -+++ b/src/gst/gstpipewiresrc.c -@@ -783,10 +783,9 @@ wait_started (GstPipeWireSrc *this) - GST_DEBUG_OBJECT (this, "waiting for started signal, state now %s", - pw_stream_state_as_string (state)); - -- if (state == PW_STREAM_STATE_ERROR) -- break; -- -- if (this->flushing) { -+ if (state == PW_STREAM_STATE_ERROR || -+ state == PW_STREAM_STATE_UNCONNECTED || -+ this->flushing) { - state = PW_STREAM_STATE_ERROR; - break; - } --- -2.41.0 - diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.83.bb b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.83.bb deleted file mode 100644 index 0ac4d0937..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.83.bb +++ /dev/null @@ -1,328 +0,0 @@ -# This recipe was written by Carlos Rafael Giani -# for meta-oe -# -# The intention is to keep this synced with meta-oe and remove it when we -# can depend on meta-oe to provide this recipe for us -# -# AGL-specific overrides and configuration should go in the .bbappend file -# -SUMMARY = "Multimedia processing server for Linux" -DESCRIPTION = "Linux server for handling and routing audio and video streams between applications and multimedia I/O devices" -HOMEPAGE = "https://pipewire.org/" -BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/pipewire/issues" -LICENSE = "MIT & GPL-2.0-only & LGPL-2.1-or-later" - -LIC_FILES_CHKSUM = " \ - file://LICENSE;md5=2158739e172e58dc9ab1bdd2d6ec9c72 \ - file://COPYING;md5=97be96ca4fab23e9657ffa590b931c1a \ -" -SECTION = "multimedia" - -DEPENDS = "dbus" - -# v0.3.83 -SRCREV = "6fd7f39dbec9c3a65aa2de0123c6bfbda7c53a85" -SRC_URI = "git://gitlab.freedesktop.org/pipewire/pipewire.git;branch=master;protocol=https" - -S = "${WORKDIR}/git" - -inherit meson pkgconfig systemd manpages gettext useradd - -USERADD_PACKAGES = "${PN}" - -GROUPADD_PARAM:${PN} = "--system pipewire" - -USERADD_PARAM:${PN} = "--system --home / --no-create-home \ - --comment 'PipeWire multimedia daemon' \ - --gid pipewire --groups audio,video \ - pipewire" - -# For "EVL", look up https://evlproject.org/ . It involves -# a specially prepared kernel, and is currently unavailable -# in Yocto. -# -# FFmpeg and Vulkan aren't really supported - at the current -# stage (version 0.3.22), these are just experiments, not -# actual features. -# -# libcamera support currently does not build successfully. -# -# systemd user service files are disabled because per-user -# PipeWire instances aren't really something that makes -# much sense in an embedded environment. A system-wide -# instance does. -# -# manpage generation requires xmltoman, which is not available. -# -# Dont build any session managers along with pipewire -# wireplumber is the session manger used in AGL and it will -# be build in a different recipe -# -EXTRA_OEMESON += " \ - -Daudiotestsrc=enabled \ - -Devl=disabled \ - -Dsystemd-user-service=disabled \ - -Dtests=disabled \ - -Dudevrulesdir=${nonarch_base_libdir}/udev/rules.d/ \ - -Dvideotestsrc=enabled \ - -Dffmpeg=disabled \ - -Dvulkan=disabled \ - -Dlibcamera=disabled \ - -Dman=disabled \ - -Dsession-managers=[] \ -" - -PACKAGECONFIG ??= "\ - ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ - ${@bb.utils.filter('DISTRO_FEATURES', 'alsa systemd', d)} \ - gstreamer jack v4l2 \ -" - -# "jack" and "pipewire-jack" packageconfigs cannot be both enabled, -# since "jack" imports libjack, and "pipewire-jack" generates -# libjack.so* files, thus colliding with the libpack package. This -# is why these two are marked in their respective packageconfigs -# as being in conflict. - -PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib udev" -PACKAGECONFIG[bluez] = "-Dbluez5=enabled,-Dbluez5=disabled,bluez5 sbc" -PACKAGECONFIG[docs] = "-Ddocs=enabled,-Ddocs=disabled,doxygen-native" -PACKAGECONFIG[gstreamer] = "-Dgstreamer=enabled,-Dgstreamer=disabled,glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base" -PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack,,,pipewire-jack" -PACKAGECONFIG[sdl2] = "-Dsdl2=enabled,-Dsdl2=disabled,virtual/libsdl2" -PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1" -PACKAGECONFIG[systemd] = "-Dsystemd=enabled -Dsystemd-system-service=enabled ,-Dsystemd=disabled -Dsystemd-system-service=disabled,systemd" -PACKAGECONFIG[v4l2] = "-Dv4l2=enabled,-Dv4l2=disabled,udev" -PACKAGECONFIG[pipewire-alsa] = "-Dpipewire-alsa=enabled,-Dpipewire-alsa=disabled,alsa-lib" -PACKAGECONFIG[pipewire-jack] = "-Dpipewire-jack=enabled -Dlibjack-path=${libdir}/${PW_MODULE_SUBDIR}/jack,-Dpipewire-jack=disabled,jack,,,jack" -PACKAGECONFIG[pipewire-v4l2] = "-Dpipewire-v4l2=enabled -Dpipewire-v4l2=${libdir}/${PW_MODULE_SUBDIR}/v4l2,-Dpipewire-v4l2=disabled,v4l2" - -PACKAGESPLITFUNCS:prepend = " split_dynamic_packages " -PACKAGESPLITFUNCS:append = " set_dynamic_metapkg_rdepends " -PACKAGESPLITFUNCS:append = " fixup_dynamic_pkg_licenses " - -SPA_SUBDIR = "spa-0.2" -PW_MODULE_SUBDIR = "pipewire-0.3" - -remove_unused_installed_files() { - # jack.conf is used by pipewire-jack (not the JACK SPA plugin). - # Remove it if pipewire-jack is not built to avoid creating the - # pipewire-jack package. - if ${@bb.utils.contains('PACKAGECONFIG', 'pipewire-jack', 'false', 'true', d)}; then - rm -f "${D}${datadir}/pipewire/jack.conf" - fi -} - -do_install[postfuncs] += "remove_unused_installed_files" - -python fixup_dynamic_pkg_licenses () { - #dynamic packages inherit currently whatever is specified in LICENSE (thus multiple) - packages = (d.getVar('PACKAGES') or "").split() - - for pkg in packages: - # we manually assign the LICENSES here to cover all packages (even dynamically created ones) - d.setVar("LICENSE:" + pkg ,"MIT") - - # next handle special cases - # ==> LICENSE:${PN}-spa-plugins-alsa = "LGPL-2.1-or-later" - if "pipewire-spa-plugins-alsa" in pkg: - d.setVar("LICENSE:pipewire-spa-plugins-alsa", "LGPL-2.1-or-later") - # ==> LICENSE:${PN}-alsa-card-profile = "LGPL-2.1-or-later" - if "pipewire-alsa-card-profile" in pkg: - d.setVar("LICENSE:pipewire-alsa-card-profile", "LGPL-2.1-or-later") - # ==> LICENSE:${PN}-jack = "GPL-2.0-only" - if "pipewire-jack" in pkg: - d.setVar("LICENSE:pipewire-jack", "GPL-2.0-only") -} - -python split_dynamic_packages () { - # Create packages for each SPA plugin. These plugins are located - # in individual subdirectories, so a recursive search is needed. - spa_libdir = d.expand('${libdir}/${SPA_SUBDIR}') - do_split_packages(d, spa_libdir, r'^libspa-(.*)\.so$', d.expand('${PN}-spa-plugins-%s'), 'PipeWire SPA plugin for %s', extra_depends='', recursive=True) - - # Create packages for each PipeWire module. - pw_module_libdir = d.expand('${libdir}/${PW_MODULE_SUBDIR}') - do_split_packages(d, pw_module_libdir, r'^libpipewire-module-(.*)\.so$', d.expand('${PN}-modules-%s'), 'PipeWire %s module', extra_depends='', recursive=False) -} - -python set_dynamic_metapkg_rdepends () { - import os - import oe.utils - - # Go through all generated SPA plugin and PipeWire module packages - # (excluding the main package and the -meta package itself) and - # add them to the -meta package as RDEPENDS. - - base_pn = d.getVar('PN') - - spa_pn = base_pn + '-spa-plugins' - spa_metapkg = spa_pn + '-meta' - - pw_module_pn = base_pn + '-modules' - pw_module_metapkg = pw_module_pn + '-meta' - - d.setVar('ALLOW_EMPTY:' + spa_metapkg, "1") - d.setVar('FILES:' + spa_metapkg, "") - - d.setVar('ALLOW_EMPTY:' + pw_module_metapkg, "1") - d.setVar('FILES:' + pw_module_metapkg, "") - - blacklist = [ spa_pn, spa_metapkg, pw_module_pn, pw_module_metapkg ] - spa_metapkg_rdepends = [] - pw_module_metapkg_rdepends = [] - pkgdest = d.getVar('PKGDEST') - - for pkg in oe.utils.packages_filter_out_system(d): - if pkg in blacklist: - continue - - is_spa_pkg = pkg.startswith(spa_pn) - is_pw_module_pkg = pkg.startswith(pw_module_pn) - if not is_spa_pkg and not is_pw_module_pkg: - continue - - if pkg in spa_metapkg_rdepends or pkg in pw_module_metapkg_rdepends: - continue - - # See if the package is empty by looking at the contents of its - # PKGDEST subdirectory. If this subdirectory is empty, then then - # package is empty as well. Empty packages do not get added to - # the meta package's RDEPENDS. - pkgdir = os.path.join(pkgdest, pkg) - if os.path.exists(pkgdir): - dir_contents = os.listdir(pkgdir) or [] - else: - dir_contents = [] - is_empty = len(dir_contents) == 0 - if not is_empty: - if is_spa_pkg: - spa_metapkg_rdepends.append(pkg) - if is_pw_module_pkg: - pw_module_metapkg_rdepends.append(pkg) - - d.setVar('RDEPENDS:' + spa_metapkg, ' '.join(spa_metapkg_rdepends)) - d.setVar('DESCRIPTION:' + spa_metapkg, spa_pn + ' meta package') - - d.setVar('RDEPENDS:' + pw_module_metapkg, ' '.join(pw_module_metapkg_rdepends)) - d.setVar('DESCRIPTION:' + pw_module_metapkg, pw_module_pn + ' meta package') -} - -PACKAGES =+ "\ - libpipewire \ - ${PN}-tools \ - ${PN}-pulse \ - ${PN}-alsa \ - ${PN}-jack \ - ${PN}-v4l2 \ - ${PN}-spa-plugins \ - ${PN}-spa-plugins-meta \ - ${PN}-spa-tools \ - ${PN}-modules \ - ${PN}-modules-meta \ - ${PN}-alsa-card-profile \ - gstreamer1.0-pipewire \ -" - -PACKAGES_DYNAMIC = "^${PN}-spa-plugins.* ^${PN}-modules.*" - -SYSTEMD_SERVICE:${PN} = "pipewire.service" -CONFFILES:${PN} += "${datadir}/pipewire/pipewire.conf" -FILES:${PN} = " \ - ${datadir}/pipewire/pipewire.conf \ - ${datadir}/pipewire/filter-chain.conf \ - ${datadir}/pipewire/filter-chain \ - ${systemd_user_unitdir}/pipewire.* \ - ${bindir}/pipewire \ - ${datadir}/pipewire/pipewire-avb.conf \ - ${bindir}/pipewire-avb \ - ${datadir}/pipewire/pipewire-aes67.conf \ - ${bindir}/pipewire-aes67 \ - ${datadir}/pipewire/pipewire.conf.avail \ - ${datadir}/pipewire/pipewire-pulse.conf.avail \ - ${datadir}/pipewire/client-rt.conf.avail \ - ${datadir}/pipewire/client.conf.avail \ - ${sysconfdir}/security/limits.d \ -" - -FILES:${PN}-dev += " \ - ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so \ -" - -CONFFILES:libpipewire += "${datadir}/pipewire/client.conf" -FILES:libpipewire = " \ - ${datadir}/pipewire/client.conf \ - ${datadir}/pipewire/client-rt.conf \ - ${datadir}/pipewire/minimal.conf \ - ${libdir}/libpipewire-*.so.* \ -" -# Add the bare minimum modules and plugins required to be able -# to use libpipewire. Without these, it is essentially unusable. -RDEPENDS:libpipewire += " \ - ${PN}-modules-client-node \ - ${PN}-modules-protocol-native \ - ${PN}-spa-plugins-support \ -" - -FILES:${PN}-tools = " \ - ${bindir}/pw-* \ -" - -# This is a shim daemon that is intended to be used as a -# drop-in PulseAudio replacement, providing a pulseaudio-compatible -# socket that can be used by applications that use libpulse. -CONFFILES:${PN}-pulse += "${datadir}/pipewire/pipewire-pulse.conf" - -FILES:${PN}-pulse = " \ - ${datadir}/pipewire/pipewire-pulse.conf \ - ${systemd_user_unitdir}/pipewire-pulse.* \ - ${bindir}/pipewire-pulse \ -" -RDEPENDS:${PN}-pulse += " \ - ${PN}-modules-protocol-pulse \ -" - -# alsa plugin to redirect audio to pipewire -FILES:${PN}-alsa = "\ - ${libdir}/alsa-lib/* \ - ${datadir}/alsa/alsa.conf.d/* \ -" - -#lib to emulate v4l2 system calls on top of PipeWire -FILES:${PN}-v4l2 = "\ - ${libdir}/${PW_MODULE_SUBDIR}/v4l2/libpw-v4l2.so \ -" - -# jack drop-in libraries to redirect audio to pipewire -CONFFILES:${PN}-jack = "${datadir}/pipewire/jack.conf" -FILES:${PN}-jack = "\ - ${datadir}/pipewire/jack.conf \ - ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so.* \ -" -# Dynamic packages (see set_dynamic_metapkg_rdepends). -FILES:${PN}-spa-plugins-bluez5 += " \ - ${datadir}/${SPA_SUBDIR}/bluez5/bluez-hardware.conf \ -" -RRECOMMENDS:${PN}-spa-plugins += "${PN}-spa-plugins-meta" - -FILES:${PN}-spa-tools = " \ - ${bindir}/spa-* \ -" - -# Dynamic packages (see set_dynamic_metapkg_rdepends). -FILES:${PN}-modules = "" -RRECOMMENDS:${PN}-modules += "${PN}-modules-meta" - -CONFFILES:${PN}-modules-rtkit = "${datadir}/pipewire/client-rt.conf" -FILES:${PN}-modules-rtkit += " \ - ${datadir}/pipewire/client-rt.conf \ - " - -FILES:${PN}-alsa-card-profile = " \ - ${datadir}/alsa-card-profile/* \ - ${nonarch_base_libdir}/udev/rules.d/90-pipewire-alsa.rules \ -" - -FILES:gstreamer1.0-pipewire = " \ - ${libdir}/gstreamer-1.0/* \ -" diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.83.bbappend b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.83.bbappend deleted file mode 100644 index 6b920abd3..000000000 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.83.bbappend +++ /dev/null @@ -1,27 +0,0 @@ -SRC_URI += "\ - file://0001-systemd-Do-not-override-rootprefix.patch \ - file://0002-gst-avoid-reporting-error-twice.patch \ - file://0003-gstpipewiresrc-break-out-of-wait_started-also-on-STA.patch \ -" - -PACKAGECONFIG = "\ - ${@bb.utils.contains('DISTRO_FEATURES', 'bluez5', 'bluez', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa pipewire-alsa', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'sndfile', '', d)} \ - ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ - gstreamer v4l2 \ -" - -do_install:append() { - # install symlinks to alsalib configuration files - for i in 50-pipewire.conf 99-pipewire-default.conf; do - if [ -f ${D}${datadir}/alsa/alsa.conf.d/${i} ]; then - install -d ${D}${sysconfdir}/alsa/conf.d - ln -s ${datadir}/alsa/alsa.conf.d/${i} ${D}${sysconfdir}/alsa/conf.d/${i} - fi - done -} - -FILES:${PN}-alsa:append = "\ - ${sysconfdir}/alsa/conf.d/* \ -" diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bb b/meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bb new file mode 100644 index 000000000..641c97e8f --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bb @@ -0,0 +1,329 @@ +# This recipe was written by Carlos Rafael Giani +# for meta-oe +# +# The intention is to keep this synced with meta-oe and remove it when we +# can depend on meta-oe to provide this recipe for us +# +# AGL-specific overrides and configuration should go in the .bbappend file +# +SUMMARY = "Multimedia processing server for Linux" +DESCRIPTION = "Linux server for handling and routing audio and video streams between applications and multimedia I/O devices" +HOMEPAGE = "https://pipewire.org/" +BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/pipewire/issues" +LICENSE = "MIT & GPL-2.0-only & LGPL-2.1-or-later" + +LIC_FILES_CHKSUM = " \ + file://LICENSE;md5=2158739e172e58dc9ab1bdd2d6ec9c72 \ + file://COPYING;md5=97be96ca4fab23e9657ffa590b931c1a \ +" +SECTION = "multimedia" + +DEPENDS = "dbus" + +# v1.0.0(El Presidente) +SRCREV = "4debdcd40b055b3eaa83a8f4443aa990ea566bfe" +SRC_URI = "git://gitlab.freedesktop.org/pipewire/pipewire.git;branch=master;protocol=https" + +S = "${WORKDIR}/git" + +inherit meson pkgconfig systemd manpages gettext useradd + +USERADD_PACKAGES = "${PN}" + +GROUPADD_PARAM:${PN} = "--system pipewire" + +USERADD_PARAM:${PN} = "--system --home / --no-create-home \ + --comment 'PipeWire multimedia daemon' \ + --gid pipewire --groups audio,video \ + pipewire" + +# For "EVL", look up https://evlproject.org/ . It involves +# a specially prepared kernel, and is currently unavailable +# in Yocto. +# +# FFmpeg and Vulkan aren't really supported - at the current +# stage (version 0.3.22), these are just experiments, not +# actual features. +# +# libcamera support currently does not build successfully. +# +# systemd user service files are disabled because per-user +# PipeWire instances aren't really something that makes +# much sense in an embedded environment. A system-wide +# instance does. +# +# manpage generation requires xmltoman, which is not available. +# +# Dont build any session managers along with pipewire +# wireplumber is the session manger used in AGL and it will +# be build in a different recipe +# +EXTRA_OEMESON += " \ + -Daudiotestsrc=enabled \ + -Devl=disabled \ + -Dsystemd-user-service=disabled \ + -Dtests=disabled \ + -Dudevrulesdir=${nonarch_base_libdir}/udev/rules.d/ \ + -Dvideotestsrc=enabled \ + -Dffmpeg=disabled \ + -Dvulkan=disabled \ + -Dlibcamera=disabled \ + -Dman=disabled \ + -Dsession-managers=[] \ +" + +PACKAGECONFIG ??= "\ + ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'alsa systemd', d)} \ + gstreamer jack v4l2 \ +" + +# "jack" and "pipewire-jack" packageconfigs cannot be both enabled, +# since "jack" imports libjack, and "pipewire-jack" generates +# libjack.so* files, thus colliding with the libpack package. This +# is why these two are marked in their respective packageconfigs +# as being in conflict. + +PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib udev" +PACKAGECONFIG[bluez] = "-Dbluez5=enabled,-Dbluez5=disabled,bluez5 sbc" +PACKAGECONFIG[docs] = "-Ddocs=enabled,-Ddocs=disabled,doxygen-native" +PACKAGECONFIG[gstreamer] = "-Dgstreamer=enabled,-Dgstreamer=disabled,glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base" +PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack,,,pipewire-jack" +PACKAGECONFIG[sdl2] = "-Dsdl2=enabled,-Dsdl2=disabled,virtual/libsdl2" +PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1" +PACKAGECONFIG[systemd] = "-Dsystemd=enabled -Dsystemd-system-service=enabled ,-Dsystemd=disabled -Dsystemd-system-service=disabled,systemd" +PACKAGECONFIG[v4l2] = "-Dv4l2=enabled,-Dv4l2=disabled,udev" +PACKAGECONFIG[pipewire-alsa] = "-Dpipewire-alsa=enabled,-Dpipewire-alsa=disabled,alsa-lib" +PACKAGECONFIG[pipewire-jack] = "-Dpipewire-jack=enabled -Dlibjack-path=${libdir}/${PW_MODULE_SUBDIR}/jack,-Dpipewire-jack=disabled,jack,,,jack" +PACKAGECONFIG[pipewire-v4l2] = "-Dpipewire-v4l2=enabled -Dpipewire-v4l2=${libdir}/${PW_MODULE_SUBDIR}/v4l2,-Dpipewire-v4l2=disabled,v4l2" + +PACKAGESPLITFUNCS:prepend = " split_dynamic_packages " +PACKAGESPLITFUNCS:append = " set_dynamic_metapkg_rdepends " +PACKAGESPLITFUNCS:append = " fixup_dynamic_pkg_licenses " + +SPA_SUBDIR = "spa-0.2" +PW_MODULE_SUBDIR = "pipewire-0.3" + +remove_unused_installed_files() { + # jack.conf is used by pipewire-jack (not the JACK SPA plugin). + # Remove it if pipewire-jack is not built to avoid creating the + # pipewire-jack package. + if ${@bb.utils.contains('PACKAGECONFIG', 'pipewire-jack', 'false', 'true', d)}; then + rm -f "${D}${datadir}/pipewire/jack.conf" + fi +} + +do_install[postfuncs] += "remove_unused_installed_files" + +python fixup_dynamic_pkg_licenses () { + #dynamic packages inherit currently whatever is specified in LICENSE (thus multiple) + packages = (d.getVar('PACKAGES') or "").split() + + for pkg in packages: + # we manually assign the LICENSES here to cover all packages (even dynamically created ones) + d.setVar("LICENSE:" + pkg ,"MIT") + + # next handle special cases + # ==> LICENSE:${PN}-spa-plugins-alsa = "LGPL-2.1-or-later" + if "pipewire-spa-plugins-alsa" in pkg: + d.setVar("LICENSE:pipewire-spa-plugins-alsa", "LGPL-2.1-or-later") + # ==> LICENSE:${PN}-alsa-card-profile = "LGPL-2.1-or-later" + if "pipewire-alsa-card-profile" in pkg: + d.setVar("LICENSE:pipewire-alsa-card-profile", "LGPL-2.1-or-later") + # ==> LICENSE:${PN}-jack = "GPL-2.0-only" + if "pipewire-jack" in pkg: + d.setVar("LICENSE:pipewire-jack", "GPL-2.0-only") +} + +python split_dynamic_packages () { + # Create packages for each SPA plugin. These plugins are located + # in individual subdirectories, so a recursive search is needed. + spa_libdir = d.expand('${libdir}/${SPA_SUBDIR}') + do_split_packages(d, spa_libdir, r'^libspa-(.*)\.so$', d.expand('${PN}-spa-plugins-%s'), 'PipeWire SPA plugin for %s', extra_depends='', recursive=True) + + # Create packages for each PipeWire module. + pw_module_libdir = d.expand('${libdir}/${PW_MODULE_SUBDIR}') + do_split_packages(d, pw_module_libdir, r'^libpipewire-module-(.*)\.so$', d.expand('${PN}-modules-%s'), 'PipeWire %s module', extra_depends='', recursive=False) +} + +python set_dynamic_metapkg_rdepends () { + import os + import oe.utils + + # Go through all generated SPA plugin and PipeWire module packages + # (excluding the main package and the -meta package itself) and + # add them to the -meta package as RDEPENDS. + + base_pn = d.getVar('PN') + + spa_pn = base_pn + '-spa-plugins' + spa_metapkg = spa_pn + '-meta' + + pw_module_pn = base_pn + '-modules' + pw_module_metapkg = pw_module_pn + '-meta' + + d.setVar('ALLOW_EMPTY:' + spa_metapkg, "1") + d.setVar('FILES:' + spa_metapkg, "") + + d.setVar('ALLOW_EMPTY:' + pw_module_metapkg, "1") + d.setVar('FILES:' + pw_module_metapkg, "") + + blacklist = [ spa_pn, spa_metapkg, pw_module_pn, pw_module_metapkg ] + spa_metapkg_rdepends = [] + pw_module_metapkg_rdepends = [] + pkgdest = d.getVar('PKGDEST') + + for pkg in oe.utils.packages_filter_out_system(d): + if pkg in blacklist: + continue + + is_spa_pkg = pkg.startswith(spa_pn) + is_pw_module_pkg = pkg.startswith(pw_module_pn) + if not is_spa_pkg and not is_pw_module_pkg: + continue + + if pkg in spa_metapkg_rdepends or pkg in pw_module_metapkg_rdepends: + continue + + # See if the package is empty by looking at the contents of its + # PKGDEST subdirectory. If this subdirectory is empty, then then + # package is empty as well. Empty packages do not get added to + # the meta package's RDEPENDS. + pkgdir = os.path.join(pkgdest, pkg) + if os.path.exists(pkgdir): + dir_contents = os.listdir(pkgdir) or [] + else: + dir_contents = [] + is_empty = len(dir_contents) == 0 + if not is_empty: + if is_spa_pkg: + spa_metapkg_rdepends.append(pkg) + if is_pw_module_pkg: + pw_module_metapkg_rdepends.append(pkg) + + d.setVar('RDEPENDS:' + spa_metapkg, ' '.join(spa_metapkg_rdepends)) + d.setVar('DESCRIPTION:' + spa_metapkg, spa_pn + ' meta package') + + d.setVar('RDEPENDS:' + pw_module_metapkg, ' '.join(pw_module_metapkg_rdepends)) + d.setVar('DESCRIPTION:' + pw_module_metapkg, pw_module_pn + ' meta package') +} + +PACKAGES =+ "\ + libpipewire \ + ${PN}-tools \ + ${PN}-pulse \ + ${PN}-alsa \ + ${PN}-jack \ + ${PN}-v4l2 \ + ${PN}-spa-plugins \ + ${PN}-spa-plugins-meta \ + ${PN}-spa-tools \ + ${PN}-modules \ + ${PN}-modules-meta \ + ${PN}-alsa-card-profile \ + gstreamer1.0-pipewire \ +" + +PACKAGES_DYNAMIC = "^${PN}-spa-plugins.* ^${PN}-modules.*" + +SYSTEMD_SERVICE:${PN} = "pipewire.service" +CONFFILES:${PN} += "${datadir}/pipewire/pipewire.conf" +FILES:${PN} = " \ + ${datadir}/pipewire/pipewire.conf \ + ${datadir}/pipewire/filter-chain.conf \ + ${datadir}/pipewire/filter-chain \ + ${systemd_user_unitdir}/pipewire.* \ + ${systemd_system_unitdir}/pipewire* \ + ${bindir}/pipewire \ + ${datadir}/pipewire/pipewire-avb.conf \ + ${bindir}/pipewire-avb \ + ${datadir}/pipewire/pipewire-aes67.conf \ + ${bindir}/pipewire-aes67 \ + ${datadir}/pipewire/pipewire.conf.avail \ + ${datadir}/pipewire/pipewire-pulse.conf.avail \ + ${datadir}/pipewire/client-rt.conf.avail \ + ${datadir}/pipewire/client.conf.avail \ + ${sysconfdir}/security/limits.d \ +" + +FILES:${PN}-dev += " \ + ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so \ +" + +CONFFILES:libpipewire += "${datadir}/pipewire/client.conf" +FILES:libpipewire = " \ + ${datadir}/pipewire/client.conf \ + ${datadir}/pipewire/client-rt.conf \ + ${datadir}/pipewire/minimal.conf \ + ${libdir}/libpipewire-*.so.* \ +" +# Add the bare minimum modules and plugins required to be able +# to use libpipewire. Without these, it is essentially unusable. +RDEPENDS:libpipewire += " \ + ${PN}-modules-client-node \ + ${PN}-modules-protocol-native \ + ${PN}-spa-plugins-support \ +" + +FILES:${PN}-tools = " \ + ${bindir}/pw-* \ +" + +# This is a shim daemon that is intended to be used as a +# drop-in PulseAudio replacement, providing a pulseaudio-compatible +# socket that can be used by applications that use libpulse. +CONFFILES:${PN}-pulse += "${datadir}/pipewire/pipewire-pulse.conf" + +FILES:${PN}-pulse = " \ + ${datadir}/pipewire/pipewire-pulse.conf \ + ${systemd_user_unitdir}/pipewire-pulse.* \ + ${bindir}/pipewire-pulse \ +" +RDEPENDS:${PN}-pulse += " \ + ${PN}-modules-protocol-pulse \ +" + +# alsa plugin to redirect audio to pipewire +FILES:${PN}-alsa = "\ + ${libdir}/alsa-lib/* \ + ${datadir}/alsa/alsa.conf.d/* \ +" + +#lib to emulate v4l2 system calls on top of PipeWire +FILES:${PN}-v4l2 = "\ + ${libdir}/${PW_MODULE_SUBDIR}/v4l2/libpw-v4l2.so \ +" + +# jack drop-in libraries to redirect audio to pipewire +CONFFILES:${PN}-jack = "${datadir}/pipewire/jack.conf" +FILES:${PN}-jack = "\ + ${datadir}/pipewire/jack.conf \ + ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so.* \ +" +# Dynamic packages (see set_dynamic_metapkg_rdepends). +FILES:${PN}-spa-plugins-bluez5 += " \ + ${datadir}/${SPA_SUBDIR}/bluez5/bluez-hardware.conf \ +" +RRECOMMENDS:${PN}-spa-plugins += "${PN}-spa-plugins-meta" + +FILES:${PN}-spa-tools = " \ + ${bindir}/spa-* \ +" + +# Dynamic packages (see set_dynamic_metapkg_rdepends). +FILES:${PN}-modules = "" +RRECOMMENDS:${PN}-modules += "${PN}-modules-meta" + +CONFFILES:${PN}-modules-rtkit = "${datadir}/pipewire/client-rt.conf" +FILES:${PN}-modules-rtkit += " \ + ${datadir}/pipewire/client-rt.conf \ + " + +FILES:${PN}-alsa-card-profile = " \ + ${datadir}/alsa-card-profile/* \ + ${nonarch_base_libdir}/udev/rules.d/90-pipewire-alsa.rules \ +" + +FILES:gstreamer1.0-pipewire = " \ + ${libdir}/gstreamer-1.0/* \ +" diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bbappend b/meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bbappend new file mode 100644 index 000000000..beb7c0817 --- /dev/null +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bbappend @@ -0,0 +1,25 @@ +SRC_URI += "\ + file://0001-systemd-Do-not-override-rootprefix.patch \ +" + +PACKAGECONFIG = "\ + ${@bb.utils.contains('DISTRO_FEATURES', 'bluez5', 'bluez', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa pipewire-alsa', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'sndfile', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ + gstreamer v4l2 \ +" + +do_install:append() { + # install symlinks to alsalib configuration files + for i in 50-pipewire.conf 99-pipewire-default.conf; do + if [ -f ${D}${datadir}/alsa/alsa.conf.d/${i} ]; then + install -d ${D}${sysconfdir}/alsa/conf.d + ln -s ${datadir}/alsa/alsa.conf.d/${i} ${D}${sysconfdir}/alsa/conf.d/${i} + fi + done +} + +FILES:${PN}-alsa:append = "\ + ${sysconfdir}/alsa/conf.d/* \ +" diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-policy-endpoint-device.lua-fix-dangling-logs-issue.patch b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-policy-endpoint-device.lua-fix-dangling-logs-issue.patch deleted file mode 100644 index ef7192192..000000000 --- a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-policy-endpoint-device.lua-fix-dangling-logs-issue.patch +++ /dev/null @@ -1,47 +0,0 @@ -From d1624b1648512ead7f6b222bc64cda94016fb0c6 Mon Sep 17 00:00:00 2001 -From: Ashok Sidipotu -Date: Fri, 24 Nov 2023 02:45:41 +0100 -Subject: [PATCH] policy-endpoint-device.lua: fix dangling logs issue. - -When logs are enabled sometimes the new log msgs added to print the link -string can assert. - -Upstream-Status: WirePlumber MR570 submitted ---- - src/scripts/policy-endpoint-device.lua | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/src/scripts/policy-endpoint-device.lua b/src/scripts/policy-endpoint-device.lua -index 4440c17c..4c74077b 100644 ---- a/src/scripts/policy-endpoint-device.lua -+++ b/src/scripts/policy-endpoint-device.lua -@@ -116,7 +116,7 @@ function createLink (si_ep, si_target) - local in_item = nil - local ep_props = si_ep.properties - local target_props = si_target.properties -- -+ local is_filter = (ep_props["node.link-group"] ~= nil) - if target_props["item.node.direction"] == "input" then - -- playback - out_item = si_ep -@@ -131,10 +131,10 @@ function createLink (si_ep, si_target) - (is_filter and ep_props["node.name"] or ep_props["name"]), - target_props["node.name"]) - -- Log.info(si_link, link_string) -- - -- create and configure link - local si_link = SessionItem ( "si-standard-link" ) -+ -+ Log.info(si_link, "creating link " .. link_string) - if not si_link:configure { - ["out.item"] = out_item, - ["in.item"] = in_item, -@@ -146,6 +146,7 @@ function createLink (si_ep, si_target) - return - end - -+ - -- register - si_link:register () - diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb index 0d7e354fb..698b9a534 100644 --- a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb +++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb @@ -13,16 +13,15 @@ DEPENDS = "glib-2.0 glib-2.0-native pipewire lua" SRC_URI = "\ git://gitlab.freedesktop.org/pipewire/wireplumber.git;protocol=https;branch=master \ - file://0001-policy-endpoint-device.lua-fix-dangling-logs-issue.patch \ " -# v0.4.16 -SRCREV = "0d249b8a13d7168fe54fa6eb1db1c4a5fcc8d3f8" +# v0.4.17 +SRCREV = "d3eb77b292655cef333a8f4cab4e861415bc37c2" # patches to be able to compile with lower version of meson that is available in AGL. SRC_URI += "\ " -PV = "0.4.16" +PV = "0.4.17" S = "${WORKDIR}/git" WPAPI="0.4" -- cgit 1.2.3-korg