git: d26cd48207f1 - main - multimedia/pipewire: unbreak MEDIASESSION after ea9c61f86374

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Wed, 11 Oct 2023 17:06:00 UTC
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d26cd48207f1d50401c130539a650e91e6f150b2

commit d26cd48207f1d50401c130539a650e91e6f150b2
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-10-11 16:57:25 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-10-11 17:05:10 +0000

    multimedia/pipewire: unbreak MEDIASESSION after ea9c61f86374
    
    $ daemon -f pipewire
    $ /usr/local/libexec/xdg-desktop-portal-wlr
    [ERROR] - pipewire: couldn't connect to context
    [ERROR] - xdpw: failed to initialize screencast
    'impl->enter_count > 0' failed at ../spa/plugins/support/loop.c:362 loop_leave()
    
    PR:             273258
    Regressed by:   https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/01096bf6695a
---
 multimedia/pipewire/Makefile                       |  2 +
 .../pipewire/files/patch-spa_plugins_meson.build   |  8 +++
 multimedia/pipewire/pkg-plist                      | 77 ++++++++++++++++++++++
 3 files changed, 87 insertions(+)

diff --git a/multimedia/pipewire/Makefile b/multimedia/pipewire/Makefile
index e13d2ddbcf2a..fb37bef94710 100644
--- a/multimedia/pipewire/Makefile
+++ b/multimedia/pipewire/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	pipewire
 DISTVERSION=	0.3.81
+PORTREVISION=	1
 CATEGORIES=	multimedia
 MASTER_SITES=	https://gitlab.freedesktop.org/pipewire/media-session/-/archive/${MEDIA_SESSION_VERSION}/:media_session
 DISTFILES=	media-session-${MEDIA_SESSION_VERSION}${EXTRACT_SUFX}:media_session
@@ -71,6 +72,7 @@ MESON_ARGS=	-D pw-cat=enabled \
 		-D raop=enabled \
 		-D avb=disabled \
 		-D bluez5=disabled \
+		-D compress-offload=disabled \
 		-D jack=disabled \
 		-D libcamera=disabled \
 		-D libcanberra=disabled \
diff --git a/multimedia/pipewire/files/patch-spa_plugins_meson.build b/multimedia/pipewire/files/patch-spa_plugins_meson.build
new file mode 100644
index 000000000000..45a68c3c3101
--- /dev/null
+++ b/multimedia/pipewire/files/patch-spa_plugins_meson.build
@@ -0,0 +1,8 @@
+--- spa/plugins/meson.build.orig	2023-10-06 09:37:06 UTC
++++ spa/plugins/meson.build
+@@ -1,4 +1,4 @@
+-if alsa_dep.found() and host_machine.system() == 'linux'
++if alsa_dep.found()
+   subdir('alsa')
+ endif
+ if get_option('avb').require(host_machine.system() == 'linux', error_message: 'AVB support is only available on Linux').allowed()
diff --git a/multimedia/pipewire/pkg-plist b/multimedia/pipewire/pkg-plist
index 6780de9bfb9f..c75ca06a5978 100644
--- a/multimedia/pipewire/pkg-plist
+++ b/multimedia/pipewire/pkg-plist
@@ -24,6 +24,7 @@ bin/pw-profiler
 bin/pw-record
 bin/pw-reserve
 bin/pw-top
+%%MEDIASESSION%%bin/spa-acp-tool
 bin/spa-inspect
 bin/spa-json-dump
 bin/spa-monitor
@@ -285,6 +286,7 @@ lib/pipewire-0.3/libpipewire-module-vban-send.so
 %%PULSEAUDIO%%lib/pipewire-0.3/libpipewire-module-zeroconf-discover.so
 lib/spa-0.2/aec/libspa-aec-null.so
 lib/spa-0.2/aec/libspa-aec-webrtc.so
+%%MEDIASESSION%%lib/spa-0.2/alsa/libspa-alsa.so
 lib/spa-0.2/audioconvert/libspa-audioconvert.so
 lib/spa-0.2/audiomixer/libspa-audiomixer.so
 lib/spa-0.2/audiotestsrc/libspa-audiotestsrc.so
@@ -295,6 +297,7 @@ lib/spa-0.2/v4l2/libspa-v4l2.so
 lib/spa-0.2/videoconvert/libspa-videoconvert.so
 lib/spa-0.2/videotestsrc/libspa-videotestsrc.so
 %%VULKAN%%lib/spa-0.2/vulkan/libspa-vulkan.so
+@comment lib/udev/rules.d/90-pipewire-alsa.rules
 libdata/pkgconfig/libpipewire-0.3.pc
 libdata/pkgconfig/libspa-0.2.pc
 %%MANPAGES%%man/man1/pipewire-pulse.1.gz
@@ -311,6 +314,80 @@ libdata/pkgconfig/libspa-0.2.pc
 %%MANPAGES%%man/man1/pw-profiler.1.gz
 %%MANPAGES%%man/man1/pw-top.1.gz
 %%MANPAGES%%man/man5/pipewire.conf.5.gz
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input-aux.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input-dock-mic.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input-fm.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input-front-mic.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input-headphone-mic.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input-headset-mic.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input-internal-mic-always.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input-internal-mic.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input-linein.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input-mic-line.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input-mic.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input-mic.conf.common
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input-rear-mic.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input-tvtuner.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input-video.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-input.conf.common
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-output-chat.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-output-headphones-2.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-output-headphones.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-output-lineout.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-output-mono.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-output-speaker-always.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-output-speaker.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-output.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/analog-output.conf.common
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/audigy-analog-output-mirror.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/audigy-analog-output.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/hdmi-output-0.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/hdmi-output-1.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/hdmi-output-10.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/hdmi-output-2.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/hdmi-output-3.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/hdmi-output-4.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/hdmi-output-5.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/hdmi-output-6.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/hdmi-output-7.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/hdmi-output-8.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/hdmi-output-9.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/iec958-stereo-input.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/iec958-stereo-output.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/steelseries-arctis-output-chat-common.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/steelseries-arctis-output-game-common.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/usb-gaming-headset-input.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/usb-gaming-headset-output-mono.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/usb-gaming-headset-output-stereo.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/paths/virtual-surround-7.1.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/9999-custom.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/analog-only.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/asus-xonar-se.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/audigy.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/cmedia-high-speed-true-hdaudio.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/default.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/dell-dock-tb16-usb-audio.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/force-speaker-and-int-mic.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/force-speaker.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/hp-tbt-dock-120w-g2.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/hp-tbt-dock-audio-module.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/kinect-audio.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/maudio-fasttrack-pro.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/native-instruments-audio4dj.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/native-instruments-audio8dj.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/native-instruments-komplete-audio6.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/native-instruments-korecontroller.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/native-instruments-traktor-audio10.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/native-instruments-traktor-audio2.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/native-instruments-traktor-audio6.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/native-instruments-traktorkontrol-s4.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/sb-omni-surround-5.1.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/sennheiser-gsx.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/simple-headphones-mic.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/steelseries-arctis-common-usb-audio.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/texas-instruments-pcm2902.conf
+%%MEDIASESSION%%share/alsa-card-profile/mixer/profile-sets/usb-gaming-headset.conf
 %%MEDIASESSION%%share/alsa/alsa.conf.d/50-pipewire.conf
 %%MEDIASESSION%%share/alsa/alsa.conf.d/99-pipewire-default.conf
 %%MEDIASESSION%%share/locale/af/LC_MESSAGES/media-session.mo