Bug 245245

Summary: multimedia/webcamd: One webcam causes two /dev/videoN devices to be created
Product: Ports & Packages Reporter: Yuri Victorovich <yuri>
Component: Individual Port(s)Assignee: Hans Petter Selasky <hselasky>
Status: Closed Not A Bug    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (hselasky)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Yuri Victorovich freebsd_committer freebsd_triage 2020-04-01 18:07:25 UTC
There is one webcamd process for one camera:
> $ ps ax | grep webcamd
> 42461  -  I<s      0:00.01 /usr/local/sbin/webcamd -N vendor-0x046d-HD-Pro-Webcam-C920 -S F652B6FF -M 0 -B -U webcamd -G webcamd -H
> 42485  9  S+       0:00.00 grep webcamd

But it creates two video devices:
> $ ls -l /dev/video*
> crw-rw-rw-  1 webcamd  webcamd  0xcd Apr  1 11:04 /dev/video0
> crw-rw-rw-  1 webcamd  webcamd  0xce Apr  1 11:04 /dev/video1

As a result, Firefox shows two video devices instead of one.

> FreeBSD xx.xx.xx 12.0-STABLE FreeBSD 12.0-STABLE r347548 GENERIC  amd64
Comment 1 Hans Petter Selasky freebsd_committer freebsd_triage 2020-04-01 18:35:25 UTC
This is expected.

The one video device is for metadata. Same under Linux.

--HPS
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2020-04-01 18:41:46 UTC
(In reply to Hans Petter Selasky from comment #1)

You are saying that this is a feature of V4L interface, and apps simply have a bug that they show two devices for each physical camera?

Both Firefox and qTox show both video devices.
Comment 3 Hans Petter Selasky freebsd_committer freebsd_triage 2020-04-01 18:42:53 UTC
commit 088ead25524583e2200aa99111bea2f66a86545a
Author: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Date:   Wed Dec 6 10:15:40 2017 -0500

    media: uvcvideo: Add a metadata device node
        Some UVC video cameras contain metadata in their payload headers. This
    patch extracts that data, adding more clock synchronisation information,
    on both bulk and isochronous endpoints and makes it available to the user
    space on a separate video node, using the V4L2_CAP_META_CAPTURE capability
    and the V4L2_BUF_TYPE_META_CAPTURE buffer queue type. By default, only the
    V4L2_META_FMT_UVC pixel format is available from those nodes. However,
    cameras can be added to the device ID table to additionally specify their
    own metadata format, in which case that format will also become available
    from the metadata node. 


Maybe firefox needs a knob flipped to detect these devices and ignore them?
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2020-04-01 19:01:28 UTC
(In reply to Hans Petter Selasky from comment #3)

The www/firefox bug report: Bug#245249
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2020-04-02 10:06:52 UTC
This is a Firefox/Mozilla bug.