OAK 双目相机 --debug 硬盘空间用尽,解决方法是禁用uvcdynctrldebug

程序

debug  20220828 OAK 双目 灰度 视频流.ipynb 

import cv2
import depthai as dai

# Create pipeline
pipeline = dai.Pipeline()

# Define sources and outputs
monoLeft = pipeline.create(dai.node.MonoCamera)
monoRight = pipeline.create(dai.node.MonoCamera)
xoutLeft = pipeline.create(dai.node.XLinkOut)
xoutRight = pipeline.create(dai.node.XLinkOut)

xoutLeft.setStreamName('left')
xoutRight.setStreamName('right')

# Properties
monoLeft.setBoardSocket(dai.CameraBoardSocket.LEFT)
monoLeft.setResolution(dai.MonoCameraProperties.SensorResolution.THE_480_P)
monoRight.setBoardSocket(dai.CameraBoardSocket.RIGHT)
monoRight.setResolution(dai.MonoCameraProperties.SensorResolution.THE_480_P)

# Linking
monoRight.out.link(xoutRight.input)
monoLeft.out.link(xoutLeft.input)

# Connect to device and start pipeline
device=dai.Device(pipeline)       ## <<<<<<<<<<<<<<<<<    debug        RuntimeError: Failed to find device after booting, error message: X_LINK_DEVICE_NOT_FOUND
                                                                ## 原来的语句是 with dai.Device(pipeline) as device:
    # Output queues will be used to get the grayscale frames from the outputs defined above
qLeft   = device.getOutputQueue(name="left", maxSize=4, blocking=False)
qRight = device.getOutputQueue(name="right", maxSize=4, blocking=False)

while True:
        # Instead of get (blocking), we use tryGet (non-blocking) which will return the available data or None otherwise
        inLeft = qLeft.tryGet()
        # print(  "inLeft=",  inLeft, "\n")                                                                      #  显示 inLeft= None     或 显示   inLeft= <depthai.ImgFrame object at 0x 7fe7 cc30 faf0 > 
        inRight = qRight.tryGet()

        if inLeft is not None:
            print(  "inLeft.getCvFrame()=",  inLeft.getCvFrame(), "\n")  
            cv2.imshow("left", inLeft.getCvFrame())

        if inRight is not None:
            cv2.imshow("right", inRight.getCvFrame())

        if cv2.waitKey(1) == ord('q'):
            break
            
#dai.DeviceBase.close (self)                                                                                 #    报错 NameError: name 'self' is not defined
#dai.DeviceBase.close (self: dai.DeviceBase)                                               #    报错SyntaxError: invalid syntax
#dai.DeviceBase.close (dai.DeviceBase)                                                        #   报错TypeError: close(): incompatible function arguments. 
                                                                                                                                         #  The following argument types are supported    1. (self: depthai.DeviceBase) -> None

    
dai.DeviceBase.close (device)                                                                              # 顺利运行没有报错,但是资源没有马上释放  27 with dai.Device(pipeline) as device:   RuntimeError: Failed to find device after booting, error message: X_LINK_DEVICE_NOT_FOUND
                                                                                                                                        #  uvcdynctrl-d/dev/video0-addctrl=03e7:f63b      也许原因在于  uvcdynctrl    疯狂debug,                     
cv2.destroyAllWindows()
## 运行上述代码后显示报错:
## ---------------------------------------------------------------------------
## RuntimeError                              Traceback (most recent call last)
## <ipython-input-15-acec109f9ba5> in <module>
##      25 
##      26 # Connect to device and start pipeline
## ---> 27 device=dai.Device(pipeline)       
## <<<<<<<<<<<<<<<<<    debug        RuntimeError: ## Failed to find device after booting, error message: X_LINK_DEVICE_NOT_FOUND
##      28                                                                 
## 原来的语句是 with ## dai.Device(pipeline) as device:
##      29     # Output queues will be used to get the grayscale frames from the outputs defined above

## RuntimeError: Failed to connect to device, error message: X_LINK_DEVICE_ALREADY_IN_USE

程序运行环境

        ubuntu 18.04

bug

    程序退出后,cpu忙,不能马上开始新的视频流,结束黑白摄像头进程,风扇狂转,系统反应变慢, 系统盘写满

