GNOME Bugzilla – Bug 795097
v4l2object: Virtualbox webcam not recognized in Cheese
Last modified: 2018-04-12 02:45:52 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!
Created attachment 370680 [details] debug output on Ubuntu 18.04
Created attachment 370681 [details] debug output on Ubuntu 16.04
Same on Fedora 28 Beta.
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'.
Created attachment 370734 [details] [review] disable DMABuf
Created attachment 370821 [details] [review] disable DMABif when emulated pixel format is detected
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 ?
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
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