Motion - Support Question 2010x 10x 28x 151833

Multiple usb cams - unable to open device

Question

I am using 2 usb cams (logitech quickcam e3500 and trust wb-1400t) plugged into my toshiba laptop running ubuntu 10.10. I am able to view both cams simoultaneously ( one opened with cheese and one with vlc).

I have configured 2 threads. Only the first cam starts (/dev/video0). the second one (/dev/video1) always says "unable to open video device". I have removed the modules for the cams (uvcvideo and gspca_pac207) and added them in different orders so that each cam is /dev/video0 at one point. Both cams work when they are /dev/video0, but none work when they are /dev/video1.

I have tried changing resolution (176x144, 320x240, 352x288), but it never helped.

the console output + messages log are from the same motion run



####################################
# console output
####################################
[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Processing config file /etc/motion/thread1.conf
[0] Processing config file /etc/motion/thread2.conf
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3426306 LIBAVFORMAT_BUILD 3424258
[0] Thread 1 is from /etc/motion/thread1.conf
[0] Thread 2 is from /etc/motion/thread2.conf
[1] Thread 1 started
[1] cap.driver: "uvcvideo"
[1] cap.card: "UVC Camera (046d:09a4)"
[1] cap.bus_info: "usb-0000:00:1d.7-3"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Config palette index 8 (YU12) doesn't work.
[1] Supported palettes:
[1] 0: MJPG (MJPEG)
[1] 1: YUYV (YUV 4:2:2 (YUYV))
[1] Selected palette YUYV
[2] Thread 2 started
[0] motion-httpd/3.2.12 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[1] Test palette YUYV (352x288)
[1] Using palette YUYV (352x288) bytesperlines 704 sizeimage 202752 colorspace 00000008
[1] found control 0x00980900, "Brightness", range 0,255 
[1]    "Brightness", default 128, current 128
[1] found control 0x00980901, "Contrast", range 0,255 
[1]    "Contrast", default 32, current 32
[1] found control 0x00980902, "Saturation", range 0,255 
[1]    "Saturation", default 32, current 32
[1] found control 0x00980913, "Gain", range 0,255 
[1]    "Gain", default 0, current 206
[1] mmap information:
[1] frames=4
[1] 0 length=202752
[1] 1 length=202752
[1] 2 length=202752
[1] 3 length=202752
[1] Using V4L2
[2] cap.driver: "pac207"
[2] cap.card: "CIF Single Chip     "
[2] cap.bus_info: "usb-0000:00:1d.0-2"
[2] cap.capabilities=0x05000001
[2] - VIDEO_CAPTURE
[2] - READWRITE
[2] - STREAMING
[2] Unable to query input 1 VIDIOC_ENUMINPUT: Invalid argument
[2] ioctl (VIDIOCGCHAN): Invalid argument
[1] Resizing pre_capture buffer to 1 items
[2] Using VIDEO_PALETTE_YUV420P palette
[2] Using V4L1
[2] Resizing pre_capture buffer to 1 items
[2] Started stream webcam server in port 8082
[2] sync error in proc 2996: Invalid argument
[1] Started stream webcam server in port 8081
[2] mcapture error in proc 2996: Invalid argument
[2] Video device fatal error - Closing video device
[2] Closing video device /dev/video1
[2] Retrying until successful connection with camera
[2] cap.driver: "pac207"
[2] cap.card: "CIF Single Chip     "
[2] cap.bus_info: "usb-0000:00:1d.0-2"
[2] cap.capabilities=0x05000001
[2] - VIDEO_CAPTURE
[2] - READWRITE
[2] - STREAMING
[2] Unable to query input 1 VIDIOC_ENUMINPUT: Invalid argument
[2] ioctl (VIDIOCGCHAN): Invalid argument
[2] Using VIDEO_PALETTE_YUV420P palette
[2] Using V4L1
[2] File of type 8 saved to: /home/giuseppe/Video//cam2-01-20101028182120.avi
[2] sync error in proc 2996: Invalid argument
[2] mcapture error in proc 2996: Invalid argument
[2] Video device fatal error - Closing video device
[2] Closing video device /dev/video1
[1] File of type 8 saved to: /home/giuseppe/Video//cam1-01-20101028182122.avi
[2] Retrying until successful connection with camera
[2] cap.driver: "pac207"
[2] cap.card: "CIF Single Chip     "
[2] cap.bus_info: "usb-0000:00:1d.0-2"
[2] cap.capabilities=0x05000001
[2] - VIDEO_CAPTURE
[2] - READWRITE
[2] - STREAMING
[2] Unable to query input 1 VIDIOC_ENUMINPUT: Invalid argument
[2] ioctl (VIDIOCGCHAN): Invalid argument
[2] Using VIDEO_PALETTE_YUV420P palette
[2] Using V4L1
[2] sync error in proc 2996: Invalid argument
[2] mcapture error in proc 2996: Invalid argument
[2] Video device fatal error - Closing video device
[2] Closing video device /dev/video1
-----------the "retrying until successful connection with camera" part keeps repeating until motion closed ----------------------------



####################################
# /var/log/messages
####################################
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [0] Processing thread 0 - config file /etc/motion/motion.conf
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [0] Processing config file /etc/motion/thread1.conf
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [0] Processing config file /etc/motion/thread2.conf
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [0] Motion 3.2.12 Started
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [0] ffmpeg LIBAVCODEC_BUILD 3426306 LIBAVFORMAT_BUILD 3424258
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [0] Thread 1 is from /etc/motion/thread1.conf
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [0] Thread 2 is from /etc/motion/thread2.conf
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [1] cap.driver: "uvcvideo"
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [1] cap.card: "UVC Camera (046d:09a4)"
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [1] cap.bus_info: "usb-0000:00:1d.7-3"
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [1] cap.capabilities=0x04000001
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [1] - VIDEO_CAPTURE
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [1] - STREAMING
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [1] Config palette index 8 (YU12) doesn't work.
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [1] Supported palettes:
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [1] 0: MJPG (MJPEG)
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [1] 1: YUYV (YUV 4:2:2 (YUYV))
Oct 28 18:21:09 giuseppe-Satellite-M40 motion: [1] Selected palette YUYV
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [1] Test palette YUYV (352x288)
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [1] Using palette YUYV (352x288) bytesperlines 704 sizeimage 202752 colorspace 00000008
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [1] found control 0x00980900, "Brightness", range 0,255 
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [1] #011"Brightness", default 128, current 128
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [1] found control 0x00980901, "Contrast", range 0,255 
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [1] #011"Contrast", default 32, current 32
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [1] found control 0x00980902, "Saturation", range 0,255 
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [1] #011"Saturation", default 32, current 32
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [1] found control 0x00980913, "Gain", range 0,255 
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [1] #011"Gain", default 0, current 206
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [2] cap.driver: "pac207"
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [2] cap.card: "CIF Single Chip     "
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [2] cap.bus_info: "usb-0000:00:1d.0-2"
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [2] cap.capabilities=0x05000001
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [2] - VIDEO_CAPTURE
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [2] - READWRITE
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [2] - STREAMING
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [1] Resizing pre_capture buffer to 1 items
Oct 28 18:21:10 giuseppe-Satellite-M40 kernel: [20882.224756] gspca: found int in endpoint: 0x83, buffer_len=2, interval=50
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [2] Resizing pre_capture buffer to 1 items
Oct 28 18:21:10 giuseppe-Satellite-M40 motion: [2] Closing video device /dev/video1
Oct 28 18:21:10 giuseppe-Satellite-M40 kernel: [20882.760356] gspca: found int in endpoint: 0x83, buffer_len=2, interval=50
Oct 28 18:21:20 giuseppe-Satellite-M40 motion: [2] cap.driver: "pac207"
Oct 28 18:21:20 giuseppe-Satellite-M40 motion: [2] cap.card: "CIF Single Chip     "
Oct 28 18:21:20 giuseppe-Satellite-M40 motion: [2] cap.bus_info: "usb-0000:00:1d.0-2"
Oct 28 18:21:20 giuseppe-Satellite-M40 motion: [2] cap.capabilities=0x05000001
Oct 28 18:21:20 giuseppe-Satellite-M40 motion: [2] - VIDEO_CAPTURE
Oct 28 18:21:20 giuseppe-Satellite-M40 motion: [2] - READWRITE
Oct 28 18:21:20 giuseppe-Satellite-M40 motion: [2] - STREAMING
Oct 28 18:21:20 giuseppe-Satellite-M40 kernel: [20892.210031] gspca: found int in endpoint: 0x83, buffer_len=2, interval=50
Oct 28 18:21:20 giuseppe-Satellite-M40 motion: [2] Closing video device /dev/video1
Oct 28 18:21:20 giuseppe-Satellite-M40 kernel: [20892.894911] gspca: found int in endpoint: 0x83, buffer_len=2, interval=50
Oct 28 18:21:30 giuseppe-Satellite-M40 motion: [2] cap.driver: "pac207"
Oct 28 18:21:30 giuseppe-Satellite-M40 motion: [2] cap.card: "CIF Single Chip     "
Oct 28 18:21:30 giuseppe-Satellite-M40 motion: [2] cap.bus_info: "usb-0000:00:1d.0-2"
Oct 28 18:21:30 giuseppe-Satellite-M40 motion: [2] cap.capabilities=0x05000001
Oct 28 18:21:30 giuseppe-Satellite-M40 motion: [2] - VIDEO_CAPTURE
Oct 28 18:21:30 giuseppe-Satellite-M40 motion: [2] - READWRITE
Oct 28 18:21:30 giuseppe-Satellite-M40 motion: [2] - STREAMING
Oct 28 18:21:30 giuseppe-Satellite-M40 kernel: [20902.216303] gspca: found int in endpoint: 0x83, buffer_len=2, interval=50
Oct 28 18:21:30 giuseppe-Satellite-M40 motion: [2] Closing video device /dev/video1
Oct 28 18:21:30 giuseppe-Satellite-M40 kernel: [20902.975189] gspca: found int in endpoint: 0x83, buffer_len=2, interval=50
----------------- the pac207 part keeps repeating until motion closed ----------------------------------------------------------

Environment

Motion version: 3.2.12
ffmpeg version: 0.6-4:0.6-2ubuntu6
Libraries: ffmpeg
Server OS: ubuntu 10.10 i686, 2.6.35-23-generic
-- OctavianStolnicu - 28 Oct 2010

Answer

I figured it out. I was running motion with LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so.

I saw that there is a v4l1compat.so so i tried running with it instead of v4l2convert.so and it started working.

Guess it's an old cam. Thanx anyway.
Topic revision: r2 - 29 Oct 2010, OctavianStolnicu
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.