Hi!
I recently upgraded the OS of my OpiZeroLTS, from the Debian Stretch Server 5.3.5 (available distro on Sunxi website) to Debian Buster 5.8.5 (downloaded from armbian webpage).
Everything went well, except when I plug my USB webcam several video devices are assigned. I made a script with fswebcam to acquire still pictures from all /dev/video* and these "ghost" cameras are causing errors when the software try to open them as regular webcams.
My script:
for vid in /dev/video*; do
output=$(basename $vid)
fswebcam -d $vid -r 1920x1080 -D 10 -S 5 -F 1 --jpeg -1 --no-banner --no-timestamp --no-info /opt/images/$output
mv /opt/images/$output /opt/images/$output.jpg
done
____
This is the error message I get running the script:
# ./capture.sh
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Unable to query input 0.
VIDIOC_ENUMINPUT: Inappropriate ioctl for device
mv: cannot stat '/opt/images/video0': No such file or directory
--- Opening /dev/video1...
Trying source module v4l2...
/dev/video1 opened.
No input was specified, using the first.
Unable to query input 0.
VIDIOC_ENUMINPUT: Inappropriate ioctl for device
mv: cannot stat '/opt/images/video1': No such file or directory
--- Opening /dev/video2...
Trying source module v4l2...
/dev/video2 opened.
No input was specified, using the first.
Adjusting resolution from 1920x1080 to 1280x800.
Delaying 10 seconds.
--- Capturing frame...
Skipping 5 frames...
Capturing 1 frames...
Captured 6 frames in 0.17 seconds. (35 fps)
--- Processing captured image...
Setting output format to JPEG, quality -1
Disabling banner.
Clearing timestamp.
Clearing info text.
Writing JPEG image to '/opt/images/video2'.
--- Opening /dev/video3...
Trying source module v4l2...
/dev/video3 opened.
No input was specified, using the first.
Unable to query input 0.
VIDIOC_ENUMINPUT: Inappropriate ioctl for device
mv: cannot stat '/opt/images/video3': No such file or directory
____
Here is my lsusb output:
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 004: ID 04f2:b351 Chicony Electronics Co., Ltd
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
_____
typing v4l2-ctl --list-devices I get:
cedrus (platform:cedrus):
/dev/video1
sun8i-di (platform:sun8i-di):
/dev/video0
HD Webcam: HD Webcam (usb-1c1b000.usb-1):
/dev/video2
/dev/video3
The only physical device is the /dev/video2
I got some clue reading this post:
https://unix.stackexchange.com/questions/512759/multiple-dev-video-for-one-physical-device
but I don´t know much (i.e. nothing) about kernel compiling, drivers and etc.
Does anyone know what to stop assigning video nodes to these memory-to-memory devices? Is there a way to filter the virtual devices on my fswebcam script?
Thank you!