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

- Add several patches from upstream
- Avoid an infinite loop when enumerating params of the converter:
  * 0001-audioconvert-avoid-infinite-loop.patch
- When the device or adapter is NULL, skip the quirk checks instead
  of crashing:
  * 0001-bluez5-handle-missing-device-and-adapter-in-quirks.patch
- Remember the last returned value from jack_get_buffer_size and
  only emit a buffersize change event when something new is
  configured. This fixes startup of jconvolver.
  * 0001-jack-remember-last-return-from-jack_get_buffer_size.patch
- Better emulation of pulseaudio which shows monitor sources with
  device.class=monitor so now pipewire does that too:
  * 0001-pulse-server-show-monitor-sources-with-device_class_monitor.patch
- Fix an errno check:
  * 0001-raop-fix-errno-check.patch

- Added more baselibs packages and their dependencies

OBS-URL: https://build.opensuse.org/request/show/946469
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pipewire?expand=0&rev=40
This commit is contained in:
Antonio Larrosa 2022-01-14 16:59:50 +00:00 committed by Git OBS Bridge
parent f4f8f4791e
commit 0b8f9e9847
8 changed files with 265 additions and 1 deletions

View File

@ -0,0 +1,48 @@
From af11fb4804c97ad0dee73dba059b7a3d42d15bad Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Wed, 5 Jan 2022 17:02:40 +0100
Subject: [PATCH] audioconvert: avoid infinite loop
When the follower has no param to enumerate we would keep on enumerating
the params of the converter forever. Fix this by setting the next value
to something that would then stop the iteration.
Also increase the amount of bits for the follower because it might need
them.
---
spa/plugins/audioconvert/audioadapter.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/spa/plugins/audioconvert/audioadapter.c b/spa/plugins/audioconvert/audioadapter.c
index b7f80feca..34622a66c 100644
--- a/spa/plugins/audioconvert/audioadapter.c
+++ b/spa/plugins/audioconvert/audioadapter.c
@@ -118,19 +118,20 @@ static int follower_enum_params(struct impl *this,
struct spa_pod_builder *builder)
{
int res;
- if (result->next < 0x10000) {
+ if (result->next < 0x100000) {
if ((res = spa_node_enum_params_sync(this->convert,
id, &result->next, filter, &result->param, builder)) == 1)
return res;
- result->next = 0x10000;
+ result->next = 0x100000;
}
- if (result->next >= 0x10000 && this->follower_params_flags[idx] & SPA_PARAM_INFO_READ) {
- result->next &= 0xffff;
+ if (result->next < 0x200000 && this->follower_params_flags[idx] & SPA_PARAM_INFO_READ) {
+ result->next &= 0xfffff;
if ((res = spa_node_enum_params_sync(this->follower,
id, &result->next, filter, &result->param, builder)) == 1) {
- result->next |= 0x10000;
+ result->next |= 0x100000;
return res;
}
+ result->next = 0x200000;
}
return 0;
}
--
GitLab

View File

@ -0,0 +1,38 @@
From 140c8d0cd95523815d42dbca10ef9457780f6636 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Tue, 11 Jan 2022 21:33:35 +0100
Subject: [PATCH] bluez5: handle missing device and adapter in quirks
When the device or adapter is NULL, skip the quirk checks instead of
crashing.
Fixes https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/155
---
spa/plugins/bluez5/quirks.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/spa/plugins/bluez5/quirks.c b/spa/plugins/bluez5/quirks.c
index 217bb61f6..16a8ebaa9 100644
--- a/spa/plugins/bluez5/quirks.c
+++ b/spa/plugins/bluez5/quirks.c
@@ -332,7 +332,7 @@ int spa_bt_quirks_get_features(const struct spa_bt_quirks *this,
}
/* Adapter */
- if (this->adapter_rules) {
+ if (this->adapter_rules && adapter) {
uint32_t no_features = 0;
int nitems = 0;
char vendor_id[64], product_id[64], address[64];
@@ -357,7 +357,7 @@ int spa_bt_quirks_get_features(const struct spa_bt_quirks *this,
}
/* Device */
- if (this->device_rules) {
+ if (this->device_rules && device) {
uint32_t no_features = 0;
int nitems = 0;
char vendor_id[64], product_id[64], version_id[64], address[64];
--
GitLab

View File

@ -0,0 +1,40 @@
From 2b102a1046630b072d80e36c872e2aa4e28052ca Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Fri, 7 Jan 2022 17:12:43 +0100
Subject: [PATCH] jack: remember last return from jack_get_buffer_size
Remember what we last returned from jack_get_buffer_size and only
emit a buffersize change event when somwthing new is configured.
Fixes startup of jconvolver.
Fixes #1989
---
pipewire-jack/src/pipewire-jack.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c
index 595d786f6..f338d2469 100644
--- a/pipewire-jack/src/pipewire-jack.c
+++ b/pipewire-jack/src/pipewire-jack.c
@@ -1227,7 +1227,8 @@ do_buffer_frames(struct spa_loop *loop,
{
uint32_t buffer_frames = *((uint32_t*)data);
struct client *c = user_data;
- do_callback_expr(c, c->buffer_frames = buffer_frames, bufsize_callback, buffer_frames, c->bufsize_arg);
+ if (c->buffer_frames != buffer_frames)
+ do_callback_expr(c, c->buffer_frames = buffer_frames, bufsize_callback, buffer_frames, c->bufsize_arg);
recompute_latencies(c);
return 0;
}
@@ -3985,6 +3986,7 @@ jack_nframes_t jack_get_buffer_size (jack_client_t *client)
res = c->position->clock.duration;
}
}
+ c->buffer_frames = res;
pw_log_debug("buffer_frames: %u", res);
return res;
}
--
GitLab

View File

@ -0,0 +1,57 @@
From 9eddd0474f55c4dda713511a14a1e15a4b4c685e Mon Sep 17 00:00:00 2001
From: Pauli Virtanen <pav@iki.fi>
Date: Thu, 6 Jan 2022 21:27:40 +0200
Subject: [PATCH] pulse-server: show monitor sources with device.class=monitor
Pulseaudio shows monitors with device.class=monitor, so we follow.
---
.../module-protocol-pulse/pulse-server.c | 25 ++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c
index 9747e5ae9..d0ebaeefd 100644
--- a/src/modules/module-protocol-pulse/pulse-server.c
+++ b/src/modules/module-protocol-pulse/pulse-server.c
@@ -3670,6 +3670,27 @@ static int fill_sink_info(struct client *client, struct message *m,
return 0;
}
+static int fill_source_info_proplist(struct message *m, struct pw_manager_object *o,
+ struct pw_node_info *info)
+{
+ struct pw_properties *props = NULL;
+ struct spa_dict *props_dict = info->props;
+
+ if (pw_manager_object_is_monitor(o)) {
+ props = pw_properties_new_dict(info->props);
+ if (props == NULL)
+ return -ENOMEM;
+
+ pw_properties_set(props, PW_KEY_DEVICE_CLASS, "monitor");
+ props_dict = &props->dict;
+ }
+
+ message_put(m, TAG_PROPLIST, props_dict, TAG_INVALID);
+ pw_properties_free(props);
+
+ return 0;
+}
+
static int fill_source_info(struct client *client, struct message *m,
struct pw_manager_object *o)
{
@@ -3762,8 +3783,10 @@ static int fill_source_info(struct client *client, struct message *m,
TAG_INVALID);
if (client->version >= 13) {
+ int res;
+ if ((res = fill_source_info_proplist(m, o, info)) < 0)
+ return res;
message_put(m,
- TAG_PROPLIST, info->props,
TAG_USEC, 0LL, /* requested latency */
TAG_INVALID);
}
--
GitLab

View File

@ -0,0 +1,44 @@
From 8e3eaf79528006ed7940a525aab343b3812e8b19 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Wed, 12 Jan 2022 10:08:40 +0100
Subject: [PATCH] raop: fix errno check
---
src/modules/module-raop/rtsp-client.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/modules/module-raop/rtsp-client.c b/src/modules/module-raop/rtsp-client.c
index c1740ea5f..9bb888773 100644
--- a/src/modules/module-raop/rtsp-client.c
+++ b/src/modules/module-raop/rtsp-client.c
@@ -203,9 +203,12 @@ static int read_line(struct pw_rtsp_client *client, char **buf)
if (res == 0)
return -EPIPE;
if (res < 0) {
- if (res == EAGAIN)
- return 0;
- return -errno;
+ res = -errno;
+ if (res == -EINTR)
+ continue;
+ if (res != -EAGAIN && res != -EWOULDBLOCK)
+ return res;
+ return 0;
}
if (c == '\n') {
client->line_buf[client->line_pos] = '\0';
@@ -435,9 +438,10 @@ int pw_rtsp_client_connect(struct pw_rtsp_client *client,
true, on_source_io, client);
if (client->source == NULL) {
+ res = -errno;
pw_log_error("%p: source create failed: %m", client);
close(fd);
- return -errno;
+ return res;
}
client->connecting = true;
free(client->session_id);
--
GitLab

View File

@ -1,5 +1,14 @@
libpipewire-0_3-0
requires "pipewire-spa-plugins-0_2-<targettype> = <version>"
requires "pipewire-modules-0_3-<targettype> = <version>"
pipewire-alsa
requires "libpipewire-0_3-0-<targettype> = <version>"
pipewire-libjack-0_3
requires "libpipewire-0_3-0-<targettype> = <version>"
pipewire-modules-0_3
requires "libpipewire-0_3-0-<targettype> = <version>"
provides "pipewire-modules-<targettype> = <version>"
obsoletes "pipewire-modules-<targettype> < <version>"
pipewire-spa-plugins-0_2
requires "libpipewire-0_3-0-<targettype> = <version>"

View File

@ -1,3 +1,27 @@
-------------------------------------------------------------------
Fri Jan 14 16:34:05 UTC 2022 - Antonio Larrosa <alarrosa@suse.com>
- Add several patches from upstream
- Avoid an infinite loop when enumerating params of the converter:
* 0001-audioconvert-avoid-infinite-loop.patch
- When the device or adapter is NULL, skip the quirk checks instead
of crashing:
* 0001-bluez5-handle-missing-device-and-adapter-in-quirks.patch
- Remember the last returned value from jack_get_buffer_size and
only emit a buffersize change event when something new is
configured. This fixes startup of jconvolver.
* 0001-jack-remember-last-return-from-jack_get_buffer_size.patch
- Better emulation of pulseaudio which shows monitor sources with
device.class=monitor so now pipewire does that too:
* 0001-pulse-server-show-monitor-sources-with-device_class_monitor.patch
- Fix an errno check:
* 0001-raop-fix-errno-check.patch
-------------------------------------------------------------------
Wed Jan 12 12:48:21 UTC 2022 - Antonio Larrosa <alarrosa@suse.com>
- Added more baselibs packages and their dependencies
-------------------------------------------------------------------
Wed Jan 5 16:23:30 UTC 2022 - Bjørn Lie <bjorn.lie@gmail.com>

View File

@ -61,7 +61,11 @@ Group: Development/Libraries/C and C++
URL: https://pipewire.org/
Source0: %{name}-%{version}.tar.xz
Source99: baselibs.conf
Patch0: 0001-audioconvert-avoid-infinite-loop.patch
Patch1: 0001-bluez5-handle-missing-device-and-adapter-in-quirks.patch
Patch2: 0001-jack-remember-last-return-from-jack_get_buffer_size.patch
Patch3: 0001-pulse-server-show-monitor-sources-with-device_class_monitor.patch
Patch4: 0001-raop-fix-errno-check.patch
BuildRequires: docutils
BuildRequires: doxygen
BuildRequires: fdupes