Update to 0.3.30

This commit is contained in:
Wim Taymans 2021-06-09 09:18:16 +02:00
parent a3ca38f0b5
commit 514cafcf4e
7 changed files with 7 additions and 220 deletions

1
.gitignore vendored
View File

@ -48,3 +48,4 @@
/pipewire-0.3.27.tar.gz
/pipewire-0.3.28.tar.gz
/pipewire-0.3.29.tar.gz
/pipewire-0.3.30.tar.gz

View File

@ -1,54 +0,0 @@
From 90c123e11c56e8a98d2f667f2e91d59cd62642fc Mon Sep 17 00:00:00 2001
From: George Kiagiadakis <george.kiagiadakis@collabora.com>
Date: Thu, 3 Jun 2021 17:36:19 +0300
Subject: [PATCH 2/5] pulse-server: suffix TAG_USEC constants with LL, as they
must be 64-bit
Fixes protocol errors on arm
---
src/modules/module-protocol-pulse/pulse-server.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c
index e29838919..993c23280 100644
--- a/src/modules/module-protocol-pulse/pulse-server.c
+++ b/src/modules/module-protocol-pulse/pulse-server.c
@@ -2301,7 +2301,7 @@ static int do_get_playback_latency(struct client *client, uint32_t command, uint
reply = reply_new(client, tag);
message_put(reply,
TAG_USEC, stream->delay, /* sink latency + queued samples */
- TAG_USEC, 0, /* always 0 */
+ TAG_USEC, 0LL, /* always 0 */
TAG_BOOLEAN, stream->playing_for > 0 &&
!stream->corked, /* playing state */
TAG_TIMEVAL, &tv,
@@ -2342,7 +2342,7 @@ static int do_get_record_latency(struct client *client, uint32_t command, uint32
gettimeofday(&now, NULL);
reply = reply_new(client, tag);
message_put(reply,
- TAG_USEC, 0, /* monitor latency */
+ TAG_USEC, 0LL, /* monitor latency */
TAG_USEC, stream->delay, /* source latency + queued */
TAG_BOOLEAN, !stream->corked, /* playing state */
TAG_TIMEVAL, &tv,
@@ -4668,7 +4668,7 @@ static int do_set_stream_buffer_attr(struct client *client, uint32_t command, ui
TAG_INVALID);
if (client->version >= 13) {
message_put(reply,
- TAG_USEC, 0, /* configured_sink_latency */
+ TAG_USEC, 0LL, /* configured_sink_latency */
TAG_INVALID);
}
} else {
@@ -4678,7 +4678,7 @@ static int do_set_stream_buffer_attr(struct client *client, uint32_t command, ui
TAG_INVALID);
if (client->version >= 13) {
message_put(reply,
- TAG_USEC, 0, /* configured_source_latency */
+ TAG_USEC, 0LL, /* configured_source_latency */
TAG_INVALID);
}
}
--
2.31.1

View File

@ -1,64 +0,0 @@
From d9ceb67a4ad5a1696c300cdcf6c119a87b2e16e7 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Thu, 3 Jun 2021 20:31:49 +0200
Subject: [PATCH 3/5] Revert "media-session: use direction to find the node by
name"
This reverts commit b0068fd46b32f6054cccc2522aed66fa5748bb87.
It breaks recording from monitor ports.
---
src/examples/media-session/media-session.c | 2 +-
src/examples/media-session/policy-node.c | 8 +++-----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/examples/media-session/media-session.c b/src/examples/media-session/media-session.c
index 03aa41dcd..a94511dee 100644
--- a/src/examples/media-session/media-session.c
+++ b/src/examples/media-session/media-session.c
@@ -1854,7 +1854,7 @@ static int link_nodes(struct impl *impl, struct endpoint_link *link,
inport = find_input_port(impl, outnode, outport, innode);
if (inport == NULL) {
- pw_log_debug(NAME" %p: port %d:%d can't be linked, no input port", impl,
+ pw_log_debug(NAME" %p: port %d:%d can't be linked", impl,
outport->direction, outport->obj.id);
continue;
}
diff --git a/src/examples/media-session/policy-node.c b/src/examples/media-session/policy-node.c
index c996bfd54..2e641453a 100644
--- a/src/examples/media-session/policy-node.c
+++ b/src/examples/media-session/policy-node.c
@@ -447,7 +447,7 @@ static const char *get_device_name(struct node *node)
return pw_properties_get(node->obj->obj.props, PW_KEY_NODE_NAME);
}
-static uint32_t find_device_for_name(struct impl *impl, const char *name, enum spa_direction direction)
+static uint32_t find_device_for_name(struct impl *impl, const char *name)
{
struct node *node;
const char *str;
@@ -458,8 +458,6 @@ static uint32_t find_device_for_name(struct impl *impl, const char *name, enum s
return id;
if ((str = get_device_name(node)) == NULL)
continue;
- if (node->direction == direction)
- continue;
if (spa_streq(str, name))
return node->obj->obj.id;
}
@@ -800,9 +798,9 @@ static int rescan_node(struct impl *impl, struct node *n)
/* we always honour the target node asked for by the client */
path_id = SPA_ID_INVALID;
if ((str = spa_dict_lookup(props, PW_KEY_NODE_TARGET)) != NULL)
- path_id = find_device_for_name(impl, str, n->direction);
+ path_id = find_device_for_name(impl, str);
if (path_id == SPA_ID_INVALID && n->obj->target_node != NULL)
- path_id = find_device_for_name(impl, n->obj->target_node, n->direction);
+ path_id = find_device_for_name(impl, n->obj->target_node);
pw_log_info("trying to link node %d exclusive:%d reconnect:%d target:%d follows-default:%d", n->id,
exclusive, reconnect, path_id, follows_default);
--
2.31.1

View File

@ -1,67 +0,0 @@
From 735db1d109949c925e4c4a47a1d798ceabb577d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= <pobrn@protonmail.com>
Date: Fri, 4 Jun 2021 02:26:17 +0200
Subject: [PATCH 4/5] pulse-server: module-combine-sink: remove hooks
Remove hooks when the module is unloaded to avoid
use-after-free issues. Remove the cleanup source as well.
Fixes #1259.
---
.../modules/module-combine-sink.c | 20 ++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/modules/module-protocol-pulse/modules/module-combine-sink.c b/src/modules/module-protocol-pulse/modules/module-combine-sink.c
index 282cd8106..7dcbcaa6d 100644
--- a/src/modules/module-protocol-pulse/modules/module-combine-sink.c
+++ b/src/modules/module-protocol-pulse/modules/module-combine-sink.c
@@ -284,8 +284,11 @@ static const struct pw_manager_events manager_events = {
.added = manager_added,
};
-static void cleanup_stream(struct combine_stream *s) {
+static void cleanup_stream(struct combine_stream *s)
+{
+ spa_hook_remove(&s->stream_listener);
pw_stream_destroy(s->stream);
+
s->stream = NULL;
s->data = NULL;
s->cleanup = false;
@@ -370,20 +373,31 @@ static int module_combine_sink_unload(struct client *client, struct module *modu
pw_log_info("unload module %p id:%u name:%s", module, module->idx, module->name);
+ if (d->cleanup != NULL)
+ pw_loop_destroy_source(module->impl->loop, d->cleanup);
+
/* Note that we explicitly disconnect the hooks to avoid having the
* cleanup triggered again in those callbacks */
if (d->sink != NULL) {
spa_hook_remove(&d->sink_listener);
pw_stream_destroy(d->sink);
}
+
for (i = 0; i < MAX_SINKS; i++) {
if (d->streams[i].stream)
cleanup_stream(&d->streams[i]);
}
- if (d->manager != NULL)
+
+ if (d->manager != NULL) {
+ spa_hook_remove(&d->manager_listener);
pw_manager_destroy(d->manager);
- if (d->core != NULL)
+ }
+
+ if (d->core != NULL) {
+ spa_hook_remove(&d->core_listener);
pw_core_disconnect(d->core);
+ }
+
pw_free_strv(d->sink_names);
free(d->sink_name);
--
2.31.1

View File

@ -1,28 +0,0 @@
From 4fcd04200378e2e5828967d4e2e5bfe988f5f41b Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Fri, 4 Jun 2021 09:07:24 +0200
Subject: [PATCH 5/5] pulse-server: avoid overflow
Make sure the requested bytes never go below 0.
See #1258
---
src/modules/module-protocol-pulse/pulse-server.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c
index 993c23280..ddb85b0a1 100644
--- a/src/modules/module-protocol-pulse/pulse-server.c
+++ b/src/modules/module-protocol-pulse/pulse-server.c
@@ -5518,7 +5518,7 @@ static int handle_memblock(struct client *client, struct message *msg)
SPA_MIN(msg->length, stream->attr.maxlength));
stream->write_index = index + msg->length;
spa_ringbuffer_write_update(&stream->ring, stream->write_index);
- stream->requested -= msg->length;
+ stream->requested -= SPA_MIN(msg->length, stream->requested);
finish:
message_free(impl, msg, false, false);
return res;
--
2.31.1

View File

@ -1,6 +1,6 @@
%global majorversion 0
%global minorversion 3
%global microversion 29
%global microversion 30
%global apiversion 0.3
%global spaversion 0.2
@ -8,7 +8,7 @@
%global libversion %{soversion}.%(bash -c '((intversion = (%{minorversion} * 100) + %{microversion})); echo ${intversion}').0
# For rpmdev-bumpspec and releng automation
%global baserelease 2
%global baserelease 1
#global snapdate 20210107
#global gitcommit b17db2cebc1a5ab2c01851d29c05f79cd2f262bb
@ -53,10 +53,6 @@ Source0: https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/%{ver
%endif
## upstream patches
Patch0001: 0002-pulse-server-suffix-TAG_USEC-constants-with-LL-as-th.patch
Patch0002: 0003-Revert-media-session-use-direction-to-find-the-node-.patch
Patch0003: 0004-pulse-server-module-combine-sink-remove-hooks.patch
Patch0004: 0005-pulse-server-avoid-overflow.patch
## upstreamable patches
@ -481,6 +477,9 @@ systemctl --no-reload preset --global pipewire.socket >/dev/null 2>&1 || :
%endif
%changelog
* Wed Jun 09 2021 Wim Taymans <wtaymans@redhat.com> - 0.3.30-1
- Update to 0.3.30
* Fri Jun 04 2021 Wim Taymans <wtaymans@redhat.com> - 0.3.29-2
- Add some important patches.

View File

@ -1 +1 @@
SHA512 (pipewire-0.3.29.tar.gz) = bc163ad3e2d7696295fd3720e8f9cc4d478a55c0694c0faa03a40333e3b65fcbff27e4e296eb9dd0191ca2782e04934915c46e04a2444b458491cd2905823ddd
SHA512 (pipewire-0.3.30.tar.gz) = ec525e0fb7e5c5313245fcc745b971fd7d4a1caa7ab9fe1fa38dc20d50f03e5969197e86b60659971676bec0f79aa7b7951c8209bfe9565a3fd1dcac1b8535b3