Workaround found: add sync=false to v4l2sink in v4l2-relayd's output pipeline
Hardware: ThinkPad X1 Carbon Gen 11 (Raptor Lake IPU6 [8086:a75d], OV2740 / 
INT3474:01)
Release: Ubuntu 26.04, kernel 7.0.0-28-generic, libcamera 0.7.0-1ubuntu2, 
v4l2-relayd 0.2.0-0ubuntu1, in-tree IPU6 driver (no DKMS)
Symptom (matching earlier comments here): a manual pipeline is fluent at ~30 
fps:
gst-launch-1.0 libcamerasrc ! videoconvert ! autovideosink

but the same source relayed through v4l2-relayd to the v4l2loopback device 
delivers roughly one frame every 4–5 seconds, with the relayd process near-idle 
(so not a CPU/softISP throughput problem).
Root cause appears to be timestamp handling: buffers pushed through relayd's 
appsrc carry timestamps that don't align with the output pipeline's clock, and 
the stock ExecStart's v4l2sink (which defaults to sync=true) blocks each buffer 
waiting for its presentation time. Disabling clock sync on the sink fixes it 
completely — smooth ~30 fps through the loopback, working in Chrome/V4L2 apps, 
with relayd's on-demand start/stop behavior intact.

Workaround as a systemd drop-in (stock ExecStart with only sync=false added to 
v4l2sink):
# /etc/systemd/system/[email protected]/execstart.conf
[Service]
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'

followed by systemctl daemon-reload and restarting the
v4l2-relayd@default instance.

Suggested proper fix: either add sync=false to the packaged ExecStart in
[email protected], or have relayd re-timestamp buffers correctly when
pushing to appsrc.

Two additional notes for others on this thread with a second (USB)
camera attached: plain libcamerasrc in VIDEOSRC selects the first
enumerated camera, which is often the USB webcam rather than the MIPI
sensor. Restricting relayd's libcamera instance to the MIPI pipeline
handler avoids that without fighting camera-name escaping through
EnvironmentFile/shell/gst-parse:

Environment=LIBCAMERA_PIPELINES_MATCH_LIST=simple
(in the same drop-in). Also, if journalctl for the relayd instance shows "Could 
not open any dma-buf provider" / "Failed to create DmaBufAllocator", the 
softISP is being blocked by the unit's device sandbox; adding 
DeviceAllow=/dev/udmabuf rw and DeviceAllow=char-dma_heap rw to the drop-in 
resolves that.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2107304

Title:
  Intel MIPI Camera not working out of the box on 25.04 where it did on
  24.10

To manage notifications about this bug go to:
https://bugs.launchpad.net/ipu6-camera-bins/+bug/2107304/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to