Здравствуйте. Возникла следующая проблема. Судя по всему не новая, но решить так и не удалось. Стоит Ubuntu Server 13.10, Motion и две web-камеры A4 PK-910H. Одна камера работает без проблем. Но вторая не запускается.
# motion -n
- Processing thread 0 - config file /etc/motion/motion.conf
[0] Processing config file /etc/motion/camera01.conf
- Processing config file /etc/motion/camera02.conf
[0] Motion 3.2.12 Started
- ffmpeg LIBAVCODEC_BUILD 3482368 LIBAVFORMAT_BUILD 3478785
[0] Thread 1 is from /etc/motion/camera01.conf
- Thread 2 is from /etc/motion/camera02.conf
[1] Thread 1 started
[2] Thread 2 started
[1] cap.driver: "uvcvideo"
[1] cap.card: "A4 TECH HD PC Camera"
[1] cap.bus_info: "usb-0000:00:14.0-4.3"
- motion-httpd/3.2.12 running, accepting connections
[1] cap.capabilities=0x84000001
- motion-httpd: waiting for data on port TCP 8100
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Config palette index 0 (S910) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] 1: MJPG (MJPEG)
[1] Selected palette YUYV
[1] VIDIOC_TRY_FMT failed for format YUYV: Input/output error
[1] Unable to find a compatible palette format.
[1] ioctl (VIDIOCGCAP): Inappropriate ioctl for device
[1] Could not fetch initial image from camera
[1] Motion continues using width and height from config file(s)
[1] Resizing pre_capture buffer to 1 items
[2] cap.driver: "uvcvideo"
[2] cap.card: "A4 TECH HD PC Camera"
[2] cap.bus_info: "usb-0000:00:14.0-4.2"
[2] cap.capabilities=0x84000001
[2] - VIDEO_CAPTURE
[2] - STREAMING
[2] Config palette index 0 (S910) doesn't work.
[2] Supported palettes:
[2] 0: YUYV (YUV 4:2:2 (YUYV))
[2] 1: MJPG (MJPEG)
[2] Selected palette YUYV
[2] Test palette YUYV (320x240)
[2] Adjusting resolution from 320x240 to 352x288.
[2] Using palette YUYV (352x288) bytesperlines 704 sizeimage 202752 colorspace 0 0000000
[2] found control 0x00980900, "Brightness", range -10,10
[2] "Brightness", default 1, current 1
[2] found control 0x00980901, "Contrast", range 1,32
[2] "Contrast", default 16, current 16
[2] found control 0x00980902, "Saturation", range 0,32
[2] "Saturation", default 17, current 17
[2] found control 0x00980903, "Hue", range -5,5
[2] "Hue", default 0, current 0
[2] found control 0x00980910, "Gamma", range 100,200
[2] "Gamma", default 150, current 150
[2] mmap information:
[2] frames=4
[2] 0 length=202752
[2] 1 length=202752
[2] 2 length=202752
[2] 3 length=202752
[2] Using V4L2
[2] Resizing pre_capture buffer to 1 items
[1] Retrying until successful connection with camera
[1] cap.driver: "uvcvideo"
[1] cap.card: "A4 TECH HD PC Camera"
[1] cap.bus_info: "usb-0000:00:14.0-4.3"
[1] cap.capabilities=0x84000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Config palette index 0 (S910) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] 1: MJPG (MJPEG)
[1] Selected palette YUYV
[1] VIDIOC_TRY_FMT failed for format YUYV: Input/output error
[1] Unable to find a compatible palette format.
[1] ioctl (VIDIOCGCAP): Inappropriate ioctl for device
[1] Retrying until successful connection with camera
[1] cap.driver: "uvcvideo"
[1] cap.card: "A4 TECH HD PC Camera"
[1] cap.bus_info: "usb-0000:00:14.0-4.3"
[1] cap.capabilities=0x84000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Config palette index 0 (S910) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] 1: MJPG (MJPEG)
[1] Selected palette YUYV
[1] Test palette YUYV (320x240)
[1] Adjusting resolution from 320x240 to 352x288.
[1] Using palette YUYV (352x288) bytesperlines 704 sizeimage 202752 colorspace 0 0000000
[1] found control 0x00980900, "Brightness", range -10,10
[1] "Brightness", default 1, current 1
[1] found control 0x00980901, "Contrast", range 1,32
[1] "Contrast", default 16, current 16
[1] found control 0x00980902, "Saturation", range 0,32
[1] "Saturation", default 17, current 17
[1] found control 0x00980903, "Hue", range -5,5
[1] "Hue", default 0, current 0
[1] found control 0x00980910, "Gamma", range 100,200
[1] "Gamma", default 150, current 150
[1] mmap information:
[1] frames=4
[1] 0 length=202752
[1] 1 length=202752
[1] 2 length=202752
[1] 3 length=202752
[1] Error starting stream VIDIOC_STREAMON: No space left on device
[1] ioctl (VIDIOCGCAP): Inappropriate ioctl for device
[2] File of type 8 saved to: /RAID/cam_capture/Camera-02/2013-11-10---21-00-00.avi
[1] Retrying until successful connection with camera
[1] cap.driver: "uvcvideo"
[1] cap.card: "A4 TECH HD PC Camera"
[1] cap.bus_info: "usb-0000:00:14.0-4.3"
[1] cap.capabilities=0x84000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Error selecting input 0 VIDIOC_S_INPUT: Device or resource busy
[1] ioctl (VIDIOCGCAP): Inappropriate ioctl for device
[1] Retrying until successful connection with camera
[1] cap.driver: "uvcvideo"
[1] cap.card: "A4 TECH HD PC Camera"
[1] cap.bus_info: "usb-0000:00:14.0-4.3"
[1] cap.capabilities=0x84000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Error selecting input 0 VIDIOC_S_INPUT: Device or resource busy
[1] ioctl (VIDIOCGCAP): Inappropriate ioctl for device
[1] Video signal lost - Adding grey image
[1] Retrying until successful connection with camera
[1] cap.driver: "uvcvideo"
[1] cap.card: "A4 TECH HD PC Camera"
[1] cap.bus_info: "usb-0000:00:14.0-4.3"
[1] cap.capabilities=0x84000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Error selecting input 0 VIDIOC_S_INPUT: Device or resource busy
[1] ioctl (VIDIOCGCAP): Inappropriate ioctl for device
^C[2] Thread exiting
[2] Calling vid_close() from motion_cleanup
[2] Closing video device /dev/video1
[1] Thread exiting
- httpd - Finishing
[0] httpd Closing
- httpd thread exit
[0] Motion terminating
Камеры в данном случае подключены через USB хаб в USB 2.0. Если одну камеру подключить к 2.0, а другую к 3.0, то при разрешении 320*240 всё работает, при большем уже нет. Плюс ко всему групп портов всего 3 (2xUSB2.0 + 2xUSB2.0 + 2xUSB3.0), а камер планируется 9 шт., так что подключить в разные группы не удастся. Кто-нибудь предложит вариант решения проблемы, или возможно камеры с микрофонами, которые без проблем будут работать вместе.
uname -a
Linux SRV 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 0ac8:3500 Z-Star Microelectronics Corp.
Bus 003 Device 004: ID 0ac8:3500 Z-Star Microelectronics Corp.
Bus 003 Device 002: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 003 Device 003: ID 045e:0797 Microsoft Corp.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
lspci
00:00.0 Host bridge: Intel Corporation 4th Gen Core Processor DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d5)
00:1c.1 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #2 (rev d5)
00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d5)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation C220 Series Chipset Family H81 Express LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 05)
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 05)
03:00.0 USB controller: ASMedia Technology Inc. Device 1142
04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
dmesg | tail
[ 51.590391] input: A4 TECH HD PC Camera as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.2/3-4.2:1.0/input/input13
[ 81.563890] uvcvideo: Failed to set UVC probe control : -32 (exp. 26).
[ 86.559357] uvcvideo: Failed to set UVC probe control : -110 (exp. 26).
[ 96.551167] uvcvideo: Failed to set UVC probe control : -32 (exp. 26).
[ 101.546614] uvcvideo: Failed to set UVC probe control : -110 (exp. 26).
[ 101.549298] usbcore: registered new interface driver snd-usb-audio
[ 101.554708] usbcore: registered new interface driver uvcvideo
[ 101.554717] USB Video Class driver (1.1.1)
[ 103.403352] usb 3-4.3: Not enough bandwidth for new device state.
[ 103.403365] usb 3-4.3: Not enough bandwidth for altsetting 7