报错内容

                cmd窗口中, 写入重复内容
                [libwebcam] Warning: The driver behind device video0 has a slightly buggy implementation of the V4L2_CTRL_FLAG_NEXT_CTRL flag.
                    --It does not return the next higher control ID if a control query fails. A workaround has been enabled.

检查工具软件

        ubuntu自带的分析磁盘容量的图形工具--Disk Usage Analyzer

发现硬盘空间用尽 

                /var/log  目录下  uvcdynctrl-udev.log ,体积巨大,接近200G , 硬盘空间用尽. 写入重复内容
                

            /var/log syslog文件体积增大    写入重复内容:
                 cc-desktop kernel: [  413.411015] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 1: -32 (exp. 2).

            /var/log kern.log文件体积增大    写入重复内容
                 cc-desktop kernel: [  125.283714] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 1: -32 (exp. 2).

                QObject::moveToThread: Current thread (0x5595c1462c70) is not the object's thread (0x5595c2b0ee80). Cannot move to target thread (0x5595c1462c70)


追踪bug

    [libwebcam] Warning: The driver behind device video0 has a slightly buggy implementation of the V4L2_CTRL_FLAG_NEXT_CTRL flag.
    It does not return the next higher control ID if a control query fails. A workaround has been enabled.

根据这句话搜索,得到网址
 

        733094 - fills disk writing to /var/log/uvcdynctrl-udev.log - Debian Bug report logs

        关闭uvcdynctrl-udev.log_Joker_Ren的博客-CSDN博客
        文中说uvcdynctrl会输出巨量的log文件,会把硬盘占满,直到100%。 解决问题只需禁用debug 就可以了

debug
    修改uvcdynctrl,禁用debug
        进入目录/lib/udev/uvcdynctrl 中
        修改文件名uvcdynctrl 更名为uvcdynctrl.txt
        修改文件内容 将 debug 设置为 0,保存
        修改文件名uvcdynctrl.txt 更名为uvcdynctrl

    删除uvcdynctrl-udev.log
        进入command
        sudo nautilus
        删除uvcdynctrl-udev.log
        清空垃圾箱, 释放硬盘空间

###########################################################################


下面是 uvcdynctrl-udev.log  中的内容(仅记录开头)

==============================================================================
uvcdynctrl script version 0.3 running from '/lib/udev/uvcdynctrl'


DEVNAME='/dev/video1'
DEVPATH='/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.1/video4linux/video1'
PPID='3560'
SEQNUM='4459'
USEC_INITIALIZED='1524407612'

==============================================================================
uvcdynctrl script version 0.3 running from '/lib/udev/uvcdynctrl'
Triggered at Sun Aug 28 13:06:14 CST 2022

ACTION='add'
COLORD_DEVICE='1'
COLORD_KIND='camera'
DEVLINKS='/dev/v4l/by-id/usb-Intel_Corporation_Luxonis_Device_1844301001BF101300-video-index0 /dev/v4l/by-path/pci-0000:00:14.0-usb-0:2:1.1-video-index0'
DEVNAME='/dev/video0'
DEVPATH='/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.1/video4linux/video0'
ID_BUS='usb'
ID_FOR_SEAT='video4linux-pci-0000_00_14_0-usb-0_2_1_1'
ID_MODEL='Luxonis_Device'
ID_MODEL_ENC='Luxonis\x20Device'
ID_MODEL_ID='f63b'
ID_PATH='pci-0000:00:14.0-usb-0:2:1.1'
ID_PATH_TAG='pci-0000_00_14_0-usb-0_2_1_1'
ID_REVISION='0200'
ID_SERIAL='Intel_Corporation_Luxonis_Device_1844301001BF101300'
ID_SERIAL_SHORT='1844301001BF101300'
ID_TYPE='video'
ID_USB_DRIVER='uvcvideo'
ID_USB_INTERFACES=':ff0000:0e0100:0e0200:'
ID_USB_INTERFACE_NUM='01'
ID_V4L_CAPABILITIES=':capture:'
ID_V4L_PRODUCT='Luxonis Device: UVC Video Contr'
ID_V4L_VERSION='2'
ID_VENDOR='Intel_Corporation'
ID_VENDOR_ENC='Intel\x20Corporation'
ID_VENDOR_ID='03e7'
IFS='     
'
MAJOR='81'
MINOR='0'
OPTIND='1'
PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
PPID='3556'
PS1='# '
PS2='> '
PS4='+ '
PWD='/'
SEQNUM='4458'
SUBSYSTEM='video4linux'
TAGS=':uaccess:seat:'
USEC_INITIALIZED='1524405312'
debug='1'
logfile='/var/log/uvcdynctrl-udev.log'
uvcdynctrlpath='uvcdynctrl'
version='0.3'

