![USB 摄像头(Logitech)停止工作,直到重新连接](https://linux22.com/image/943161/USB%20%E6%91%84%E5%83%8F%E5%A4%B4%EF%BC%88Logitech%EF%BC%89%E5%81%9C%E6%AD%A2%E5%B7%A5%E4%BD%9C%EF%BC%8C%E7%9B%B4%E5%88%B0%E9%87%8D%E6%96%B0%E8%BF%9E%E6%8E%A5.png)
我有一台戴尔台式电脑,装有 Ubuntu 18.04 和 Logitech BRIO 摄像头。它在 Ubuntu 16.04 上运行良好,在升级到 18.04 后运行了几个星期,拍摄了数百张照片。然后从一两周前开始,它只能拍摄几张照片,有时 30 张,有时 50 张,然后停止工作,直到断开连接并重新连接。我还有另一台戴尔台式电脑,也装有 Ubuntu 18.04 和相同的摄像头,但那台电脑没有互联网连接,也没有更新。那台电脑继续正常工作。我换了摄像头,问题仍然存在于这台电脑上。
我重新连接相机并运行此脚本进行测试,使用 fswebcam 获取照片并保存为 jpg:
#!/bin/bash
for index in {0..100}
do
echo shot $index
echo Time: `date +"%Y-%m-%d %T"`
fswebcam -d v4l2:/dev/video0 -r 4096x2160 --jpeg -1 --no-banner -S 9 --verbose temp/shot.jpg
sleep 1
done
exit
它工作正常 20 到 50 次,然后 fswebcam 说“无法找到兼容的调色板格式”。这是连续两次拍摄的输出,最后一次成功,第一次失败:
shot 62
Time: 2021-11-30 11:26:17
--- Opening v4l2:/dev/video0...
>>> Using 'v4l2' source module.
/dev/video0 opened.
src_v4l2_get_capability,87: /dev/video0 information:
src_v4l2_get_capability,88: cap.driver: "uvcvideo"
src_v4l2_get_capability,89: cap.card: "Logitech BRIO"
src_v4l2_get_capability,90: cap.bus_info: "usb-0000:00:14.0-8"
src_v4l2_get_capability,91: cap.capabilities=0x84200001
src_v4l2_get_capability,92: - VIDEO_CAPTURE
src_v4l2_get_capability,103: - STREAMING
No input was specified, using the first.
src_v4l2_set_input,181: /dev/video0: Input 0 information:
src_v4l2_set_input,182: name = "Camera 1"
src_v4l2_set_input,183: type = 00000002
src_v4l2_set_input,185: - CAMERA
src_v4l2_set_input,186: audioset = 00000000
src_v4l2_set_input,187: tuner = 00000000
src_v4l2_set_input,188: status = 00000000
src_v4l2_set_pix_format,520: Device offers the following V4L2 pixel formats:
src_v4l2_set_pix_format,533: 0: [0x56595559] 'YUYV' (YUYV 4:2:2)
src_v4l2_set_pix_format,533: 1: [0x47504A4D] 'MJPG' (Motion-JPEG)
src_v4l2_set_pix_format,533: 2: [0x3231564E] 'NV12' (Y/CbCr 4:2:0)
Using palette MJPEG
src_v4l2_set_mmap,672: mmap information:
src_v4l2_set_mmap,673: frames=4
src_v4l2_set_mmap,722: 0 length=17694720
src_v4l2_set_mmap,722: 1 length=17694720
src_v4l2_set_mmap,722: 2 length=17694720
src_v4l2_set_mmap,722: 3 length=17694720
--- Capturing frame...
Skipping 9 frames...
Capturing 1 frames...
Captured 10 frames in 0.31 seconds. (32 fps)
--- Processing captured image...
Setting output format to JPEG, quality -1
Disabling banner.
Writing JPEG image to 'temp/shot.jpg'.
shot 63
Time: 2021-11-30 11:26:29
--- Opening v4l2:/dev/video0...
>>> Using 'v4l2' source module.
/dev/video0 opened.
src_v4l2_get_capability,87: /dev/video0 information:
src_v4l2_get_capability,88: cap.driver: "uvcvideo"
src_v4l2_get_capability,89: cap.card: "Logitech BRIO"
src_v4l2_get_capability,90: cap.bus_info: "usb-0000:00:14.0-8"
src_v4l2_get_capability,91: cap.capabilities=0x84200001
src_v4l2_get_capability,92: - VIDEO_CAPTURE
src_v4l2_get_capability,103: - STREAMING
No input was specified, using the first.
src_v4l2_set_input,181: /dev/video0: Input 0 information:
src_v4l2_set_input,182: name = "Camera 1"
src_v4l2_set_input,183: type = 00000002
src_v4l2_set_input,185: - CAMERA
src_v4l2_set_input,186: audioset = 00000000
src_v4l2_set_input,187: tuner = 00000000
src_v4l2_set_input,188: status = 00000000
src_v4l2_set_pix_format,520: Device offers the following V4L2 pixel formats:
src_v4l2_set_pix_format,533: 0: [0x56595559] 'YUYV' (YUYV 4:2:2)
src_v4l2_set_pix_format,533: 1: [0x47504A4D] 'MJPG' (Motion-JPEG)
src_v4l2_set_pix_format,533: 2: [0x3231564E] 'NV12' (Y/CbCr 4:2:0)
Unable to find a compatible palette format.
dmesg -T 显示此信息,从相机重新连接时开始:
[Tue Nov 30 11:18:03 2021] usb 2-8: USB disconnect, device number 7
[Tue Nov 30 11:18:10 2021] usb 2-8: new SuperSpeed USB device number 8 using xhci_hcd
[Tue Nov 30 11:18:10 2021] usb 2-8: New USB device found, idVendor=046d, idProduct=085e
[Tue Nov 30 11:18:10 2021] usb 2-8: New USB device strings: Mfr=0, Product=2,
SerialNumber=3
[Tue Nov 30 11:18:10 2021] usb 2-8: Product: Logitech BRIO
[Tue Nov 30 11:18:10 2021] usb 2-8: SerialNumber: 93004248
[Tue Nov 30 11:18:10 2021] uvcvideo: Found UVC 1.00 device Logitech BRIO (046d:085e)
[Tue Nov 30 11:18:10 2021] input: Logitech BRIO as
/devices/pci0000:00/0000:00:14.0/usb2/2-8/2-8:1.0/input/input20
[Tue Nov 30 11:18:10 2021] usb 2-8: current rate 16000 is different from the runtime rate 24000
[Tue Nov 30 11:18:10 2021] usb 2-8: current rate 16000 is different from the runtime rate 32000
[Tue Nov 30 11:18:10 2021] usb 2-8: current rate 16000 is different from the runtime rate 48000
[Tue Nov 30 11:18:10 2021] input: Logitech BRIO as /devices/pci0000:00/0000:00:14.0/usb2/2-8/2-8:1.4/0003:046D:085E.0006/input/input21
[Tue Nov 30 11:18:10 2021] hid-generic 0003:046D:085E.0006: input,hidraw0: USB HID v1.11 Device [Logitech BRIO] on usb-0000:00:14.0-8/input4
[Tue Nov 30 11:18:10 2021] usb 2-8: current rate 16000 is different from the runtime rate 48000
[Tue Nov 30 11:18:10 2021] usb 2-8: current rate 16000 is different from the runtime rate 48000
[Tue Nov 30 11:18:10 2021] usb 2-8: current rate 16000 is different from the runtime rate 48000
[Tue Nov 30 11:26:21 2021] usb 2-8: Set SEL for device-initiated U1 failed.
[Tue Nov 30 11:26:21 2021] usb 2-8: Set SEL for device-initiated U2 failed.
[Tue Nov 30 11:26:27 2021] usb 2-8: Set SEL for device-initiated U1 failed.
[Tue Nov 30 11:26:27 2021] usb 2-8: Set SEL for device-initiated U2 failed.
[Tue Nov 30 11:26:28 2021] uvcvideo: Failed to set UVC probe control : -32 (exp. 26).
[Tue Nov 30 11:26:28 2021] uvcvideo: Failed to set UVC probe control : -32 (exp. 26).
[Tue Nov 30 11:26:28 2021] uvcvideo: Failed to set UVC probe control : -32 (exp. 26).
[Tue Nov 30 11:26:28 2021] uvcvideo: Failed to set UVC probe control : -32 (exp. 26).
[Tue Nov 30 11:26:28 2021] uvcvideo: Failed to set UVC probe control : -32 (exp. 26).
[Tue Nov 30 11:26:28 2021] uvcvideo: Failed to set UVC probe control : -32 (exp. 26).
最后这一点已经重复多次了。
我已尝试过很多次,但总是以同样的方式失败,首先出现“usb 2-8:为设备启动的 U1 设置 SEL 失败”。
我怎样才能找到并解决这个问题?
答案1
正如评论所说,我在 Windows 10 上遇到了类似的问题。我最近注意到日志中有一个警告,提到我正在使用带有 2.0 USB 端口(计算机上唯一可用的端口)的网络摄像头。我切换到 3.2 USB 端口,一个多小时以来没有断开连接...我在几个地方读到(像这儿) 网络摄像头仅在使用默认/罗技电缆或完全兼容的电缆时才能在 4K 下正常工作,这至少需要 USB3 480mbs。因此,将其插入 USB2 确实可能会有问题。当您使用时-r 4096x2160
,您的问题可能相同吗?