After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 795097 - v4l2object: Virtualbox webcam not recognized in Cheese
v4l2object: Virtualbox webcam not recognized in Cheese
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.14.0
Other Linux
: Normal normal
: 1.14.1
Assigned To: Cheese Maintainer(s)
Cheese Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2018-04-09 10:00 UTC by Whoopie
Modified: 2018-04-12 02:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
LD_PRELOAD debug output (147.73 KB, text/plain)
2018-04-09 10:00 UTC, Whoopie
  Details
debug output on Ubuntu 18.04 (11.37 KB, text/plain)
2018-04-09 10:00 UTC, Whoopie
  Details
debug output on Ubuntu 16.04 (229.50 KB, text/plain)
2018-04-09 10:01 UTC, Whoopie
  Details
disable DMABuf (252 bytes, patch)
2018-04-10 14:29 UTC, Whoopie
none Details | Review
disable DMABif when emulated pixel format is detected (845 bytes, patch)
2018-04-11 20:28 UTC, Whoopie
committed Details | Review

Description Whoopie 2018-04-09 10:00:17 UTC
Created attachment 370679 [details]
LD_PRELOAD debug output

Running Ubuntu 18.04 with gstreamer-1.0 1.14.0, the virtualbox webcam (using uvcvideo kernel module) is not detected by Cheese.

Please find attached 'GST_DEBUG="2,v4l2*:7" cheese' output from Ubuntu 18.04 (bionic) and Ubuntu 16.04 (xenial) where it works. The debug output is in v4l-cheese-debug-bionic.txt and v4l-cheese-debug-xenial.txt.

BTW, if I run 'LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libv4l/v4l2convert.so cheese', the webcam is detected, but it shows 'There was an error playing video from the webcam'. The debug output is in v4l-cheese-debug-ld_preload.txt.

I'd be grateful if you had a look. Thanks a lot in advance!
Comment 1 Whoopie 2018-04-09 10:00:47 UTC
Created attachment 370680 [details]
debug output on Ubuntu 18.04
Comment 2 Whoopie 2018-04-09 10:01:09 UTC
Created attachment 370681 [details]
debug output on Ubuntu 16.04
Comment 3 Whoopie 2018-04-09 14:30:57 UTC
Same on Fedora 28 Beta.
Comment 4 Whoopie 2018-04-10 14:28:31 UTC
Thanks to Nicolas Dufresne's analysis, I could find a workaround by disabling DMABuf if GST_V4L2_USE_LIBV4L2=1 is set. Please find attached the patch 'disable-dmabuf.patch'.
Comment 5 Whoopie 2018-04-10 14:29:28 UTC
Created attachment 370734 [details] [review]
disable DMABuf
Comment 6 Whoopie 2018-04-11 20:28:40 UTC
Created attachment 370821 [details] [review]
disable DMABif when emulated pixel format is detected
Comment 7 Nicolas Dufresne (ndufresne) 2018-04-12 01:09:18 UTC
Review of attachment 370821 [details] [review]:

Looks good, thanks, only small note, it's about the author line, would you mind providing your complete name ?
Comment 8 Nicolas Dufresne (ndufresne) 2018-04-12 02:20:38 UTC
commit 2d774554e9bb6c04438f2e8587a43e2a41e6d1fb (HEAD -> master)
Author: Whoopie <whoopie79@gmx.com>
Date:   Wed Apr 11 20:28:00 2018 +0000

    v4l2object: Disable DMABuf for emulated formats
    
    libv4l2 does not prevent exporting DMABuf even when emulated formats are
    in use. As a side effect, userspace ends up with buffers of the original
    formats which will cause issues.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=795097
Comment 9 Nicolas Dufresne (ndufresne) 2018-04-12 02:45:52 UTC
commit 59a24f074fb532ddddd24f25b96ac7f67ddec150 (HEAD -> 1.14)
Author: Whoopie <whoopie79@gmx.com>
Date:   Wed Apr 11 20:28:00 2018 +0000

    v4l2object: Disable DMABuf for emulated formats
    
    libv4l2 does not prevent exporting DMABuf even when emulated formats are
    in use. As a side effect, userspace ends up with buffers of the original
    formats which will cause issues.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=795097