From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 90BF7158089 for ; Wed, 25 Oct 2023 01:32:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8885C2BC019; Wed, 25 Oct 2023 01:32:43 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6EE1C2BC019 for ; Wed, 25 Oct 2023 01:32:43 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 98960335CF4 for ; Wed, 25 Oct 2023 01:32:42 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id ACA9D12BD for ; Wed, 25 Oct 2023 01:32:40 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1698197499.e78e092c510e751cab6bf1ea1a1d0b7c145c0be0.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/pipewire/files/0.3.83/, media-video/pipewire/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-video/pipewire/files/0.3.83/0001-stream-improve-queued_buffers-reporting.patch media-video/pipewire/files/0.3.83/0002-module-echo-cancel-playback-source-async.patch media-video/pipewire/files/0.3.83/0003-alsa-guard-against-null-areas.patch media-video/pipewire/pipewire-0.3.83-r1.ebuild media-video/pipewire/pipewire-0.3.83.ebuild X-VCS-Directories: media-video/pipewire/ media-video/pipewire/files/0.3.83/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: e78e092c510e751cab6bf1ea1a1d0b7c145c0be0 X-VCS-Branch: master Date: Wed, 25 Oct 2023 01:32:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 9664b809-e817-45b6-a3e1-e0be4ad65767 X-Archives-Hash: 2370d0df7d9e75e18d6d135846cf90d9 commit: e78e092c510e751cab6bf1ea1a1d0b7c145c0be0 Author: Sam James gentoo org> AuthorDate: Wed Oct 25 01:30:27 2023 +0000 Commit: Sam James gentoo org> CommitDate: Wed Oct 25 01:31:39 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e78e092c media-video/pipewire: backport recommended upstream patches to 0.3.83 Bug: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3592 Bug: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3593 Bug: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3600 Signed-off-by: Sam James gentoo.org> ...1-stream-improve-queued_buffers-reporting.patch | 53 ++++++++++++++++++++++ ...-module-echo-cancel-playback-source-async.patch | 36 +++++++++++++++ .../0003-alsa-guard-against-null-areas.patch | 52 +++++++++++++++++++++ ...ire-0.3.83.ebuild => pipewire-0.3.83-r1.ebuild} | 0 4 files changed, 141 insertions(+) diff --git a/media-video/pipewire/files/0.3.83/0001-stream-improve-queued_buffers-reporting.patch b/media-video/pipewire/files/0.3.83/0001-stream-improve-queued_buffers-reporting.patch new file mode 100644 index 000000000000..029a7930a60e --- /dev/null +++ b/media-video/pipewire/files/0.3.83/0001-stream-improve-queued_buffers-reporting.patch @@ -0,0 +1,53 @@ +https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3592 +https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/3d8c7c40b5cc16eaf7bd1fb72c17783ce42e2d0e + +From 3d8c7c40b5cc16eaf7bd1fb72c17783ce42e2d0e Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Fri, 20 Oct 2023 09:57:52 +0200 +Subject: [PATCH] stream: improve queued_buffers reporting + +Also add the queued buffers in the converter to the pw_time.queued_buffers +field. This means that queued_buffers + avail_buffers always equal the +total amount of allocated buffers, which makes more sense. + +Fixes #3592 +--- a/src/pipewire/stream.c ++++ b/src/pipewire/stream.c +@@ -2340,6 +2340,7 @@ int pw_stream_get_time_n(struct pw_stream *stream, struct pw_time *time, size_t + struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this); + uintptr_t seq1, seq2; + uint32_t buffered, quantum, index; ++ int32_t avail_buffers; + + do { + seq1 = SPA_SEQ_READ(impl->seq); +@@ -2358,19 +2359,23 @@ int pw_stream_get_time_n(struct pw_stream *stream, struct pw_time *time, size_t + time->delay += (impl->latency.min_rate + impl->latency.max_rate) / 2; + time->delay += ((impl->latency.min_ns + impl->latency.max_ns) / 2) * time->rate.denom / SPA_NSEC_PER_SEC; + ++ avail_buffers = spa_ringbuffer_get_read_index(&impl->dequeued.ring, &index); ++ avail_buffers = SPA_CLAMP(avail_buffers, 0, (int32_t)impl->n_buffers); ++ + if (size >= offsetof(struct pw_time, queued_buffers)) + time->buffered = buffered; + if (size >= offsetof(struct pw_time, avail_buffers)) +- time->queued_buffers = spa_ringbuffer_get_read_index(&impl->queued.ring, &index); ++ time->queued_buffers = impl->n_buffers - avail_buffers; + if (size >= sizeof(struct pw_time)) +- time->avail_buffers = spa_ringbuffer_get_read_index(&impl->dequeued.ring, &index); ++ time->avail_buffers = avail_buffers; + + pw_log_trace_fp("%p: %"PRIi64" %"PRIi64" %"PRIu64" %d/%d %"PRIu64" %" +- PRIu64" %"PRIu64" %"PRIu64" %"PRIu64, stream, ++ PRIu64" %"PRIu64" %"PRIu64" %"PRIu64" %d/%d", stream, + time->now, time->delay, time->ticks, + time->rate.num, time->rate.denom, time->queued, + impl->dequeued.outcount, impl->dequeued.incount, +- impl->queued.outcount, impl->queued.incount); ++ impl->queued.outcount, impl->queued.incount, ++ avail_buffers, impl->n_buffers); + return 0; + } + +-- +GitLab diff --git a/media-video/pipewire/files/0.3.83/0002-module-echo-cancel-playback-source-async.patch b/media-video/pipewire/files/0.3.83/0002-module-echo-cancel-playback-source-async.patch new file mode 100644 index 000000000000..ee96f949a2bb --- /dev/null +++ b/media-video/pipewire/files/0.3.83/0002-module-echo-cancel-playback-source-async.patch @@ -0,0 +1,36 @@ +https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3593 +https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/93d5848031cd9101d830fb4c37c5a7404ac5f276 + +From 93d5848031cd9101d830fb4c37c5a7404ac5f276 Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Sat, 21 Oct 2023 09:27:43 +0200 +Subject: [PATCH] module-echo-cancel: playback and source are async + +The playback and source streams don't dequeue/queue buffers from +the process function and so need to be marked async. + +Fixes #3593 +--- a/src/modules/module-echo-cancel.c ++++ b/src/modules/module-echo-cancel.c +@@ -1002,7 +1002,8 @@ static int setup_streams(struct impl *impl) + PW_DIRECTION_OUTPUT, + PW_ID_ANY, + PW_STREAM_FLAG_MAP_BUFFERS | +- PW_STREAM_FLAG_RT_PROCESS, ++ PW_STREAM_FLAG_RT_PROCESS | ++ PW_STREAM_FLAG_ASYNC, + params, n_params)) < 0) { + spa_pod_dynamic_builder_clean(&b); + return res; +@@ -1036,7 +1037,8 @@ static int setup_streams(struct impl *impl) + PW_ID_ANY, + PW_STREAM_FLAG_AUTOCONNECT | + PW_STREAM_FLAG_MAP_BUFFERS | +- PW_STREAM_FLAG_RT_PROCESS, ++ PW_STREAM_FLAG_RT_PROCESS | ++ PW_STREAM_FLAG_ASYNC, + params, n_params)) < 0) { + spa_pod_dynamic_builder_clean(&b); + return res; +-- +GitLab diff --git a/media-video/pipewire/files/0.3.83/0003-alsa-guard-against-null-areas.patch b/media-video/pipewire/files/0.3.83/0003-alsa-guard-against-null-areas.patch new file mode 100644 index 000000000000..e16b44538b1b --- /dev/null +++ b/media-video/pipewire/files/0.3.83/0003-alsa-guard-against-null-areas.patch @@ -0,0 +1,52 @@ +https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3600 +https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/920beea3eb55ee7156bd8c00a201bdcafa0df5b0 + +From 920beea3eb55ee7156bd8c00a201bdcafa0df5b0 Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Sun, 22 Oct 2023 17:26:25 +0200 +Subject: [PATCH] alsa: guard agaist NULL areas + +snd_pcm_ioplug_mmap_areas() can fail and return NULL + +Fixes #3600 +--- a/pipewire-alsa/alsa-plugins/pcm_pipewire.c ++++ b/pipewire-alsa/alsa-plugins/pcm_pipewire.c +@@ -309,21 +309,21 @@ snd_pcm_pipewire_process(snd_pcm_pipewire_t *pw, struct pw_buffer *b, + xfer = nframes; + if (xfer > 0) { + const snd_pcm_channel_area_t *areas = snd_pcm_ioplug_mmap_areas(io); +- const snd_pcm_uframes_t offset = hw_ptr % io->buffer_size; +- +- if (io->stream == SND_PCM_STREAM_PLAYBACK) +- snd_pcm_areas_copy_wrap(pwareas, 0, nframes, +- areas, offset, +- io->buffer_size, +- io->channels, xfer, +- io->format); +- else +- snd_pcm_areas_copy_wrap(areas, offset, +- io->buffer_size, +- pwareas, 0, nframes, +- io->channels, xfer, +- io->format); +- ++ if (areas != NULL) { ++ const snd_pcm_uframes_t offset = hw_ptr % io->buffer_size; ++ if (io->stream == SND_PCM_STREAM_PLAYBACK) ++ snd_pcm_areas_copy_wrap(pwareas, 0, nframes, ++ areas, offset, ++ io->buffer_size, ++ io->channels, xfer, ++ io->format); ++ else ++ snd_pcm_areas_copy_wrap(areas, offset, ++ io->buffer_size, ++ pwareas, 0, nframes, ++ io->channels, xfer, ++ io->format); ++ } + hw_ptr += xfer; + if (hw_ptr >= pw->boundary) + hw_ptr -= pw->boundary; +-- +GitLab diff --git a/media-video/pipewire/pipewire-0.3.83.ebuild b/media-video/pipewire/pipewire-0.3.83-r1.ebuild similarity index 100% rename from media-video/pipewire/pipewire-0.3.83.ebuild rename to media-video/pipewire/pipewire-0.3.83-r1.ebuild