VID of new device: '03e7'
PID of new device: 'f63b'
Executing command: 'uvcdynctrl -d /dev/video0 --addctrl=03e7:f63b'


[libwebcam] Warning: The driver behind device video0 has a slightly buggy implementation
  of the V4L2_CTRL_FLAG_NEXT_CTRL flag. It does not return the next higher
  control ID if a control query fails. A workaround has been enabled.
[libwebcam] Warning: The driver behind device video0 has a slightly buggy implementation
  of the V4L2_CTRL_FLAG_NEXT_CTRL flag. It does not return the next higher
  control ID if a control query fails. A workaround has been enabled.
[libwebcam] Warning: The driver behind device video0 has a slightly buggy implementation
  of the V4L2_CTRL_FLAG_NEXT_CTRL flag. It does not return the next higher
  control ID if a control query fails. A workaround has been enabled.
[libwebcam] Warning: The driver behind device video0 has a slightly buggy implementation
  of the V4L2_CTRL_FLAG_NEXT_CTRL flag. It does not return the next higher
  control ID if a control query fails. A workaround has been enabled.

========================================================


     尝试过的其他方法2 -1                                                                                                  
        等待2分钟,cup闲下来,再运行jupyter notebook 程序就能成功
        
     尝试过的其他方法2 -2                                                                                                  
        dai.DeviceBase.close (device)                                                                              
        # 顺利运行没有报错,但是资源没有马上释放  27 with dai.Device(pipeline) as device:   RuntimeError: Failed to find device after booting, error message: X_LINK_DEVICE_NOT_FOUND
        有时能马上开始新的视频流,但是有时需要等待2分钟,cup闲下来,再运行jupyter notebook 程序就能成功
        
        原因在于
            高cpu利用线程
                uvcdynctrl-d/dev/video0-addctrl=03e7:f63b

            导致资源不能及时释放,
                 with dai.Device(pipeline) as device:   RuntimeError: Failed to find device after booting, error message: X_LINK_DEVICE_NOT_FOUND

                这时运行释放资源 程序就能成功

   尝试过的其他方法 2-3
        pip install pyqt5 -i https://pypi.tuna.tsinghua.edu.cn/simple
        显示已经安装, Requirement already satisfied: PyQt5_sip<4.20,>=4.19.14 in ./anaconda3/lib/python3.8/site-packages (from pyqt5) (4.19.19)


QObject::moveToThread: Current thread (0x5595c1462c70) is not the object's thread (0x5595c2b0ee80).
Cannot move to target thread (0x5595c1462c70)

[I 2022-08-28 20:07:12.403 ServerApp] Saving file at /depthai-OAK/20220828 OAK 双目 灰度 视频流.ipynb
[1844301001BF101300] [1.4] [23.272] [system] [info] PRINT:LeonCss: bss_init took 40.529 ms
BootloaderConfig.options1 checksum doesn't match. Is: 0x10304418 should be: 0xF8135BD0
GPIO boot mode 0x16, interface USBD
Setting aons(0..4) back to boot from flash (offset = 0)
====ENABLE WATCHDOG====1
initial keepalive, countdown: 10
PLL0: 700000 AUX_IO0: 24000 AUX_IO1: 24000 MCFG: 24000 MECFG: 24000
Board init ret 3
eeprom configuration version: 55AA0006
Reading VERSION 6 --- ->
eeprom configuration load from user area, status: 0
--> brdInit ...
brdInitAuxDevices: Error: SC = 27: io_initialize expander_cam_gpios_1 [OK]

spi_N25Q_init: Flash JEDEC ID: ff ff ff
Invalid Flash JEDEC ID... No NOR available
Could not register the spi device
Failed to probe IR driver LM3644
Failed to probe IR driver LM3644
Failed to probe IR driver LM3644
Closing EEPROm!
MyriaX board configuration
pll0 frequency: 700000, ref0 frequency: 24000
Is booted from flash by bootloader: 0
Networking not available...
Called by: LOS, controller: LOS
Enumerating on socket: Cam_A / RGB / Center
Probe failed I2C1 0x10 reg 300a: expected 7750, read 0000
  >> Registered camera IMX214R0 (imx214) as /dev/Camera_0
