BUG: Two USB cams on reporting to same Motion
System information:
Debian Squeeze 6.0.0
Kernel: 2.6.32-5-xen-amd64
Motion: 3.2.12
2x Logitech HD Webcam C270
I have two Logitech HD Webcam C270 and when I run one of them at a time motion works just fine, no errors and it records my video footages without problem, but in the same second I add both of them to motion it fails.
I have tried to run motion on one cam and Cheese on the other and that works, also when you flip the role, I have tried running both cams with Cheese at the same time and no problem, so its not the USB-controller, the two cams a plugged in to the motherboard on the same controller 00:13.2:2 and 00:13.2:4, I have also tried on two different controllers and one USB2- and one USB3-controller, so I can without a dough say that its not a hardware problem.
When cams running separately only change in conf-files is that one of the following lines in motionBoth.conf have bin removed:
thread /etc/motion/gang.conf
thread /etc/motion/bib.conf
=== motionBoth.conf ===
target_dir /var/www/motion
netcam_tolerant_check off
despeckle EedDl
smart_mask_speed 0
lightswitch 0
minimum_motion_frames 1
pre_capture 0
post_capture 0
gap 60
max_mpeg_time 0
output_all off
output_motion off
quality 75
ppm off
ffmpeg_cap_new on
ffmpeg_cap_motion off
ffmpeg_timelapse 0
ffmpeg_timelapse_mode daily
ffmpeg_bps 500000
ffmpeg_variable_bitrate 0
ffmpeg_video_codec swf
ffmpeg_deinterlace off
snapshot_interval 0
locate off
text_right %Y-%m-%d\n%T-%q
text_changes off
text_event %Y%m%d%H%M%S
text_double off
webcam_port 8081
webcam_quality 50
webcam_motion off
webcam_maxrate 1
webcam_localhost on
webcam_limit 0
control_port 8080
control_localhost on
control_html_output on
track_type 0
track_auto off
track_motorx 0
track_motory 0
track_maxx 0
track_maxy 0
track_iomojo_id 0
track_step_angle_x 10
track_step_angle_y 10
track_move_wait 10
track_speed 255
track_stepsize 40
quiet on
sql_log_image on
sql_log_snapshot on
sql_log_mpeg off
sql_log_timelapse off
sql_query insert into security(camera, filename, frame, file_type, time_stamp, event_time_stamp) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')
thread /etc/motion/gang.conf
thread /etc/motion/bib.conf
=== End motionBoth.conf ===
=== gang.conf ===
# gang i kaelder
width 1280
height 720
videodevice /dev/video1
v4l2_palette 6
input 8
norm 0
framerate 2
minimum_frame_time 0
text_left gang
jpeg_filename sidstegang
movie_filename gang%Y%m%d%H%M%S
=== End gang.conf ===
=== bib.conf ===
# gang i kaelder
width 1280
height 720
videodevice /dev/video0
v4l2_palette 6
input 8
norm 0
framerate 2
minimum_frame_time 0
text_left bib
rotate 270
jpeg_filename sidstebib
movie_filename bib%Y%m%d%H%M%S
=== End bib.conf ===
=== CAM1 ===
[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Processing config file /etc/motion/gang.conf
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3412993 LIBAVFORMAT_BUILD 3415808
[0] Thread 1 is from /etc/motion/gang.conf
[1] Thread 1 started
[0] motion-httpd/3.2.12 running, accepting connections
[1] cap.driver: "uvcvideo"
[0] motion-httpd: waiting for data on port TCP 8080
[1] cap.card: "UVC Camera (046d:0825)"
[1] cap.bus_info: "usb-0000:00:13.2-4"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Test palette YUYV (1280x720)
[1] Using palette YUYV (1280x720) bytesperlines 2560 sizeimage 1843200 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 20
[1] mmap information:
[1] frames=4
[1] 0 length=1843200
[1] 1 length=1843200
[1] 2 length=1843200
[1] 3 length=1843200
[1] Using V4L2
[1] Resizing pre_capture buffer to 1 items
[1] Started stream webcam server in port 8081
[0] httpd - Finishing
[0] httpd Closing
[0] httpd thread exit
[1] Thread exiting
[1] Calling vid_close() from motion_cleanup
[1] Closing video device /dev/video1
[0] Motion terminating
=== END CAM1 ===
=== CAM2 ===
[0] Processing thread 0 - config file /etc/motion/motion2.conf
[0] Processing config file /etc/motion/bib.conf
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3412993 LIBAVFORMAT_BUILD 3415808
[0] Thread 1 is from /etc/motion/bib.conf
[1] Thread 1 started
[0] motion-httpd/3.2.12 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8082
[1] cap.driver: "uvcvideo"
[1] cap.card: "UVC Camera (046d:0825)"
[1] cap.bus_info: "usb-0000:00:13.2-2"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Test palette YUYV (1280x720)
[1] Using palette YUYV (1280x720) bytesperlines 2560 sizeimage 1843200 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 32
[1] mmap information:
[1] frames=4
[1] 0 length=1843200
[1] 1 length=1843200
[1] 2 length=1843200
[1] 3 length=1843200
[1] Using V4L2
[1] Resizing pre_capture buffer to 1 items
[1] Started stream webcam server in port 8083
[1] Thread exiting
[1] Calling vid_close() from motion_cleanup
[1] Closing video device /dev/video0
[0] httpd - Finishing
[0] httpd Closing
[0] httpd thread exit
[0] Motion terminating
=== END CAM2 ===
=== BOTH CAMs ===
[0] Processing thread 0 - config file /etc/motion/motionBoth.conf
[0] Processing config file /etc/motion/gang.conf
[0] Processing config file /etc/motion/bib.conf
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3412993 LIBAVFORMAT_BUILD 3415808
[0] Thread 1 is from /etc/motion/gang.conf
[0] Webcam port number 8081 for thread 1 conflicts with thread 0
[0] Webcam feature for thread 1 is disabled.
[0] Thread 2 is from /etc/motion/bib.conf
[1] Thread 1 started
[1] cap.driver: "uvcvideo"
[0] motion-httpd/3.2.12 running, accepting connections
[1] cap.card: "UVC Camera (046d:0825)"
[0] motion-httpd: waiting for data on port TCP 8080
[1] cap.bus_info: "usb-0000:00:13.2-4"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[2] Thread 2 started
[1] Test palette YUYV (1280x720)
[1] Using palette YUYV (1280x720) bytesperlines 2560 sizeimage 1843200 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 20
[1] mmap information:
[1] frames=4
[1] 0 length=1843200
[1] 1 length=1843200
[1] 2 length=1843200
[1] 3 length=1843200
[1] Using V4L2
[2] cap.driver: "uvcvideo"
[2] cap.card: "UVC Camera (046d:0825)"
[2] cap.bus_info: "usb-0000:00:13.2-2"
[2] cap.capabilities=0x04000001
[2] - VIDEO_CAPTURE
[2] - STREAMING
[1] Resizing pre_capture buffer to 1 items
[2] Test palette YUYV (1280x720)
[2] Using palette YUYV (1280x720) bytesperlines 2560 sizeimage 1843200 colorspace 00000008
[2] found control 0x00980900, "Brightness", range 0,255
[2] "Brightness", default 128, current 128
[2] found control 0x00980901, "Contrast", range 0,255
[2] "Contrast", default 32, current 32
[2] found control 0x00980902, "Saturation", range 0,255
[2] "Saturation", default 32, current 32
[2] found control 0x00980913, "Gain", range 0,255
[2] "Gain", default 0, current 32
[2] mmap information:
[2] frames=4
[2] 0 length=1843200
[2] 1 length=1843200
[2] 2 length=1843200
[2] 3 length=1843200
[2] Error starting stream VIDIOC_STREAMON: No space left on device
[2] ioctl(VIDIOCGMBUF) - Error device does not support memory map
[2] V4L capturing using read is deprecated!
[2] Motion only supports mmap.
[2] Could not fetch initial image from camera
[2] Motion continues using width and height from config file(s)
[2] Resizing pre_capture buffer to 1 items
[2] Started stream webcam server in port 8081
[2] Retrying until successful connection with camera
[2] cap.driver: "uvcvideo"
[2] cap.card: "UVC Camera (046d:0825)"
[2] cap.bus_info: "usb-0000:00:13.2-2"
[2] cap.capabilities=0x04000001
[2] - VIDEO_CAPTURE
[2] - STREAMING
[2] Error selecting input 0 VIDIOC_S_INPUT: Device or resource busy
[2] ioctl(VIDIOCGMBUF) - Error device does not support memory map
[2] V4L capturing using read is deprecated!
[2] Motion only supports mmap.
[2] Retrying until successful connection with camera
[2] cap.driver: "uvcvideo"
[2] cap.card: "UVC Camera (046d:0825)"
[2] cap.bus_info: "usb-0000:00:13.2-2"
[2] cap.capabilities=0x04000001
[2] - VIDEO_CAPTURE
[2] - STREAMING
[2] Error selecting input 0 VIDIOC_S_INPUT: Device or resource busy
[2] ioctl(VIDIOCGMBUF) - Error device does not support memory map
[2] V4L capturing using read is deprecated!
[2] Motion only supports mmap.
[2] Retrying until successful connection with camera
[2] cap.driver: "uvcvideo"
[2] cap.card: "UVC Camera (046d:0825)"
[2] cap.bus_info: "usb-0000:00:13.2-2"
[2] cap.capabilities=0x04000001
[2] - VIDEO_CAPTURE
[2] - STREAMING
[2] Error selecting input 0 VIDIOC_S_INPUT: Device or resource busy
[2] ioctl(VIDIOCGMBUF) - Error device does not support memory map
[2] V4L capturing using read is deprecated!
[2] Motion only supports mmap.
[2] Video signal lost - Adding grey image
[2] Retrying until successful connection with camera
[2] cap.driver: "uvcvideo"
[2] cap.card: "UVC Camera (046d:0825)"
[2] cap.bus_info: "usb-0000:00:13.2-2"
[2] cap.capabilities=0x04000001
[2] - VIDEO_CAPTURE
[2] - STREAMING
[2] Error selecting input 0 VIDIOC_S_INPUT: Device or resource busy
[2] ioctl(VIDIOCGMBUF) - Error device does not support memory map
[2] V4L capturing using read is deprecated!
[2] Motion only supports mmap.
[2] Retrying until successful connection with camera
[2] cap.driver: "uvcvideo"
[2] cap.card: "UVC Camera (046d:0825)"
[2] cap.bus_info: "usb-0000:00:13.2-2"
[2] cap.capabilities=0x04000001
[2] - VIDEO_CAPTURE
[2] - STREAMING
[2] Error selecting input 0 VIDIOC_S_INPUT: Device or resource busy
[2] ioctl(VIDIOCGMBUF) - Error device does not support memory map
[2] V4L capturing using read is deprecated!
[2] Motion only supports mmap.
[2] Thread exiting
[1] Thread exiting
[1] Calling vid_close() from motion_cleanup
[1] Closing video device /dev/video1
[0] httpd - Finishing
[0] httpd Closing
[0] httpd thread exit
[0] Motion terminating
=== END BOTH CAMs ===
Environment
Motion version: |
3.2.12 |
ffmpeg version: |
SVN-r0.5.2-4:0.5.2-6 |
Shared libraries: |
ffmpeg, mysql, postgresql |
Server OS: |
Debian Squeeze, kernel 2.6.32-5-xen-amd64 |
--
HenrikDigeSemark - 25 Feb 2011
Follow up
A year later, same kernel, same release, same distro, same problem.
--
GillesLatulipe - 04 Mar 2012
Fix record