Decreasing startup delay with v4lsrc

Kristian Kielhofner kris at kriskinc.com
Sun Jan 15 19:45:43 UTC 2017


On Sun, Jan 15, 2017 at 11:47 AM, Nicolas Dufresne <nicolas at ndufresne.ca> wrote:
>
> This issue is common with many UVC cameras. I have research the problem
> and some improvement is possible. What you need to know is that UVC
> interface expose only a subset of V4L2 and GStreamer capabilities
> interface. Because we don't know from USERSPACE, we probe all the
> possibilities through V4L2, which endup probing the hardware with the
> same subset again and again. Some USB UVC camera are really slow at
> probing time, which leads to this issue.
>
> The best solution would be to implement a cache in the kernel driver of
> the probed results. This way, the driver could return from the cache
> whenever we probe something different but which has a subset identical
> to a previous probe. Or, we could add some flags in the drivers that
> enumerate which fields are implemented.
>
> The second solution, could be to implement extra quirk in GStreamer
> when probing the UVC drivers. This could require identifying exactly
> which capabilities have no mapping on UVC side and make sure to avoid
> probing for those capabilities.
>
> A third solution, which I don't like much, would be to allow users to
> pass the probed caps to the v4l2src element. The reason I don't like
> it, is that by-passing the probes is error prone and may lead to
> unusual error being reported. This endup being extra effort when
> helping users over this mailing list.
>
> regards,
> Nicolas
>

Hi Nicolas,

  Thank you for getting back to me so quickly.

  I've implemented something similar to your second option, I only
enumerate for the formats I want and then I stop when Gstreamer probes
one resolution and one frame rate. In my application this provides the
exact capabilities I want and I've been able to reduce probe time from
seven seconds to about 1.5.

  The third option you provide would be best for my application. I
understand your hesitation about user confusion but perhaps there is a
way to implement this without creating extra support efforts?

  Thanks again!

-- 
Kristian Kielhofner


More information about the gstreamer-devel mailing list