Enumerating on socket: Cam_B / Left
Probe failed I2C2 0x60 reg 300a: expected 9281, read 7750
  >> Registered camera MV200 (ov7750) as /dev/Camera_1
Enumerating on socket: Cam_C / Right
Probe failed I2C2 0x62 reg 300a: expected 9281, read 7750
  >> Registered camera MV200 (ov7750) as /dev/Camera_2
Enumerating on socket: CAM_D
initial keepalive, countdown: 9
Initializing XLink...
UsbPumpVscAppI_Event: 5 VSC2_EVENT_ATTACH
UsbPumpVscAppI_Event: 4 VSC2_EVENT_RESET
initial keepalive, countdown: 8
UsbPumpVscAppI_Event: 4 VSC2_EVENT_RESET
UsbPumpVscAppI_Event: 0 VSC2_EVENT_INTERFACE_UP
UvcDevice_Start
USB 3.1 gen1 video device detected
Bulk endpoint on 2 interface
Done!
Usb connection speed: Super - USB 3.0
I: [Timesync] [   1729382] [main] startSync:116     Timesync | Callback not set
Temperature: Driver registered.
Temperature: Initialized driver.
Temperature: Sensor opened: CSS.
Temperature: Sensor opened: MSS.
Temperature: Sensor opened: UPA.
Temperature: Sensor opened: DSS.
[1844301001BF101300] [1.4] [23.272] [system] [info] PRINT:LeonMss: Called by: LRT, controller: LOS

QObject::moveToThread: Current thread (0x5595c1462c70) is not the object's thread (0x5595c2b0ee80).
Cannot move to target thread (0x5595c1462c70)

QObject::moveToThread: Current thread (0x5595c1462c70) is not the object's thread (0x5595c2b0ee80).
Cannot move to target thread (0x5595c1462c70)

[I 2022-08-28 20:13:12.466 ServerApp] Saving file at /depthai-OAK/20220828 OAK 双目 灰度 视频流.ipynb
[1844301001BF101300] [1.4] [302.004] [system] [info] PRINT:LeonCss: bss_init took 40.527 ms
BootloaderConfig.options1 checksum doesn't match. Is: 0x10304418 should be: 0xF8135BD0
GPIO boot mode 0x16, interface USBD
Setting aons(0..4) back to boot from flash (offset = 0)
====ENABLE WATCHDOG====1
initial keepalive, countdown: 10
PLL0: 700000 AUX_IO0: 24000 AUX_IO1: 24000 MCFG: 24000 MECFG: 24000
Board init ret 3
eeprom configuration version: 55AA0006
Reading VERSION 6 --- ->
eeprom configuration load from user area, status: 0
--> brdInit ...
brdInitAuxDevices: Error: SC = 27: io_initialize expander_cam_gpios_1 [OK]

spi_N25Q_init: Flash JEDEC ID: ff ff ff
Invalid Flash JEDEC ID... No NOR available
Could not register the spi device
Failed to probe IR driver LM3644
Failed to probe IR driver LM3644
Failed to probe IR driver LM3644
Closing EEPROm!
MyriaX board configuration
pll0 frequency: 700000, ref0 frequency: 24000
Is booted from flash by bootloader: 0
Networking not available...
Called by: LOS, controller: LOS
Enumerating on socket: Cam_A / RGB / Center

Probe failed I2C1 0x10 reg 300a: expected 7750, read 0000
  >> Registered camera IMX214R0 (imx214) as /dev/Camera_0
Enumerating on socket: Cam_B / Left

Probe failed I2C2 0x60 reg 300a: expected 9281, read 7750
  >> Registered camera MV200 (ov7750) as /dev/Camera_1
Enumerating on socket: Cam_C / Right

Probe failed I2C2 0x60 reg 300a: expected 9281, read 7750
  >> Registered camera MV200 (ov7750) as /dev/Camera_2
