USB camera stops in UI, and ignores settings

Camera model

Creative Live Sync HD

What is the problem?

The web interface only shows the camera feed for about a minute then stops. It's also not streaming at the configured rate.

What did you already try to solve it?

Logs (/var/log/webcamd.log, syslog, dmesg, ... no logs, no support)

webcamd.log:

Starting up webcamDaemon...

--- Configuration: ----------------------------
cfg_file:      /boot/octopi.txt
camera:        usb
usb options:   -r HD -f 1
raspi options: -fps 10
http options:  -w ./www-octopi -n --listen 127.0.0.1

Explicitly USB device: 
-----------------------------------------------

Found video devices:
/dev/video1
/dev/video10
/dev/video11
/dev/video12
/dev/video13
/dev/video14
/dev/video15
/dev/video16
/dev/video2
config file='/boot/octopi.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video1
<13>Mar  3 21:52:03 root: Starting USB webcam
Checking for VL805 (Raspberry Pi 4)...
  - It seems that you don't have VL805 (Raspberry Pi 4).
    There should be no problems with USB (a.k.a. select() timeout)
Running ./mjpg_streamer -o output_http.so -w ./www-octopi -n --listen 127.0.0.1 -i input_uvc.so -r HD -f 1 -d /dev/video1
MJPG Streamer Version: git rev: 5554f42c352ecfa7edaec6fc51e507afce605a34
 i: Using V4L2 device.: /dev/video1
 i: Desired Resolution: 1280 x 720
 i: Frames Per Second.: 1
 i: Format............: JPEG
 i: TV-Norm...........: DEFAULT
 i: FPS coerced ......: from 1 to 30
UVCIOC_CTRL_ADD - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Mode: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Frequency: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Disable video processing: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Raw bits per pixel: Inappropriate ioctl for device (25)
 o: www-folder-path......: ./www-octopi/
 o: HTTP TCP port........: 8080
 o: HTTP Listen Address..: 127.0.0.1
 o: username:password....: disabled
 o: commands.............: disabled
Done bring up all configured video device

dmesg

[ 2111.328631] usb 1-1.4: new high-speed USB device number 5 using xhci_hcd
[ 2111.474804] usb 1-1.4: New USB device found, idVendor=041e, idProduct=409f, bcdDevice=31.01
[ 2111.474824] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2111.474841] usb 1-1.4: Product: Live! Cam Sync 1080p
[ 2111.474857] usb 1-1.4: Manufacturer: Creative Technology Ltd.
[ 2111.474872] usb 1-1.4: SerialNumber: Live! Cam Sync 1080p Audio
[ 2111.476955] uvcvideo: Found UVC 1.00 device Live! Cam Sync 1080p (041e:409f)
[ 2111.489814] input: Live! Cam Sync 1080p: Live! Cam as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.0/input/input1

Additional information about your setup (OctoPrint version, OctoPi version, ...)

Raspberry Pi 4
OctoPrint 1.5.3
OctoPi Version 0.18.0

The symptom is that in the box on the UI where the video should be, it goes black with an icon in the center like it doesn't know what the type is. Refreshing the window seems to bring the video back for another minute, then it stops.

I've tried lowering FPS from 30 to 10 to 1, and in the 1 minute or so that the stream works it appears to be streaming at full FPS. But the log clearly shows it's lowering from 30 to 1.

Also interesting, even though the browser stops getting the stream the server software is still sending it, as witnessed by lots of data seen in tcpdump (and if I kill mjpg_streamer , the data rate drops way down).

I've tried the UI on two different computers (one Mac, one Windows), on different browsers (Chrome & Safari on the Mac, Chrome and Edge on Windows).

some browsers on some devices can't handle some streams for some reason.

Try to watch the stream with the direct link
http://octopi/webcam/?action=stream

Is this a valid -r value? I have only ever seen numbers here, or a specific format that is detailed in the docs:

[-r | --resolution ]...: the resolution of the video device,
                         can be one of the following strings:
                         QSIF QCIF CGA QVGA CIF VGA 
                         SVGA XGA SXGA 
                         or a custom value like the following
                         example: 640x480

That may be why the FPS setting is being ignored - maybe it goes back to the defaults.

Yeah I thought the same but then I saw this

I guess the added hd and fhd and didn't document it :man_shrugging:

1 Like

I figured this out, at least partly.

The Creative Labs Live camera I have is apparently a newer one then what's listed on the official list, but same name. It does not appear to support a slower frame rate then 30fps when in mjpg mode. (Creative Live! Cam Sync 1080p Full HD Wide-angle Webcam with Dual Built-in Mic - Creative Labs (United States)). It does support 10fps in YUY2 mode, but that causes mjpg_streamer to consume 50% CPU. No bueno.

I plugged in my (much more expensive) Logitech c930e and it has been streaming at 10fps happily and the browser hasn't lost sync yet.

I came across a command here that shows the camera capabilities:

v4l2-ctl --list-formats-ext -d /dev/video1

Every mode the camera has for MJPG is 30fps. Booo.

So my nice Logitech camera is moving to the 3D printer and the Creative Labs is moving to my desktop.

At least this fixes it!

I have one of these 1080p Live! sync cams and it as above it is a pain to get running. I have failed completely with "-r 1920x1080 -f 30". I did have more sucsess with "-r HD -f 30" that managed to lower the cpu usage and let my Pi3 b run correctly and the final test was "-r FHD -f 30" that reduce the dropped frames and made life a little easier, that was untill I checked on my Kodi 19 Rpi4 that I use to remote view the stream from my home. The stream just refuses to load giving me pixel count errors ?? (maybe its a kodi Pi4 problem as its essentially beta software) but if I connect the old cam it still works when the strm file is loaded (but it is only a 480 webcam that seems to ignore all commands passed to it so works with every setting by ignoring them ). The strm file literally just points to the stream http://192.168.x.x/webcam/?action=stream. The stream loads fine on pc and laptop using firefox Any other suggestions I can try. I can not set a different resolutions as it causes cpu problems