Camera model
2x C270
What is the problem?
One was working fine. I then went through the Chris's Basement youtube tutorial and the original cam stopped working (it's being seen second according to /var/log/messages
) I originally got past the source octopi.txt
in the webcamd files which originally threw me.
Now a cam will not start with 'Unable to set format: 1196444237 res: 1280x720'
What did you already try to solve it?
So I first tried setting different resolutions, all got the same error, so I went through my config again.
I set up the rules so that my devices are allocated a symlink in /dev based on their serial numbers taken from /var/log/messages
when plugging them in.
**pi@pmk3** : **/etc/udev/rules.d $** cat 99-usb.rules
SUBSYSTEM=="video4linux", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="0825", ATTRS{serial}=="D6A16790", SYMLINK+="videosky"
SUBSYSTEM=="video4linux", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="0825", ATTRS{serial}=="18502F90", SYMLINK+="videobase"
I checked and both symlinks point to a video[number] so I'm assuming that's good:
**pi@pmk3** : **/etc/default $** ls -las /dev/video*
0 crw-rw---- 1 root video 81, 0 Nov 20 23:07 **/dev/video0**
0 crw-rw---- 1 root video 81, 1 Nov 20 23:07 **/dev/video1**
0 crw-rw---- 1 root video 81, 4 Nov 20 23:07 **/dev/video10**
0 crw-rw---- 1 root video 81, 5 Nov 20 23:07 **/dev/video11**
0 crw-rw---- 1 root video 81, 6 Nov 20 23:07 **/dev/video12**
0 crw-rw---- 1 root video 81, 2 Nov 20 23:07 **/dev/video2**
0 crw-rw---- 1 root video 81, 3 Nov 20 23:07 **/dev/video3**
0 lrwxrwxrwx 1 root root 6 Nov 20 23:07 **/dev/videobase** -> **video0**
0 lrwxrwxrwx 1 root root 6 Nov 20 23:07 **/dev/videosky** -> **video3**
The system is able to support 2 C270 cameras attached since it can tell them apart.
webcamd (the original cam now called /dev/videosky, but now detected second) was updated as per the video and is failing to start while the webcamd2 (/dev/videobase) is starting fine. See webcamd logs below.
I saw somewhere about checking if the devices have attached properly:
**pi@pmk3** : **/etc/udev/rules.d $** v4l2-ctl --list-devices
bcm2835-codec (platform:bcm2835-codec):
/dev/video10
/dev/video11
/dev/video12
UVC Camera (046d:0825) (usb-3f980000.usb-1.1.2):
/dev/video2
/dev/video3
UVC Camera (046d:0825) (usb-3f980000.usb-1.2):
/dev/video0
/dev/video1
But in that article, it says I should be using the first of the devices lists, which is video2, not video3 that the symlink points at. I assumed this is a red herring because if I use /dev/video2 I get a device busy error.
Looking at the capabilities however:
pi@pmk3:~ $ v4l2-ctl -d /dev/videosky --all
Driver Info (not using libv4l2):
Driver name : uvcvideo
Card type : UVC Camera (046d:0825)
Bus info : usb-3f980000.usb-1.1.2
Driver version: 4.19.66
Capabilities : 0x84A00001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04A00000
Streaming
Extended Pix Format
Priority: 2
Seems a bit light on stuff, but this is the physical camera that was there before, just being detected second now. If I do the same to the /dev/video2
which is first as per the previous article:
pi@pmk3:~ $ v4l2-ctl -d /dev/video2 --all
Driver Info (not using libv4l2):
Driver name : uvcvideo
Card type : UVC Camera (046d:0825)
Bus info : usb-3f980000.usb-1.1.2
Driver version: 4.19.66
Capabilities : 0x84A00001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
Width/Height : 640/480
Pixel Format : 'YUYV'
Field : None
Bytes per Line : 1280
Size Image : 614400
Colorspace : sRGB
Transfer Function : Default
YCbCr/HSV Encoding: Default
Quantization : Default
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 640, Height 480
Default : Left 0, Top 0, Width 640, Height 480
Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 640, Height 480
Selection: crop_bounds, Left 0, Top 0, Width 640, Height 480
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 30.000 (30/1)
Read buffers : 0
brightness (int) : min=0 max=255 step=1 default=128 value=128
contrast (int) : min=0 max=255 step=1 default=32 value=32
saturation (int) : min=0 max=255 step=1 default=32 value=32
white_balance_temperature_auto (bool) : default=1 value=1
gain (int) : min=0 max=255 step=1 default=64 value=64
power_line_frequency (menu) : min=0 max=2 default=2 value=2
white_balance_temperature (int) : min=0 max=10000 step=10 default=4000 value=4000 flags=inactive
sharpness (int) : min=0 max=255 step=1 default=24 value=24
backlight_compensation (int) : min=0 max=1 step=1 default=0 value=0
exposure_auto (menu) : min=0 max=3 default=3 value=3
exposure_absolute (int) : min=1 max=10000 step=1 default=166 value=166 flags=inactive
exposure_auto_priority (bool) : default=0 value=1
That seems good, except it's the YUYV camera which I don't want. But I thought I'd try the -y option, and that gives me a device busy:
Starting up webcamDaemon...
--- Configuration: ----------------------------
camera: auto
usb options: -d /dev/video2 -r 1280x720 -f 30 -y
raspi options: -fps 10
http options: -w ./www-octopi -p 8080
-----------------------------------------------
Explicitly set USB device was found in options: /dev/video2
Found video devices:
/dev/video0
/dev/video1
/dev/video10
/dev/video11
/dev/video12
/dev/video2
/dev/video3
USB device was set in options and found in devices, start MJPG-streamer with the configured USB video device: /dev/video2
<13>Nov 21 07:10:41 pi: Starting USB webcam
Running ./mjpg_streamer -o output_http.so -w ./www-octopi -p 8080 -i input_uvc.so -r 1280x720 -f 30 -y
MJPG Streamer Version: git rev: ddb69b7b4f114f3c2ca01adf55712792ca8aed43
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 1280 x 720
i: Frames Per Second.: 30
i: Format............: YUYV
i: JPEG Quality......: 80
i: TV-Norm...........: DEFAULT
libv4l2: error setting pixformat: Device or resource busy
Unable to set format: 1448695129 res: 1280x720
Init v4L2 failed !! exit fatal
i: init_VideoIn failed
The new hardware shows what I'd expect:
pi@pmk3:~ $ v4l2-ctl -d /dev/videobase --all
Driver Info (not using libv4l2):
Driver name : uvcvideo
Card type : UVC Camera (046d:0825)
Bus info : usb-3f980000.usb-1.2
Driver version: 4.19.66
Capabilities : 0x84A00001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
Width/Height : 1280/720
Pixel Format : 'MJPG'
Field : None
Bytes per Line : 0
Size Image : 816000
Colorspace : sRGB
Transfer Function : Default
YCbCr/HSV Encoding: Default
Quantization : Default
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 1280, Height 720
Default : Left 0, Top 0, Width 1280, Height 720
Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 1280, Height 720
Selection: crop_bounds, Left 0, Top 0, Width 1280, Height 720
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 30.000 (30/1)
Read buffers : 0
brightness (int) : min=0 max=255 step=1 default=128 value=100
contrast (int) : min=0 max=255 step=1 default=32 value=28
saturation (int) : min=0 max=255 step=1 default=32 value=26
white_balance_temperature_auto (bool) : default=1 value=0
gain (int) : min=0 max=255 step=1 default=64 value=128
power_line_frequency (menu) : min=0 max=2 default=2 value=2
white_balance_temperature (int) : min=0 max=10000 step=10 default=4000 value=6000
sharpness (int) : min=0 max=255 step=1 default=24 value=24
backlight_compensation (int) : min=0 max=1 step=1 default=0 value=0
exposure_auto (menu) : min=0 max=3 default=3 value=1
exposure_absolute (int) : min=1 max=10000 step=1 default=166 value=171
exposure_auto_priority (bool) : default=0 value=0
I have now run out of things to try.
Logs
My looping /var/log/webcamd:
Starting up webcamDaemon...
--- Configuration: ----------------------------
camera: auto
usb options: -d /dev/videosky -r 1280x720 -f 30
raspi options: -fps 10
http options: -w ./www-octopi -p 8080
-----------------------------------------------
Found video devices:
/dev/video0
/dev/video1
/dev/video10
/dev/video11
/dev/video12
/dev/video2
/dev/video3
USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>Nov 21 00:12:05 pi: Starting USB webcam
Running ./mjpg_streamer -o output_http.so -w ./www-octopi -p 8080 -i input_uvc.so -d /dev/videosky -r 1280x720 -f 30
MJPG Streamer Version: git rev: ddb69b7b4f114f3c2ca01adf55712792ca8aed43
i: Using V4L2 device.: /dev/video3
i: Desired Resolution: 1280 x 720
i: Frames Per Second.: 30
i: Format............: JPEG
i: TV-Norm...........: DEFAULT
Unable to set format: 1196444237 res: 1280x720
Init v4L2 failed !! exit fatal
i: init_VideoIn failed
Additional information about your setup (OctoPrint version, OctoPi version, ...)
OctoPrint 1.3.12 running on OctoPi 0.16.0 on a Pi3B+