Snapshot failed to work with v4l2-relayd/v4l2loopback devices

Bug #2076315 reported by hugh chao
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OEM Priority Project
Confirmed
Undecided
Unassigned
gnome-snapshot (Ubuntu)
Confirmed
Undecided
Unassigned
v4l2loopback (Ubuntu)
New
Undecided
Unassigned

Bug Description

Currently mipi camera failed to work on snapshot app on Ubuntu 24.04,
hope this issue can be fixed.

Rex Tsai (chihchun)
tags: added: oem-priority
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-snapshot (Ubuntu):
status: New → Confirmed
Revision history for this message
Rex Tsai (chihchun) wrote :

Need more debug information.

GNOME Snapshot use pipewiredeviceprovider when it's not inside a jail. The problem can be rephrased as "why pw-dump doesn't give the v4l2loopback created video device. It seems /usr/bin/snapshot.snapshot itself already has some problem to support the general video4linux devices.

Changed in gnome-snapshot (Ubuntu):
status: Confirmed → Incomplete
no longer affects: oem-priority
Revision history for this message
Shih-Yuan Lee (fourdollars) wrote (last edit ):

After some rough investigations, there are three different issues.

The first issue: the v4l2 video device is not listed from `pw-dump`, but I can make it listed after executing `systemctl --user restart pipewire`. So it could be related to some initialization problem within the pipewire infrastructure.

The second issue is a stream error that makes it unable to play camera stream. https://paste.ubuntu.com/p/MYPXTs3K39/

The third issue is only observed by my own USB camera device so far that even there is no problem to initialize the device on snapshot, but it can not fetch the camera stream to show or to record. I am not sure if we will encounter the third issue after we solved the previous two issues. https://paste.ubuntu.com/p/dcW4f6ykzs/

FYI, https://gitlab.gnome.org/GNOME/snapshot/-/blob/main/TROUBLESHOOTING.md

summary: - Snapshot failed to work on mipi camera
+ Snapshot failed to work on Intel MIPI camera
Changed in oem-priority:
status: New → Confirmed
Changed in gnome-snapshot (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote : Re: Snapshot failed to work on Intel MIPI camera

The first issue seems to be similar to bug #2061687
which is reported upstream as https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3539

The stream error message seems similar to https://gitlab.gnome.org/GNOME/snapshot/-/issues/180 . Could you perhaps report it against gstreamer upstream on https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues ?

Could you also report the issue about your own device on https://gitlab.gnome.org/GNOME/snapshot/-/issues ?

Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

Another webcam device in an old iMac works fine. https://paste.ubuntu.com/p/m3Mm476SVf/

Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

I reported https://gitlab.gnome.org/GNOME/snapshot/-/issues/223 for my own Logitech QuickCam Notebook Pro.

Revision history for this message
Shih-Yuan Lee (fourdollars) wrote (last edit ):

The error is from /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstpipewire.so belonged to pipewire. https://paste.ubuntu.com/p/jNRQ8zbkHq/
Should we probably report the second issue to https://gitlab.freedesktop.org/pipewire/pipewire/-/issues instead?

Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

I can also duplicate the second issue by the Virtual Camera created by v4l2-relayd. https://paste.ubuntu.com/p/xvyNRxSxf5/

So the problem is basically between v4l2-relayd/v4l2loopback and pipewire.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Sending to https://gitlab.freedesktop.org/pipewire/pipewire/-/issues probably makes sense yes. Assuming that #1 is identical to the other report mentioned and #3 device specific I'm going to retitle the bug to be about #2 if that's ok with you?

summary: - Snapshot failed to work on Intel MIPI camera
+ Snapshot failed to work with v4l2-relayd/v4l2loopback devices
Revision history for this message
Sebastien Bacher (seb128) wrote :
Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

The symptom looks like https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/707.
I agree that we should focus on the major #2 issue.

tags: added: jira-nantou-467
Revision history for this message
You-Sheng Yang (vicamo) wrote (last edit ):

https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/707 I don't think that's possible, or say it's a different use scenario.

The pipewire loopback is possible, because the virtual sinks/sources it created has to be accessed through libpipewire. The v4l2loopback kernel module is meant to provide kernel devices, and it must be kernel devices to be compatible with kernel V4L2 ioctl interfaces. You can certainly create loopback pipewire devices, but that doesn't mean the problems of obs/zoom/Google Meets/... will be resolved automatically until they adopt pipewire. That's a different thing.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

Snapshots reqbuf with V4L2_MEMORY_USERPTR and v4l2loopback supports only V4L2_MEMORY_MMAP. Still investigating...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers