Files
omarchy-pkgs/pkgbuilds/edge/v4l2-relayd/PKGBUILD
T
Gaggery Tsai 5644881bcb v4l2-relayd: reset output pipeline on reader disconnect
When the last camera reader disconnects, cycle the output pipeline
(v4l2sink) through READY → PLAYING to reset v4l2loopback's format
state. Without this, switching between camera apps that use different
PipeWire paths (e.g. Chromium → GNOME Snapshot) fails with "no more
input formats" because v4l2loopback retains stale format state from
the previous session.

The reset is guarded by an input_was_active flag so it only triggers
after an actual streaming session, not during PipeWire's brief device
probes on startup.

Tested on Dell XPS 16 (Panther Lake) with PipeWire 1.6.2:
- Snapshot → Zoom → Snapshot: working
- Suspend → resume → Snapshot: working
- Boot → first Snapshot: 30fps
2026-03-30 10:09:12 -07:00

50 lines
1.3 KiB
Bash

# Maintainer: Ayla Ounce <ayla@ounce.email>
pkgname=v4l2-relayd
pkgver=0.2.0
pkgrel=2
pkgdesc="Plays gstreamer sources into v4l2loopback devices."
arch=('x86_64')
url="https://gitlab.com/vicamo/v4l2-relayd"
license=('GPL')
depends=(
'glib2'
'gstreamer'
'gst-plugins-base-libs'
'gst-plugins-good'
'v4l2loopback-dkms'
)
makedepends=('git')
source=("https://gitlab.com/vicamo/v4l2-relayd/-/archive/upstream/${pkgver}/v4l2-relayd-upstream-${pkgver}.tar.gz"
"0001-reset-output-on-idle.patch")
sha256sums=('0c063edf18dcc6edcdef46e695128cfc2b2d60964ea8538c7e79a2454310c53d'
'SKIP')
prepare() {
cd "$srcdir/${pkgname}-upstream-${pkgver}"
patch -p0 < "$srcdir/0001-reset-output-on-idle.patch"
}
build() {
cd "$srcdir/${pkgname}-upstream-${pkgver}"
./autogen.sh
./configure --prefix=/usr --sysconfdir=/etc
make
}
check() {
cd "$srcdir/${pkgname}-upstream-${pkgver}"
make -k check
}
package() {
cd "$srcdir/${pkgname}-upstream-${pkgver}"
make DESTDIR="$pkgdir/" install
# The module supports configuring multiple loopback devices; since we
# don't know whether the user might be using some for other purposes,
# we should not override its options unilaterally.
rm "$pkgdir/etc/modprobe.d/v4l2-relayd.conf"
rmdir "$pkgdir/etc/modprobe.d/"
}