编辑:我添加了一些来自telcoMsudo lsusb
和sudo dmesg
下面 telcoM 建议的附加信息。我有一台可以使用的相机,还有一台来自同一制造商的类似相机,它不能在 Linux 上运行,但可以在 Windows 上运行。
当我将网络摄像头插入 USB 端口时,它没有被检测为摄像头。
lsusb
这是插入相机之前的输出:
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 8087:0026 Intel Corp.
Bus 001 Device 003: ID 0c45:6720 Microdia Integrated_Webcam_HD
Bus 001 Device 002: ID 0a5c:5842 Broadcom Corp. 58200
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 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 025: ID 32e4:8830
Bus 002 Device 024: ID 2109:8110 VIA Labs, Inc. Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 8087:0026 Intel Corp.
Bus 001 Device 003: ID 0c45:6720 Microdia Integrated_Webcam_HD
Bus 001 Device 002: ID 0a5c:5842 Broadcom Corp. 58200
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
我可以看到已经添加了一个设备。运行sudo lsusb -D /dev/bus/usb/002/025
给出:
Device: ID 32e4:8830
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 9
idVendor 0x32e4
idProduct 0x8830
bcdDevice 1.00
iManufacturer 2 HD USB Camera
iProduct 1 HD USB Camera
iSerial 3 2020040501
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x038d
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 256mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 14 Video
bFunctionSubClass 3 Video Interface Collection
bFunctionProtocol 0
iFunction 5 HD USB Camera
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 1 Video Control
bInterfaceProtocol 0
iInterface 5 HD USB Camera
VideoControl Interface Descriptor:
bLength 13
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdUVC 1.00
wTotalLength 0x006c
dwClockFrequency 15.000000MHz
bInCollection 1
baInterfaceNr( 0) 1
VideoControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 5
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bSourceID 4
iTerminal 0
VideoControl Interface Descriptor:
bLength 28
bDescriptorType 36
bDescriptorSubtype 6 (EXTENSION_UNIT)
bUnitID 3
guidExtensionCode {28f03370-6311-4a2e-ba2c-6890eb334016}
bNumControl 24
bNrPins 1
baSourceID( 0) 2
bControlSize 3
bmControls( 0) 0xff
bmControls( 1) 0xff
bmControls( 2) 0xff
iExtension 0
VideoControl Interface Descriptor:
bLength 29
bDescriptorType 36
bDescriptorSubtype 6 (EXTENSION_UNIT)
bUnitID 4
guidExtensionCode {bd5321b4-d635-ca45-b203-4e0149b301bc}
bNumControl 32
bNrPins 1
baSourceID( 0) 3
bControlSize 4
bmControls( 0) 0x03
bmControls( 1) 0x80
bmControls( 2) 0x3f
bmControls( 3) 0x9f
iExtension 0
VideoControl Interface Descriptor:
bLength 18
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType 0x0201 Camera Sensor
bAssocTerminal 0
iTerminal 0
wObjectiveFocalLengthMin 0
wObjectiveFocalLengthMax 0
wOcularFocalLength 0
bControlSize 3
bmControls 0x0000000e
Auto-Exposure Mode
Auto-Exposure Priority
Exposure Time (Absolute)
VideoControl Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 5 (PROCESSING_UNIT)
Warning: Descriptor too short
bUnitID 2
bSourceID 1
wMaxMultiplier 0
bControlSize 2
bmControls 0x0000177f
Brightness
Contrast
Hue
Saturation
Sharpness
Gamma
White Balance Temperature
Backlight Compensation
Gain
Power Line Frequency
White Balance Temperature, Auto
iProcessing 0
bmVideoStandards 0x00
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0010 1x 16 bytes
bInterval 6
bMaxBurst 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0400 1x 1024 bytes
bInterval 1
bMaxBurst 0
INTERFACE CLASS: 0f 24 01 02 df 02 82 00 05 02 01 01 01 00 00
INTERFACE CLASS: 0b 24 06 01 0a 00 01 00 00 00 00
INTERFACE CLASS: 1e 24 07 01 00 40 06 b0 04 00 40 77 1b 00 40 77 1b 4d 9a 3a 00 2a 2c 0a 00 01 2a 2c 0a 00
INTERFACE CLASS: 1e 24 07 02 00 c0 0c 90 09 00 40 4d 72 00 40 4d 72 4d da f3 00 2a 2c 0a 00 01 2a 2c 0a 00
INTERFACE CLASS: 1e 24 07 03 00 20 0a 98 07 00 d0 14 48 00 d0 14 48 4d c8 99 00 2a 2c 0a 00 01 2a 2c 0a 00
INTERFACE CLASS: 1e 24 07 04 00 00 08 00 06 00 00 00 2d 00 00 00 2d 4d 02 60 00 2a 2c 0a 00 01 2a 2c 0a 00
INTERFACE CLASS: 1e 24 07 05 00 00 05 c0 03 00 00 94 11 00 00 94 11 4d 82 25 00 2a 2c 0a 00 01 2a 2c 0a 00
INTERFACE CLASS: 1e 24 07 06 00 00 04 00 03 00 00 80 16 00 00 80 16 4d 02 18 00 15 16 05 00 01 15 16 05 00
INTERFACE CLASS: 1e 24 07 07 00 20 03 58 02 00 a0 bb 0d 00 a0 bb 0d 4d a8 0e 00 15 16 05 00 01 15 16 05 00
INTERFACE CLASS: 1e 24 07 08 00 80 02 e0 01 00 00 ca 08 00 00 ca 08 4d 62 09 00 15 16 05 00 01 15 16 05 00
INTERFACE CLASS: 1e 24 07 09 00 40 01 f0 00 00 80 32 02 00 80 32 02 4d 5a 02 00 15 16 05 00 01 15 16 05 00
INTERFACE CLASS: 1e 24 07 0a 00 40 06 b0 04 00 40 77 1b 00 40 77 1b 4d 9a 3a 00 2a 2c 0a 00 01 2a 2c 0a 00
INTERFACE CLASS: 26 24 03 00 08 c0 0c 90 09 20 0a 98 07 00 08 00 06 40 06 b0 04 00 05 c0 03 00 04 00 03 20 03 58 02 80 02 e0 01 00
INTERFACE CLASS: 1b 24 04 02 0a 59 55 59 32 00 00 10 00 80 00 00 aa 00 38 9b 71 10 01 00 00 00 00
INTERFACE CLASS: 1e 24 05 01 00 40 06 b0 04 00 80 4f 12 00 80 4f 12 00 98 3a 00 40 42 0f 00 01 40 42 0f 00
INTERFACE CLASS: 1e 24 05 02 00 c0 0c 90 09 00 80 3d 0f 00 80 3d 0f 00 d8 f3 00 40 4b 4c 00 01 40 4b 4c 00
INTERFACE CLASS: 1e 24 05 03 00 20 0a 98 07 00 90 6a 0e 00 90 6a 0e 00 c6 99 00 d5 dc 32 00 01 d5 dc 32 00
INTERFACE CLASS: 1e 24 05 04 00 00 08 00 06 00 00 00 09 00 00 00 09 00 00 60 00 d5 dc 32 00 01 d5 dc 32 00
INTERFACE CLASS: 1e 24 05 05 00 00 05 c0 03 00 00 b8 0b 00 00 b8 0b 00 80 25 00 40 42 0f 00 01 40 42 0f 00
INTERFACE CLASS: 1e 24 05 06 00 00 04 00 03 00 00 80 07 00 00 80 07 00 00 18 00 40 42 0f 00 01 40 42 0f 00
INTERFACE CLASS: 1e 24 05 07 00 20 03 58 02 00 a0 bb 0d 00 a0 bb 0d 00 a6 0e 00 15 16 05 00 01 15 16 05 00
INTERFACE CLASS: 1e 24 05 08 00 80 02 e0 01 00 00 ca 08 00 00 ca 08 00 60 09 00 15 16 05 00 01 15 16 05 00
INTERFACE CLASS: 1e 24 05 09 00 40 01 f0 00 00 80 32 02 00 80 32 02 00 58 02 00 15 16 05 00 01 15 16 05 00
INTERFACE CLASS: 1e 24 05 0a 00 40 06 b0 04 00 80 4f 12 00 80 4f 12 00 98 3a 00 40 42 0f 00 01 40 42 0f 00
INTERFACE CLASS: 26 24 03 00 08 c0 0c 90 09 20 0a 98 07 00 08 00 06 40 06 b0 04 00 05 c0 03 00 04 00 03 20 03 58 02 80 02 e0 01 00
INTERFACE CLASS: 06 24 0d 01 01 04
Binary Object Store Descriptor:
bLength 5
bDescriptorType 15
wTotalLength 0x0016
bNumDeviceCaps 2
USB 2.0 Extension Device Capability:
bLength 7
bDescriptorType 16
bDevCapabilityType 2
bmAttributes 0x00000002
HIRD Link Power Management (LPM) Supported
SuperSpeed USB Device Capability:
bLength 10
bDescriptorType 16
bDevCapabilityType 3
bmAttributes 0x00
wSpeedsSupported 0x000c
Device can operate at High Speed (480Mbps)
Device can operate at SuperSpeed (5Gbps)
bFunctionalitySupport 2
Lowest fully-functional device speed is High Speed (480Mbps)
bU1DevExitLat 4 micro seconds
bU2DevExitLat 231 micro seconds
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x000c
(Bus Powered)
U1 Enabled
U2 Enabled
运行时v4l2-ctl --list-devices
仅显示我的集成摄像头,而不是我刚刚插入的 USB 摄像头。
Integrated_Webcam_HD: Integrate (usb-0000:00:14.0-11):
/dev/video0
/dev/video1
当我udevadm monitor
在插入相机时运行时,我看到以下内容:
KERNEL[6495.827968] add /devices/pci0000:00/0000:00:14.0/usb2/2-4 (usb)
KERNEL[6495.830203] add /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0 (usb)
KERNEL[6495.831815] bind /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0 (usb)
KERNEL[6495.831900] bind /devices/pci0000:00/0000:00:14.0/usb2/2-4 (usb)
UDEV [6495.838037] add /devices/pci0000:00/0000:00:14.0/usb2/2-4 (usb)
UDEV [6495.839827] add /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0 (usb)
UDEV [6495.841660] bind /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0 (usb)
UDEV [6495.844529] bind /devices/pci0000:00/0000:00:14.0/usb2/2-4 (usb)
KERNEL[6498.523402] add /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2 (usb)
KERNEL[6498.528879] add /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2/2-4.2:1.0 (usb)
KERNEL[6498.534396] add /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2/2-4.2:1.0/media1 (media)
KERNEL[6498.534515] add /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2/2-4.2:1.0/input/input34 (input)
KERNEL[6498.534826] add /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2/2-4.2:1.0/input/input34/event13 (input)
KERNEL[6498.534898] bind /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2/2-4.2:1.0 (usb)
KERNEL[6498.534955] add /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2/2-4.2:1.1 (usb)
KERNEL[6498.535019] bind /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2 (usb)
UDEV [6498.542294] add /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2 (usb)
UDEV [6498.545007] add /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2/2-4.2:1.1 (usb)
UDEV [6498.545291] add /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2/2-4.2:1.0 (usb)
UDEV [6498.546363] add /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2/2-4.2:1.0/media1 (media)
UDEV [6498.547609] add /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2/2-4.2:1.0/input/input34 (input)
UDEV [6498.617161] add /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2/2-4.2:1.0/input/input34/event13 (input)
UDEV [6498.621564] bind /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2/2-4.2:1.0 (usb)
UDEV [6498.626172] bind /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2 (usb)
有很多操作,但与 video4linux 设备无关。
这是相关部分sudo dmesg
:
[93748.440857] usb 2-4: new SuperSpeed USB device number 24 using xhci_hcd
[93748.697861] usb 2-4: New USB device found, idVendor=2109, idProduct=8110, bcdDevice= 2.90
[93748.697873] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[93748.697877] usb 2-4: Product: USB3.0 Hub
[93748.697880] usb 2-4: Manufacturer: VIA Labs, Inc.
[93748.700414] hub 2-4:1.0: USB hub found
[93748.700656] hub 2-4:1.0: 2 ports detected
[93751.387006] usb 2-4.2: new SuperSpeed USB device number 25 using xhci_hcd
[93751.477156] usb 2-4.2: New USB device found, idVendor=32e4, idProduct=8830, bcdDevice= 1.00
[93751.477168] usb 2-4.2: New USB device strings: Mfr=2, Product=1, SerialNumber=3
[93751.477173] usb 2-4.2: Product: HD USB Camera
[93751.477176] usb 2-4.2: Manufacturer: HD USB Camera
[93751.477179] usb 2-4.2: SerialNumber: 2020040501
[93751.483406] usb 2-4.2: Found UVC 1.00 device HD USB Camera (32e4:8830)
[93751.488907] usb 2-4.2: No streaming interface found for terminal 5.
[93751.489209] input: HD USB Camera: HD USB Camera as /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.2/2-4.2:1.0/input/input41
相比之下,当我插入可以工作的相机时,以下是相同的输出。第一的sudo lsusb -D /dev/bus/usb/001/014
Device: ID 32e4:8830
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.01
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x32e4
idProduct 0x8830
bcdDevice 1.00
iManufacturer 2 HD USB Camera
iProduct 1 HD USB Camera
iSerial 3 2020040498
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0381
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 256mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 14 Video
bFunctionSubClass 3 Video Interface Collection
bFunctionProtocol 0
iFunction 5 HD USB Camera
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 1 Video Control
bInterfaceProtocol 0
iInterface 5 HD USB Camera
VideoControl Interface Descriptor:
bLength 13
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdUVC 1.00
wTotalLength 0x006c
dwClockFrequency 15.000000MHz
bInCollection 1
baInterfaceNr( 0) 1
VideoControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 5
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bSourceID 4
iTerminal 0
VideoControl Interface Descriptor:
bLength 28
bDescriptorType 36
bDescriptorSubtype 6 (EXTENSION_UNIT)
bUnitID 3
guidExtensionCode {28f03370-6311-4a2e-ba2c-6890eb334016}
bNumControl 24
bNrPins 1
baSourceID( 0) 2
bControlSize 3
bmControls( 0) 0xff
bmControls( 1) 0xff
bmControls( 2) 0xff
iExtension 0
VideoControl Interface Descriptor:
bLength 29
bDescriptorType 36
bDescriptorSubtype 6 (EXTENSION_UNIT)
bUnitID 4
guidExtensionCode {bd5321b4-d635-ca45-b203-4e0149b301bc}
bNumControl 32
bNrPins 1
baSourceID( 0) 3
bControlSize 4
bmControls( 0) 0x03
bmControls( 1) 0x80
bmControls( 2) 0x3f
bmControls( 3) 0x9f
iExtension 0
VideoControl Interface Descriptor:
bLength 18
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType 0x0201 Camera Sensor
bAssocTerminal 0
iTerminal 0
wObjectiveFocalLengthMin 0
wObjectiveFocalLengthMax 0
wOcularFocalLength 0
bControlSize 3
bmControls 0x0000000e
Auto-Exposure Mode
Auto-Exposure Priority
Exposure Time (Absolute)
VideoControl Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 5 (PROCESSING_UNIT)
Warning: Descriptor too short
bUnitID 2
bSourceID 1
wMaxMultiplier 0
bControlSize 2
bmControls 0x0000177f
Brightness
Contrast
Hue
Saturation
Sharpness
Gamma
White Balance Temperature
Backlight Compensation
Gain
Power Line Frequency
White Balance Temperature, Auto
iProcessing 0
bmVideoStandards 0x00
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0010 1x 16 bytes
bInterval 6
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
INTERFACE CLASS: 0f 24 01 02 df 02 82 00 05 02 01 01 01 00 00
INTERFACE CLASS: 0b 24 06 01 0a 00 01 00 00 00 00
INTERFACE CLASS: 1e 24 07 01 00 40 06 b0 04 00 40 77 1b 00 40 77 1b 4d 9a 3a 00 2a 2c 0a 00 01 2a 2c 0a 00
INTERFACE CLASS: 1e 24 07 02 00 c0 0c 90 09 00 40 4d 72 00 40 4d 72 4d da f3 00 2a 2c 0a 00 01 2a 2c 0a 00
INTERFACE CLASS: 1e 24 07 03 00 20 0a 98 07 00 d0 14 48 00 d0 14 48 4d c8 99 00 2a 2c 0a 00 01 2a 2c 0a 00
INTERFACE CLASS: 1e 24 07 04 00 00 08 00 06 00 00 00 2d 00 00 00 2d 4d 02 60 00 2a 2c 0a 00 01 2a 2c 0a 00
INTERFACE CLASS: 1e 24 07 05 00 00 05 c0 03 00 00 94 11 00 00 94 11 4d 82 25 00 2a 2c 0a 00 01 2a 2c 0a 00
INTERFACE CLASS: 1e 24 07 06 00 00 04 00 03 00 00 80 16 00 00 80 16 4d 02 18 00 15 16 05 00 01 15 16 05 00
INTERFACE CLASS: 1e 24 07 07 00 20 03 58 02 00 a0 bb 0d 00 a0 bb 0d 4d a8 0e 00 15 16 05 00 01 15 16 05 00
INTERFACE CLASS: 1e 24 07 08 00 80 02 e0 01 00 00 ca 08 00 00 ca 08 4d 62 09 00 15 16 05 00 01 15 16 05 00
INTERFACE CLASS: 1e 24 07 09 00 40 01 f0 00 00 80 32 02 00 80 32 02 4d 5a 02 00 15 16 05 00 01 15 16 05 00
INTERFACE CLASS: 1e 24 07 0a 00 40 06 b0 04 00 40 77 1b 00 40 77 1b 4d 9a 3a 00 2a 2c 0a 00 01 2a 2c 0a 00
INTERFACE CLASS: 26 24 03 00 08 c0 0c 90 09 20 0a 98 07 00 08 00 06 40 06 b0 04 00 05 c0 03 00 04 00 03 20 03 58 02 80 02 e0 01 00
INTERFACE CLASS: 1b 24 04 02 0a 59 55 59 32 00 00 10 00 80 00 00 aa 00 38 9b 71 10 01 00 00 00 00
INTERFACE CLASS: 1e 24 05 01 00 40 06 b0 04 00 80 4f 12 00 80 4f 12 00 98 3a 00 40 42 0f 00 01 40 42 0f 00
INTERFACE CLASS: 1e 24 05 02 00 c0 0c 90 09 00 80 3d 0f 00 80 3d 0f 00 d8 f3 00 40 4b 4c 00 01 40 4b 4c 00
INTERFACE CLASS: 1e 24 05 03 00 20 0a 98 07 00 90 6a 0e 00 90 6a 0e 00 c6 99 00 d5 dc 32 00 01 d5 dc 32 00
INTERFACE CLASS: 1e 24 05 04 00 00 08 00 06 00 00 00 09 00 00 00 09 00 00 60 00 d5 dc 32 00 01 d5 dc 32 00
INTERFACE CLASS: 1e 24 05 05 00 00 05 c0 03 00 00 b8 0b 00 00 b8 0b 00 80 25 00 40 42 0f 00 01 40 42 0f 00
INTERFACE CLASS: 1e 24 05 06 00 00 04 00 03 00 00 80 07 00 00 80 07 00 00 18 00 40 42 0f 00 01 40 42 0f 00
INTERFACE CLASS: 1e 24 05 07 00 20 03 58 02 00 a0 bb 0d 00 a0 bb 0d 00 a6 0e 00 15 16 05 00 01 15 16 05 00
INTERFACE CLASS: 1e 24 05 08 00 80 02 e0 01 00 00 ca 08 00 00 ca 08 00 60 09 00 15 16 05 00 01 15 16 05 00
INTERFACE CLASS: 1e 24 05 09 00 40 01 f0 00 00 80 32 02 00 80 32 02 00 58 02 00 15 16 05 00 01 15 16 05 00
INTERFACE CLASS: 1e 24 05 0a 00 40 06 b0 04 00 80 4f 12 00 80 4f 12 00 98 3a 00 40 42 0f 00 01 40 42 0f 00
INTERFACE CLASS: 26 24 03 00 08 c0 0c 90 09 20 0a 98 07 00 08 00 06 40 06 b0 04 00 05 c0 03 00 04 00 03 20 03 58 02 80 02 e0 01 00
INTERFACE CLASS: 06 24 0d 01 01 04
Binary Object Store Descriptor:
bLength 5
bDescriptorType 15
wTotalLength 0x000c
bNumDeviceCaps 1
USB 2.0 Extension Device Capability:
bLength 7
bDescriptorType 16
bDevCapabilityType 2
bmAttributes 0x00000002
HIRD Link Power Management (LPM) Supported
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0002
(Bus Powered)
Remote Wakeup Enabled
对于udevadm monitor
有效的相机:
KERNEL[6682.722836] add /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
KERNEL[6682.724650] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
KERNEL[6682.736729] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/video4linux/video2 (video4linux)
KERNEL[6682.736795] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/video4linux/video3 (video4linux)
KERNEL[6682.736898] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/media1 (media)
KERNEL[6682.737039] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/input/input35 (input)
KERNEL[6682.737245] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/input/input35/event13 (input)
KERNEL[6682.737326] bind /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
KERNEL[6682.737401] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.1 (usb)
KERNEL[6682.737487] bind /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.1 (usb)
KERNEL[6682.737556] bind /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
UDEV [6682.761644] add /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
UDEV [6682.765782] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.1 (usb)
UDEV [6682.765844] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
UDEV [6682.768518] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/media1 (media)
UDEV [6682.769022] bind /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.1 (usb)
UDEV [6682.769206] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/video4linux/video3 (video4linux)
UDEV [6682.769302] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/video4linux/video2 (video4linux)
UDEV [6682.769715] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/input/input35 (input)
UDEV [6682.877079] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/input/input35/event13 (input)
UDEV [6682.880687] bind /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
UDEV [6682.891060] bind /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
最后sudo dmesg
:
[92330.404900] usb 1-3: new high-speed USB device number 11 using xhci_hcd
[92330.578969] usb 1-3: New USB device found, idVendor=32e4, idProduct=8830, bcdDevice= 1.00
[92330.578980] usb 1-3: New USB device strings: Mfr=2, Product=1, SerialNumber=3
[92330.578985] usb 1-3: Product: HD USB Camera
[92330.578989] usb 1-3: Manufacturer: HD USB Camera
[92330.578992] usb 1-3: SerialNumber: 2020040498
[92330.583178] usb 1-3: Found UVC 1.00 device HD USB Camera (32e4:8830)
[92330.594432] input: HD USB Camera: HD USB Camera as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/input/input39
主要区别似乎是No streaming interface found for terminal 5
dmesg 中的行。
如何为此 USB 摄像头手动创建 v4l2 设备?
我读过许多关于使用 udev 为摄像机分配稳定名称的帖子,但所有这些帖子似乎都假设首先创建了某些视频设备。我创建的任何规则SUBSYSTEM=="video4linux"
都没有任何效果,因为 udev 只看到SUBSYSTEM=="usb"
事件。
任何见解将不胜感激...谢谢
答案1
输出lsusb -D /dev/bus/usb/002/015
做看起来该设备试图成为UVC 兼容视频设备- 但有一些迹象表明其设备描述符可能有一两个错误。
设备ID中的供应商ID部分32e4:8830
似乎指的是“Ailipu Technology Co., Ltd”根据这个USB ID搜索引擎。它显然是中国深圳的一家 USB 摄像头制造商。根据快速谷歌搜索,他们自己的 USB 相机品牌显然被命名为“ELP”。
首先,您是否lsusb
以 root 身份运行该命令?在输出的第二行,它说:
Couldn't open device, some information will be missing
其次,列出的视频控制接口描述符之一lsusb
导致了此警告:
Warning: Descriptor too short
根据 UVC 规范版本 1.5,处理单元的视频控制接口描述符的大小应至少为 13 个字节,而不是该描述符所声称的 11 个字节。
第三,在Video Streaming接口的Interface Descriptor中,值为bInterfaceProtocol
0
在输出的最后lsusb
,有一堆该命令无法解析的数据,而是显示为十六进制转储。接口描述符数据中可能存在某种错误,导致其中一些出现乱码。这可能会导致尝试使用该设备时出现问题。
四、设备宣称UVC规范版本1.00:
bcdUVC 1.00
这UVC 规范 1.50 版于 2012 年发布,因此如果此信息正确,则该设备要么相当旧,要么故意使用旧版本的规范。
(UVC 规范的最佳来源是 usb.org,但目前UVC规范1.5文档包大小似乎为 0 字节。)
描述符能够包含任何纯语言文本字符串的所有位置都指定为零,表明未包含此类字符串。看起来这款相机的描述符被编写为最大限度地通用且无法识别。
Linux 驱动程序需要从相机的接口描述符中解码的重要信息之一uvcvideo
是相机输出数据的实际视频格式。如果没有这些信息,数据将毫无意义。
请检查sudo dmesg
输出:如果uvcvideo
驱动程序在尝试识别相机时输出任何错误消息,则可以在其中找到这些消息。这些消息的内容可能有助于理解该问题。