17

I have a Dell XPS 9370, which is known to have only one camera. But ls /dev/video* results in /dev/video0 /dev/video1 /dev/video2 /dev/video3, so four different camera devices.
These four cameras bubble up to the applications, e.g. Skype which lists four cameras, but just the first one (/dev/video0) works.

Does anybody know where the other entries come from? Or how to hide them from higher layers?

4 Answers4

10

The answer given here https://unix.stackexchange.com/questions/512759/multiple-dev-video-for-one-physical-device is a good one. I have the same problem with Skype and it started when I upgraded the kernel from 4.4.x to 5.1.x so somewhere in there the uvcvideo module produced a different output. However, has it is pointed out the output of

v4l2-ctl --device=/dev/video* --all

does show that each entry has a different capability, and in the case of my logitech usb camera only 1 has video capture. So this is most likely a bug in Skype, that appeared after the kernel probably fix a bug themselves, that does not only shows the entries that have a "Video capture" capability.

sabby
  • 116
8

Each camera has a second metadata device added to output timestamp information or detailed per frame metadata

You can use v4l2-ctl to get more information on a device, and can use v4l2-ctl --list-formats --device /dev/videoX to determine if it contains video streams.

To list just devices with video data use:

for dev in `find /dev -iname 'video*' -printf "%f\n"`
do
  v4l2-ctl --list-formats --device /dev/$dev | \
    grep -qE '\[[0-9]\]' && \
    echo $dev `cat /sys/class/video4linux/$dev/name`
done

This can be combined with fzf to select a camera and launch a program:

for dev in `find /dev -iname 'video*' -printf "%f\n"`;do; v4l2-ctl --list-formats --device /dev/$dev | grep -qE '\[[0-9]\]' && echo $dev `cat /sys/class/video4linux/$dev/name`;done | fzf | awk '{ printf("/dev/%s", $1) }' | xargs guvcview --device
James EJ
  • 171
6

To find out what each device is, you can run this (and change the number in video0 to video1, etc):

cat /sys/class/video4linux/video0/name

Googling Dell XPS 9370 gives information that this model has also an infrared camera in addition to the normal web camera, and the infrared camera can be used for authenticating with face recognition. https://wiki.archlinux.org/index.php/Dell_XPS_13_(9370)

If you want to disable for example the IR camera, more information about your system is needed, for example dmesg.

Karl R.
  • 111
  • 1
  • 1
  • 6
4

The difference between /dev/video0 and /dev/video1 for a single camera is that one is for 'Video Capture' and the other is for 'Metadata Capture'.

It can be checked in 'Device Caps' info below:

The following command shows the info for /dev/video0:

$ v4l2-ctl --info --device /dev/video0
Driver Info (not using libv4l2):
Driver name   : uvcvideo
Card type     : 720p HD Camera: 720p HD Camera
Bus info      : usb-0000:00:14.0-6
Driver version: 5.3.18
Capabilities  : 0x84A00001
    Video Capture
    Metadata Capture
    Streaming
    Extended Pix Format
    Device Capabilities
Device Caps   : 0x04200001
    Video Capture
    Streaming
    Extended Pix Format

And for /dev/video1:

$ v4l2-ctl --info --device /dev/video1
Driver Info (not using libv4l2):
Driver name   : uvcvideo
Card type     : 720p HD Camera: 720p HD Camera
Bus info      : usb-0000:00:14.0-6
Driver version: 5.3.18
Capabilities  : 0x84A00001
    Video Capture
    Metadata Capture
    Streaming
    Extended Pix Format
    Device Capabilities
Device Caps   : 0x04A00000
    Metadata Capture
    Streaming
    Extended Pix Format
bigbell
  • 53