SHA256
1
0
forked from pool/wireplumber

Accepting request 964074 from home:alarrosa:branches:multimedia:libs

- Update to version 0.4.9:
  * Fixes:
    - restore-stream no longer crashes if properties for it are not
      present in the config (#190)
    - spa-json no longer crashes on non-x86 architectures
    - Fixed a potential crash in the bluetooth auto-switch module
      (#193)
    - Fixed a race condition that would cause Zoom desktop audio
      sharing to fail (#197)
    - Surround sound in some games is now exposed properly
      (pipewire#876)
    - Fixed a race condition that would cause the default source &
      sink to not be set at startup
    - policy-node now supports the 'target.object' key on streams
      and metadata
    - Multiple fixes in policy-node that make the logic in some
      cases behave more like PulseAudio (regarding nodes with the
      dont-reconnect property and regarding following the default
      source/sink)
    - Fixed a bug with parsing unquoted strings in spa-json
  * Misc:
    - The policy now supports configuring "persistent" device
      profiles. If a device is manually set to one of these
      profiles, then it will not be auto-switched to another
      profile automatically under any circumstances (#138, #204)
    - The device-activation module was re-written in lua
    - Brave, Edge, Vivaldi and Telegram were added in the bluetooth
      auto-switch applications list
    - ALSA nodes now use the PCM name to populate node.nick, which
      is useful at least on HDA cards using UCM, where all outputs

OBS-URL: https://build.opensuse.org/request/show/964074
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=35
This commit is contained in:
Antonio Larrosa 2022-03-22 18:53:03 +00:00 committed by Git OBS Bridge
parent 79a19a2d78
commit 9fa960a074
12 changed files with 53 additions and 323 deletions

View File

@ -1,25 +0,0 @@
From 5f96f69218273573e625475846269b3914cfcecf Mon Sep 17 00:00:00 2001
From: George Kiagiadakis <george.kiagiadakis@collabora.com>
Date: Wed, 9 Feb 2022 13:35:13 +0200
Subject: [PATCH] restore-stream: do not crash if config.properties is nil
Fixes #190
---
src/scripts/restore-stream.lua | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/scripts/restore-stream.lua b/src/scripts/restore-stream.lua
index 404eede5..0c17bdd7 100644
--- a/src/scripts/restore-stream.lua
+++ b/src/scripts/restore-stream.lua
@@ -10,6 +10,7 @@
-- Receive script arguments from config.lua
local config = ... or {}
+config.properties = config.properties or {}
config_restore_props = config.properties["restore-props"] or false
config_restore_target = config.properties["restore-target"] or false
--
GitLab

View File

@ -1,212 +0,0 @@
From e429db7e8c266045aee25e153fb2308bd61fe233 Mon Sep 17 00:00:00 2001
From: Julian Bouzas <julian.bouzas@collabora.com>
Date: Wed, 9 Feb 2022 07:59:59 -0500
Subject: [PATCH] spa-json: fix va_list APIs for different architectures
The va_list type might not always be a pointer in some architectures, so we
cannot guarantee it will be modified after using it for a second time in another
function. This fixes the issue by using macros so args does not get copied, and
always gets modified when using it more than once.
---
lib/wp/spa-json.c | 156 ++++++++++++++++++++++++----------------------
1 file changed, 80 insertions(+), 76 deletions(-)
diff --git a/lib/wp/spa-json.c b/lib/wp/spa-json.c
index f14f395d..c5e59a3e 100644
--- a/lib/wp/spa-json.c
+++ b/lib/wp/spa-json.c
@@ -363,33 +363,33 @@ wp_spa_json_new_string (const gchar *value)
wp_spa_json_builder_new_formatted ("\"%s\"", value));
}
-static void
-wp_spa_json_builder_add_value (WpSpaJsonBuilder *self, const gchar *fmt,
- va_list args)
-{
- switch (*fmt) {
- case 'n':
- wp_spa_json_builder_add_null (self);
- break;
- case 'b':
- wp_spa_json_builder_add_boolean (self, va_arg(args, gboolean));
- break;
- case 'i':
- wp_spa_json_builder_add_int (self, va_arg(args, gint));
- break;
- case 'f':
- wp_spa_json_builder_add_float (self, (float)va_arg(args, double));
- break;
- case 's':
- wp_spa_json_builder_add_string (self, va_arg(args, const gchar *));
- break;
- case 'J':
- wp_spa_json_builder_add_json (self, va_arg(args, WpSpaJson *));
- break;
- default:
- return;
- }
-}
+/* Args is not a pointer in some architectures, so this needs to be a macro to
+ * avoid args being copied */
+#define wp_spa_json_builder_add_value(self,fmt,args) \
+do { \
+ switch (*fmt) { \
+ case 'n': \
+ wp_spa_json_builder_add_null (self); \
+ break; \
+ case 'b': \
+ wp_spa_json_builder_add_boolean (self, va_arg(args, gboolean)); \
+ break; \
+ case 'i': \
+ wp_spa_json_builder_add_int (self, va_arg(args, gint)); \
+ break; \
+ case 'f': \
+ wp_spa_json_builder_add_float (self, (float)va_arg(args, double)); \
+ break; \
+ case 's': \
+ wp_spa_json_builder_add_string (self, va_arg(args, const gchar *)); \
+ break; \
+ case 'J': \
+ wp_spa_json_builder_add_json (self, va_arg(args, WpSpaJson *)); \
+ break; \
+ default: \
+ break; \
+ } \
+} while(false)
/*!
* \brief Creates a spa json of type array
@@ -724,48 +724,46 @@ wp_spa_json_parse_object_valist (WpSpaJson *self, va_list args)
return res;
}
-static gboolean
-wp_spa_json_parse_value (const gchar *data, int len, const gchar *fmt,
- va_list args)
-{
- switch (*fmt) {
- case 'n':
- if (!spa_json_is_null (data, len))
- return FALSE;
- break;
- case 'b':
- if (!wp_spa_json_parse_boolean_internal (data, len,
- va_arg(args, gboolean *)))
- return FALSE;
- break;
- case 'i':
- if (spa_json_parse_int (data, len, va_arg(args, gint *)) < 0)
- return FALSE;
- break;
- case 'f':
- if (spa_json_parse_float (data, len,
- (float *)va_arg(args, double *)) < 0)
- return FALSE;
- break;
- case 's': {
- gchar *str = wp_spa_json_parse_string_internal (data, len);
- if (!str)
- return FALSE;
- *va_arg(args, gchar **) = str;
- break;
- }
- case 'J': {
- WpSpaJson *j = wp_spa_json_new (data, len);
- if (!j)
- return FALSE;
- *va_arg(args, WpSpaJson **) = j;
- break;
- }
- default:
- return FALSE;
- }
- return TRUE;
-}
+/* Args is not a pointer in some architectures, so this needs to be a macro to
+ * avoid args being copied */
+#define wp_spa_json_parse_value(data,len,fmt,args) \
+do { \
+ switch (*fmt) { \
+ case 'n': \
+ if (!spa_json_is_null (data, len)) \
+ return FALSE; \
+ break; \
+ case 'b': \
+ if (!wp_spa_json_parse_boolean_internal (data, len, \
+ va_arg(args, gboolean *))) \
+ return FALSE; \
+ break; \
+ case 'i': \
+ if (spa_json_parse_int (data, len, va_arg(args, gint *)) < 0) \
+ return FALSE; \
+ break; \
+ case 'f': \
+ if (spa_json_parse_float (data, len, va_arg(args, float *)) < 0) \
+ return FALSE; \
+ break; \
+ case 's': { \
+ gchar *str = wp_spa_json_parse_string_internal (data, len); \
+ if (!str) \
+ return FALSE; \
+ *va_arg(args, gchar **) = str; \
+ break; \
+ } \
+ case 'J': { \
+ WpSpaJson *j = wp_spa_json_new (data, len); \
+ if (!j) \
+ return FALSE; \
+ *va_arg(args, WpSpaJson **) = j; \
+ break; \
+ } \
+ default: \
+ return FALSE; \
+ } \
+} while(false)
/*!
* \brief Parses the object property values of a spa json object
@@ -827,8 +825,7 @@ wp_spa_json_object_get_valist (WpSpaJson *self, va_list args)
value = g_value_get_boxed (&item);
if (g_strcmp0 (key_str, lookup_key) == 0) {
- if (!wp_spa_json_parse_value (value->data, value->size, lookup_fmt, args))
- return FALSE;
+ wp_spa_json_parse_value (value->data, value->size, lookup_fmt, args);
lookup_key = va_arg(args, const gchar *);
if (!lookup_key)
return TRUE;
@@ -1366,9 +1363,12 @@ gboolean
wp_spa_json_parser_get_value (WpSpaJsonParser *self, const gchar *fmt,
va_list args)
{
- return wp_spa_json_parser_advance (self) &&
- wp_spa_json_parse_value (self->curr.cur,
- self->curr.end - self->curr.cur, fmt, args);
+ if (wp_spa_json_parser_advance (self)) {
+ wp_spa_json_parse_value (self->curr.cur, self->curr.end - self->curr.cur,
+ fmt, args);
+ return TRUE;
+ }
+ return FALSE;
}
/*!
@@ -1419,9 +1419,13 @@ wp_spa_json_parser_get_valist (WpSpaJsonParser *self, va_list args)
if (!format)
return TRUE;
- /* parse value */
- if (!wp_spa_json_parser_get_value (self, format, args))
+ /* advance */
+ if (!wp_spa_json_parser_advance (self))
return FALSE;
+
+ /* parse value */
+ wp_spa_json_parse_value (self->curr.cur, self->curr.end - self->curr.cur,
+ format, args);
} while (TRUE);
return FALSE;
--
GitLab

View File

@ -1,26 +0,0 @@
From c4c5ca8e2215e5fc295b39af4504c43ed3fe176f Mon Sep 17 00:00:00 2001
From: George Kiagiadakis <george.kiagiadakis@collabora.com>
Date: Mon, 14 Feb 2022 10:38:51 +0200
Subject: [PATCH] policy-bluetooth: fix string.find crash with nil string
Fixes #193
---
src/scripts/policy-bluetooth.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/scripts/policy-bluetooth.lua b/src/scripts/policy-bluetooth.lua
index 24fbffbb..f8f69a14 100644
--- a/src/scripts/policy-bluetooth.lua
+++ b/src/scripts/policy-bluetooth.lua
@@ -118,7 +118,7 @@ local function isSwitched(device)
end
local function isBluez5AudioSink(sink_name)
- if string.find(sink_name, "bluez_output.") ~= nil then
+ if sink_name and string.find(sink_name, "bluez_output.") ~= nil then
return true
end
return false
--
GitLab

View File

@ -1,43 +0,0 @@
From afbc0ce57aac7aee8dc1651de4620f15c73dbace Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Mon, 21 Feb 2022 15:21:36 +0100
Subject: [PATCH] si-audio-adapter: relax format parsing
Some nodes can omit the format/rate/channels to indicate that they can
deal with all possibilities and adapt to what they are linked to.
See pipewire#876
---
modules/module-si-audio-adapter.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/modules/module-si-audio-adapter.c b/modules/module-si-audio-adapter.c
index f1f6218..84e393f 100644
--- a/modules/module-si-audio-adapter.c
+++ b/modules/module-si-audio-adapter.c
@@ -158,19 +158,12 @@ si_audio_adapter_find_format (WpSiAudioAdapter * self, WpNode * node)
struct spa_pod *position = NULL;
wp_spa_pod_fixate (pod);
- /* defaults */
spa_zero(raw_format);
- raw_format.format = SPA_AUDIO_FORMAT_F32;
- raw_format.rate = si_audio_adapter_get_default_clock_rate (self);
- raw_format.channels = 2;
- raw_format.position[0] = SPA_AUDIO_CHANNEL_FL;
- raw_format.position[1] = SPA_AUDIO_CHANNEL_FR;
-
if (spa_pod_parse_object(wp_spa_pod_get_spa_pod (pod),
SPA_TYPE_OBJECT_Format, NULL,
- SPA_FORMAT_AUDIO_format, SPA_POD_Id(&raw_format.format),
+ SPA_FORMAT_AUDIO_format, SPA_POD_OPT_Id(&raw_format.format),
SPA_FORMAT_AUDIO_rate, SPA_POD_OPT_Int(&raw_format.rate),
- SPA_FORMAT_AUDIO_channels, SPA_POD_Int(&raw_format.channels),
+ SPA_FORMAT_AUDIO_channels, SPA_POD_OPT_Int(&raw_format.channels),
SPA_FORMAT_AUDIO_position, SPA_POD_OPT_Pod(&position)) < 0)
continue;
--
GitLab

View File

@ -4,7 +4,7 @@
<param name="scm">git</param> <param name="scm">git</param>
<param name="url">https://gitlab.freedesktop.org/pipewire/wireplumber.git</param> <param name="url">https://gitlab.freedesktop.org/pipewire/wireplumber.git</param>
<param name="changesgenerate">enable</param> <param name="changesgenerate">enable</param>
<param name="revision">0.4.8</param> <param name="revision">0.4.9</param>
<param name="versionformat">@PARENT_TAG@</param> <param name="versionformat">@PARENT_TAG@</param>
<!-- <!--
<param name="versionprefix">0.4.6+git</param> <param name="versionprefix">0.4.6+git</param>

View File

@ -1,4 +1,4 @@
<servicedata> <servicedata>
<service name="tar_scm"> <service name="tar_scm">
<param name="url">https://gitlab.freedesktop.org/pipewire/wireplumber.git</param> <param name="url">https://gitlab.freedesktop.org/pipewire/wireplumber.git</param>
<param name="changesrevision">e14bb72dcc85e2130d0ea96768e5ae3b375a041e</param></service></servicedata> <param name="changesrevision">8b97b40c4467951fbd4181afb47e4175361365a6</param></service></servicedata>

View File

@ -12,7 +12,7 @@ def md5FromData(data):
contents = open('90-enable-all.lua', 'r', encoding='utf-8').read() contents = open('90-enable-all.lua', 'r', encoding='utf-8').read()
md5sum = md5FromData(contents.encode('utf-8')) md5sum = md5FromData(contents.encode('utf-8'))
expected_md5sum = '2c036caab5a4b2698a6ee32c36eac94d' expected_md5sum = '74b508b1be26ae58d3e851d3abebc009'
if md5sum != expected_md5sum: if md5sum != expected_md5sum:
print('The script has to be updated for new changes in 90-enable-all.lua') print('The script has to be updated for new changes in 90-enable-all.lua')
@ -28,8 +28,7 @@ sections = ['enable-metadata',
'track-user-choices-devices', 'track-user-choices-devices',
'track-user-choices-streams', 'track-user-choices-streams',
'link-nodes-by-roles', 'link-nodes-by-roles',
'suspend-idle-nodes', 'suspend-idle-nodes']
'device-activation']
if len(content_sections) != len(sections): if len(content_sections) != len(sections):
print('The script has to be updated for new changes in 90-enable-all.lua') print('The script has to be updated for new changes in 90-enable-all.lua')

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4eefadee7b4c54efb5e92429d7bd0bd0647b652aab0b19c3bdf52b8b5c9b50c7
size 1919500

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f4fd0ade7f9252b8eeb9ce657de03f8d95881439cc6aa2dc8aede8d8bf07468f
size 1928716

View File

@ -1,3 +1,45 @@
-------------------------------------------------------------------
Tue Mar 22 18:36:13 UTC 2022 - alarrosa@suse.com
- Update to version 0.4.9:
* Fixes:
- restore-stream no longer crashes if properties for it are not
present in the config (#190)
- spa-json no longer crashes on non-x86 architectures
- Fixed a potential crash in the bluetooth auto-switch module
(#193)
- Fixed a race condition that would cause Zoom desktop audio
sharing to fail (#197)
- Surround sound in some games is now exposed properly
(pipewire#876)
- Fixed a race condition that would cause the default source &
sink to not be set at startup
- policy-node now supports the 'target.object' key on streams
and metadata
- Multiple fixes in policy-node that make the logic in some
cases behave more like PulseAudio (regarding nodes with the
dont-reconnect property and regarding following the default
source/sink)
- Fixed a bug with parsing unquoted strings in spa-json
* Misc:
- The policy now supports configuring "persistent" device
profiles. If a device is manually set to one of these
profiles, then it will not be auto-switched to another
profile automatically under any circumstances (#138, #204)
- The device-activation module was re-written in lua
- Brave, Edge, Vivaldi and Telegram were added in the bluetooth
auto-switch applications list
- ALSA nodes now use the PCM name to populate node.nick, which
is useful at least on HDA cards using UCM, where all outputs
(analog, hdmi, etc) are exposesd as nodes on a single profile
- An icon name is now set on the properties of bluetooth devices
- Drop patches already upstream:
* 0001-spa-json-fix-va_list-APIs-for-different-architectures.patch
* 0001-restore-stream-do-not-crash-if-config_properties-is-nil.patch
* 0002-policy-bluetooth-fix-string.find-crash-with-nil-string.patch
* 0003-si-audio-adapter-relax-format-parsing.patch
- Update split-config-file.py script
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Mar 10 12:14:13 UTC 2022 - Alexei Sorokin <sor.alexei@meowr.ru> Thu Mar 10 12:14:13 UTC 2022 - Alexei Sorokin <sor.alexei@meowr.ru>

View File

@ -1,4 +1,4 @@
name: wireplumber name: wireplumber
version: 0.4.8 version: 0.4.9
mtime: 1644252730 mtime: 1647949138
commit: e14bb72dcc85e2130d0ea96768e5ae3b375a041e commit: 8b97b40c4467951fbd4181afb47e4175361365a6

View File

@ -22,7 +22,7 @@
%define sover 0 %define sover 0
%define libwireplumber libwireplumber-%{apiver_str}-%{sover} %define libwireplumber libwireplumber-%{apiver_str}-%{sover}
Name: wireplumber Name: wireplumber
Version: 0.4.8 Version: 0.4.9
Release: 0 Release: 0
Summary: Session / policy manager implementation for PipeWire Summary: Session / policy manager implementation for PipeWire
License: MIT License: MIT
@ -30,10 +30,6 @@ Group: Development/Libraries/C and C++
URL: https://gitlab.freedesktop.org/pipewire/wireplumber URL: https://gitlab.freedesktop.org/pipewire/wireplumber
Source0: wireplumber-%{version}.tar.xz Source0: wireplumber-%{version}.tar.xz
Source1: split-config-file.py Source1: split-config-file.py
Patch0: 0001-spa-json-fix-va_list-APIs-for-different-architectures.patch
Patch1: 0001-restore-stream-do-not-crash-if-config_properties-is-nil.patch
Patch2: 0002-policy-bluetooth-fix-string.find-crash-with-nil-string.patch
Patch3: 0003-si-audio-adapter-relax-format-parsing.patch
# PATCH-FIX-OPENSUSE reduce-meson-dependency.patch # PATCH-FIX-OPENSUSE reduce-meson-dependency.patch
Patch100: reduce-meson-required-version.patch Patch100: reduce-meson-required-version.patch
# docs # docs
@ -182,7 +178,6 @@ export XDG_RUNTIME_DIR=/tmp
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-default-nodes-api.so %{_libdir}/wireplumber-%{apiver}/libwireplumber-module-default-nodes-api.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-default-nodes.so %{_libdir}/wireplumber-%{apiver}/libwireplumber-module-default-nodes.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-default-profile.so %{_libdir}/wireplumber-%{apiver}/libwireplumber-module-default-profile.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-device-activation.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-file-monitor-api.so %{_libdir}/wireplumber-%{apiver}/libwireplumber-module-file-monitor-api.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-logind.so %{_libdir}/wireplumber-%{apiver}/libwireplumber-module-logind.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-lua-scripting.so %{_libdir}/wireplumber-%{apiver}/libwireplumber-module-lua-scripting.so