Enumerating on socket: CAM_D
initial keepalive, countdown: 9
Initializing XLink...
UsbPumpVscAppI_Event: 5 VSC2_EVENT_ATTACH
UsbPumpVscAppI_Event: 4 VSC2_EVENT_RESET
UsbPumpVscAppI_Event: 4 VSC2_EVENT_RESET
initial keepalive, countdown: 8
UsbPumpVscAppI_Event: 0 VSC2_EVENT_INTERFACE_UP
UvcDevice_Start
USB 3.1 gen1 video device detected
Bulk endpoint on 2 interface
Done!
Usb connection speed: Super - USB 3.0
I: [Timesync] [   1676326] [main] startSync:116     Timesync | Callback not set
Temperature: Driver registered.
Temperature: Initialized driver.
Temperature: Sensor opened: CSS.
Temperature: Sensor opened: MSS.
Temperature: Sensor opened: UPA.
Temperature: Sensor opened: DSS.
[1844301001BF101300] [1.4] [302.004] [system] [info] PRINT:LeonMss: Called by: LRT, controller: LOS

QObject::moveToThread: Current thread (0x5595c1462c70) is not the object's thread (0x5595c2b0ee80).
Cannot move to target thread (0x5595c1462c70)

### 回答1: OAK-D-Pro 是一款功能强大的智能深度相机,具有高度的智能化和灵活性。它搭载了 OpenCV、OpenVINO、TensorFlow 等多种先进的 AI 框架和算法,可以用于人脸识别、姿势识别、手势识别、物体检测、场景分析等多种应用场景。 OAK-D-Pro 还支持多种连接方式,包括 USB、HDMI、以太网等,方便与不同的设备进行联接。同时,它也具有较高的处理性能和低功耗,可以在较长时间内进行运算。 总之,OAK-D-Pro 是一款非常优秀的智能深度相机,可以广泛应用于各种 AI 领域,具有很高的性价比。 ### 回答2: 智能深度相机OAK-D Pro是一款功能强大的相机,具有出色的效果和性能。 首先,OAK-D Pro采用了先进的深度感知技术,能够实时获取环境中的深度信息。通过双目立体视觉和深度学习算法的结合,它能够高精度地感知和测量物体的三维空间位置和形状。这使得OAK-D Pro在目标检测、位姿估计、实时地图生成等任务中表现出色。 其次,OAK-D Pro具备较高的图像分辨率和图像质量。它搭载了高清摄像头,能够捕捉到更多细节,并保持图像的清晰度和真实感。这使得其在计算机视觉应用中可以更准确地分析和处理图像。 此外,OAK-D Pro还具备强大的计算能力和算法处理能力。其内置的高性能处理器和深度学习推理芯片可以快速高效地处理和分析图像数据。这使得OAK-D Pro能够在实时应用场景中保持稳定且高效的性能表现。 最后,OAK-D Pro还支持多种接口和数据输出方式,可以与其他设备和平台进行无缝集成。这为用户提供了更大的灵活性,可以在各种应用中充分发挥OAK-D Pro的效能。 综上所述,智能深度相机OAK-D Pro具有优秀的深度感知能力、高清影像质量、强大的计算能力和多样化的数据输出接口。其出色的效果使得它在计算机视觉和人工智能领域有着广泛的应用前景。 ### 回答3: 智能深度相机OAK-D Pro是一款高性能的相机产品,具有出色的效果。它采用了深度学习算法,可以实现更精确的深度感知,并与计算机视觉技术相结合,实现高质量的图像和视频输出。 OAK-D Pro的主要特点之一是其高分辨率和高帧率。它配备了一个强大的传感器,能够捕捉到更多细节,并以每秒30帧的速度进行图像和视频的采集。这意味着用户可以获得更清晰、更流畅的图像和视频体验。 此外,OAK-D Pro还具备智能边缘计算的能力。它内置了强大的处理器和神经网络,能够在设备上进行实时的图像和视频分析,无需依赖云端的计算资源。这种边缘计算的方式大大提高了响应速度,并能够实现更高效的应用,比如目标检测、人脸识别等。 此外,OAK-D Pro还支持深度数据的获取和处理。它能够测量出场景中每个像素的距离,并生成精确的深度图像。这为各种应用提供了更多可能性,比如虚拟现实、增强现实等。 综上所述,智能深度相机OAK-D Pro具有出色的性能和效果。它不仅能够提供高质量的图像和视频输出,还能够进行智能边缘计算和深度数据处理,满足用户在各种应用场景中的需求。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值