[Bug 732326] New: Slow UVC webcam startup due to excessive S_FMT

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Fri Jun 27 12:59:27 PDT 2014


https://bugzilla.gnome.org/show_bug.cgi?id=732326
  GStreamer | gst-plugins-good | git

           Summary: Slow UVC webcam startup due to excessive S_FMT
    Classification: Platform
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-good
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: dan at reactivated.net
         QAContact: gstreamer-bugs at lists.freedesktop.org
                CC: nicolas.dufresne at collabora.co.uk
     GNOME version: ---


gstreamer-0.8 and gstreamer-1.2 can start up my UVC webcam reasonably quickly,
but with gstreamer-1.3 from git, "gst-launch-1.0 v4l2src ! xvimagesink" takes
about 5 seconds before the video feed is displayed.
cheese takes 10 seconds to load, for some reason it seems to create the v4l2
object twice so the delay is doubled.

Device is branded as Manhattan 460729:

  idVendor           0x1e4e Cubeternet
  idProduct          0x0102 GL-UPC822 UVC WebCam
  bcdDevice            0.02
  iManufacturer           1 Etron Technology, Inc.
  iProduct                2 USB2.0 Camera

The delay is under gst_v4l2_object_get_caps() - in gstreamer1.3 on this setup
this results in 25 S_FMT ioctls being dispatched from
gst_v4l2_object_get_nearest_size which is called in nested loops via this call
chain:

gst_v4l2_object_get_caps
gst_v4l2_object_probe_caps_for_format
gst_v4l2_object_probe_caps_for_format_and_size
gst_v4l2_object_get_nearest_size

The ioctl in question:
  if (prevfmt_valid)
    if (v4l2_ioctl (fd, VIDIOC_S_FMT, &prevfmt) < 0) {
      GST_WARNING_OBJECT (v4l2object->element,
          "Unable to restore format after trying format: %s",
          g_strerror (errno));
    }


This ioctl takes about 0.17 seconds per call.

The ioctl in question is a workaround of a kernel driver bug from 2011, see:
https://bugzilla.kernel.org/show_bug.cgi?id=36152
https://bugzilla.gnome.org/show_bug.cgi?id=649067

The kernel bug is closed upstream and I ran the test case, the earlier problem
does not reproduce here.

Can we drop the workaround?

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list