我有两个 USB 摄像头,分别以两种分辨率运行。它们是在同一个 USB 3.0 集线器上运行的 USB 3 摄像头。如果我以 1280x720 和 12 fps(约 23 MB/s 的数据)运行它们,一个摄像头会在大约一小时后出现故障,而据我所知,第二个摄像头会无限期地继续运行。如果我以 640x480 和 30 fps(约 18.5 MB/s)的速度运行它们,一个摄像头往往会在大约 24 小时后出现故障,而另一个摄像头会继续工作。这两种数据速率都大大符合 USB 3.0 或 USB 2.0 集线器的规格。
当相机发生故障时,显然是由于它所连接的 USB 端口发生故障。除了关闭设备、切断电源并重新启动之外,似乎没有其他方法可以恢复该端口。简单的重新启动并不能解决问题,我怀疑这是因为除非切断计算机的电源,否则 USB 端口不会关闭。
有人遇到过类似的事情吗?或者有人能告诉我如何进一步调试这个问题吗?我可以用更多数据进行更新,但现在我不确定哪些数据是有用的。
谢谢。
更新 1:不确定其重要性,但我已经确认我的相机被读取为 USB 2.0 设备,而不是 USB 3.0 设备:
$:~/locus_dev/src/locus_calibration$ lsusb -d 2560:c110 -v | grep USB
bcdUSB 2.00
更新 2:与我之前的更新相反,我发现有些摄像头被随机读取为 usb 2.0,而有些则被随机读取为 3.0。故障似乎与 2.0 或 3.0 摄像头无关。我在发生故障时检查了 dmesg 日志,发现了以下文本。其中还提到由于“内存不足”而终止进程:
[14754.261924] uvcvideo: Non-zero status (-71) in video completion handler.
[14754.278012] uvcvideo: Non-zero status (-71) in video completion handler.
[14754.297514] uvcvideo: Non-zero status (-71) in video completion handler. [14754.311271] uvcvideo: Non-zero status (-71) in video completion handler.
[14754.402011] uvcvideo: Non-zero status (-71) in video completion handler.
[14760.459965] uvcvideo: Failed to query (130) UVC probe control : -110 (exp. 26).
[14775.656667] usb 3-2: reset SuperSpeed USB device number 2 using xhci_hcd
[14775.672307] usb 3-2: descriptor type invalid, skip
[14775.672311] usb 3-2: No LPM exit latency info found, disabling LPM.
[14775.672314] usb 3-2: device firmware changed
[14775.723768] usb 3-2: USB disconnect, device number 2
[14775.931744] usb 3-2: new SuperSpeed USB device number 4 using xhci_hcd
[14775.948235] usb 3-2: no configurations
[14775.950077] usb 3-2: can't read configurations, error -22
[14776.143814] usb 3-2: new SuperSpeed USB device number 5 using xhci_hcd
[14776.162902] usb 3-2: no configurations
[14776.164689] usb 3-2: can't read configurations, error -22
[14776.355745] usb 3-2: new SuperSpeed USB device number 6 using xhci_hcd
[14776.372164] usb 3-2: no configurations
[14776.374073] usb 3-2: can't read configurations, error -22
[14776.567733] usb 3-2: new SuperSpeed USB device number 7 using xhci_hcd
[14776.584193] usb 3-2: no configurations
[14776.586088] usb 3-2: can't read configurations, error -22
[14776.611732] usb usb3-port2: unable to enumerate USB device