Merge current Quattro into sudo expiry fix

This commit is contained in:
Afonso Oliveira committed 2026-09-08 15:28:24 +01:00
commit 60ac419f8c
17 files changed
+227 -11

No files matched your search

@@ -0,0 +1,9 @@
[Unit]
Description=Create the Cam Link 4K virtual camera
After=systemd-modules-load.service
[Service]
# Reruns on every relay start, so a deleted or unloaded device comes back.
Type=oneshot
ExecStart=/usr/bin/modprobe v4l2loopback
ExecStart=/bin/sh -c 'grep -qsx "Cam Link 4K" /sys/devices/virtual/video4linux/*/name || exec v4l2loopback-ctl add -n "Cam Link 4K" -x 1'
@@ -0,0 +1,16 @@
[Unit]
# udev starts this when the Cam Link 4K appears. Only the device's stop is
# tied in: a start dependency on it would leave a job waiting whenever the
# base v4l2-relayd.service is started with no Cam Link attached.
ConditionPathExists=/dev/camlink4k
StopPropagatedFrom=dev-camlink4k.device
Requires=camlink-4k-loopback.service
After=camlink-4k-loopback.service
[Service]
RestartSec=2
# The packaged command line, plus sync=false on the sink. v4l2src stamps each
# frame with its capture time, so by the time it reaches the sink it is already
# past due and a synced sink drops every one of them.
ExecStart=
ExecStart=/bin/sh -c 'DEVICE=$(grep -l -m1 -E "^${CARD_LABEL}$" /sys/devices/virtual/video4linux/*/name | cut -d/ -f6); exec /usr/bin/v4l2-relayd -i "${VIDEOSRC}" $${SPLASHSRC:+-s "$${SPLASHSRC}"} -o "appsrc name=appsrc caps=video/x-raw,format=${FORMAT},width=${WIDTH},height=${HEIGHT},framerate=${FRAMERATE} ! videoconvert ! v4l2sink name=v4l2sink sync=false device=/dev/$${DEVICE}" $EXTRA_OPTS'
+6
View File
@@ -0,0 +1,6 @@
# Keep the Elgato Cam Link 4K's raw capture node away from users and hand it to
# the v4l2-relayd instance that re-exposes it as a 16:9 virtual camera.
# Sorted after 70-uaccess adds the tag and before 73-seat-late applies its ACL.
SUBSYSTEM=="video4linux", ENV{ID_VENDOR_ID}=="0fd9", ENV{ID_MODEL}=="Cam_Link_4K", ENV{ID_V4L_CAPABILITIES}==":capture:", \
TAG-="uaccess", OWNER="root", GROUP="root", MODE="0600", SYMLINK+="camlink4k", \
TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/camlink4k", ENV{SYSTEMD_WANTS}="v4l2-relayd@camlink.service"
+9
View File
@@ -0,0 +1,9 @@
# Elgato Cam Link 4K relayed as a fixed 16:9 virtual camera. Browser meeting
# apps send 720p at most; raise WIDTH/HEIGHT (up to 3840x2160) for apps that
# can use more.
VIDEOSRC="v4l2src device=/dev/camlink4k"
FORMAT=NV12
WIDTH=1280
HEIGHT=720
FRAMERATE=30/1
CARD_LABEL="Cam Link 4K"