community/pipewire: cherry-pick a libcamera-plugin fix

that greatly improves stability and reliability, making usage and
development of pw-based camera apps more fun.
The commit is from the 1.2 branch and will thus be part of PW 1.2.4,
which, however, may be several weeks out, making a backport worthwhile.

See https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/2108
This commit is contained in:
Robert Mader 2024-08-31 11:50:22 +02:00 committed by Bart Ribbers
parent 915462f877
commit b700ee7529
2 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,26 @@
From dcf2d8f1033a8de5713501354f182f7140c8f0a4 Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@collabora.com>
Date: Fri, 30 Aug 2024 06:48:28 +0200
Subject: [PATCH] libcamera: reset ringbuffer when clearing buffers
Keeping the ringbuffer state around resulted in a high chance of
using wrong buffer IDs for consequent streams, causing various issues.
---
spa/plugins/libcamera/libcamera-utils.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/spa/plugins/libcamera/libcamera-utils.cpp b/spa/plugins/libcamera/libcamera-utils.cpp
index fdfd6e46d..4a5e0f676 100644
--- a/spa/plugins/libcamera/libcamera-utils.cpp
+++ b/spa/plugins/libcamera/libcamera-utils.cpp
@@ -149,6 +149,7 @@ static int spa_libcamera_clear_buffers(struct impl *impl, struct port *port)
freeBuffers(impl, port);
port->n_buffers = 0;
+ port->ring = SPA_RINGBUFFER_INIT();
return 0;
}
--
2.46.0

View File

@ -2,7 +2,7 @@
# Maintainer: team/alpine-desktop <bribbers@disroot.org>
pkgname=pipewire
pkgver=1.2.3
pkgrel=0
pkgrel=1
_so_ver=0.3
pkgdesc="Multimedia processing graphs"
url="https://pipewire.org/"
@ -59,6 +59,7 @@ subpackages="
"
install="$pkgname.post-upgrade $pkgname.post-install"
source="https://gitlab.freedesktop.org/PipeWire/pipewire/-/archive/$pkgver/pipewire-$pkgver.tar.gz
0001-libcamera-reset-ringbuffer-when-clearing-buffers.patch
pipewire.desktop
pipewire-launcher.sh
"
@ -246,6 +247,7 @@ libs() {
sha512sums="
025dbda4bdbea7848a6b3892170bd81eb284385a2da202a9f294030cd710d460ca4e604025b8a475e54eb37839fe91b92adb550c3ad7c7ce9aa960d73d22821b pipewire-1.2.3.tar.gz
8161b89b0ab0951d539872aceb2f059b84fffb1d41dca94fc525682109cdd80006ad4515a5176a1010ab02ddec1883e7ae9577f8d6f1b807ebe330efe34a97ca 0001-libcamera-reset-ringbuffer-when-clearing-buffers.patch
b70b05151bcf4b7f13d68b2731d789b9c062fadfcb91f4ed6bdb0d495390b0010f57034fb115a053e1459c7d9ea27523ca1c0c69639aeeb96c17ebac8dfc5b57 pipewire.desktop
6f4322d306bef346187778fc0975d608fdd37d4c8e08815a0aed28ef7e07c3f21d6a80b70743d0f867bdc237f5e1dc28131c778e7a45e363e5677668ce7acdb1 pipewire-launcher.sh
"