I can run the sample code as well as the depthai_demo.py script with the OAK-D, and it properly displays the video as well as detections, however it seems that the OAK-D device regularly disconnects then reconnects (based on the output I think it's rebooting). This happens around every 60 seconds, but the time can vary up to a couple minutes. It takes around 10 seconds for the device to reconnect, and the OAK-D device makes a quiet click sound once it has reconnected. It goes back to showing the video and detections. For the demo this happens with the default CNN when passed no command-line arguments as well as any other CNN. I'm running a new MacBook Pro (Apple M1 chip) with macOS 11.0.1 (Big Sur). I tried from a terminal window both with and without Rosetta 2, as well as from a Jupyter notebook within Visual Studio Code. I'm using Python 3.7.9. I'm also using the USB cable that came with the OAK-D, with and without the power plugged in. I'm using an official Apple USB adapter to plug into the Mac (without any other hub) since the new Macs only have USB-4 plugs. I haven't had any disconnection problems with other devices such as with an iPhone. Has anyone else had this problem, or know of a solution? Below is the output I get while running. The error starts after the first occurrence of "depthai: INIT OK!", starting with "E: [global] [ 436357] [] handleIncomingEvent:563 handleIncomingEvent() Read failed -1". It then says its closing the streams, the watchdog gets triggered, reseting is done, then reconnection occurs up to another "depthai: INIT OK!" line, after which things go back to running normally. I cut off everything else after that, it basically repeats this process every minute or so.
`martin@Martins-MacBook-Pro depthai % python3 depthai_demo.py
No calibration file. Using Calibration Defaults.
Using depthai module from: /Users/martin/.local/lib/python3.7/site-packages/depthai.cpython-37m-darwin.so
Depthai version installed: 0.4.1.1
Compiled mode found: compiled for 14 shaves, 14 cmx_slices and 1 NN_engines
XLink initialized.
Sending internal device firmware
Successfully connected to device.
Usb speed : Super/5000Mbps
Mx serial id : 14442C10D1ADC5D200
Loading config file
Attempting to open stream config_d2h
watchdog started
Successfully opened stream config_d2h with ID #0!
Closing stream config_d2h: ...
Closing stream config_d2h: DONE.
EEPROM data: valid (v5)
Board name : BW1098OBC
Board rev : R0M0E0
HFOV L/R : 71.86 deg
HFOV RGB : 68.7938 deg
L-R distance : 7.5 cm
L-RGB distance : 3.75 cm
L/R swapped : yes
L/R crop region: center
Rectification Rotation R1 (left):
0.999728, -0.011736, 0.020164,
0.011658, 0.999924, 0.003994,
-0.020209, -0.003758, 0.999789,
Rectification Rotation R2 (right):
0.999777, -0.000435, -0.021122,
0.000353, 0.999992, -0.003881,
0.021123, 0.003872, 0.999769,
Calibration intrinsic matrix M1 (left):
854.181580, 0.000000, 640.437195,
0.000000, 855.316772, 414.747101,
0.000000, 0.000000, 1.000000,
Calibration intrinsic matrix M2 (right):
856.262634, 0.000000, 638.958191,
0.000000, 856.423462, 409.921021,
0.000000, 0.000000, 1.000000,
Calibration rotation matrix R:
0.999082, -0.011460, 0.041279,
0.011145, 0.999907, 0.007857,
-0.041366, -0.007390, 0.999117,
Calibration translation matrix T:
-7.424194,
0.003229,
0.156848,
Calibration Distortion Coeff d1 (Left):
-4.347425, 12.671949, 0.000272, -0.000323, -11.234915, -4.406286, 12.902558,
-11.451633, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
Calibration Distortion Coeff d2 (Right):
-5.615151, 18.504915, 0.000820, 0.000260, -19.905716, -5.662169, 18.696529,
-20.096554, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
['metaout', 'previewout']
Available streams: ['meta_d2h', 'left', 'right', 'disparity', 'depth', 'metaout', 'previewout', 'jpegout', 'video', 'object_tracker', 'rectified_left', 'rectified_right', 'color']
/Users/martin/Documents/oakd/depthai/resources/nn/mobilenet-ssd/mobilenet-ssd.json
depthai: Using calibration from stored in EEPROM
config_h2d json:
{"board":{"calib_data":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"mesh_left":[0.0],"mesh_right":[0.0]},"load_inBlob":true,"pipeline":{"streams":[{"name":"metaout"},{"name":"previewout"}]},"ai":{"NCEs":1,"NN_config":{"NN_family":"mobilenet","confidence_threshold":0.5,"output_format":"detection"},"blob0_size":14477056,"blob1_size":0,"calc_dist_to_bb":true,"camera_input":"rgb","cmx_slices":14,"keep_aspect_ratio":true,"num_stages":1,"shaves":14},"app":{"enable_reconfig":true,"sync_sequence_numbers":false,"sync_video_meta_streams":false,"usb_chunk_KiB":64},"board":{"clear-eeprom":false,"left_fov_deg":71.86000061035156,"left_to_rgb_distance_m":0.03750000149011612,"left_to_right_distance_m":0.07500000298023224,"name":"","override-eeprom":false,"revision":"","rgb_fov_deg":68.7938003540039,"stereo_center_crop":false,"store-to-eeprom":false,"swap-left-and-right-cameras":true},"camera":{"mono":{"fps":30.0,"resolution_h":400,"resolution_w":640},"rgb":{"fps":30.0,"resolution_h":1080,"resolution_w":1920}},"depth":{"depth_limit_mm":10000,"lr_check":false,"median_kernel_size":7,"padding_factor":0.30000001192092896,"warp_rectify":{"edge_fill_color":0,"mirror_frame":true,"use_mesh":false}},"ot":{"confidence_threshold":0.5,"max_tracklets":20}}
size of input string json_config_obj to config_h2d is ->1652
size of json_config_obj that is expected to be sent to config_h2d is ->1048576
Attempting to open stream config_h2d
Successfully opened stream config_h2d with ID #1!
Writing 1048576 bytes to config_h2d
!!! XLink write successful: config_h2d (1048576)
Closing stream config_h2d: ...
Closing stream config_h2d: DONE.
Creating observer stream host_capture: ...
Attempting to open stream host_capture
Successfully opened stream host_capture with ID #0!
Creating observer stream host_capture: DONE.
Read: 14477056
Attempting to open stream inBlob
Successfully opened stream inBlob with ID #1!
Writing 14477056 bytes to inBlob
!!! XLink write successful: inBlob (14477056)
Closing stream inBlob: ...
Closing stream inBlob: DONE.
depthai: done sending Blob file /Users/martin/Documents/oakd/depthai/resources/nn/mobilenet-ssd/mobilenet-ssd.blob.sh14cmx14NCE1
Attempting to open stream outBlob
Successfully opened stream outBlob with ID #2!
Closing stream outBlob: ...
Closing stream outBlob: DONE.
Input layer :
Name: data
Index: 0
Element type: uint8
Element size: 1byte
Offset: 0 byte
Dimensions: [Batch : 1, Channel : 3, Height : 300, Width : 300]
Output layer :
Name: detection_out
Index: 0
Element type: float16
Element size: 2 bytes
Offset: 0 byte
Dimensions: [Batch : 1, Channel : 1, Height : 100, Width : 7]
CNN to depth bounding-box mapping: start(159, 39), max_size(321, 321)
Host stream start:metaout
Opening stream for read: metaout
Attempting to open stream metaout
Successfully opened stream metaout with ID #1!
Starting thread for stream: metaout
Host stream start:previewout
Opening stream for read: previewout
Attempting to open stream previewout
Started thread for stream: metaout
Successfully opened stream previewout with ID #2!
Starting thread for stream: previewout
depthai: INIT OK!
Started thread for stream: previewout
E: [global] [ 436357] [] handleIncomingEvent:563 handleIncomingEvent() Read failed -1
E: [global] [ 436358] [] addEvent:264 Condition failed: event->header.flags.bitField.ack != 1
E: [global] [ 436358] [] addEventWithPerf:276 addEvent(event) method call failed with an error: 3
E: [global] [ 436358] [] XLinkReadData:156 Condition failed: (addEventWithPerf(&event, &opTime))
Device get data failed: 7
Closing stream previewout: ...
E: [global] [ 436358] [] addEvent:264 Condition failed: event->header.flags.bitField.ack != 1
E: [global] [ 436358] [] addEventWithPerf:276 addEvent(event) method call failed with an error: 3
E: [global] [ 436358] [] XLinkReadData:156 Condition failed: (addEventWithPerf(&event, &opTime))
Device get data failed: 7
Closing stream metaout: ...
E: [global] [ 436358] [] dispatcherEventSend:53 Write failed (header) (err -99) | event XLINK_CLOSE_STREAM_REQ
E: [xLink] [ 436358] [] sendEvents:1027 Event sending failed
E: [global] [ 436358] [] dispatcherEventSend:53 Write failed (header) (err -99) | event XLINK_CLOSE_STREAM_REQ
E: [xLink] [ 436358] [] sendEvents:1027 Event sending failed
Closing stream previewout: DONE.
Thread for previewout finished.
Closing stream metaout: DONE.
Thread for metaout finished.
watchdog triggered
=== New data in observer stream host_capture, size: 4
Writing 4 bytes to host_capture
E: [global] [ 440148] [] dispatcherEventSend:53 Write failed (header) (err -4) | event XLINK_WRITE_REQ
E: [xLink] [ 440148] [] sendEvents:1027 Event sending failed
!!! XLink write successful: host_capture (4)
Stopping threads: ...
Stopping threads: DONE 0.000s.
Closing all observer streams: ...
Closing stream host_capture: ...
Closing stream host_capture: DONE.
Closing all observer streams: DONE.
Reseting device: 0.
E: [global] [ 440149] [] dispatcherEventSend:53 Write failed (header) (err -4) | event XLINK_RESET_REQ
E: [xLink] [ 440149] [] sendEvents:1027 Event sending failed
E: [global] [ 440149] [] XLinkResetRemote:266 can't wait dispatcherClosedSem
Reseting: DONE.
XLink already initialized.
Sending internal device firmware
Successfully connected to device.
Usb speed : Super/5000Mbps
Mx serial id : 14442C10D1ADC5D200
Loading config file
Attempting to open stream config_d2h
Successfully opened stream config_d2h with ID #0!
Closing stream config_d2h: ...
Closing stream config_d2h: DONE.
EEPROM data: valid (v5)
Board name : BW1098OBC
Board rev : R0M0E0
HFOV L/R : 71.86 deg
HFOV RGB : 68.7938 deg
L-R distance : 7.5 cm
L-RGB distance : 3.75 cm
L/R swapped : yes
L/R crop region: center
Rectification Rotation R1 (left):
0.999728, -0.011736, 0.020164,
0.011658, 0.999924, 0.003994,
-0.020209, -0.003758, 0.999789,
Rectification Rotation R2 (right):
0.999777, -0.000435, -0.021122,
0.000353, 0.999992, -0.003881,
0.021123, 0.003872, 0.999769,
Calibration intrinsic matrix M1 (left):
854.181580, 0.000000, 640.437195,
0.000000, 855.316772, 414.747101,
0.000000, 0.000000, 1.000000,
Calibration intrinsic matrix M2 (right):
856.262634, 0.000000, 638.958191,
0.000000, 856.423462, 409.921021,
0.000000, 0.000000, 1.000000,
Calibration rotation matrix R:
0.999082, -0.011460, 0.041279,
0.011145, 0.999907, 0.007857,
-0.041366, -0.007390, 0.999117,
Calibration translation matrix T:
-7.424194,
0.003229,
0.156848,
Calibration Distortion Coeff d1 (Left):
-4.347425, 12.671949, 0.000272, -0.000323, -11.234915, -4.406286, 12.902558,
-11.451633, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
Calibration Distortion Coeff d2 (Right):
-5.615151, 18.504915, 0.000820, 0.000260, -19.905716, -5.662169, 18.696529,
-20.096554, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
/Users/martin/Documents/oakd/depthai/resources/nn/mobilenet-ssd/mobilenet-ssd.json
depthai: Using calibration from stored in EEPROM
config_h2d json:
{"board":{"calib_data":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"mesh_left":[0.0],"mesh_right":[0.0]},"load_inBlob":true,"pipeline":{"streams":[{"name":"metaout"},{"name":"previewout"}]},"ai":{"NCEs":1,"NN_config":{"NN_family":"mobilenet","confidence_threshold":0.5,"output_format":"detection"},"blob0_size":14477056,"blob1_size":0,"calc_dist_to_bb":true,"camera_input":"rgb","cmx_slices":14,"keep_aspect_ratio":true,"num_stages":1,"shaves":14},"app":{"enable_reconfig":true,"sync_sequence_numbers":false,"sync_video_meta_streams":false,"usb_chunk_KiB":64},"board":{"clear-eeprom":false,"left_fov_deg":71.86000061035156,"left_to_rgb_distance_m":0.03750000149011612,"left_to_right_distance_m":0.07500000298023224,"name":"","override-eeprom":false,"revision":"","rgb_fov_deg":68.7938003540039,"stereo_center_crop":false,"store-to-eeprom":false,"swap-left-and-right-cameras":true},"camera":{"mono":{"fps":30.0,"resolution_h":400,"resolution_w":640},"rgb":{"fps":30.0,"resolution_h":1080,"resolution_w":1920}},"depth":{"depth_limit_mm":10000,"lr_check":false,"median_kernel_size":7,"padding_factor":0.30000001192092896,"warp_rectify":{"edge_fill_color":0,"mirror_frame":true,"use_mesh":false}},"ot":{"confidence_threshold":0.5,"max_tracklets":20}}
size of input string json_config_obj to config_h2d is ->1652
size of json_config_obj that is expected to be sent to config_h2d is ->1048576
Attempting to open stream config_h2d
Successfully opened stream config_h2d with ID #1!
Writing 1048576 bytes to config_h2d
!!! XLink write successful: config_h2d (1048576)
Closing stream config_h2d: ...
Closing stream config_h2d: DONE.
Creating observer stream host_capture: ...
Attempting to open stream host_capture
Successfully opened stream host_capture with ID #0!
Creating observer stream host_capture: DONE.
Read: 14477056
Attempting to open stream inBlob
Successfully opened stream inBlob with ID #1!
Writing 14477056 bytes to inBlob
!!! XLink write successful: inBlob (14477056)
Closing stream inBlob: ...
Closing stream inBlob: DONE.
depthai: done sending Blob file /Users/martin/Documents/oakd/depthai/resources/nn/mobilenet-ssd/mobilenet-ssd.blob.sh14cmx14NCE1
Attempting to open stream outBlob
Successfully opened stream outBlob with ID #2!
Closing stream outBlob: ...
Closing stream outBlob: DONE.
Input layer :
Name: data
Index: 0
Element type: uint8
Element size: 1byte
Offset: 0 byte
Dimensions: [Batch : 1, Channel : 3, Height : 300, Width : 300]
Output layer :
Name: detection_out
Index: 0
Element type: float16
Element size: 2 bytes
Offset: 0 byte
Dimensions: [Batch : 1, Channel : 1, Height : 100, Width : 7]
CNN to depth bounding-box mapping: start(159, 39), max_size(321, 321)
Host stream start:metaout
Opening stream for read: metaout
Attempting to open stream metaout
Successfully opened stream metaout with ID #1!
Starting thread for stream: metaout
Host stream start:previewout
Opening stream for read: previewout
Attempting to open stream previewout
Started thread for stream: metaout
Successfully opened stream previewout with ID #2!
Starting thread for stream: previewout
depthai: INIT OK!
`