public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-sound/pulseaudio-daemon/, media-sound/pulseaudio-daemon/files/
@ 2021-09-24 18:16 Mart Raudsepp
  0 siblings, 0 replies; 8+ messages in thread
From: Mart Raudsepp @ 2021-09-24 18:16 UTC (permalink / raw
  To: gentoo-commits

commit:     26646b27529e13f7beb0c78fac339e1d78bf07d4
Author:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 24 18:07:09 2021 +0000
Commit:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Fri Sep 24 18:15:57 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26646b27

media-sound/pulseaudio-daemon: Add split package for pulseaudio daemon

Bug: https://bugs.gentoo.org/536780
Package-Manager: Portage-3.0.20, Repoman-3.0.2
Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>

 media-sound/pulseaudio-daemon/Manifest             |   1 +
 .../pulseaudio-daemon/files/15.0-daemon-only.patch | 277 ++++++++++++++++++
 ...pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch |  25 ++
 .../pulseaudio-daemon/files/pulseaudio.conf.d      |   6 +
 .../pulseaudio-daemon/files/pulseaudio.init.d-5    |  80 ++++++
 .../pulseaudio-daemon/files/pulseaudio.service     |  10 +
 .../pulseaudio-daemon/files/pulseaudio.tmpfiles    |   1 +
 media-sound/pulseaudio-daemon/metadata.xml         |  66 +++++
 .../pulseaudio-daemon-15.0.ebuild                  | 320 +++++++++++++++++++++
 9 files changed, 786 insertions(+)

diff --git a/media-sound/pulseaudio-daemon/Manifest b/media-sound/pulseaudio-daemon/Manifest
new file mode 100644
index 00000000000..308d5950874
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/Manifest
@@ -0,0 +1 @@
+DIST pulseaudio-15.0.tar.xz 1521760 BLAKE2B a6f7b74fdcfe7f2a993eafb9f465946915a24b6801d3077971b9377290d6c70b3f8640a800abd09d5901db96a20349f31b1beedd9da2249f69b591fb8392f489 SHA512 352ef20384c76c631c0faa73b08e2318902a433712e0c086a5ac7a0ae58873c8d4be8f35879bdec71a93b19ae8e2ba073cacac4d56215bcf58375a0cd9d88833

diff --git a/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch b/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch
new file mode 100644
index 00000000000..9b18310f9e2
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch
@@ -0,0 +1,277 @@
+From 5bcbd2ba656ac38ba500dc110cc13dbaa0d77853 Mon Sep 17 00:00:00 2001
+From: Mart Raudsepp <mart@leio.tech>
+Date: Fri, 24 Sep 2021 15:19:05 +0300
+Subject: [PATCH] build-sys: meson: Allow building the daemon only
+
+---
+ meson.build                       | 23 ++++++++++++++++++++---
+ meson_options.txt                 |  3 +++
+ po/meson.build                    |  3 ---
+ shell-completion/bash/meson.build |  2 ++
+ src/daemon/meson.build            |  4 ++--
+ src/meson.build                   | 11 +++++++++++
+ src/modules/gsettings/meson.build |  3 +--
+ src/tests/meson.build             |  9 +++++++--
+ src/utils/meson.build             | 10 ++++++----
+ 9 files changed, 52 insertions(+), 16 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 63ed62342..420cc6fac 100644
+--- a/meson.build
++++ b/meson.build
+@@ -53,6 +53,8 @@ libpulse_mainloop_glib_version = '@0@.@1@.@2@'.format(
+   libpulse_mainloop_glib_version_info[1],
+ )
+ 
++i18n = import('i18n')
++
+ # Paths
+ 
+ prefix = get_option('prefix')
+@@ -68,6 +70,7 @@ localedir = join_paths(prefix, get_option('localedir'))
+ localstatedir = join_paths(prefix, get_option('localstatedir'))
+ sysconfdir = join_paths(prefix, get_option('sysconfdir'))
+ privlibdir = join_paths(libdir, 'pulseaudio')
++po_dir = join_paths(meson.current_source_dir(), 'po')
+ 
+ if host_machine.system() == 'windows'
+   # Windows only supports loading libraries from the same dir as the executable
+@@ -796,20 +799,28 @@ check_dep = dependency('check', version : '>= 0.9.10', required : get_option('te
+ if get_option('doxygen')
+   subdir('doxygen')
+ endif
+-subdir('po')
++if not get_option('daemon-only')
++  subdir('po')
++endif
+ if get_option('man')
+   subdir('man')
+ endif
+ subdir('shell-completion/bash')
+-subdir('shell-completion/zsh')
++if not get_option('daemon-only')
++  subdir('shell-completion/zsh')
++endif
+ subdir('src')
+-subdir('vala')
++if not get_option('daemon-only')
++ subdir('vala')
++endif
+ 
+ # Now generate config.h from everything above
+ configure_file(output : 'config.h', configuration : cdata)
+ 
+ # pkg-config files
+ 
++if not get_option('daemon-only')
++
+ pc_cdata = configuration_data()
+ 
+ pc_cdata.set('prefix', prefix)
+@@ -842,8 +853,12 @@ foreach file : pc_files
+     install_dir : pkgconfigdir)
+ endforeach
+ 
++endif # !daemon-only
++
+ # CMake files
+ 
++if not get_option('daemon-only')
++
+ m4 = find_program('m4', required: true)
+ 
+ cmakedir = join_paths(libdir, 'cmake', 'PulseAudio')
+@@ -872,6 +887,8 @@ configure_file(
+   install_dir : cmakedir,
+ )
+ 
++endif # !daemon-only
++
+ ############################################################
+ 
+ # Final summary
+diff --git a/meson_options.txt b/meson_options.txt
+index bb41a42a7..62828ac5c 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1,6 +1,9 @@
+ option('daemon',
+        type : 'boolean', value : true,
+        description : 'Enable building and installation of pulseaudio daemon and supporting configuration files')
++option('daemon-only',
++       type : 'boolean', value : false,
++       description : 'Build and install only the pulseaudio daemon and supporting configuration files, relying on a system installation of libpulse')
+ option('doxygen',
+        type : 'boolean', value : true,
+        description : 'Enable building and installation of documentation generated with doxygen')
+diff --git a/po/meson.build b/po/meson.build
+index 34278db47..33429373c 100644
+--- a/po/meson.build
++++ b/po/meson.build
+@@ -1,4 +1,3 @@
+-i18n = import('i18n')
+ i18n.gettext(
+   meson.project_name(),
+   preset: 'glib',
+@@ -7,5 +6,3 @@ i18n.gettext(
+   args: ['--msgid-bugs-address=https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/new',
+          '--width=90'],
+ )
+-
+-po_dir = meson.current_source_dir()
+diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build
+index 3ba5cb16f..83d90b94b 100644
+--- a/shell-completion/bash/meson.build
++++ b/shell-completion/bash/meson.build
+@@ -8,6 +8,7 @@ if bashcompletiondir != 'no'
+     ]
+   endif
+ 
++  if not get_option('daemon-only')
+   aliases += [
+     'pacat',
+     'pactl',
+@@ -16,6 +17,7 @@ if bashcompletiondir != 'no'
+     'parec',
+     'parecord',
+   ]
++  endif
+ 
+   install_data('pulseaudio', install_dir : bashcompletiondir)
+ 
+diff --git a/src/daemon/meson.build b/src/daemon/meson.build
+index 262e193b2..e8f70a453 100644
+--- a/src/daemon/meson.build
++++ b/src/daemon/meson.build
+@@ -30,8 +30,8 @@ executable('pulseaudio',
+   install_rpath : privlibdir,
+   include_directories : [configinc, topinc],
+   link_args : ['-ffast-math'],
+-  link_with : [libpulsecore, libpulsecommon, libpulse],
+-  dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep],
++  link_with : [libpulsecore],
++  dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep, libpulsecommon_dep, libpulse_dep],
+   c_args : pa_c_args,
+ )
+ 
+diff --git a/src/meson.build b/src/meson.build
+index e2860811b..a56667271 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -188,6 +188,15 @@ else
+ endif
+ # FIXME: Do SIMD things
+ 
++if get_option('daemon-only')
++  libpulsecommon_dep = cc.find_library('pulsecommon-' + pa_version_major_minor, dirs : privlibdir, required : true)
++  libpulse_dep = dependency('libpulse', required : true)
++  libpulse_simple_dep = dependency('libpulse-simple', required : true)
++  if glib_dep.found()
++    libpulse_mainloop_glib_dep = dependency('libpulse-mainloop-glib', required : true)
++  endif
++else
++
+ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
+   libpulsecommon_sources,
+   libpulsecommon_headers,
+@@ -207,6 +216,8 @@ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
+ libpulsecommon_dep = declare_dependency(link_with: libpulsecommon)
+ 
+ subdir('pulse')
++endif
++
+ if get_option('daemon')
+   subdir('pulsecore')
+   subdir('daemon')
+diff --git a/src/modules/gsettings/meson.build b/src/modules/gsettings/meson.build
+index 68a72c3ff..9604699e7 100644
+--- a/src/modules/gsettings/meson.build
++++ b/src/modules/gsettings/meson.build
+@@ -8,8 +8,7 @@ gsettings_helper = executable('gsettings-helper',
+   gsettings_helper_sources,
+   c_args : pa_c_args,
+   include_directories : [configinc, topinc],
+-  link_with : [libpulsecommon, libpulse],
+-  dependencies : [gio_dep],
++  dependencies : [gio_dep, libpulsecommon_dep, libpulse_dep],
+   install_dir : pulselibexecdir,
+   install_rpath : privlibdir,
+   install : true,
+diff --git a/src/tests/meson.build b/src/tests/meson.build
+index acd301037..56d71299f 100644
+--- a/src/tests/meson.build
++++ b/src/tests/meson.build
+@@ -20,8 +20,6 @@ default_tests += [
+     [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+   [ 'json-test', 'json-test.c',
+     [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+-  [ 'mainloop-test', 'mainloop-test.c',
+-    [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+   [ 'proplist-test', 'proplist-test.c',
+     [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+   [ 'thread-mainloop-test', 'thread-mainloop-test.c',
+@@ -32,6 +30,13 @@ default_tests += [
+     [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep ] ],
+ ]
+ 
++if not get_option('daemon-only')
++  default_tests += [
++    [ 'mainloop-test', 'mainloop-test.c',
++      [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
++  ]
++endif
++
+ if get_option('daemon')
+   default_tests += [
+     [ 'asyncmsgq-test', 'asyncmsgq-test.c',
+diff --git a/src/utils/meson.build b/src/utils/meson.build
+index c9635fdb6..7ed6e738f 100644
+--- a/src/utils/meson.build
++++ b/src/utils/meson.build
+@@ -1,3 +1,4 @@
++if not get_option('daemon-only')
+ pacat_sources = [
+   'pacat.c',
+ ]
+@@ -41,6 +42,7 @@ executable('pactl',
+   dependencies : [sndfile_dep, libintl_dep],
+   c_args : pa_c_args,
+ )
++endif
+ 
+ if get_option('daemon')
+   if host_machine.system() != 'windows'
+@@ -53,8 +55,7 @@ if get_option('daemon')
+       install: true,
+       install_rpath : privlibdir,
+       include_directories : [configinc, topinc],
+-      link_with : [libpulsecommon, libpulse],
+-      dependencies: [libintl_dep],
++      dependencies: [libintl_dep, libpulsecommon_dep, libpulse_dep],
+       c_args : pa_c_args,
+     )
+ 
+@@ -67,13 +68,13 @@ if get_option('daemon')
+       install: true,
+       install_rpath : privlibdir,
+       include_directories : [configinc, topinc],
+-      link_with : [libpulsecommon, libpulse],
+-      dependencies: [libintl_dep],
++      dependencies: [libintl_dep, libpulsecommon_dep, libpulse_dep],
+       c_args : pa_c_args,
+     )
+   endif
+ endif
+ 
++if not get_option('daemon-only')
+ if x11_dep.found()
+   pax11publish_sources = [
+     'pax11publish.c',
+@@ -121,3 +122,4 @@ if dbus_dep.found() and fftw_dep.found()
+ endif
+ 
+ install_data('pa-info', install_dir : bindir)
++endif
+-- 
+2.32.0
+

diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch
new file mode 100644
index 00000000000..f3df62031d3
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch
@@ -0,0 +1,25 @@
+https://bugs.gentoo.org/806052
+
+commit 42af3ee08381faa5807fde68d4c8ec0d7ad5e9a5
+Author: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
+Date:   Tue Aug 3 09:43:32 2021 +0300
+
+    build-sys: meson: Require xice, xsm and xtst for daemon only
+    
+    Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/613>
+
+--- a/meson.build
++++ b/meson.build
+@@ -681,9 +681,9 @@ endif
+ x11_dep = dependency('x11-xcb', required : get_option('x11'))
+ if x11_dep.found()
+   xcb_dep  = dependency('xcb',  required : true, version : '>= 1.6')
+-  ice_dep  = dependency('ice',  required : true)
+-  sm_dep   = dependency('sm',   required : true)
+-  xtst_dep = dependency('xtst', required : true)
++  ice_dep  = dependency('ice',  required : get_option('daemon'))
++  sm_dep   = dependency('sm',   required : get_option('daemon'))
++  xtst_dep = dependency('xtst', required : get_option('daemon'))
+   cdata.set('HAVE_X11', 1)
+   if cc.has_function('XSetIOErrorExitHandler', dependencies: x11_dep)
+     cdata.set('HAVE_XSETIOERROREXITHANDLER', 1)

diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio.conf.d b/media-sound/pulseaudio-daemon/files/pulseaudio.conf.d
new file mode 100644
index 00000000000..9e7245344a5
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio.conf.d
@@ -0,0 +1,6 @@
+# Config file for /etc/init.d/pulseaudio
+
+# For more see "pulseaudio -h".
+
+# Startup options
+PA_OPTS="--log-target=syslog --disallow-module-loading=1"

diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio.init.d-5 b/media-sound/pulseaudio-daemon/files/pulseaudio.init.d-5
new file mode 100644
index 00000000000..a14f5e74aa5
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio.init.d-5
@@ -0,0 +1,80 @@
+#!/sbin/openrc-run
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+	need localmount
+	use net
+
+	local script="/etc/pulse/system.pa"
+
+	for opt in ${PA_OPTS}; do
+		case "$opt" in
+			--file=*)	script="${opt#*=}" ;;
+			-F*)		script="${opt#-F}" ;;
+		esac
+	done
+
+	config "$script"
+
+	local needs="$(get_options need)"
+	if [ -n "${needs}" ]; then
+		need ${needs}
+		return
+	fi
+
+	if egrep -q '^[[:space:]]*load-module[[:space:]]+module-console-kit' "$script"; then
+	    needs="${needs} consolekit"
+	fi
+
+#ifdef UDEV
+	if egrep -q '^[[:space:]]*load-module[[:space:]]+module-udev-detect' "$script"; then
+	    needs="${needs} udev"
+	fi
+#endif
+
+#ifdef AVAHI
+	if egrep -q '^[[:space:]]*load-module[[:space:]]+module-zeroconf-publish' "$script"; then
+	    needs="${needs} avahi-daemon"
+	fi
+#endif
+
+#ifdef BLUETOOTH
+	if egrep -q '^[[:space:]]*load-module[[:space:]]+module-bt-proximity' "$script"; then
+	    needs="${needs} bluetooth"
+	fi
+#endif
+
+#ifdef ALSA
+	if egrep -q '^[[:space:]]*load-module[[:space:]]+module-alsa-(sink|source)' "$script" || 
+	    egrep -q '^[[:space:]]*load-module[[:space:]]+module-(udev-)?detect' "$script" ||
+	    egrep -q '^[[:space:]]*add-autoload-source[[:space:]]+(input|output)[[:space:]]+module-alsa-(sink|source)' "$script"; then
+	    needs="${needs} alsasound"
+	fi
+#endif
+
+	need "${needs}"
+	save_options need "${needs}"
+}
+
+start() {
+	if [ -z "${PULSEAUDIO_SHOULD_NOT_GO_SYSTEMWIDE}" ]; then
+		eerror "Please don't use system wide PulseAudio unless you read the"
+		eerror "documentation available at http://www.pulseaudio.org/wiki/WhatIsWrongWithSystemMode"
+		eerror ""
+		eerror "When you're done, please set the variable PULSEAUDIO_SHOULD_NOT_GO_SYSTEMWIDE in"
+		eerror "/etc/conf.d/pulseaudio . Please remember that upstream does not support this mode"
+		eerror "when used for standard desktop configurations."
+		return 1
+	fi
+	ebegin "Starting pulseaudio"
+	PA_ALL_OPTS="${PA_OPTS} --fail=1 --daemonize=1 --system"
+	start-stop-daemon --start --exec /usr/bin/pulseaudio -- ${PA_ALL_OPTS}
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping pulseaudio"
+	start-stop-daemon --stop --quiet --exec /usr/bin/pulseaudio --pidfile /var/run/pulse/pid
+	eend $?
+}

diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio.service b/media-sound/pulseaudio-daemon/files/pulseaudio.service
new file mode 100644
index 00000000000..c5f0d579992
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=System wide PulseAudio instance
+After=syslog.target network.target alsasound.service
+
+[Service]
+Restart=always
+ExecStart=/usr/bin/pulseaudio --system --log-target=syslog
+
+[Install]
+WantedBy=multi-user.target

diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio.tmpfiles b/media-sound/pulseaudio-daemon/files/pulseaudio.tmpfiles
new file mode 100644
index 00000000000..88374e35574
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio.tmpfiles
@@ -0,0 +1 @@
+d /var/run/pulse 0755 pulse audio -

diff --git a/media-sound/pulseaudio-daemon/metadata.xml b/media-sound/pulseaudio-daemon/metadata.xml
new file mode 100644
index 00000000000..9808d54c65c
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/metadata.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="project">
+    <email>gnome@gentoo.org</email>
+    <name>Gentoo GNOME Desktop</name>
+  </maintainer>
+  <use>
+    <flag name="X">
+      Build the X11 publish module to export PulseAudio information
+      through X11 protocol for clients to make use. Don't enable this
+      flag if you want to use a system wide instance. If unsure, enable
+      this flag.
+    </flag>
+    <flag name="alsa-plugin">
+      Request installing <pkg>media-plugins/alsa-plugins</pkg> with
+      PulseAudio plugin enabled. This ensures that clients supporting
+      ALSA only will use PulseAudio.
+    </flag>
+    <flag name="elogind">Use <pkg>sys-auth/elogind</pkg> for giving each session a PA client</flag>
+    <flag name="oss">
+      Enable OSS sink/source (output/input). Deprecated, upstream does
+      not support this on systems where other sink/source systems are
+      available (i.e.: Linux). The padsp wrapper is now always build
+      if the system supports OSS at all.
+    </flag>
+    <flag name="glib">
+      Build the GSettings PA module.
+    </flag>
+    <flag name="system-wide">
+      Allow preparation and installation of the system-wide init
+      script for PulseAudio. Since this support is only supported for
+      embedded situations, do not enable without reading the upstream
+      instructions at
+      https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/ .
+    </flag>
+    <flag name="asyncns">Use libasyncns for asynchronous name resolution.</flag>
+    <flag name="equalizer">
+      Enable the equalizer module (requires <pkg>sci-libs/fftw</pkg>).
+    </flag>
+    <flag name="ssl">
+      Use <pkg>dev-libs/openssl</pkg> to provide support for RAOP
+      (AirPort) streaming.
+    </flag>
+    <flag name="gdbm">
+      Use <pkg>sys-libs/gdbm</pkg> to store PulseAudio
+      databases. Recommended for desktop usage. This flag causes the
+      whole package to be licensed under GPL-2 or later.
+    </flag>
+    <flag name="webrtc-aec">
+      Uses the webrtc.org AudioProcessing library for enhancing VoIP calls
+      greatly in applications that support it by performing acoustic echo
+      cancellation, analog gain control, noise suppression and other processing.
+    </flag>
+    <flag name="systemd">
+      Build with <pkg>sys-apps/systemd</pkg> support to replace standalone
+      ConsoleKit.
+    </flag>
+    <flag name="native-headset">
+      Build with native HSP backend for bluez 5.
+    </flag>
+    <flag name="ofono-headset">
+      Build with oFono HFP backend for bluez 5, requires <pkg>net-misc/ofono</pkg>.
+    </flag>
+  </use>
+</pkgmetadata>

diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild
new file mode 100644
index 00000000000..e0d3851c214
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild
@@ -0,0 +1,320 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+MY_PV="${PV/_pre*}"
+MY_P="pulseaudio-${MY_PV}"
+
+inherit bash-completion-r1 gnome2-utils meson optfeature systemd tmpfiles udev
+
+DESCRIPTION="A networked sound server with an advanced plugin system"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/PulseAudio/"
+
+if [[ ${PV} = 9999 ]]; then
+	inherit git-r3
+	EGIT_BRANCH="master"
+	EGIT_REPO_URI="https://gitlab.freedesktop.org/pulseaudio/pulseaudio"
+else
+	SRC_URI="https://freedesktop.org/software/pulseaudio/releases/${MY_P}.tar.xz"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+S="${WORKDIR}/${MY_P}"
+
+# libpulse-simple and libpulse link to libpulse-core; this is daemon's
+# library and can link to gdbm and other GPL-only libraries. In this
+# cases, we have a fully GPL-2 package. Leaving the rest of the
+# GPL-forcing USE flags for those who use them.
+LICENSE="!gdbm? ( LGPL-2.1 ) gdbm? ( GPL-2 )"
+
+SLOT="0"
+
+# +alsa-plugin as discussed in bug #519530
+# TODO: Deal with bluez5-gstreamer - requires ldacenc and rtpldacpay gstreamer elements
+# TODO: Find out why webrtc-aec is + prefixed - there's already the always available speexdsp-aec
+# NOTE: The current ebuild sets +X almost certainly just for the pulseaudio.desktop file
+IUSE="+alsa +alsa-plugin +asyncns bluetooth dbus elogind equalizer +gdbm gstreamer +glib gtk ipv6 jack lirc
+native-headset ofono-headset +orc oss selinux sox ssl systemd system-wide tcpd test +udev +webrtc-aec +X zeroconf"
+
+RESTRICT="!test? ( test )"
+
+# See "*** BLUEZ support not found (requires D-Bus)" in configure.ac
+# Basically all IUSE are either ${MULTILIB_USEDEP} for client libs or they belong under !daemon ()
+# We duplicate alsa-plugin, {native,ofono}-headset under daemon to let users deal with them at once
+REQUIRED_USE="
+	alsa-plugin? ( alsa )
+	bluetooth? ( dbus )
+	?? ( elogind systemd )
+	equalizer? ( dbus )
+	native-headset? ( bluetooth )
+	ofono-headset? ( bluetooth )
+	udev? ( || ( alsa oss ) )
+	zeroconf? ( dbus )
+"
+
+BDEPEND="
+	dev-lang/perl
+	dev-perl/XML-Parser
+	sys-devel/gettext
+	virtual/libiconv
+	virtual/libintl
+	virtual/pkgconfig
+	orc? ( >=dev-lang/orc-0.4.15 )
+	system-wide? ( dev-util/unifdef )
+"
+
+# NOTE:
+# - libpcre needed in some cases, bug #472228
+# - media-libs/speexdsp is providing echo canceller implementation and used in resampler
+# TODO: libatomic_ops is only needed on some architectures and conditions, and then at runtime too
+COMMON_DEPEND="
+	>=media-libs/libpulse-${PV}[glib?]
+	dev-libs/libatomic_ops
+	>=media-libs/libsndfile-1.0.20
+	>=media-libs/speexdsp-1.2
+	|| (
+		elibc_glibc? ( virtual/libc )
+		elibc_uclibc? ( virtual/libc )
+		dev-libs/libpcre:3
+	)
+	alsa? ( >=media-libs/alsa-lib-1.0.24 )
+	asyncns? ( >=net-libs/libasyncns-0.1 )
+	bluetooth? (
+		>=net-wireless/bluez-5
+		media-libs/sbc
+	)
+	dev-libs/libltdl
+	sys-kernel/linux-headers
+	>=sys-libs/libcap-2.22-r2
+	dbus? ( >=sys-apps/dbus-1.4.12 )
+	elogind? ( sys-auth/elogind )
+	equalizer? (
+		sci-libs/fftw:3.0
+	)
+	gdbm? ( sys-libs/gdbm:= )
+	glib? ( >=dev-libs/glib-2.28.0:2 )
+	gstreamer? (
+		media-libs/gst-plugins-base
+		>=media-libs/gstreamer-1.14
+	)
+	gtk? ( x11-libs/gtk+:3 )
+	jack? ( virtual/jack )
+	lirc? ( app-misc/lirc )
+	ofono-headset? ( >=net-misc/ofono-1.13 )
+	orc? ( >=dev-lang/orc-0.4.15 )
+	selinux? ( sec-policy/selinux-pulseaudio )
+	sox? ( >=media-libs/soxr-0.1.1 )
+	ssl? ( dev-libs/openssl:= )
+	systemd? ( sys-apps/systemd:= )
+	tcpd? ( sys-apps/tcp-wrappers )
+	udev? ( >=virtual/udev-143[hwdb(+)] )
+	webrtc-aec? ( >=media-libs/webrtc-audio-processing-0.2:0 )
+	X? (
+		>=x11-libs/libxcb-1.6
+		x11-libs/libICE
+		x11-libs/libSM
+		>=x11-libs/libX11-1.4.0
+		>=x11-libs/libXtst-1.0.99.2
+	)
+	zeroconf? ( >=net-dns/avahi-0.6.12[dbus] )
+	!<media-sound/pulseaudio-15.0-r100
+"
+
+# pulseaudio ships a bundle xmltoman, which uses XML::Parser
+DEPEND="
+	${COMMON_DEPEND}
+	test? ( >=dev-libs/check-0.9.10 )
+	X? ( x11-base/xorg-proto )
+"
+
+# alsa-utils dep is for the alsasound init.d script (see bug 155707); TODO: read it
+# NOTE: Only system-wide needs acct-group/audio unless elogind/systemd is not used
+RDEPEND="
+	${COMMON_DEPEND}
+	system-wide? (
+		alsa? ( media-sound/alsa-utils )
+		acct-user/pulse
+		acct-group/audio
+		acct-group/pulse-access
+	)
+"
+
+# This is a PDEPEND to avoid a circular dep
+PDEPEND="
+	alsa? ( alsa-plugin? ( >=media-plugins/alsa-plugins-1.0.27-r1[pulseaudio] ) )
+"
+
+DOCS=( NEWS README )
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	"${FILESDIR}"/pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch
+	"${FILESDIR}"/${PV}-daemon-only.patch
+)
+
+src_prepare() {
+	default
+
+	gnome2_environment_reset
+}
+
+src_configure() {
+	local emesonargs=(
+		--localstatedir="${EPREFIX}"/var
+
+		-Ddaemon=true
+		-Ddaemon-only=true
+		-Ddoxygen=false
+		-Dgcov=false
+		-Dman=false
+		# tests involve random modules, so just do them for the native # TODO: tests should run always
+		$(meson_use test tests)
+		-Ddatabase=$(usex gdbm gdbm simple) # tdb is also an option but no one cares about it
+		-Dstream-restore-clear-old-devices=true
+		-Drunning-from-build-tree=false
+
+		# Paths
+		-Dmodlibexecdir="${EPREFIX}/usr/$(get_libdir)/pulseaudio/modules" # Was $(get_libdir)/${P}
+		-Dsystemduserunitdir=$(systemd_get_userunitdir)
+		-Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"
+		-Dbashcompletiondir="$(get_bashcompdir)" # Alternatively DEPEND on app-shells/bash-completion for pkg-config to provide the value
+
+		# Optional features
+		$(meson_feature alsa)
+		$(meson_feature asyncns)
+		$(meson_feature zeroconf avahi)
+		$(meson_feature bluetooth bluez5)
+		-Dbluez5-gstreamer=disabled # no ldacenc/rtpldacpay gst elements packaged yet
+		$(meson_use native-headset bluez5-native-headset)
+		$(meson_use ofono-headset bluez5-ofono-headset)
+		$(meson_feature dbus)
+		$(meson_feature elogind)
+		$(meson_feature equalizer fftw)
+		$(meson_feature glib) # WARNING: toggling this likely changes ABI
+		$(meson_feature glib gsettings) # Supposedly correct?
+		$(meson_feature gstreamer)
+		$(meson_feature gtk)
+		-Dhal-compat=true # Consider disabling on next revbump
+		$(meson_use ipv6)
+		$(meson_feature jack)
+		$(meson_feature lirc)
+		$(meson_feature ssl openssl)
+		$(meson_feature orc)
+		$(meson_feature oss oss-output)
+		-Dsamplerate=disabled # Matches upstream
+		$(meson_feature sox soxr)
+		-Dspeex=enabled
+		$(meson_feature systemd)
+		$(meson_feature tcpd tcpwrap) # TODO: This should technically be enabled for 32bit too, but at runtime it probably is never used without daemon?
+		$(meson_feature udev)
+		-Dvalgrind=auto
+		$(meson_feature X x11)
+
+		# Echo cancellation
+		-Dadrian-aec=false # Not packaged?
+		$(meson_feature webrtc-aec)
+	)
+
+	meson_src_configure
+}
+
+src_install() {
+	meson_src_install
+
+	# Installed by media-libs/libpulse
+	rm "${ED}/$(get_bashcompdir)"/pulseaudio || die
+
+	if use system-wide; then
+		newconfd "${FILESDIR}"/pulseaudio.conf.d pulseaudio
+
+		use_define() {
+			local define=${2:-$(echo ${1} | tr '[:lower:]' '[:upper:]')}
+
+			use "${1}" && echo "-D${define}" || echo "-U${define}"
+		}
+
+		unifdef -x 1 \
+			$(use_define zeroconf AVAHI) \
+			$(use_define alsa) \
+			$(use_define bluetooth) \
+			$(use_define udev) \
+			"${FILESDIR}"/pulseaudio.init.d-5 \
+			> "${T}"/pulseaudio \
+			|| die
+
+		doinitd "${T}"/pulseaudio
+
+		systemd_dounit "${FILESDIR}"/pulseaudio.service
+
+		# We need /var/run/pulse, bug 442852
+		newtmpfiles "${FILESDIR}"/pulseaudio.tmpfiles pulseaudio.conf
+	else
+		# Prevent warnings when system-wide is not used, bug 447694
+		if use dbus; then
+			rm "${ED}"/etc/dbus-1/system.d/pulseaudio-system.conf || die
+		fi
+	fi
+
+	if use zeroconf; then
+		sed -i \
+			-e '/module-zeroconf-publish/s:^#::' \
+			"${ED}/etc/pulse/default.pa" \
+			|| die
+	fi
+
+	find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+}
+
+pkg_postinst() {
+	gnome2_schemas_update
+
+	if use system-wide; then
+		tmpfiles_process "pulseaudio.conf"
+
+		elog "You have enabled the 'system-wide' USE flag for pulseaudio."
+		elog "This mode should only be used on headless servers, embedded systems,"
+		elog "or thin clients. It will usually require manual configuration, and is"
+		elog "incompatible with many expected pulseaudio features."
+		elog "On normal desktop systems, system-wide mode is STRONGLY DISCOURAGED."
+		elog ""
+		elog "For more information, see"
+		elog "    https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/"
+		elog "    https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/"
+		elog "    https://wiki.gentoo.org/wiki/PulseAudio#Headless_server"
+		elog ""
+	fi
+
+	if use equalizer; then
+		elog "You will need to load some extra modules to make qpaeq work."
+		elog "You can do that by adding the following two lines in"
+		elog "/etc/pulse/default.pa and restarting pulseaudio:"
+		elog "load-module module-equalizer-sink"
+		elog "load-module module-dbus-protocol"
+		elog ""
+	fi
+
+	if use native-headset && use ofono-headset; then
+		elog "You have enabled both native and ofono headset profiles. The runtime decision"
+		elog "which to use is done via the 'headset' argument of module-bluetooth-discover."
+		elog ""
+	fi
+
+	if use systemd; then
+		elog "It's recommended to start pulseaudio via its systemd user units:"
+		elog ""
+		elog "  systemctl --user enable pulseaudio.service pulseaudio.socket"
+		elog ""
+		elog "The change from autospawn to user units will take effect after restarting."
+		elog ""
+	fi
+
+	optfeature_header "PulseAudio can be enhanced by installing the following:"
+	use equalizer && optfeature "using the qpaeq script" dev-python/PyQt5[dbus,widgets]
+	use dbus && optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit
+}
+
+pkg_postrm() {
+	gnome2_schemas_update
+}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/pulseaudio-daemon/, media-sound/pulseaudio-daemon/files/
@ 2021-09-24 20:33 Mart Raudsepp
  0 siblings, 0 replies; 8+ messages in thread
From: Mart Raudsepp @ 2021-09-24 20:33 UTC (permalink / raw
  To: gentoo-commits

commit:     af91ed24e9307789c9b1946568f740426ff1df6d
Author:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 24 20:32:51 2021 +0000
Commit:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Fri Sep 24 20:33:10 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af91ed24

media-sound/pulseaudio-daemon: Install manpages

Package-Manager: Portage-3.0.20, Repoman-3.0.2
Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>

 .../pulseaudio-daemon/files/15.0-daemon-only.patch | 25 ++++++++++++++++++++--
 .../pulseaudio-daemon-15.0.ebuild                  | 24 ++++++++++-----------
 2 files changed, 35 insertions(+), 14 deletions(-)

diff --git a/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch b/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch
index 9b18310f9e2..4d99c1ebe63 100644
--- a/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch
+++ b/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch
@@ -1,9 +1,10 @@
-From 5bcbd2ba656ac38ba500dc110cc13dbaa0d77853 Mon Sep 17 00:00:00 2001
+From f4f28cc436a506d1dfbd514968b2976ab31cdf5f Mon Sep 17 00:00:00 2001
 From: Mart Raudsepp <mart@leio.tech>
 Date: Fri, 24 Sep 2021 15:19:05 +0300
 Subject: [PATCH] build-sys: meson: Allow building the daemon only
 
 ---
+ man/meson.build                   |  2 ++
  meson.build                       | 23 ++++++++++++++++++++---
  meson_options.txt                 |  3 +++
  po/meson.build                    |  3 ---
@@ -13,8 +14,28 @@ Subject: [PATCH] build-sys: meson: Allow building the daemon only
  src/modules/gsettings/meson.build |  3 +--
  src/tests/meson.build             |  9 +++++++--
  src/utils/meson.build             | 10 ++++++----
- 9 files changed, 52 insertions(+), 16 deletions(-)
+ 10 files changed, 54 insertions(+), 16 deletions(-)
 
+diff --git a/man/meson.build b/man/meson.build
+index 31c581a8f..c12ad5e6a 100644
+--- a/man/meson.build
++++ b/man/meson.build
+@@ -14,6 +14,7 @@ if get_option('daemon')
+   ]
+ endif
+ 
++if not get_option('daemon-only')
+ manpages += [
+   ['pacat', '1', ['paplay', 'parec', 'parecord', 'pamon']],
+   ['pactl', '1'],
+@@ -31,6 +32,7 @@ if x11_dep.found()
+     ['pax11publish', '1'],
+   ]
+ endif
++endif
+ 
+ # FIXME: Add esdcompat if HAVE_ESOUND
+ #manpages += ['esdcompat', '1'],
 diff --git a/meson.build b/meson.build
 index 63ed62342..420cc6fac 100644
 --- a/meson.build

diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild
index e0d3851c214..73a2602a4bf 100644
--- a/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild
+++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild
@@ -53,17 +53,6 @@ REQUIRED_USE="
 	zeroconf? ( dbus )
 "
 
-BDEPEND="
-	dev-lang/perl
-	dev-perl/XML-Parser
-	sys-devel/gettext
-	virtual/libiconv
-	virtual/libintl
-	virtual/pkgconfig
-	orc? ( >=dev-lang/orc-0.4.15 )
-	system-wide? ( dev-util/unifdef )
-"
-
 # NOTE:
 # - libpcre needed in some cases, bug #472228
 # - media-libs/speexdsp is providing echo canceller implementation and used in resampler
@@ -145,6 +134,17 @@ PDEPEND="
 	alsa? ( alsa-plugin? ( >=media-plugins/alsa-plugins-1.0.27-r1[pulseaudio] ) )
 "
 
+BDEPEND="
+	dev-lang/perl
+	dev-perl/XML-Parser
+	sys-devel/gettext
+	virtual/libiconv
+	virtual/libintl
+	virtual/pkgconfig
+	orc? ( >=dev-lang/orc-0.4.15 )
+	system-wide? ( dev-util/unifdef )
+"
+
 DOCS=( NEWS README )
 
 S="${WORKDIR}/${MY_P}"
@@ -168,7 +168,7 @@ src_configure() {
 		-Ddaemon-only=true
 		-Ddoxygen=false
 		-Dgcov=false
-		-Dman=false
+		-Dman=true
 		# tests involve random modules, so just do them for the native # TODO: tests should run always
 		$(meson_use test tests)
 		-Ddatabase=$(usex gdbm gdbm simple) # tdb is also an option but no one cares about it


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/pulseaudio-daemon/, media-sound/pulseaudio-daemon/files/
@ 2022-06-15 21:56 Sam James
  0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2022-06-15 21:56 UTC (permalink / raw
  To: gentoo-commits

commit:     17dea0907ab8369c600955b38bd27c86c9c79cc8
Author:     Igor V. Kovalenko <igor.v.kovalenko <AT> gmail <DOT> com>
AuthorDate: Mon Jun 13 22:14:38 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 15 21:56:33 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=17dea090

media-sound/pulseaudio-daemon: Make module-console-kit optional

Upstream commit 823e46fba0742605f557b68cd591f61624b93966

Now it is possible to explicitly disable module-console-kit, do that since
consolekit is no longer available in the tree.

Closes: https://bugs.gentoo.org/669908
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...lseaudio-16.0-optional-module-console-kit.patch | 76 ++++++++++++++++++++++
 .../pulseaudio-daemon-16.0-r2.ebuild               |  2 +
 2 files changed, 78 insertions(+)

diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-optional-module-console-kit.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-optional-module-console-kit.patch
new file mode 100644
index 000000000000..4ffdb82f4901
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-optional-module-console-kit.patch
@@ -0,0 +1,76 @@
+commit 823e46fba0742605f557b68cd591f61624b93966
+Author: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
+Date:   Sun Jun 12 21:49:32 2022 +0300
+
+    build-sys: meson: Make module-console-kit optional
+    
+    Default build configuration would fail to run on a system without systemd-logind
+    (or elogind) and without ConsoleKit daemon responding on dbus interface. Here,
+    module-console-kit would fail to initialize, preventing daemon from starting.
+    
+    Make module-console-kit an optional build feature to allow opt-out.
+    
+    Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/719>
+
+diff --git a/meson.build b/meson.build
+index d4cdbd6a5..c6db7e670 100644
+--- a/meson.build
++++ b/meson.build
+@@ -732,6 +732,10 @@ if get_option('daemon')
+     cdata.set('HAVE_SYSTEMD_LOGIN', 1)
+   endif
+ 
++  if get_option('consolekit').enabled()
++    assert(dbus_dep.found(), 'ConsoleKit requires D-Bus support')
++  endif
++
+   tcpwrap_dep = cc.find_library('wrap', required: get_option('tcpwrap'))
+   if cc.has_header('tcpd.h') and cc.has_function('hosts_access', dependencies : tcpwrap_dep)
+     cdata.set('HAVE_LIBWRAP', 1)
+@@ -1001,6 +1005,7 @@ summary += [
+   '  Enable HAL->udev compat:     @0@'.format(get_option('hal-compat')),
+   'Enable systemd units:          @0@'.format(systemd_dep.found()),
+   'Enable elogind:                @0@'.format(libelogind_dep.found()),
++  'Enable ConsoleKit:             @0@'.format(not get_option('consolekit').disabled() and dbus_dep.found()),
+   'Enable TCP Wrappers:           @0@'.format(tcpwrap_dep.found()),
+   'Enable OpenSSL (for Airtunes): @0@'.format(openssl_dep.found()),
+   'Database:                      @0@'.format(get_option('database')),
+diff --git a/meson_options.txt b/meson_options.txt
+index b23210072..e7160a3a7 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -99,6 +99,9 @@ option('bluez5-native-headset',
+ option('bluez5-ofono-headset',
+        type : 'boolean',
+        description : 'Optional oFono headset backend support (BlueZ 5)')
++option('consolekit',
++       type : 'feature', value : 'auto',
++       description : 'Optional ConsoleKit support')
+ option('dbus',
+        type : 'feature', value : 'auto',
+        description : 'Optional D-Bus support')
+diff --git a/src/modules/meson.build b/src/modules/meson.build
+index cdf372c8e..1d8004300 100644
+--- a/src/modules/meson.build
++++ b/src/modules/meson.build
+@@ -130,7 +130,6 @@ endif
+ 
+ if dbus_dep.found()
+   all_modules += [
+-    [ 'module-console-kit', 'module-console-kit.c', [], [], [dbus_dep] ],
+     [ 'module-dbus-protocol',
+       [ 'dbus/iface-card.c', 'dbus/iface-card.h',
+ 	'dbus/iface-card-profile.c', 'dbus/iface-card-profile.h',
+@@ -147,6 +146,12 @@ if dbus_dep.found()
+       [], [], [dbus_dep] ],
+     [ 'module-rygel-media-server', 'module-rygel-media-server.c', [], [], [dbus_dep], libprotocol_http ],
+   ]
++
++  if not get_option('consolekit').disabled()
++    all_modules += [
++      [ 'module-console-kit', 'module-console-kit.c', [], [], [dbus_dep] ],
++    ]
++  endif
+ endif
+ 
+ if fftw_dep.found()

diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r2.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r2.ebuild
index 9d8e52522d06..adf6cbbd994e 100644
--- a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r2.ebuild
+++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r2.ebuild
@@ -163,6 +163,7 @@ S="${WORKDIR}/${MY_P}"
 # patches merged upstream, to be removed with 16.1 or later bump
 PATCHES=(
 	"${FILESDIR}"/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch
+	"${FILESDIR}"/pulseaudio-16.0-optional-module-console-kit.patch
 )
 
 src_prepare() {
@@ -210,6 +211,7 @@ src_configure() {
 		-Dbluez5-gstreamer=${enable_bluez5_gstreamer}
 		$(meson_use bluetooth bluez5-native-headset)
 		$(meson_use ofono-headset bluez5-ofono-headset)
+		-Dconsolekit=disabled
 		$(meson_feature dbus)
 		$(meson_feature elogind)
 		-Dfftw=${enable_fftw}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/pulseaudio-daemon/, media-sound/pulseaudio-daemon/files/
@ 2022-06-15 21:56 Sam James
  0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2022-06-15 21:56 UTC (permalink / raw
  To: gentoo-commits

commit:     b1a66ec4bead0f93cc7ac233369453e20d3cbca9
Author:     Igor V. Kovalenko <igor.v.kovalenko <AT> gmail <DOT> com>
AuthorDate: Mon Jun 13 22:14:19 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 15 21:56:33 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b1a66ec4

media-sound/pulseaudio-daemon: rtp: Initialize SDP info struct field added for OPUS

Upstream commit d7a633df899dda8738a30df318269e28c902e815

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...lseaudio-16.0-fix-rtp-receiver-sdp-record.patch |  26 ++
 .../pulseaudio-daemon-16.0-r2.ebuild               | 385 +++++++++++++++++++++
 2 files changed, 411 insertions(+)

diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch
new file mode 100644
index 000000000000..3d72b9a009c4
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch
@@ -0,0 +1,26 @@
+commit d7a633df899dda8738a30df318269e28c902e815
+Author: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
+Date:   Mon Jun 13 21:38:08 2022 +0300
+
+    rtp: Initialize SDP info struct field added for OPUS
+    
+    Turned out that pa_sdp_info::enable_opus is never initialized, which seldom
+    makes module-rtp-recv believe it will be playing OPUS-encoded stream even though
+    discovered SDP record does not indicate OPUS codec in metadata.
+    
+    Fix this by adding missing initializer.
+    
+    Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/720>
+
+diff --git a/src/modules/rtp/sdp.c b/src/modules/rtp/sdp.c
+index 4e6a442f8..bf131a27e 100644
+--- a/src/modules/rtp/sdp.c
++++ b/src/modules/rtp/sdp.c
+@@ -129,6 +129,7 @@ pa_sdp_info *pa_sdp_parse(const char *t, pa_sdp_info *i, int is_goodbye) {
+     i->origin = i->session_name = NULL;
+     i->salen = 0;
+     i->payload = 255;
++    i->enable_opus = false;
+ 
+     if (pa_startswith(t, PA_SDP_HEADER)) {
+         t += sizeof(PA_SDP_HEADER) - 1;

diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r2.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r2.ebuild
new file mode 100644
index 000000000000..9d8e52522d06
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r2.ebuild
@@ -0,0 +1,385 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+MY_PV="${PV/_pre*}"
+MY_P="pulseaudio-${MY_PV}"
+inherit bash-completion-r1 gnome2-utils meson optfeature systemd tmpfiles udev
+
+DESCRIPTION="A networked sound server with an advanced plugin system"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/PulseAudio/"
+
+if [[ ${PV} = 9999 ]]; then
+	inherit git-r3
+	EGIT_BRANCH="master"
+	EGIT_REPO_URI="https://gitlab.freedesktop.org/pulseaudio/pulseaudio"
+else
+	SRC_URI="https://freedesktop.org/software/pulseaudio/releases/${MY_P}.tar.xz"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+S="${WORKDIR}/${MY_P}"
+
+# libpulse-simple and libpulse link to libpulse-core; this is daemon's
+# library and can link to gdbm and other GPL-only libraries. In this
+# cases, we have a fully GPL-2 package. Leaving the rest of the
+# GPL-forcing USE flags for those who use them.
+LICENSE="!gdbm? ( LGPL-2.1 ) gdbm? ( GPL-2 )"
+
+SLOT="0"
+
+# +alsa-plugin as discussed in bug #519530
+# TODO: Find out why webrtc-aec is + prefixed - there's already the always available speexdsp-aec
+# NOTE: The current ebuild sets +X almost certainly just for the pulseaudio.desktop file
+IUSE="+alsa +alsa-plugin aptx +asyncns bluetooth dbus elogind equalizer fftw +gdbm +glib gstreamer gtk ipv6 jack ldac lirc
+ofono-headset +orc oss selinux sox ssl systemd system-wide tcpd test +udev valgrind +webrtc-aec +X zeroconf"
+
+RESTRICT="!test? ( test )"
+
+# See "*** BLUEZ support not found (requires D-Bus)" in configure.ac
+# Basically all IUSE are either ${MULTILIB_USEDEP} for client libs or they belong under !daemon ()
+# We duplicate alsa-plugin, {native,ofono}-headset under daemon to let users deal with them at once
+REQUIRED_USE="
+	?? ( elogind systemd )
+	alsa-plugin? ( alsa )
+	aptx? ( bluetooth )
+	bluetooth? ( dbus )
+	equalizer? ( dbus )
+	ldac? ( bluetooth )
+	ofono-headset? ( bluetooth )
+	udev? ( || ( alsa oss ) )
+	zeroconf? ( dbus )
+"
+
+# NOTE:
+# - libpcre needed in some cases, bug #472228
+# - media-libs/speexdsp is providing echo canceller implementation and used in resampler
+# TODO: libatomic_ops is only needed on some architectures and conditions, and then at runtime too
+gstreamer_deps="
+	media-libs/gst-plugins-base
+	>=media-libs/gstreamer-1.14
+"
+COMMON_DEPEND="
+	>=media-libs/libpulse-${PV}[dbus?,glib?,systemd?,tcpd?,valgrind?,X?]
+	dev-libs/libatomic_ops
+	>=media-libs/libsndfile-1.0.20
+	>=media-libs/speexdsp-1.2
+	|| (
+		elibc_glibc? ( virtual/libc )
+		dev-libs/libpcre:3
+	)
+	alsa? ( >=media-libs/alsa-lib-1.0.24 )
+	aptx? ( ${gstreamer_deps} )
+	asyncns? ( >=net-libs/libasyncns-0.1 )
+	bluetooth? (
+		>=net-wireless/bluez-5
+		media-libs/sbc
+	)
+	dev-libs/libltdl
+	sys-kernel/linux-headers
+	>=sys-libs/libcap-2.22-r2
+	dbus? ( >=sys-apps/dbus-1.4.12 )
+	elogind? ( sys-auth/elogind )
+	equalizer? (
+		sci-libs/fftw:3.0=
+	)
+	fftw? (
+		sci-libs/fftw:3.0=
+	)
+	gdbm? ( sys-libs/gdbm:= )
+	glib? ( >=dev-libs/glib-2.28.0:2 )
+	gstreamer? ( ${gstreamer_deps} )
+	gtk? ( x11-libs/gtk+:3 )
+	jack? ( virtual/jack )
+	ldac? ( ${gstreamer_deps} )
+	lirc? ( app-misc/lirc )
+	ofono-headset? ( >=net-misc/ofono-1.13 )
+	orc? ( >=dev-lang/orc-0.4.15 )
+	selinux? ( sec-policy/selinux-pulseaudio )
+	sox? ( >=media-libs/soxr-0.1.1 )
+	ssl? ( dev-libs/openssl:= )
+	systemd? ( sys-apps/systemd:= )
+	tcpd? ( sys-apps/tcp-wrappers )
+	udev? ( >=virtual/udev-143[hwdb(+)] )
+	valgrind? ( dev-util/valgrind )
+	webrtc-aec? ( >=media-libs/webrtc-audio-processing-0.2:0 )
+	X? (
+		>=x11-libs/libxcb-1.6
+		x11-libs/libICE
+		x11-libs/libSM
+		>=x11-libs/libX11-1.4.0
+		>=x11-libs/libXtst-1.0.99.2
+	)
+	zeroconf? ( >=net-dns/avahi-0.6.12[dbus] )
+	!<media-sound/pulseaudio-15.0-r100
+"
+
+# pulseaudio ships a bundle xmltoman, which uses XML::Parser
+DEPEND="
+	${COMMON_DEPEND}
+	test? ( >=dev-libs/check-0.9.10 )
+	X? ( x11-base/xorg-proto )
+"
+
+# alsa-utils dep is for the alsasound init.d script (see bug 155707); TODO: read it
+# NOTE: Only system-wide needs acct-group/audio unless elogind/systemd is not used
+RDEPEND="
+	${COMMON_DEPEND}
+	system-wide? (
+		alsa? ( media-sound/alsa-utils )
+		acct-user/pulse
+		acct-group/audio
+		acct-group/pulse-access
+	)
+	bluetooth? (
+		ldac? ( media-plugins/gst-plugins-ldac )
+		aptx? ( media-plugins/gst-plugins-openaptx )
+	)
+	!media-video/pipewire[sound-server(+)]
+"
+unset gstreamer_deps
+
+# This is a PDEPEND to avoid a circular dep
+PDEPEND="
+	alsa? ( alsa-plugin? ( >=media-plugins/alsa-plugins-1.0.27-r1[pulseaudio] ) )
+"
+
+BDEPEND="
+	dev-lang/perl
+	dev-perl/XML-Parser
+	sys-devel/gettext
+	virtual/libiconv
+	virtual/libintl
+	virtual/pkgconfig
+	orc? ( >=dev-lang/orc-0.4.15 )
+	system-wide? ( dev-util/unifdef )
+"
+
+DOCS=( NEWS README )
+
+S="${WORKDIR}/${MY_P}"
+
+# patches merged upstream, to be removed with 16.1 or later bump
+PATCHES=(
+	"${FILESDIR}"/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch
+)
+
+src_prepare() {
+	default
+
+	gnome2_environment_reset
+}
+
+src_configure() {
+	local enable_bluez5_gstreamer="disabled"
+	if use aptx || use ldac ; then
+		enable_bluez5_gstreamer="enabled"
+	fi
+
+	local enable_fftw="disabled"
+	if use equalizer || use fftw ; then
+		enable_fftw="enabled"
+	fi
+
+	local emesonargs=(
+		--localstatedir="${EPREFIX}"/var
+
+		-Ddaemon=true
+		-Dclient=false
+		-Ddoxygen=false
+		-Dgcov=false
+		-Dman=true
+		# tests involve random modules, so just do them for the native # TODO: tests should run always
+		$(meson_use test tests)
+		-Ddatabase=$(usex gdbm gdbm simple) # tdb is also an option but no one cares about it
+		-Dstream-restore-clear-old-devices=true
+		-Drunning-from-build-tree=false
+
+		# Paths
+		-Dmodlibexecdir="${EPREFIX}/usr/$(get_libdir)/pulseaudio/modules" # Was $(get_libdir)/${P}
+		-Dsystemduserunitdir=$(systemd_get_userunitdir)
+		-Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"
+		-Dbashcompletiondir="$(get_bashcompdir)" # Alternatively DEPEND on app-shells/bash-completion for pkg-config to provide the value
+
+		# Optional features
+		$(meson_feature alsa)
+		$(meson_feature asyncns)
+		$(meson_feature zeroconf avahi)
+		$(meson_feature bluetooth bluez5)
+		-Dbluez5-gstreamer=${enable_bluez5_gstreamer}
+		$(meson_use bluetooth bluez5-native-headset)
+		$(meson_use ofono-headset bluez5-ofono-headset)
+		$(meson_feature dbus)
+		$(meson_feature elogind)
+		-Dfftw=${enable_fftw}
+		$(meson_feature glib) # WARNING: toggling this likely changes ABI
+		$(meson_feature glib gsettings) # Supposedly correct?
+		$(meson_feature gstreamer)
+		$(meson_feature gtk)
+		-Dhal-compat=true # Consider disabling on next revbump
+		$(meson_use ipv6)
+		$(meson_feature jack)
+		$(meson_feature lirc)
+		$(meson_feature ssl openssl)
+		$(meson_feature orc)
+		$(meson_feature oss oss-output)
+		-Dsamplerate=disabled # Matches upstream
+		$(meson_feature sox soxr)
+		-Dspeex=enabled
+		$(meson_feature systemd)
+		$(meson_feature tcpd tcpwrap) # TODO: This should technically be enabled for 32bit too, but at runtime it probably is never used without daemon?
+		$(meson_feature udev)
+		$(meson_feature valgrind)
+		$(meson_feature X x11)
+
+		# Echo cancellation
+		-Dadrian-aec=false # Not packaged?
+		$(meson_feature webrtc-aec)
+	)
+
+	meson_src_configure
+}
+
+src_install() {
+	meson_src_install
+
+	# Upstream installs 'pactl' if client is built, with all symlinks except for
+	# 'pulseaudio', 'pacmd' and 'pasuspender' which are installed if server is built.
+	# This trips QA warning, workaround:
+	# - install missing aliases in media-libs/libpulse (client build)
+	# - remove corresponding symlinks in media-sound/pulseaudio-daemonclient (server build)
+	rm "${D}/$(get_bashcompdir)"/pulseaudio || die
+	rm "${D}/$(get_bashcompdir)"/pacmd || die
+	rm "${D}/$(get_bashcompdir)"/pasuspender || die
+
+	if use system-wide; then
+		newconfd "${FILESDIR}"/pulseaudio.conf.d pulseaudio
+
+		use_define() {
+			local define=${2:-$(echo ${1} | tr '[:lower:]' '[:upper:]')}
+
+			use "${1}" && echo "-D${define}" || echo "-U${define}"
+		}
+
+		unifdef -x 1 \
+			$(use_define zeroconf AVAHI) \
+			$(use_define alsa) \
+			$(use_define bluetooth) \
+			$(use_define udev) \
+			"${FILESDIR}"/pulseaudio.init.d-5 \
+			> "${T}"/pulseaudio \
+			|| die
+
+		doinitd "${T}"/pulseaudio
+
+		systemd_dounit "${FILESDIR}"/pulseaudio.service
+
+		# We need /var/run/pulse, bug 442852
+		newtmpfiles "${FILESDIR}"/pulseaudio.tmpfiles pulseaudio.conf
+	else
+		# Prevent warnings when system-wide is not used, bug 447694
+		if use dbus; then
+			rm "${ED}"/etc/dbus-1/system.d/pulseaudio-system.conf || die
+		fi
+	fi
+
+	if use zeroconf; then
+		sed -i \
+			-e '/module-zeroconf-publish/s:^#::' \
+			"${ED}/etc/pulse/default.pa" \
+			|| die
+	fi
+
+	# Only enable autospawning pulseaudio daemon on systems without systemd
+	if ! use systemd; then
+		insinto /etc/pulse/client.conf.d
+		newins "${FILESDIR}/enable-autospawn.conf" "enable-autospawn.conf"
+	fi
+
+	find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+}
+
+pkg_postinst() {
+	gnome2_schemas_update
+
+	use udev && udev_reload
+
+	if use system-wide; then
+		tmpfiles_process "pulseaudio.conf"
+
+		elog "You have enabled the 'system-wide' USE flag for pulseaudio."
+		elog "This mode should only be used on headless servers, embedded systems,"
+		elog "or thin clients. It will usually require manual configuration, and is"
+		elog "incompatible with many expected pulseaudio features."
+		elog "On normal desktop systems, system-wide mode is STRONGLY DISCOURAGED."
+		elog ""
+		elog "For more information, see"
+		elog "    https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/"
+		elog "    https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/"
+		elog "    https://wiki.gentoo.org/wiki/PulseAudio#Headless_server"
+		elog ""
+	fi
+
+	if use equalizer; then
+		elog "You will need to load some extra modules to make qpaeq work."
+		elog "You can do that by adding the following two lines in"
+		elog "/etc/pulse/default.pa and restarting pulseaudio:"
+		elog "load-module module-equalizer-sink"
+		elog "load-module module-dbus-protocol"
+		elog ""
+	fi
+
+	if use bluetooth; then
+		elog "You have enabled bluetooth USE flag for pulseaudio. Daemon will now handle"
+		elog "bluetooth Headset (HSP HS and HSP AG) and Handsfree (HFP HF) profiles using"
+		elog "native headset backend by default. This can be selectively disabled"
+		elog "via runtime configuration arguments to module-bluetooth-discover"
+		elog "in /etc/pulse/default.pa"
+		elog "To disable HFP HF append enable_native_hfp_hf=false"
+		elog "To disable HSP HS append enable_native_hsp_hs=false"
+		elog "To disable HSP AG append headset=auto or headset=ofono"
+		elog "(note this does NOT require enabling USE ofono)"
+		elog ""
+	fi
+
+	if use ofono-headset; then
+		elog "You have enabled both native and ofono headset profiles. The runtime decision"
+		elog "which to use is done via the 'headset' argument of module-bluetooth-discover."
+		elog ""
+	fi
+
+	if use gstreamer; then
+		elog "GStreamer-based RTP implementation modile enabled."
+		elog "To use OPUS payload install media-plugins/gst-plugins-opus"
+		elog "and add enable_opus=1 argument to module-rtp-send"
+		elog ""
+	fi
+
+	if use systemd; then
+		elog "Pulseaudio autospawn by client library is no longer enabled when systemd is available."
+		elog "It's recommended to start pulseaudio via its systemd user units:"
+		elog ""
+		elog "  systemctl --user enable pulseaudio.service pulseaudio.socket"
+		elog ""
+		elog "Root user can change system default configuration for all users:"
+		elog ""
+		elog "  systemctl --global enable pulseaudio.service pulseaudio.socket"
+		elog ""
+		elog "If you would like to enable autospawn by client library, edit autospawn flag in /etc/pulse/client.conf like this:"
+		elog ""
+		elog "  autospawn = yes"
+		elog ""
+		elog "The change from autospawn to user units will take effect after restarting."
+		elog ""
+	fi
+
+	optfeature_header "PulseAudio can be enhanced by installing the following:"
+	use equalizer && optfeature "using the qpaeq script" dev-python/PyQt5[dbus,widgets]
+	use dbus && optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit
+}
+
+pkg_postrm() {
+	gnome2_schemas_update
+	use udev && udev_reload
+}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/pulseaudio-daemon/, media-sound/pulseaudio-daemon/files/
@ 2022-07-31  3:40 Sam James
  0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2022-07-31  3:40 UTC (permalink / raw
  To: gentoo-commits

commit:     10b61dc8872a9ba034771bd9b793e452fd428363
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 31 03:39:14 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 31 03:39:33 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10b61dc8

media-sound/pulseaudio-daemon: drop 16.0-r4, 16.0-r5

Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...udio-16.0-fix-combine-sink-underrun-crash.patch |  72 ----
 ...io-16.0-fix-gstreamer-bluetooth-arm-crash.patch |  43 ---
 ...pulseaudio-16.0-fix-pacmd-play-file-crash.patch |  42 ---
 ...lseaudio-16.0-fix-rtp-receiver-sdp-record.patch |  26 --
 .../pulseaudio-daemon-16.0-r4.ebuild               | 388 --------------------
 .../pulseaudio-daemon-16.0-r5.ebuild               | 396 ---------------------
 6 files changed, 967 deletions(-)

diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-combine-sink-underrun-crash.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-combine-sink-underrun-crash.patch
deleted file mode 100644
index d66d75afdfda..000000000000
--- a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-combine-sink-underrun-crash.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/ee8bfb49adddd271d8a8cafa796c6f9fa84de48a
-
-From ee8bfb49adddd271d8a8cafa796c6f9fa84de48a Mon Sep 17 00:00:00 2001
-From: Georg Chini <georg@chini.tk>
-Date: Fri, 17 Jun 2022 13:11:11 +0200
-Subject: [PATCH] combine-sink: Fix threading issue during underrun
-
-A recent commit added i->origin sink for the sink inputs of the combine sinks.
-Therefore pa_sink_process_input_underruns() treated the combine sink like
-filter sinks. pa_sink_process_input_underruns() calls itself with the
-origin sink, which is only correct for filter sinks because they run in the
-thread context of the origin sink. The combine sink however has its own
-thread context, so pa_sink_process_input_underruns() was executed in the
-wrong context.
-This patch fixes the issue by skipping the section for module-combine-sink.
-
-Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/722>
----
- src/pulsecore/sink.c | 37 +++++++++++++++++++++++--------------
- 1 file changed, 23 insertions(+), 14 deletions(-)
-
-diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
-index 3108ae765..0f0dc56fc 100644
---- a/src/pulsecore/sink.c
-+++ b/src/pulsecore/sink.c
-@@ -1016,20 +1016,29 @@ size_t pa_sink_process_input_underruns(pa_sink *s, size_t left_to_play) {
-         if (i->origin_sink) {
-             size_t filter_result, left_to_play_origin;
- 
--            /* The recursive call works in the origin sink domain ... */
--            left_to_play_origin = pa_convert_size(left_to_play, &i->sink->sample_spec, &i->origin_sink->sample_spec);
--
--            /* .. and returns the time to sleep before waking up. We need the
--             * underrun duration for comparisons, so we undo the subtraction on
--             * the return value... */
--            filter_result = left_to_play_origin - pa_sink_process_input_underruns(i->origin_sink, left_to_play_origin);
--
--            /* ... and convert it back to the master sink domain */
--            filter_result = pa_convert_size(filter_result, &i->origin_sink->sample_spec, &i->sink->sample_spec);
--
--            /* Remember the longest underrun so far */
--            if (filter_result > result)
--                result = filter_result;
-+            /* The combine sink sets i->origin sink but has a different threading model
-+             * than the filter sinks. Therefore the recursion below may not be executed
-+             * because pa_sink_process_input_underruns() was not called in the thread
-+             * context of the origin sink.
-+             * FIXME: It is unclear if some other kind of recursion would be necessary
-+             * for the combine sink. */
-+            if (!i->module || !pa_safe_streq(i->module->name, "module-combine-sink")) {
-+
-+                /* The recursive call works in the origin sink domain ... */
-+                left_to_play_origin = pa_convert_size(left_to_play, &i->sink->sample_spec, &i->origin_sink->sample_spec);
-+
-+                /* .. and returns the time to sleep before waking up. We need the
-+                 * underrun duration for comparisons, so we undo the subtraction on
-+                 * the return value... */
-+                filter_result = left_to_play_origin - pa_sink_process_input_underruns(i->origin_sink, left_to_play_origin);
-+
-+                /* ... and convert it back to the master sink domain */
-+                filter_result = pa_convert_size(filter_result, &i->origin_sink->sample_spec, &i->sink->sample_spec);
-+
-+                /* Remember the longest underrun so far */
-+                if (filter_result > result)
-+                    result = filter_result;
-+            }
-         }
- 
-         if (uf == 0) {
--- 
-GitLab
-

diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-gstreamer-bluetooth-arm-crash.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-gstreamer-bluetooth-arm-crash.patch
deleted file mode 100644
index a2efaf37b381..000000000000
--- a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-gstreamer-bluetooth-arm-crash.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/dd4dc5e8bce2c03631c3613dbddee1a691bdd17d
-
-From dd4dc5e8bce2c03631c3613dbddee1a691bdd17d Mon Sep 17 00:00:00 2001
-From: Jan Palus <jpalus@fastmail.com>
-Date: Fri, 17 Jun 2022 14:36:36 +0200
-Subject: [PATCH] bluetooth/gst: Correct var type for GST_TYPE_BITMASK
-
-GST_TYPE_BITMASK is 64-bit bit mask while corresponding channel_mask in
-pulseaudio is int therefore usually 32-bit. Switch to uint64_t instead
-to match internal representation in gstreamer.
-
-Fixes pulseaudio crash on ARM 32-bit when pulseaudio is compiled with
-gstreamer and either LDAC or aptX support is available.
-
-Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/723>
----
- src/modules/bluetooth/a2dp-codec-gst.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/modules/bluetooth/a2dp-codec-gst.c b/src/modules/bluetooth/a2dp-codec-gst.c
-index 8ef74be9c..11839c580 100644
---- a/src/modules/bluetooth/a2dp-codec-gst.c
-+++ b/src/modules/bluetooth/a2dp-codec-gst.c
-@@ -22,6 +22,7 @@
- #endif
- 
- #include <arpa/inet.h>
-+#include <stdint.h>
- 
- #include <pulsecore/log.h>
- #include <pulsecore/macro.h>
-@@ -82,7 +83,7 @@ fail:
- static GstCaps *gst_create_caps_from_sample_spec(const pa_sample_spec *ss) {
-     gchar *sample_format;
-     GstCaps *caps;
--    int channel_mask;
-+    uint64_t channel_mask;
- 
-     switch (ss->format) {
-         case PA_SAMPLE_S16LE:
--- 
-GitLab
-

diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-pacmd-play-file-crash.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-pacmd-play-file-crash.patch
deleted file mode 100644
index f9c044dbb2be..000000000000
--- a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-pacmd-play-file-crash.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/a8a2a31408c4acf54530d65922d235d3e590ce05
-
-From a8a2a31408c4acf54530d65922d235d3e590ce05 Mon Sep 17 00:00:00 2001
-From: Jaechul Lee <jcsing.lee@samsung.com>
-Date: Thu, 2 Jun 2022 15:07:09 +0900
-Subject: [PATCH] sound-file-stream: Fix crash when playing a file which is not
- aligned
-
-pulseaudio crash occurred when I play a file using pacmd play-file command.
-The file is not aligned with its frame size and the last rendering size
-is also not aligned. Thus, an assertion was generated at the end of the
-file as the following.
-
-memblockq.c: Assertion 'uchunk->length % bq->base == 0' failed at
-../src/pulsecore/memblockq.c:288, function pa_memblockq_push(). Aborting.
-
-When I play the file using paplay, it works good. So, I changed to
-pa_memblockq_push_align instead of pa_memblockq_push to prevent the
-assertion.
-
-Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
-Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/717>
----
- src/pulsecore/sound-file-stream.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/pulsecore/sound-file-stream.c b/src/pulsecore/sound-file-stream.c
-index 147aa2288..255f4b61a 100644
---- a/src/pulsecore/sound-file-stream.c
-+++ b/src/pulsecore/sound-file-stream.c
-@@ -185,7 +185,7 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t length, pa_memchunk *chunk
- 
-         tchunk.length = (size_t) n * fs;
- 
--        pa_memblockq_push(u->memblockq, &tchunk);
-+        pa_memblockq_push_align(u->memblockq, &tchunk);
-         pa_memblock_unref(tchunk.memblock);
-     }
- 
--- 
-GitLab
-

diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch
deleted file mode 100644
index 3d72b9a009c4..000000000000
--- a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-commit d7a633df899dda8738a30df318269e28c902e815
-Author: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
-Date:   Mon Jun 13 21:38:08 2022 +0300
-
-    rtp: Initialize SDP info struct field added for OPUS
-    
-    Turned out that pa_sdp_info::enable_opus is never initialized, which seldom
-    makes module-rtp-recv believe it will be playing OPUS-encoded stream even though
-    discovered SDP record does not indicate OPUS codec in metadata.
-    
-    Fix this by adding missing initializer.
-    
-    Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/720>
-
-diff --git a/src/modules/rtp/sdp.c b/src/modules/rtp/sdp.c
-index 4e6a442f8..bf131a27e 100644
---- a/src/modules/rtp/sdp.c
-+++ b/src/modules/rtp/sdp.c
-@@ -129,6 +129,7 @@ pa_sdp_info *pa_sdp_parse(const char *t, pa_sdp_info *i, int is_goodbye) {
-     i->origin = i->session_name = NULL;
-     i->salen = 0;
-     i->payload = 255;
-+    i->enable_opus = false;
- 
-     if (pa_startswith(t, PA_SDP_HEADER)) {
-         t += sizeof(PA_SDP_HEADER) - 1;

diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r4.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r4.ebuild
deleted file mode 100644
index 8c47aaf30579..000000000000
--- a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r4.ebuild
+++ /dev/null
@@ -1,388 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-MY_PV="${PV/_pre*}"
-MY_P="pulseaudio-${MY_PV}"
-inherit bash-completion-r1 gnome2-utils meson optfeature systemd tmpfiles udev
-
-DESCRIPTION="A networked sound server with an advanced plugin system"
-HOMEPAGE="https://www.freedesktop.org/wiki/Software/PulseAudio/"
-
-if [[ ${PV} = 9999 ]]; then
-	inherit git-r3
-	EGIT_BRANCH="master"
-	EGIT_REPO_URI="https://gitlab.freedesktop.org/pulseaudio/pulseaudio"
-else
-	SRC_URI="https://freedesktop.org/software/pulseaudio/releases/${MY_P}.tar.xz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
-fi
-
-S="${WORKDIR}/${MY_P}"
-
-# libpulse-simple and libpulse link to libpulse-core; this is daemon's
-# library and can link to gdbm and other GPL-only libraries. In this
-# cases, we have a fully GPL-2 package. Leaving the rest of the
-# GPL-forcing USE flags for those who use them.
-LICENSE="!gdbm? ( LGPL-2.1 ) gdbm? ( GPL-2 )"
-
-SLOT="0"
-
-# +alsa-plugin as discussed in bug #519530
-# TODO: Find out why webrtc-aec is + prefixed - there's already the always available speexdsp-aec
-# NOTE: The current ebuild sets +X almost certainly just for the pulseaudio.desktop file
-IUSE="+alsa +alsa-plugin aptx +asyncns bluetooth dbus elogind equalizer fftw +gdbm +glib gstreamer jack ldac lirc
-ofono-headset +orc oss selinux sox ssl systemd system-wide tcpd test +udev valgrind +webrtc-aec +X zeroconf"
-
-RESTRICT="!test? ( test )"
-
-# See "*** BLUEZ support not found (requires D-Bus)" in configure.ac
-# Basically all IUSE are either ${MULTILIB_USEDEP} for client libs or they belong under !daemon ()
-# We duplicate alsa-plugin, {native,ofono}-headset under daemon to let users deal with them at once
-REQUIRED_USE="
-	?? ( elogind systemd )
-	alsa-plugin? ( alsa )
-	aptx? ( bluetooth )
-	bluetooth? ( dbus )
-	equalizer? ( dbus )
-	ldac? ( bluetooth )
-	ofono-headset? ( bluetooth )
-	udev? ( || ( alsa oss ) )
-	zeroconf? ( dbus )
-"
-
-# NOTE:
-# - libpcre needed in some cases, bug #472228
-# - media-libs/speexdsp is providing echo canceller implementation and used in resampler
-# TODO: libatomic_ops is only needed on some architectures and conditions, and then at runtime too
-gstreamer_deps="
-	media-libs/gst-plugins-base
-	>=media-libs/gstreamer-1.14
-"
-COMMON_DEPEND="
-	~media-libs/libpulse-${PV}[dbus?,glib?,systemd?,valgrind?,X?]
-	dev-libs/libatomic_ops
-	>=media-libs/libsndfile-1.0.20
-	>=media-libs/speexdsp-1.2
-	|| (
-		elibc_glibc? ( virtual/libc )
-		dev-libs/libpcre:3
-	)
-	alsa? ( >=media-libs/alsa-lib-1.0.24 )
-	aptx? ( ${gstreamer_deps} )
-	asyncns? ( >=net-libs/libasyncns-0.1 )
-	bluetooth? (
-		>=net-wireless/bluez-5
-		media-libs/sbc
-	)
-	dev-libs/libltdl
-	sys-kernel/linux-headers
-	>=sys-libs/libcap-2.22-r2
-	dbus? ( >=sys-apps/dbus-1.4.12 )
-	elogind? ( sys-auth/elogind )
-	equalizer? (
-		sci-libs/fftw:3.0=
-	)
-	fftw? (
-		sci-libs/fftw:3.0=
-	)
-	gdbm? ( sys-libs/gdbm:= )
-	glib? ( >=dev-libs/glib-2.28.0:2 )
-	gstreamer? (
-		${gstreamer_deps}
-		>=dev-libs/glib-2.26.0:2
-	)
-	jack? ( virtual/jack )
-	ldac? ( ${gstreamer_deps} )
-	lirc? ( app-misc/lirc )
-	ofono-headset? ( >=net-misc/ofono-1.13 )
-	orc? ( >=dev-lang/orc-0.4.15 )
-	selinux? ( sec-policy/selinux-pulseaudio )
-	sox? ( >=media-libs/soxr-0.1.1 )
-	ssl? ( dev-libs/openssl:= )
-	systemd? ( sys-apps/systemd:= )
-	tcpd? ( sys-apps/tcp-wrappers )
-	udev? ( >=virtual/udev-143[hwdb(+)] )
-	valgrind? ( dev-util/valgrind )
-	webrtc-aec? ( >=media-libs/webrtc-audio-processing-0.2:0 )
-	X? (
-		>=x11-libs/libxcb-1.6
-		x11-libs/libICE
-		x11-libs/libSM
-		>=x11-libs/libX11-1.4.0
-		>=x11-libs/libXtst-1.0.99.2
-	)
-	zeroconf? ( >=net-dns/avahi-0.6.12[dbus] )
-	!<media-sound/pulseaudio-15.0-r100
-"
-
-# pulseaudio ships a bundle xmltoman, which uses XML::Parser
-DEPEND="
-	${COMMON_DEPEND}
-	test? ( >=dev-libs/check-0.9.10 )
-	X? ( x11-base/xorg-proto )
-"
-
-# alsa-utils dep is for the alsasound init.d script (see bug 155707); TODO: read it
-# NOTE: Only system-wide needs acct-group/audio unless elogind/systemd is not used
-RDEPEND="
-	${COMMON_DEPEND}
-	system-wide? (
-		alsa? ( media-sound/alsa-utils )
-		acct-user/pulse
-		acct-group/audio
-		acct-group/pulse-access
-	)
-	bluetooth? (
-		ldac? ( media-plugins/gst-plugins-ldac )
-		aptx? ( media-plugins/gst-plugins-openaptx )
-	)
-"
-unset gstreamer_deps
-
-# This is a PDEPEND to avoid a circular dep
-PDEPEND="
-	alsa? ( alsa-plugin? ( >=media-plugins/alsa-plugins-1.0.27-r1[pulseaudio] ) )
-"
-
-BDEPEND="
-	dev-lang/perl
-	dev-perl/XML-Parser
-	sys-devel/gettext
-	virtual/libiconv
-	virtual/libintl
-	virtual/pkgconfig
-	orc? ( >=dev-lang/orc-0.4.15 )
-	system-wide? ( dev-util/unifdef )
-"
-
-DOCS=( NEWS README )
-
-S="${WORKDIR}/${MY_P}"
-
-# patches merged upstream, to be removed with 16.1 or later bump
-PATCHES=(
-	"${FILESDIR}"/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch
-	"${FILESDIR}"/pulseaudio-16.0-optional-module-console-kit.patch
-)
-
-src_prepare() {
-	default
-
-	gnome2_environment_reset
-}
-
-src_configure() {
-	local enable_bluez5_gstreamer="disabled"
-	if use aptx || use ldac ; then
-		enable_bluez5_gstreamer="enabled"
-	fi
-
-	local enable_fftw="disabled"
-	if use equalizer || use fftw ; then
-		enable_fftw="enabled"
-	fi
-
-	local emesonargs=(
-		--localstatedir="${EPREFIX}"/var
-
-		-Ddaemon=true
-		-Dclient=false
-		-Ddoxygen=false
-		-Dgcov=false
-		-Dman=true
-		# tests involve random modules, so just do them for the native # TODO: tests should run always
-		$(meson_use test tests)
-		-Ddatabase=$(usex gdbm gdbm simple) # tdb is also an option but no one cares about it
-		-Dstream-restore-clear-old-devices=true
-		-Drunning-from-build-tree=false
-
-		# Paths
-		-Dmodlibexecdir="${EPREFIX}/usr/$(get_libdir)/pulseaudio/modules" # Was $(get_libdir)/${P}
-		-Dsystemduserunitdir=$(systemd_get_userunitdir)
-		-Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"
-		-Dbashcompletiondir="$(get_bashcompdir)" # Alternatively DEPEND on app-shells/bash-completion for pkg-config to provide the value
-
-		# Optional features
-		$(meson_feature alsa)
-		$(meson_feature asyncns)
-		$(meson_feature zeroconf avahi)
-		$(meson_feature bluetooth bluez5)
-		-Dbluez5-gstreamer=${enable_bluez5_gstreamer}
-		$(meson_use bluetooth bluez5-native-headset)
-		$(meson_use ofono-headset bluez5-ofono-headset)
-		-Dconsolekit=disabled
-		$(meson_feature dbus)
-		$(meson_feature elogind)
-		-Dfftw=${enable_fftw}
-		$(meson_feature glib) # WARNING: toggling this likely changes ABI
-		$(meson_feature glib gsettings) # Supposedly correct?
-		$(meson_feature gstreamer)
-		-Dgtk=disabled
-		-Dhal-compat=false
-		-Dipv6=true
-		$(meson_feature jack)
-		$(meson_feature lirc)
-		$(meson_feature ssl openssl)
-		$(meson_feature orc)
-		$(meson_feature oss oss-output)
-		-Dsamplerate=disabled # Matches upstream
-		$(meson_feature sox soxr)
-		-Dspeex=enabled
-		$(meson_feature systemd)
-		$(meson_feature tcpd tcpwrap)
-		$(meson_feature udev)
-		$(meson_feature valgrind)
-		$(meson_feature X x11)
-
-		# Echo cancellation
-		-Dadrian-aec=false # Not packaged?
-		$(meson_feature webrtc-aec)
-	)
-
-	meson_src_configure
-}
-
-src_install() {
-	meson_src_install
-
-	# Upstream installs 'pactl' if client is built, with all symlinks except for
-	# 'pulseaudio', 'pacmd' and 'pasuspender' which are installed if server is built.
-	# This trips QA warning, workaround:
-	# - install missing aliases in media-libs/libpulse (client build)
-	# - remove corresponding symlinks in media-sound/pulseaudio-daemonclient (server build)
-	rm "${D}/$(get_bashcompdir)"/pulseaudio || die
-	rm "${D}/$(get_bashcompdir)"/pacmd || die
-	rm "${D}/$(get_bashcompdir)"/pasuspender || die
-
-	if use system-wide; then
-		newconfd "${FILESDIR}"/pulseaudio.conf.d pulseaudio
-
-		use_define() {
-			local define=${2:-$(echo ${1} | tr '[:lower:]' '[:upper:]')}
-
-			use "${1}" && echo "-D${define}" || echo "-U${define}"
-		}
-
-		unifdef -x 1 \
-			$(use_define zeroconf AVAHI) \
-			$(use_define alsa) \
-			$(use_define bluetooth) \
-			$(use_define udev) \
-			"${FILESDIR}"/pulseaudio.init.d-5 \
-			> "${T}"/pulseaudio \
-			|| die
-
-		doinitd "${T}"/pulseaudio
-
-		systemd_dounit "${FILESDIR}"/pulseaudio.service
-
-		# We need /var/run/pulse, bug 442852
-		newtmpfiles "${FILESDIR}"/pulseaudio.tmpfiles pulseaudio.conf
-	else
-		# Prevent warnings when system-wide is not used, bug 447694
-		if use dbus; then
-			rm "${ED}"/etc/dbus-1/system.d/pulseaudio-system.conf || die
-		fi
-	fi
-
-	if use zeroconf; then
-		sed -i \
-			-e '/module-zeroconf-publish/s:^#::' \
-			"${ED}/etc/pulse/default.pa" \
-			|| die
-	fi
-
-	# Only enable autospawning pulseaudio daemon on systems without systemd
-	if ! use systemd; then
-		insinto /etc/pulse/client.conf.d
-		newins "${FILESDIR}/enable-autospawn.conf" "enable-autospawn.conf"
-	fi
-
-	find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-}
-
-pkg_postinst() {
-	gnome2_schemas_update
-
-	use udev && udev_reload
-
-	if use system-wide; then
-		tmpfiles_process "pulseaudio.conf"
-
-		elog "You have enabled the 'system-wide' USE flag for pulseaudio."
-		elog "This mode should only be used on headless servers, embedded systems,"
-		elog "or thin clients. It will usually require manual configuration, and is"
-		elog "incompatible with many expected pulseaudio features."
-		elog "On normal desktop systems, system-wide mode is STRONGLY DISCOURAGED."
-		elog ""
-		elog "For more information, see"
-		elog "    https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/"
-		elog "    https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/"
-		elog "    https://wiki.gentoo.org/wiki/PulseAudio#Headless_server"
-		elog ""
-	fi
-
-	if use equalizer; then
-		elog "You will need to load some extra modules to make qpaeq work."
-		elog "You can do that by adding the following two lines in"
-		elog "/etc/pulse/default.pa and restarting pulseaudio:"
-		elog "load-module module-equalizer-sink"
-		elog "load-module module-dbus-protocol"
-		elog ""
-	fi
-
-	if use bluetooth; then
-		elog "You have enabled bluetooth USE flag for pulseaudio. Daemon will now handle"
-		elog "bluetooth Headset (HSP HS and HSP AG) and Handsfree (HFP HF) profiles using"
-		elog "native headset backend by default. This can be selectively disabled"
-		elog "via runtime configuration arguments to module-bluetooth-discover"
-		elog "in /etc/pulse/default.pa"
-		elog "To disable HFP HF append enable_native_hfp_hf=false"
-		elog "To disable HSP HS append enable_native_hsp_hs=false"
-		elog "To disable HSP AG append headset=auto or headset=ofono"
-		elog "(note this does NOT require enabling USE ofono)"
-		elog ""
-	fi
-
-	if use ofono-headset; then
-		elog "You have enabled both native and ofono headset profiles. The runtime decision"
-		elog "which to use is done via the 'headset' argument of module-bluetooth-discover."
-		elog ""
-	fi
-
-	if use gstreamer; then
-		elog "GStreamer-based RTP implementation modile enabled."
-		elog "To use OPUS payload install media-plugins/gst-plugins-opus"
-		elog "and add enable_opus=1 argument to module-rtp-send"
-		elog ""
-	fi
-
-	if use systemd; then
-		elog "Pulseaudio autospawn by client library is no longer enabled when systemd is available."
-		elog "It's recommended to start pulseaudio via its systemd user units:"
-		elog ""
-		elog "  systemctl --user enable pulseaudio.service pulseaudio.socket"
-		elog ""
-		elog "Root user can change system default configuration for all users:"
-		elog ""
-		elog "  systemctl --global enable pulseaudio.service pulseaudio.socket"
-		elog ""
-		elog "If you would like to enable autospawn by client library, edit autospawn flag in /etc/pulse/client.conf like this:"
-		elog ""
-		elog "  autospawn = yes"
-		elog ""
-		elog "The change from autospawn to user units will take effect after restarting."
-		elog ""
-	fi
-
-	optfeature_header "PulseAudio can be enhanced by installing the following:"
-	use equalizer && optfeature "using the qpaeq script" dev-python/PyQt5[dbus,widgets]
-	use dbus && optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit
-}
-
-pkg_postrm() {
-	gnome2_schemas_update
-	use udev && udev_reload
-}

diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r5.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r5.ebuild
deleted file mode 100644
index 66f340cd76f7..000000000000
--- a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r5.ebuild
+++ /dev/null
@@ -1,396 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-MY_PV="${PV/_pre*}"
-MY_P="pulseaudio-${MY_PV}"
-inherit bash-completion-r1 gnome2-utils meson optfeature systemd tmpfiles udev
-
-DESCRIPTION="Daemon component of PulseAudio (networked sound server)"
-HOMEPAGE="https://www.freedesktop.org/wiki/Software/PulseAudio/"
-
-if [[ ${PV} = 9999 ]]; then
-	inherit git-r3
-	EGIT_BRANCH="master"
-	EGIT_REPO_URI="https://gitlab.freedesktop.org/pulseaudio/pulseaudio"
-else
-	SRC_URI="https://freedesktop.org/software/pulseaudio/releases/${MY_P}.tar.xz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
-fi
-
-S="${WORKDIR}/${MY_P}"
-
-# libpulse-simple and libpulse link to libpulse-core; this is daemon's
-# library and can link to gdbm and other GPL-only libraries. In this
-# cases, we have a fully GPL-2 package. Leaving the rest of the
-# GPL-forcing USE flags for those who use them.
-LICENSE="!gdbm? ( LGPL-2.1 ) gdbm? ( GPL-2 )"
-
-SLOT="0"
-
-# +alsa-plugin as discussed in bug #519530
-# TODO: Find out why webrtc-aec is + prefixed - there's already the always available speexdsp-aec
-# NOTE: The current ebuild sets +X almost certainly just for the pulseaudio.desktop file
-IUSE="+alsa +alsa-plugin aptx +asyncns bluetooth dbus elogind equalizer fftw +gdbm +glib gstreamer jack ldac lirc
-ofono-headset +orc oss selinux sox ssl systemd system-wide tcpd test +udev valgrind +webrtc-aec +X zeroconf"
-
-RESTRICT="!test? ( test )"
-
-# See "*** BLUEZ support not found (requires D-Bus)" in configure.ac
-# Basically all IUSE are either ${MULTILIB_USEDEP} for client libs or they belong under !daemon ()
-# We duplicate alsa-plugin, {native,ofono}-headset under daemon to let users deal with them at once
-REQUIRED_USE="
-	?? ( elogind systemd )
-	alsa-plugin? ( alsa )
-	aptx? ( bluetooth )
-	bluetooth? ( dbus )
-	equalizer? ( dbus )
-	ldac? ( bluetooth )
-	ofono-headset? ( bluetooth )
-	udev? ( || ( alsa oss ) )
-	zeroconf? ( dbus )
-"
-
-# NOTE:
-# - libpcre needed in some cases, bug #472228
-# - media-libs/speexdsp is providing echo canceller implementation and used in resampler
-# TODO: libatomic_ops is only needed on some architectures and conditions, and then at runtime too
-gstreamer_deps="
-	media-libs/gst-plugins-base
-	>=media-libs/gstreamer-1.14
-"
-COMMON_DEPEND="
-	~media-libs/libpulse-${PV}[dbus?,glib?,systemd?,valgrind?,X?]
-	dev-libs/libatomic_ops
-	>=media-libs/libsndfile-1.0.20
-	>=media-libs/speexdsp-1.2
-	|| (
-		elibc_glibc? ( virtual/libc )
-		dev-libs/libpcre:3
-	)
-	alsa? ( >=media-libs/alsa-lib-1.0.24 )
-	aptx? ( ${gstreamer_deps} )
-	asyncns? ( >=net-libs/libasyncns-0.1 )
-	bluetooth? (
-		>=net-wireless/bluez-5
-		media-libs/sbc
-	)
-	dev-libs/libltdl
-	sys-kernel/linux-headers
-	>=sys-libs/libcap-2.22-r2
-	dbus? ( >=sys-apps/dbus-1.4.12 )
-	elogind? ( sys-auth/elogind )
-	equalizer? (
-		sci-libs/fftw:3.0=
-	)
-	fftw? (
-		sci-libs/fftw:3.0=
-	)
-	gdbm? ( sys-libs/gdbm:= )
-	glib? ( >=dev-libs/glib-2.28.0:2 )
-	gstreamer? (
-		${gstreamer_deps}
-		>=dev-libs/glib-2.26.0:2
-	)
-	jack? ( virtual/jack )
-	ldac? ( ${gstreamer_deps} )
-	lirc? ( app-misc/lirc )
-	ofono-headset? ( >=net-misc/ofono-1.13 )
-	orc? ( >=dev-lang/orc-0.4.15 )
-	selinux? ( sec-policy/selinux-pulseaudio )
-	sox? ( >=media-libs/soxr-0.1.1 )
-	ssl? ( dev-libs/openssl:= )
-	systemd? ( sys-apps/systemd:= )
-	tcpd? ( sys-apps/tcp-wrappers )
-	udev? ( >=virtual/udev-143[hwdb(+)] )
-	valgrind? ( dev-util/valgrind )
-	webrtc-aec? ( >=media-libs/webrtc-audio-processing-0.2:0 )
-	X? (
-		>=x11-libs/libxcb-1.6
-		x11-libs/libICE
-		x11-libs/libSM
-		>=x11-libs/libX11-1.4.0
-		>=x11-libs/libXtst-1.0.99.2
-	)
-	zeroconf? ( >=net-dns/avahi-0.6.12[dbus] )
-	!<media-sound/pulseaudio-15.0-r100
-"
-
-# pulseaudio ships a bundle xmltoman, which uses XML::Parser
-DEPEND="
-	${COMMON_DEPEND}
-	test? ( >=dev-libs/check-0.9.10 )
-	X? ( x11-base/xorg-proto )
-"
-
-# alsa-utils dep is for the alsasound init.d script (see bug 155707); TODO: read it
-# NOTE: Only system-wide needs acct-group/audio unless elogind/systemd is not used
-RDEPEND="
-	${COMMON_DEPEND}
-	system-wide? (
-		alsa? ( media-sound/alsa-utils )
-		acct-user/pulse
-		acct-group/audio
-		acct-group/pulse-access
-	)
-	bluetooth? (
-		ldac? ( media-plugins/gst-plugins-ldac )
-		aptx? ( media-plugins/gst-plugins-openaptx )
-	)
-"
-unset gstreamer_deps
-
-# This is a PDEPEND to avoid a circular dep
-PDEPEND="
-	alsa? ( alsa-plugin? ( >=media-plugins/alsa-plugins-1.0.27-r1[pulseaudio] ) )
-"
-
-BDEPEND="
-	dev-lang/perl
-	dev-perl/XML-Parser
-	sys-devel/gettext
-	virtual/libiconv
-	virtual/libintl
-	virtual/pkgconfig
-	orc? ( >=dev-lang/orc-0.4.15 )
-	system-wide? ( dev-util/unifdef )
-"
-
-DOCS=( NEWS README )
-
-S="${WORKDIR}/${MY_P}"
-
-# patches merged upstream, to be removed with 16.1 or later bump
-PATCHES=(
-	"${FILESDIR}"/pulseaudio-16.0-fix-rtp-receiver-sdp-record.patch
-	"${FILESDIR}"/pulseaudio-16.0-optional-module-console-kit.patch
-	"${FILESDIR}"/pulseaudio-16.0-fix-combine-sink-underrun-crash.patch
-	"${FILESDIR}"/pulseaudio-16.0-fix-gstreamer-bluetooth-arm-crash.patch
-	"${FILESDIR}"/pulseaudio-16.0-fix-pacmd-play-file-crash.patch
-)
-
-src_prepare() {
-	default
-
-	gnome2_environment_reset
-}
-
-src_configure() {
-	local enable_bluez5_gstreamer="disabled"
-	if use aptx || use ldac ; then
-		enable_bluez5_gstreamer="enabled"
-	fi
-
-	local enable_fftw="disabled"
-	if use equalizer || use fftw ; then
-		enable_fftw="enabled"
-	fi
-
-	local emesonargs=(
-		--localstatedir="${EPREFIX}"/var
-
-		-Ddaemon=true
-		-Dclient=false
-		-Ddoxygen=false
-		-Dgcov=false
-		-Dman=true
-		# tests involve random modules, so just do them for the native # TODO: tests should run always
-		$(meson_use test tests)
-		-Ddatabase=$(usex gdbm gdbm simple) # tdb is also an option but no one cares about it
-		-Dstream-restore-clear-old-devices=true
-		-Drunning-from-build-tree=false
-
-		# Paths
-		-Dmodlibexecdir="${EPREFIX}/usr/$(get_libdir)/pulseaudio/modules" # Was $(get_libdir)/${P}
-		-Dsystemduserunitdir=$(systemd_get_userunitdir)
-		-Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"
-		-Dbashcompletiondir="$(get_bashcompdir)" # Alternatively DEPEND on app-shells/bash-completion for pkg-config to provide the value
-
-		# Optional features
-		$(meson_feature alsa)
-		$(meson_feature asyncns)
-		$(meson_feature zeroconf avahi)
-		$(meson_feature bluetooth bluez5)
-		-Dbluez5-gstreamer=${enable_bluez5_gstreamer}
-		$(meson_use bluetooth bluez5-native-headset)
-		$(meson_use ofono-headset bluez5-ofono-headset)
-		-Dconsolekit=disabled
-		$(meson_feature dbus)
-		$(meson_feature elogind)
-		-Dfftw=${enable_fftw}
-		$(meson_feature glib) # WARNING: toggling this likely changes ABI
-		$(meson_feature glib gsettings) # Supposedly correct?
-		$(meson_feature gstreamer)
-		-Dgtk=disabled
-		-Dhal-compat=false
-		-Dipv6=true
-		$(meson_feature jack)
-		$(meson_feature lirc)
-		$(meson_feature ssl openssl)
-		$(meson_feature orc)
-		$(meson_feature oss oss-output)
-		-Dsamplerate=disabled # Matches upstream
-		$(meson_feature sox soxr)
-		-Dspeex=enabled
-		$(meson_feature systemd)
-		$(meson_feature tcpd tcpwrap)
-		$(meson_feature udev)
-		$(meson_feature valgrind)
-		$(meson_feature X x11)
-
-		# Echo cancellation
-		-Dadrian-aec=false # Not packaged?
-		$(meson_feature webrtc-aec)
-	)
-
-	meson_src_configure
-}
-
-src_install() {
-	meson_src_install
-
-	# Upstream installs 'pactl' if client is built, with all symlinks except for
-	# 'pulseaudio', 'pacmd' and 'pasuspender' which are installed if server is built.
-	# This trips QA warning, workaround:
-	# - install missing aliases in media-libs/libpulse (client build)
-	# - remove corresponding symlinks in media-sound/pulseaudio-daemonclient (server build)
-	rm "${D}/$(get_bashcompdir)"/pulseaudio || die
-	rm "${D}/$(get_bashcompdir)"/pacmd || die
-	rm "${D}/$(get_bashcompdir)"/pasuspender || die
-
-	# Daemon configuration scripts will try to load snippets from corresponding '.d' dirs.
-	# Install these dirs to silence a warning if they are missing.
-	keepdir /etc/pulse/default.pa.d
-	keepdir /etc/pulse/system.pa.d
-
-	if use system-wide; then
-		newconfd "${FILESDIR}"/pulseaudio.conf.d pulseaudio
-
-		use_define() {
-			local define=${2:-$(echo ${1} | tr '[:lower:]' '[:upper:]')}
-
-			use "${1}" && echo "-D${define}" || echo "-U${define}"
-		}
-
-		unifdef -x 1 \
-			$(use_define zeroconf AVAHI) \
-			$(use_define alsa) \
-			$(use_define bluetooth) \
-			$(use_define udev) \
-			"${FILESDIR}"/pulseaudio.init.d-5 \
-			> "${T}"/pulseaudio \
-			|| die
-
-		doinitd "${T}"/pulseaudio
-
-		systemd_dounit "${FILESDIR}"/pulseaudio.service
-
-		# We need /var/run/pulse, bug 442852
-		newtmpfiles "${FILESDIR}"/pulseaudio.tmpfiles pulseaudio.conf
-	else
-		# Prevent warnings when system-wide is not used, bug 447694
-		if use dbus; then
-			rm "${ED}"/etc/dbus-1/system.d/pulseaudio-system.conf || die
-		fi
-	fi
-
-	if use zeroconf; then
-		sed -i \
-			-e '/module-zeroconf-publish/s:^#::' \
-			"${ED}/etc/pulse/default.pa" \
-			|| die
-	fi
-
-	# Only enable autospawning pulseaudio daemon on systems without systemd
-	if ! use systemd; then
-		insinto /etc/pulse/client.conf.d
-		newins "${FILESDIR}/enable-autospawn.conf" "enable-autospawn.conf"
-	fi
-
-	find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-}
-
-pkg_postinst() {
-	gnome2_schemas_update
-
-	use udev && udev_reload
-
-	if use system-wide; then
-		tmpfiles_process "pulseaudio.conf"
-
-		elog "You have enabled the 'system-wide' USE flag for pulseaudio."
-		elog "This mode should only be used on headless servers, embedded systems,"
-		elog "or thin clients. It will usually require manual configuration, and is"
-		elog "incompatible with many expected pulseaudio features."
-		elog "On normal desktop systems, system-wide mode is STRONGLY DISCOURAGED."
-		elog ""
-		elog "For more information, see"
-		elog "    https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/"
-		elog "    https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/"
-		elog "    https://wiki.gentoo.org/wiki/PulseAudio#Headless_server"
-		elog ""
-	fi
-
-	if use equalizer; then
-		elog "You will need to load some extra modules to make qpaeq work."
-		elog "You can do that by adding the following two lines in"
-		elog "/etc/pulse/default.pa and restarting pulseaudio:"
-		elog "load-module module-equalizer-sink"
-		elog "load-module module-dbus-protocol"
-		elog ""
-	fi
-
-	if use bluetooth; then
-		elog "You have enabled bluetooth USE flag for pulseaudio. Daemon will now handle"
-		elog "bluetooth Headset (HSP HS and HSP AG) and Handsfree (HFP HF) profiles using"
-		elog "native headset backend by default. This can be selectively disabled"
-		elog "via runtime configuration arguments to module-bluetooth-discover"
-		elog "in /etc/pulse/default.pa"
-		elog "To disable HFP HF append enable_native_hfp_hf=false"
-		elog "To disable HSP HS append enable_native_hsp_hs=false"
-		elog "To disable HSP AG append headset=auto or headset=ofono"
-		elog "(note this does NOT require enabling USE ofono)"
-		elog ""
-	fi
-
-	if use ofono-headset; then
-		elog "You have enabled both native and ofono headset profiles. The runtime decision"
-		elog "which to use is done via the 'headset' argument of module-bluetooth-discover."
-		elog ""
-	fi
-
-	if use gstreamer; then
-		elog "GStreamer-based RTP implementation modile enabled."
-		elog "To use OPUS payload install media-plugins/gst-plugins-opus"
-		elog "and add enable_opus=1 argument to module-rtp-send"
-		elog ""
-	fi
-
-	if use systemd; then
-		elog "Pulseaudio autospawn by client library is no longer enabled when systemd is available."
-		elog "It's recommended to start pulseaudio via its systemd user units:"
-		elog ""
-		elog "  systemctl --user enable pulseaudio.service pulseaudio.socket"
-		elog ""
-		elog "Root user can change system default configuration for all users:"
-		elog ""
-		elog "  systemctl --global enable pulseaudio.service pulseaudio.socket"
-		elog ""
-		elog "If you would like to enable autospawn by client library, edit autospawn flag in /etc/pulse/client.conf like this:"
-		elog ""
-		elog "  autospawn = yes"
-		elog ""
-		elog "The change from autospawn to user units will take effect after restarting."
-		elog ""
-	fi
-
-	optfeature_header "PulseAudio can be enhanced by installing the following:"
-	use equalizer && optfeature "using the qpaeq script" dev-python/PyQt5[dbus,widgets]
-	use dbus && optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit
-}
-
-pkg_postrm() {
-	gnome2_schemas_update
-	use udev && udev_reload
-}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/pulseaudio-daemon/, media-sound/pulseaudio-daemon/files/
@ 2022-11-29  7:13 Mart Raudsepp
  0 siblings, 0 replies; 8+ messages in thread
From: Mart Raudsepp @ 2022-11-29  7:13 UTC (permalink / raw
  To: gentoo-commits

commit:     38919a9dc42d975a5966c3dacb61c19995993109
Author:     Igor V. Kovalenko <igor.v.kovalenko <AT> gmail <DOT> com>
AuthorDate: Sun Nov 27 20:11:11 2022 +0000
Commit:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Tue Nov 29 07:08:16 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38919a9d

media-sound/pulseaudio-daemon: Fix module-combine-sink crashes

Upstream commits:
37c72c20720d6f7fefeeb151f5e10c2cd0dda30e
0cbbc408aee2b5f2c42280d24dc615405387b5b1

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/28452
Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>

 ...audio-16.1-module-combine-sink-load-crash.patch |  26 ++
 ...dio-16.1-module-combine-sink-unload-crash.patch |  22 ++
 .../pulseaudio-daemon-16.1-r1.ebuild               | 395 +++++++++++++++++++++
 3 files changed, 443 insertions(+)

diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-16.1-module-combine-sink-load-crash.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-16.1-module-combine-sink-load-crash.patch
new file mode 100644
index 000000000000..d02c1029f8b0
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio-16.1-module-combine-sink-load-crash.patch
@@ -0,0 +1,26 @@
+commit 37c72c20720d6f7fefeeb151f5e10c2cd0dda30e
+Author: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
+Date:   Sun Nov 27 22:30:45 2022 +0300
+
+    module-combine-sink: Do not set up rate adjustment timer at load time
+    
+    Rate adjustment timer is set up when combine sink is resumed and relased when
+    combine sink is suspended. Do not create this timer again while module is loaded
+    to prevent duplicate effort causing assertion in time_callback.
+    
+    Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/756>
+
+diff --git a/src/modules/module-combine-sink.c b/src/modules/module-combine-sink.c
+index f98f4820b..4b7690183 100644
+--- a/src/modules/module-combine-sink.c
++++ b/src/modules/module-combine-sink.c
+@@ -1711,9 +1711,6 @@ int pa__init(pa_module*m) {
+     PA_IDXSET_FOREACH(o, u->outputs, idx)
+         output_verify(o);
+ 
+-    if (u->adjust_time > 0)
+-        u->time_event = pa_core_rttime_new(m->core, pa_rtclock_now() + u->adjust_time, time_callback, u);
+-
+     pa_modargs_free(ma);
+ 
+     return 0;

diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-16.1-module-combine-sink-unload-crash.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-16.1-module-combine-sink-unload-crash.patch
new file mode 100644
index 000000000000..f0cd82dde16e
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio-16.1-module-combine-sink-unload-crash.patch
@@ -0,0 +1,22 @@
+commit 0cbbc408aee2b5f2c42280d24dc615405387b5b1
+Author: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
+Date:   Sun Nov 27 19:39:23 2022 +0300
+
+    module-combine-sink: Suspend while unloading to fix crash moving sinks
+    
+    Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/756>
+
+diff --git a/src/modules/module-combine-sink.c b/src/modules/module-combine-sink.c
+index 4b7690183..2ccd9eb13 100644
+--- a/src/modules/module-combine-sink.c
++++ b/src/modules/module-combine-sink.c
+@@ -1733,6 +1733,9 @@ void pa__done(pa_module*m) {
+     if (!(u = m->userdata))
+         return;
+ 
++    if (u->sink && PA_SINK_IS_LINKED(u->sink->state))
++        pa_sink_suspend(u->sink, true, PA_SUSPEND_UNAVAILABLE);
++
+     pa_strlist_free(u->unlinked_slaves);
+ 
+     if (u->sink_put_slot)

diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1-r1.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1-r1.ebuild
new file mode 100644
index 000000000000..8ccca2d552d5
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1-r1.ebuild
@@ -0,0 +1,395 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+MY_PV="${PV/_pre*}"
+MY_P="pulseaudio-${MY_PV}"
+inherit bash-completion-r1 gnome2-utils meson optfeature systemd tmpfiles udev
+
+DESCRIPTION="Daemon component of PulseAudio (networked sound server)"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/PulseAudio/"
+
+if [[ ${PV} = 9999 ]]; then
+	inherit git-r3
+	EGIT_BRANCH="master"
+	EGIT_REPO_URI="https://gitlab.freedesktop.org/pulseaudio/pulseaudio"
+else
+	SRC_URI="https://freedesktop.org/software/pulseaudio/releases/${MY_P}.tar.xz"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+S="${WORKDIR}/${MY_P}"
+
+# libpulse-simple and libpulse link to libpulse-core; this is daemon's
+# library and can link to gdbm and other GPL-only libraries. In this
+# cases, we have a fully GPL-2 package. Leaving the rest of the
+# GPL-forcing USE flags for those who use them.
+LICENSE="!gdbm? ( LGPL-2.1 ) gdbm? ( GPL-2 )"
+
+SLOT="0"
+
+# +alsa-plugin as discussed in bug #519530
+# TODO: Find out why webrtc-aec is + prefixed - there's already the always available speexdsp-aec
+# NOTE: The current ebuild sets +X almost certainly just for the pulseaudio.desktop file
+IUSE="+alsa +alsa-plugin aptx +asyncns bluetooth dbus elogind equalizer fftw +gdbm +glib gstreamer jack ldac lirc
+ofono-headset +orc oss selinux sox ssl systemd system-wide tcpd test +udev valgrind +webrtc-aec +X zeroconf"
+
+RESTRICT="!test? ( test )"
+
+# See "*** BLUEZ support not found (requires D-Bus)" in configure.ac
+# Basically all IUSE are either ${MULTILIB_USEDEP} for client libs or they belong under !daemon ()
+# We duplicate alsa-plugin, {native,ofono}-headset under daemon to let users deal with them at once
+REQUIRED_USE="
+	?? ( elogind systemd )
+	alsa-plugin? ( alsa )
+	aptx? ( bluetooth )
+	bluetooth? ( dbus )
+	equalizer? ( dbus )
+	ldac? ( bluetooth )
+	ofono-headset? ( bluetooth )
+	udev? ( || ( alsa oss ) )
+	zeroconf? ( dbus )
+"
+
+# NOTE:
+# - libpcre needed in some cases, bug #472228
+# - media-libs/speexdsp is providing echo canceller implementation and used in resampler
+# TODO: libatomic_ops is only needed on some architectures and conditions, and then at runtime too
+gstreamer_deps="
+	media-libs/gst-plugins-base
+	>=media-libs/gstreamer-1.14
+"
+COMMON_DEPEND="
+	~media-libs/libpulse-${PV}[dbus?,glib?,systemd?,valgrind?,X?]
+	dev-libs/libatomic_ops
+	>=media-libs/libsndfile-1.0.20
+	>=media-libs/speexdsp-1.2
+	|| (
+		elibc_glibc? ( virtual/libc )
+		dev-libs/libpcre:3
+	)
+	alsa? ( >=media-libs/alsa-lib-1.0.24 )
+	aptx? ( ${gstreamer_deps} )
+	asyncns? ( >=net-libs/libasyncns-0.1 )
+	bluetooth? (
+		>=net-wireless/bluez-5
+		media-libs/sbc
+	)
+	dev-libs/libltdl
+	sys-kernel/linux-headers
+	>=sys-libs/libcap-2.22-r2
+	dbus? ( >=sys-apps/dbus-1.4.12 )
+	elogind? ( sys-auth/elogind )
+	equalizer? (
+		sci-libs/fftw:3.0=
+	)
+	fftw? (
+		sci-libs/fftw:3.0=
+	)
+	gdbm? ( sys-libs/gdbm:= )
+	glib? ( >=dev-libs/glib-2.28.0:2 )
+	gstreamer? (
+		${gstreamer_deps}
+		>=dev-libs/glib-2.26.0:2
+	)
+	jack? ( virtual/jack )
+	ldac? ( ${gstreamer_deps} )
+	lirc? ( app-misc/lirc )
+	ofono-headset? ( >=net-misc/ofono-1.13 )
+	orc? ( >=dev-lang/orc-0.4.15 )
+	selinux? ( sec-policy/selinux-pulseaudio )
+	sox? ( >=media-libs/soxr-0.1.1 )
+	ssl? ( dev-libs/openssl:= )
+	systemd? ( sys-apps/systemd:= )
+	tcpd? ( sys-apps/tcp-wrappers )
+	udev? ( >=virtual/udev-143[hwdb(+)] )
+	valgrind? ( dev-util/valgrind )
+	webrtc-aec? ( >=media-libs/webrtc-audio-processing-0.2:0 )
+	X? (
+		>=x11-libs/libxcb-1.6
+		x11-libs/libICE
+		x11-libs/libSM
+		>=x11-libs/libX11-1.4.0
+		>=x11-libs/libXtst-1.0.99.2
+	)
+	zeroconf? ( >=net-dns/avahi-0.6.12[dbus] )
+	!<media-sound/pulseaudio-15.0-r100
+"
+
+# pulseaudio ships a bundle xmltoman, which uses XML::Parser
+DEPEND="
+	${COMMON_DEPEND}
+	test? ( >=dev-libs/check-0.9.10 )
+	X? ( x11-base/xorg-proto )
+"
+
+# alsa-utils dep is for the alsasound init.d script (see bug 155707); TODO: read it
+# NOTE: Only system-wide needs acct-group/audio unless elogind/systemd is not used
+RDEPEND="
+	${COMMON_DEPEND}
+	system-wide? (
+		alsa? ( media-sound/alsa-utils )
+		acct-user/pulse
+		acct-group/audio
+		acct-group/pulse-access
+	)
+	bluetooth? (
+		ldac? ( media-plugins/gst-plugins-ldac )
+		aptx? ( media-plugins/gst-plugins-openaptx )
+	)
+	!media-video/pipewire[sound-server(+)]
+"
+unset gstreamer_deps
+
+# This is a PDEPEND to avoid a circular dep
+PDEPEND="
+	alsa? ( alsa-plugin? ( >=media-plugins/alsa-plugins-1.0.27-r1[pulseaudio] ) )
+"
+
+BDEPEND="
+	dev-lang/perl
+	dev-perl/XML-Parser
+	sys-devel/gettext
+	virtual/libiconv
+	virtual/libintl
+	virtual/pkgconfig
+	orc? ( >=dev-lang/orc-0.4.15 )
+	system-wide? ( dev-util/unifdef )
+"
+
+DOCS=( NEWS README )
+
+S="${WORKDIR}/${MY_P}"
+
+# patches merged upstream, to be removed with 16.2 or later bump
+PATCHES=(
+	"${FILESDIR}"/pulseaudio-16.0-optional-module-console-kit.patch
+	"${FILESDIR}"/pulseaudio-16.1-module-combine-sink-load-crash.patch
+	"${FILESDIR}"/pulseaudio-16.1-module-combine-sink-unload-crash.patch
+)
+
+src_prepare() {
+	default
+
+	gnome2_environment_reset
+}
+
+src_configure() {
+	local enable_bluez5_gstreamer="disabled"
+	if use aptx || use ldac ; then
+		enable_bluez5_gstreamer="enabled"
+	fi
+
+	local enable_fftw="disabled"
+	if use equalizer || use fftw ; then
+		enable_fftw="enabled"
+	fi
+
+	local emesonargs=(
+		--localstatedir="${EPREFIX}"/var
+
+		-Ddaemon=true
+		-Dclient=false
+		-Ddoxygen=false
+		-Dgcov=false
+		-Dman=true
+		# tests involve random modules, so just do them for the native # TODO: tests should run always
+		$(meson_use test tests)
+		-Ddatabase=$(usex gdbm gdbm simple) # tdb is also an option but no one cares about it
+		-Dstream-restore-clear-old-devices=true
+		-Drunning-from-build-tree=false
+
+		# Paths
+		-Dmodlibexecdir="${EPREFIX}/usr/$(get_libdir)/pulseaudio/modules" # Was $(get_libdir)/${P}
+		-Dsystemduserunitdir=$(systemd_get_userunitdir)
+		-Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"
+		-Dbashcompletiondir="$(get_bashcompdir)" # Alternatively DEPEND on app-shells/bash-completion for pkg-config to provide the value
+
+		# Optional features
+		$(meson_feature alsa)
+		$(meson_feature asyncns)
+		$(meson_feature zeroconf avahi)
+		$(meson_feature bluetooth bluez5)
+		-Dbluez5-gstreamer=${enable_bluez5_gstreamer}
+		$(meson_use bluetooth bluez5-native-headset)
+		$(meson_use ofono-headset bluez5-ofono-headset)
+		-Dconsolekit=disabled
+		$(meson_feature dbus)
+		$(meson_feature elogind)
+		-Dfftw=${enable_fftw}
+		$(meson_feature glib) # WARNING: toggling this likely changes ABI
+		$(meson_feature glib gsettings) # Supposedly correct?
+		$(meson_feature gstreamer)
+		-Dgtk=disabled
+		-Dhal-compat=false
+		-Dipv6=true
+		$(meson_feature jack)
+		$(meson_feature lirc)
+		$(meson_feature ssl openssl)
+		$(meson_feature orc)
+		$(meson_feature oss oss-output)
+		-Dsamplerate=disabled # Matches upstream
+		$(meson_feature sox soxr)
+		-Dspeex=enabled
+		$(meson_feature systemd)
+		$(meson_feature tcpd tcpwrap)
+		$(meson_feature udev)
+		$(meson_feature valgrind)
+		$(meson_feature X x11)
+
+		# Echo cancellation
+		-Dadrian-aec=false # Not packaged?
+		$(meson_feature webrtc-aec)
+	)
+
+	meson_src_configure
+}
+
+src_install() {
+	meson_src_install
+
+	# Upstream installs 'pactl' if client is built, with all symlinks except for
+	# 'pulseaudio', 'pacmd' and 'pasuspender' which are installed if server is built.
+	# This trips QA warning, workaround:
+	# - install missing aliases in media-libs/libpulse (client build)
+	# - remove corresponding symlinks in media-sound/pulseaudio-daemonclient (server build)
+	rm "${D}/$(get_bashcompdir)"/pulseaudio || die
+	rm "${D}/$(get_bashcompdir)"/pacmd || die
+	rm "${D}/$(get_bashcompdir)"/pasuspender || die
+
+	# Daemon configuration scripts will try to load snippets from corresponding '.d' dirs.
+	# Install these dirs to silence a warning if they are missing.
+	keepdir /etc/pulse/default.pa.d
+	keepdir /etc/pulse/system.pa.d
+
+	if use system-wide; then
+		newconfd "${FILESDIR}"/pulseaudio.conf.d pulseaudio
+
+		use_define() {
+			local define=${2:-$(echo ${1} | tr '[:lower:]' '[:upper:]')}
+
+			use "${1}" && echo "-D${define}" || echo "-U${define}"
+		}
+
+		unifdef -x 1 \
+			$(use_define zeroconf AVAHI) \
+			$(use_define alsa) \
+			$(use_define bluetooth) \
+			$(use_define udev) \
+			"${FILESDIR}"/pulseaudio.init.d-5 \
+			> "${T}"/pulseaudio \
+			|| die
+
+		doinitd "${T}"/pulseaudio
+
+		systemd_dounit "${FILESDIR}"/pulseaudio.service
+
+		# We need /var/run/pulse, bug 442852
+		newtmpfiles "${FILESDIR}"/pulseaudio.tmpfiles pulseaudio.conf
+	else
+		# Prevent warnings when system-wide is not used, bug 447694
+		if use dbus; then
+			rm "${ED}"/etc/dbus-1/system.d/pulseaudio-system.conf || die
+		fi
+	fi
+
+	if use zeroconf; then
+		sed -i \
+			-e '/module-zeroconf-publish/s:^#::' \
+			"${ED}/etc/pulse/default.pa" \
+			|| die
+	fi
+
+	# Only enable autospawning pulseaudio daemon on systems without systemd
+	if ! use systemd; then
+		insinto /etc/pulse/client.conf.d
+		newins "${FILESDIR}/enable-autospawn.conf" "enable-autospawn.conf"
+	fi
+
+	find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+}
+
+pkg_postinst() {
+	gnome2_schemas_update
+
+	use udev && udev_reload
+
+	if use system-wide; then
+		tmpfiles_process "pulseaudio.conf"
+
+		elog "You have enabled the 'system-wide' USE flag for pulseaudio."
+		elog "This mode should only be used on headless servers, embedded systems,"
+		elog "or thin clients. It will usually require manual configuration, and is"
+		elog "incompatible with many expected pulseaudio features."
+		elog "On normal desktop systems, system-wide mode is STRONGLY DISCOURAGED."
+		elog ""
+		elog "For more information, see"
+		elog "    https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/"
+		elog "    https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/"
+		elog "    https://wiki.gentoo.org/wiki/PulseAudio#Headless_server"
+		elog ""
+	fi
+
+	if use equalizer; then
+		elog "You will need to load some extra modules to make qpaeq work."
+		elog "You can do that by adding the following two lines in"
+		elog "/etc/pulse/default.pa and restarting pulseaudio:"
+		elog "load-module module-equalizer-sink"
+		elog "load-module module-dbus-protocol"
+		elog ""
+	fi
+
+	if use bluetooth; then
+		elog "You have enabled bluetooth USE flag for pulseaudio. Daemon will now handle"
+		elog "bluetooth Headset (HSP HS and HSP AG) and Handsfree (HFP HF) profiles using"
+		elog "native headset backend by default. This can be selectively disabled"
+		elog "via runtime configuration arguments to module-bluetooth-discover"
+		elog "in /etc/pulse/default.pa"
+		elog "To disable HFP HF append enable_native_hfp_hf=false"
+		elog "To disable HSP HS append enable_native_hsp_hs=false"
+		elog "To disable HSP AG append headset=auto or headset=ofono"
+		elog "(note this does NOT require enabling USE ofono)"
+		elog ""
+	fi
+
+	if use ofono-headset; then
+		elog "You have enabled both native and ofono headset profiles. The runtime decision"
+		elog "which to use is done via the 'headset' argument of module-bluetooth-discover."
+		elog ""
+	fi
+
+	if use gstreamer; then
+		elog "GStreamer-based RTP implementation modile enabled."
+		elog "To use OPUS payload install media-plugins/gst-plugins-opus"
+		elog "and add enable_opus=1 argument to module-rtp-send"
+		elog ""
+	fi
+
+	if use systemd; then
+		elog "Pulseaudio autospawn by client library is no longer enabled when systemd is available."
+		elog "It's recommended to start pulseaudio via its systemd user units:"
+		elog ""
+		elog "  systemctl --user enable pulseaudio.service pulseaudio.socket"
+		elog ""
+		elog "Root user can change system default configuration for all users:"
+		elog ""
+		elog "  systemctl --global enable pulseaudio.service pulseaudio.socket"
+		elog ""
+		elog "If you would like to enable autospawn by client library, edit autospawn flag in /etc/pulse/client.conf like this:"
+		elog ""
+		elog "  autospawn = yes"
+		elog ""
+		elog "The change from autospawn to user units will take effect after restarting."
+		elog ""
+	fi
+
+	optfeature_header "PulseAudio can be enhanced by installing the following:"
+	use equalizer && optfeature "using the qpaeq script" dev-python/PyQt5[dbus,widgets]
+	use dbus && optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit
+}
+
+pkg_postrm() {
+	gnome2_schemas_update
+	use udev && udev_reload
+}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/pulseaudio-daemon/, media-sound/pulseaudio-daemon/files/
@ 2022-12-03  7:50 Sam James
  0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2022-12-03  7:50 UTC (permalink / raw
  To: gentoo-commits

commit:     ec06180714fd70296f1ac141438e2a39de624c97
Author:     Igor V. Kovalenko <igor.v.kovalenko <AT> gmail <DOT> com>
AuthorDate: Sat Dec  3 06:31:05 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec  3 07:48:08 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec061807

media-sound/pulseaudio-daemon: Move qpaeq to daemon build

Upstream commit 07a9fcefbab049d66cb174ca2c9b91fecc444c5b

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/28519
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../pulseaudio-16.1-move-qpaeq-to-daemon.patch     | 36 ++++++++++++++++++++++
 ...-r1.ebuild => pulseaudio-daemon-16.1-r2.ebuild} |  1 +
 2 files changed, 37 insertions(+)

diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-16.1-move-qpaeq-to-daemon.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-16.1-move-qpaeq-to-daemon.patch
new file mode 100644
index 000000000000..d3943bf10a49
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio-16.1-move-qpaeq-to-daemon.patch
@@ -0,0 +1,36 @@
+commit 07a9fcefbab049d66cb174ca2c9b91fecc444c5b
+Author: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
+Date:   Sat Jul 9 09:12:38 2022 +0300
+
+    build-sys: meson: Move qpaeq to daemon build
+    
+    Equalizer control requires server modules only available when daemon is built.
+    Move qpaeq script to be installed together with daemon.
+    
+    Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/734>
+
+diff --git a/src/utils/meson.build b/src/utils/meson.build
+index 28e1fc10a..8496d0bc5 100644
+--- a/src/utils/meson.build
++++ b/src/utils/meson.build
+@@ -72,6 +72,10 @@ if get_option('daemon')
+       c_args : pa_c_args,
+     )
+   endif
++
++  if dbus_dep.found() and fftw_dep.found()
++    install_data('qpaeq', install_dir : bindir)
++  endif
+ endif
+ 
+ if get_option('client')
+@@ -117,9 +121,5 @@ if get_option('client')
+     )
+   endif
+ 
+-  if dbus_dep.found() and fftw_dep.found()
+-    install_data('qpaeq', install_dir : bindir)
+-  endif
+-
+   install_data('pa-info', install_dir : bindir)
+ endif

diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1-r1.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1-r2.ebuild
similarity index 99%
rename from media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1-r1.ebuild
rename to media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1-r2.ebuild
index 8ccca2d552d5..a358f8c2235d 100644
--- a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1-r1.ebuild
+++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1-r2.ebuild
@@ -167,6 +167,7 @@ PATCHES=(
 	"${FILESDIR}"/pulseaudio-16.0-optional-module-console-kit.patch
 	"${FILESDIR}"/pulseaudio-16.1-module-combine-sink-load-crash.patch
 	"${FILESDIR}"/pulseaudio-16.1-module-combine-sink-unload-crash.patch
+	"${FILESDIR}"/pulseaudio-16.1-move-qpaeq-to-daemon.patch
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/pulseaudio-daemon/, media-sound/pulseaudio-daemon/files/
@ 2023-10-06 12:09 Sam James
  0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2023-10-06 12:09 UTC (permalink / raw
  To: gentoo-commits

commit:     1fec97488a02d57d0ed0716f2445f220eac44eb3
Author:     Igor V. Kovalenko <igor.v.kovalenko <AT> gmail <DOT> com>
AuthorDate: Fri Oct  6 08:35:43 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 12:05:11 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fec9748

media-sound/pulseaudio-daemon: Backport UAC2 avoid-resampling fix

Upstream commit aed52c507f345d0b5c4cd2b1d2c58dae2d904b53
Upstream commit 5ab2b9cb0e32190c3ea12b0f4cb7533d7340bbf1

See upstream https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1414

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/33209
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...dio-16.1-fix-uac2-broken-avoid-resampling.patch | 382 +++++++++++++++++++++
 .../pulseaudio-daemon-16.1-r8.ebuild               |   1 +
 2 files changed, 383 insertions(+)

diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-16.1-fix-uac2-broken-avoid-resampling.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-16.1-fix-uac2-broken-avoid-resampling.patch
new file mode 100644
index 000000000000..a260ced351a5
--- /dev/null
+++ b/media-sound/pulseaudio-daemon/files/pulseaudio-16.1-fix-uac2-broken-avoid-resampling.patch
@@ -0,0 +1,382 @@
+commit aed52c507f345d0b5c4cd2b1d2c58dae2d904b53
+Author: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
+Date:   Wed Feb 22 01:19:24 2023 +0300
+
+    alsa-util: Perform format and rate detection before setting HW params
+    
+    Perform detection of supported sample format and rates just after device is
+    opened, before `snd_pcm_hw_params()` is called for the first time. This fixes a
+    problem where device restricts available sample rates after HW params are set
+    preventing sample rate detection (seen with UAC2 devices and kernel 6.1.9)
+    
+    Bug: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1414
+    Bug: https://github.com/alsa-project/alsa-lib/issues/119
+    Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/782>
+
+diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
+index 49c39687c..c272e392b 100644
+--- a/src/modules/alsa/alsa-mixer.c
++++ b/src/modules/alsa/alsa-mixer.c
+@@ -5074,7 +5074,7 @@ static snd_pcm_t* mapping_open_pcm(pa_alsa_mapping *m,
+     handle = pa_alsa_open_by_template(
+                               m->device_strings, dev_id, NULL, &try_ss,
+                               &try_map, mode, &try_period_size,
+-                              &try_buffer_size, 0, NULL, NULL, exact_channels);
++                              &try_buffer_size, 0, NULL, NULL, NULL, NULL, exact_channels);
+     if (handle && !exact_channels && m->channel_map.channels != try_map.channels) {
+         char buf[PA_CHANNEL_MAP_SNPRINT_MAX];
+         pa_log_debug("Channel map for mapping '%s' permanently changed to '%s'", m->name,
+diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
+index b249df680..ca22f195f 100644
+--- a/src/modules/alsa/alsa-sink.c
++++ b/src/modules/alsa/alsa-sink.c
+@@ -2527,7 +2527,9 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
+                       &ss, &map,
+                       SND_PCM_STREAM_PLAYBACK,
+                       &period_frames, &buffer_frames, tsched_frames,
+-                      &b, &d, mapping)))
++                      &b, &d,
++                      &u->supported_formats, &u->supported_rates,
++                      mapping)))
+             goto fail;
+ 
+     } else if ((dev_id = pa_modargs_get_value(ma, "device_id", NULL))) {
+@@ -2541,7 +2543,9 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
+                       &ss, &map,
+                       SND_PCM_STREAM_PLAYBACK,
+                       &period_frames, &buffer_frames, tsched_frames,
+-                      &b, &d, profile_set, &mapping)))
++                      &b, &d,
++                      &u->supported_formats, &u->supported_rates,
++                      profile_set, &mapping)))
+             goto fail;
+ 
+     } else {
+@@ -2552,7 +2556,9 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
+                       &ss, &map,
+                       SND_PCM_STREAM_PLAYBACK,
+                       &period_frames, &buffer_frames, tsched_frames,
+-                      &b, &d, false)))
++                      &b, &d,
++                      &u->supported_formats, &u->supported_rates,
++                      false)))
+             goto fail;
+     }
+ 
+@@ -2598,13 +2604,11 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
+ 
+     u->verified_sample_spec = ss;
+ 
+-    u->supported_formats = pa_alsa_get_supported_formats(u->pcm_handle, ss.format);
+     if (!u->supported_formats) {
+         pa_log_error("Failed to find any supported sample formats.");
+         goto fail;
+     }
+ 
+-    u->supported_rates = pa_alsa_get_supported_rates(u->pcm_handle, ss.rate);
+     if (!u->supported_rates) {
+         pa_log_error("Failed to find any supported sample rates.");
+         goto fail;
+diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
+index ef8b12c32..d88c47f1f 100644
+--- a/src/modules/alsa/alsa-source.c
++++ b/src/modules/alsa/alsa-source.c
+@@ -2218,7 +2218,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
+                       &ss, &map,
+                       SND_PCM_STREAM_CAPTURE,
+                       &period_frames, &buffer_frames, tsched_frames,
+-                      &b, &d, mapping)))
++                      &b, &d, &u->supported_formats, &u->supported_rates, mapping)))
+             goto fail;
+ 
+     } else if ((dev_id = pa_modargs_get_value(ma, "device_id", NULL))) {
+@@ -2232,7 +2232,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
+                       &ss, &map,
+                       SND_PCM_STREAM_CAPTURE,
+                       &period_frames, &buffer_frames, tsched_frames,
+-                      &b, &d, profile_set, &mapping)))
++                      &b, &d, &u->supported_formats, &u->supported_rates, profile_set, &mapping)))
+             goto fail;
+ 
+     } else {
+@@ -2243,7 +2243,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
+                       &ss, &map,
+                       SND_PCM_STREAM_CAPTURE,
+                       &period_frames, &buffer_frames, tsched_frames,
+-                      &b, &d, false)))
++                      &b, &d, &u->supported_formats, &u->supported_rates, false)))
+             goto fail;
+     }
+ 
+@@ -2279,13 +2279,11 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
+ 
+     u->verified_sample_spec = ss;
+ 
+-    u->supported_formats = pa_alsa_get_supported_formats(u->pcm_handle, ss.format);
+     if (!u->supported_formats) {
+         pa_log_error("Failed to find any supported sample formats.");
+         goto fail;
+     }
+ 
+-    u->supported_rates = pa_alsa_get_supported_rates(u->pcm_handle, ss.rate);
+     if (!u->supported_rates) {
+         pa_log_error("Failed to find any supported sample rates.");
+         goto fail;
+diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
+index e75756f53..744e7aae1 100644
+--- a/src/modules/alsa/alsa-ucm.c
++++ b/src/modules/alsa/alsa-ucm.c
+@@ -2026,7 +2026,7 @@ static snd_pcm_t* mapping_open_pcm(pa_alsa_ucm_config *ucm, pa_alsa_mapping *m,
+     try_buffer_size = ucm->core->default_n_fragments * try_period_size;
+ 
+     pcm = pa_alsa_open_by_device_string(m->device_strings[0], NULL, &try_ss,
+-            &try_map, mode, &try_period_size, &try_buffer_size, 0, NULL, NULL, exact_channels);
++            &try_map, mode, &try_period_size, &try_buffer_size, 0, NULL, NULL, NULL, NULL, exact_channels);
+ 
+     if (pcm) {
+         if (!exact_channels)
+diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
+index fd30f18bd..b631c870c 100644
+--- a/src/modules/alsa/alsa-util.c
++++ b/src/modules/alsa/alsa-util.c
+@@ -523,6 +523,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto(
+         snd_pcm_uframes_t tsched_size,
+         bool *use_mmap,
+         bool *use_tsched,
++        pa_sample_format_t **query_supported_formats,
++        unsigned int **query_supported_rates,
+         pa_alsa_profile_set *ps,
+         pa_alsa_mapping **mapping) {
+ 
+@@ -561,6 +563,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto(
+                 tsched_size,
+                 use_mmap,
+                 use_tsched,
++                query_supported_formats,
++                query_supported_rates,
+                 m);
+ 
+         if (pcm_handle) {
+@@ -588,6 +592,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto(
+                 tsched_size,
+                 use_mmap,
+                 use_tsched,
++                query_supported_formats,
++                query_supported_rates,
+                 m);
+ 
+         if (pcm_handle) {
+@@ -612,6 +618,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto(
+             tsched_size,
+             use_mmap,
+             use_tsched,
++            query_supported_formats,
++            query_supported_rates,
+             false);
+     pa_xfree(d);
+ 
+@@ -632,6 +640,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_mapping(
+         snd_pcm_uframes_t tsched_size,
+         bool *use_mmap,
+         bool *use_tsched,
++        pa_sample_format_t **query_supported_formats,
++        unsigned int **query_supported_rates,
+         pa_alsa_mapping *m) {
+ 
+     snd_pcm_t *pcm_handle;
+@@ -661,6 +671,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_mapping(
+             tsched_size,
+             use_mmap,
+             use_tsched,
++            query_supported_formats,
++            query_supported_rates,
+             pa_channel_map_valid(&m->channel_map) /* Query the channel count if we don't know what we want */);
+ 
+     if (!pcm_handle)
+@@ -684,6 +696,8 @@ snd_pcm_t *pa_alsa_open_by_device_string(
+         snd_pcm_uframes_t tsched_size,
+         bool *use_mmap,
+         bool *use_tsched,
++        pa_sample_format_t **query_supported_formats,
++        unsigned int **query_supported_rates,
+         bool require_exact_channel_number) {
+ 
+     int err;
+@@ -711,6 +725,12 @@ snd_pcm_t *pa_alsa_open_by_device_string(
+ 
+         pa_log_debug("Managed to open %s", d);
+ 
++        if (query_supported_formats)
++            *query_supported_formats = pa_alsa_get_supported_formats(pcm_handle, ss->format);
++
++        if (query_supported_rates)
++            *query_supported_rates = pa_alsa_get_supported_rates(pcm_handle, ss->rate);
++
+         if ((err = pa_alsa_set_hw_params(
+                      pcm_handle,
+                      ss,
+@@ -784,6 +804,8 @@ snd_pcm_t *pa_alsa_open_by_template(
+         snd_pcm_uframes_t tsched_size,
+         bool *use_mmap,
+         bool *use_tsched,
++        pa_sample_format_t **query_supported_formats,
++        unsigned int **query_supported_rates,
+         bool require_exact_channel_number) {
+ 
+     snd_pcm_t *pcm_handle;
+@@ -805,6 +827,8 @@ snd_pcm_t *pa_alsa_open_by_template(
+                 tsched_size,
+                 use_mmap,
+                 use_tsched,
++                query_supported_formats,
++                query_supported_rates,
+                 require_exact_channel_number);
+ 
+         pa_xfree(d);
+diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h
+index 2eed3eac3..c65801104 100644
+--- a/src/modules/alsa/alsa-util.h
++++ b/src/modules/alsa/alsa-util.h
+@@ -67,6 +67,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto(
+         snd_pcm_uframes_t tsched_size,
+         bool *use_mmap,                   /* modified at return */
+         bool *use_tsched,                 /* modified at return */
++        pa_sample_format_t **query_supported_formats, /* modified at return */
++        unsigned int **query_supported_rates,         /* modified at return */
+         pa_alsa_profile_set *ps,
+         pa_alsa_mapping **mapping);       /* modified at return */
+ 
+@@ -82,6 +84,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_mapping(
+         snd_pcm_uframes_t tsched_size,
+         bool *use_mmap,                   /* modified at return */
+         bool *use_tsched,                 /* modified at return */
++        pa_sample_format_t **query_supported_formats, /* modified at return */
++        unsigned int **query_supported_rates,         /* modified at return */
+         pa_alsa_mapping *mapping);
+ 
+ /* Opens the explicit ALSA device */
+@@ -96,6 +100,8 @@ snd_pcm_t *pa_alsa_open_by_device_string(
+         snd_pcm_uframes_t tsched_size,
+         bool *use_mmap,                   /* modified at return */
+         bool *use_tsched,                 /* modified at return */
++        pa_sample_format_t **query_supported_formats, /* modified at return */
++        unsigned int **query_supported_rates,         /* modified at return */
+         bool require_exact_channel_number);
+ 
+ /* Opens the explicit ALSA device with a fallback list */
+@@ -111,6 +117,8 @@ snd_pcm_t *pa_alsa_open_by_template(
+         snd_pcm_uframes_t tsched_size,
+         bool *use_mmap,                   /* modified at return */
+         bool *use_tsched,                 /* modified at return */
++        pa_sample_format_t **query_supported_formats, /* modified at return */
++        unsigned int **query_supported_rates,        /* modified at return */
+         bool require_exact_channel_number);
+ 
+ void pa_alsa_dump(pa_log_level_t level, snd_pcm_t *pcm);
+commit 5ab2b9cb0e32190c3ea12b0f4cb7533d7340bbf1
+Author: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
+Date:   Wed Feb 22 01:50:22 2023 +0300
+
+    alsa-util: Fix pa_alsa_get_supported_formats fallback.
+    
+    Looks like original intention was to scan over sample formats supported by PA,
+    but code does the scan by list of alsa formats. Reverse the map and adjust
+    fallback case which now can use the same map.
+    
+    Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/782>
+
+diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
+index b631c870c..d3c092f52 100644
+--- a/src/modules/alsa/alsa-util.c
++++ b/src/modules/alsa/alsa-util.c
+@@ -1502,35 +1502,35 @@ unsigned int *pa_alsa_get_supported_rates(snd_pcm_t *pcm, unsigned int fallback_
+ }
+ 
+ pa_sample_format_t *pa_alsa_get_supported_formats(snd_pcm_t *pcm, pa_sample_format_t fallback_format) {
+-    static const snd_pcm_format_t format_trans_to_pa[] = {
+-        [SND_PCM_FORMAT_U8] = PA_SAMPLE_U8,
+-        [SND_PCM_FORMAT_A_LAW] = PA_SAMPLE_ALAW,
+-        [SND_PCM_FORMAT_MU_LAW] = PA_SAMPLE_ULAW,
+-        [SND_PCM_FORMAT_S16_LE] = PA_SAMPLE_S16LE,
+-        [SND_PCM_FORMAT_S16_BE] = PA_SAMPLE_S16BE,
+-        [SND_PCM_FORMAT_FLOAT_LE] = PA_SAMPLE_FLOAT32LE,
+-        [SND_PCM_FORMAT_FLOAT_BE] = PA_SAMPLE_FLOAT32BE,
+-        [SND_PCM_FORMAT_S32_LE] = PA_SAMPLE_S32LE,
+-        [SND_PCM_FORMAT_S32_BE] = PA_SAMPLE_S32BE,
+-        [SND_PCM_FORMAT_S24_3LE] = PA_SAMPLE_S24LE,
+-        [SND_PCM_FORMAT_S24_3BE] = PA_SAMPLE_S24BE,
+-        [SND_PCM_FORMAT_S24_LE] = PA_SAMPLE_S24_32LE,
+-        [SND_PCM_FORMAT_S24_BE] = PA_SAMPLE_S24_32BE,
++    static const snd_pcm_format_t format_trans_to_pcm[] = {
++        [PA_SAMPLE_U8] = SND_PCM_FORMAT_U8,
++        [PA_SAMPLE_ALAW] = SND_PCM_FORMAT_A_LAW,
++        [PA_SAMPLE_ULAW] = SND_PCM_FORMAT_MU_LAW,
++        [PA_SAMPLE_S16LE] = SND_PCM_FORMAT_S16_LE,
++        [PA_SAMPLE_S16BE] = SND_PCM_FORMAT_S16_BE,
++        [PA_SAMPLE_FLOAT32LE] = SND_PCM_FORMAT_FLOAT_LE,
++        [PA_SAMPLE_FLOAT32BE] = SND_PCM_FORMAT_FLOAT_BE,
++        [PA_SAMPLE_S32LE] = SND_PCM_FORMAT_S32_LE,
++        [PA_SAMPLE_S32BE] = SND_PCM_FORMAT_S32_BE,
++        [PA_SAMPLE_S24LE] = SND_PCM_FORMAT_S24_3LE,
++        [PA_SAMPLE_S24BE] = SND_PCM_FORMAT_S24_3BE,
++        [PA_SAMPLE_S24_32LE] = SND_PCM_FORMAT_S24_LE,
++        [PA_SAMPLE_S24_32BE] = SND_PCM_FORMAT_S24_BE,
+     };
+-    static const snd_pcm_format_t all_formats[] = {
+-        SND_PCM_FORMAT_U8,
+-        SND_PCM_FORMAT_A_LAW,
+-        SND_PCM_FORMAT_MU_LAW,
+-        SND_PCM_FORMAT_S16_LE,
+-        SND_PCM_FORMAT_S16_BE,
+-        SND_PCM_FORMAT_FLOAT_LE,
+-        SND_PCM_FORMAT_FLOAT_BE,
+-        SND_PCM_FORMAT_S32_LE,
+-        SND_PCM_FORMAT_S32_BE,
+-        SND_PCM_FORMAT_S24_3LE,
+-        SND_PCM_FORMAT_S24_3BE,
+-        SND_PCM_FORMAT_S24_LE,
+-        SND_PCM_FORMAT_S24_BE,
++    static const pa_sample_format_t all_formats[] = {
++        PA_SAMPLE_U8,
++        PA_SAMPLE_ALAW,
++        PA_SAMPLE_ULAW,
++        PA_SAMPLE_S16LE,
++        PA_SAMPLE_S16BE,
++        PA_SAMPLE_FLOAT32LE,
++        PA_SAMPLE_FLOAT32BE,
++        PA_SAMPLE_S32LE,
++        PA_SAMPLE_S32BE,
++        PA_SAMPLE_S24LE,
++        PA_SAMPLE_S24BE,
++        PA_SAMPLE_S24_32LE,
++        PA_SAMPLE_S24_32BE,
+     };
+     bool supported[PA_ELEMENTSOF(all_formats)] = {
+         false,
+@@ -1548,7 +1548,7 @@ pa_sample_format_t *pa_alsa_get_supported_formats(snd_pcm_t *pcm, pa_sample_form
+     }
+ 
+     for (i = 0, n = 0; i < PA_ELEMENTSOF(all_formats); i++) {
+-        if (snd_pcm_hw_params_test_format(pcm, hwparams, all_formats[i]) == 0) {
++        if (snd_pcm_hw_params_test_format(pcm, hwparams, format_trans_to_pcm[all_formats[i]]) == 0) {
+             supported[i] = true;
+             n++;
+         }
+@@ -1559,7 +1559,7 @@ pa_sample_format_t *pa_alsa_get_supported_formats(snd_pcm_t *pcm, pa_sample_form
+ 
+         for (i = 0, j = 0; i < PA_ELEMENTSOF(all_formats); i++) {
+             if (supported[i])
+-                formats[j++] = format_trans_to_pa[all_formats[i]];
++                formats[j++] = all_formats[i];
+         }
+ 
+         formats[j] = PA_SAMPLE_MAX;
+@@ -1567,7 +1567,7 @@ pa_sample_format_t *pa_alsa_get_supported_formats(snd_pcm_t *pcm, pa_sample_form
+         formats = pa_xnew(pa_sample_format_t, 2);
+ 
+         formats[0] = fallback_format;
+-        if ((ret = snd_pcm_hw_params_set_format(pcm, hwparams, format_trans_to_pa[formats[0]])) < 0) {
++        if ((ret = snd_pcm_hw_params_set_format(pcm, hwparams, format_trans_to_pcm[formats[0]])) < 0) {
+             pa_log_debug("snd_pcm_hw_params_set_format() failed: %s", pa_alsa_strerror(ret));
+             pa_xfree(formats);
+             return NULL;

diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1-r8.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1-r8.ebuild
index 0245469211bc..e12ba4cea6fc 100644
--- a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1-r8.ebuild
+++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.1-r8.ebuild
@@ -168,6 +168,7 @@ PATCHES=(
 	"${FILESDIR}"/pulseaudio-16.1-fix-memblock-alignment.patch
 	"${FILESDIR}"/pulseaudio-16.1-add-more-standard-samplerates.patch
 	"${FILESDIR}"/pulseaudio-16.1-fix-resampler-oversized-memblock.patch
+	"${FILESDIR}"/pulseaudio-16.1-fix-uac2-broken-avoid-resampling.patch
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-10-06 12:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-31  3:40 [gentoo-commits] repo/gentoo:master commit in: media-sound/pulseaudio-daemon/, media-sound/pulseaudio-daemon/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2023-10-06 12:09 Sam James
2022-12-03  7:50 Sam James
2022-11-29  7:13 Mart Raudsepp
2022-06-15 21:56 Sam James
2022-06-15 21:56 Sam James
2021-09-24 20:33 Mart Raudsepp
2021-09-24 18:16 Mart Raudsepp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox