Hi folks, I'm still running into issues starting and stopping camera capture, specifically on the mono cameras of my Pro Wide PoEs. Script below; cameras both display on start, I can successfully stop the camera capture at least once (pressing 'p'). When I restart the cameras (pressing 's') - usually the first time, but sometimes the second iteration of stop / start - the left camera will not start and the right camera will capture a few frames then freeze. If I then try to stop the capture again, I get the error:

[system] [critical] Fatal error. Please report to developers. Log: 'PlgSrcMipi' '1130'
[host] [warning] Device crashed, but no crash dump could be extracted.

Test code (modified from chengguizi over on github issue 745 which might be related?):

#!/usr/bin/env python3

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.CAM_B)
monoLeft.setResolution(dai.MonoCameraProperties.SensorResolution.THE_720_P)
monoRight.setBoardSocket(dai.CameraBoardSocket.CAM_C)
monoRight.setResolution(dai.MonoCameraProperties.SensorResolution.THE_720_P)

controlIn = pipeline.create(dai.node.XLinkIn)
controlIn.setStreamName('control')
controlIn.out.link(monoRight.inputControl)
controlIn.out.link(monoLeft.inputControl)

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

device_infos = dai.Device.getAllAvailableDevices()
print(device_infos)

# Connect to device and start pipeline
with dai.Device(device_infos[0]) as device:
    device.startPipeline(pipeline)
    controlQueue = device.getInputQueue('control')

    # 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()
        inRight = qRight.tryGet()

        if inLeft is not None:
            cv2.imshow("left", inLeft.getCvFrame())

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

        key = cv2.waitKey(1)
        if key == ord('q'):
            break
        elif key == ord('p'):
            ctrl = dai.CameraControl()
            ctrl.setStopStreaming()
            controlQueue.send(ctrl)
        elif key == ord('s'):
            ctrl = dai.CameraControl()
            ctrl.setStartStreaming()
            controlQueue.send(ctrl)

I was going to open a github issue about this, but thought I'd check here if anyone had any insight into this problem before I did that.

Hi @cnolan
I think the issue is that stereo cameras share the i2c bus, so pausing the master camera will pause the slave. Then rerunning them seems to cause issues with synchronization. Best to create an issue on depthai-python repo since it's FW related.

Thanks,
Jaka

    Hi jakaskerl thanks for that, shall do. Can you remind me, is one of the two mono sockets designated as master vs. slave? Is that controlled by the frame sync mode - i.e. if I set one to INPUT and one to OUTPUT via setFrameSyncMode(dai.CameraControl.FrameSyncMode.INPUT), will that manipulate which is master and which is slave? Is the strobe output specifically wired to one socket?

    Hi @cnolan
    Yes, the FrameSyncMode controls the syncing part (via FSIN). Changing INPUT and OUTPUT does change which camera drives the signal. STROBE is isolated, but the left camera drives the IR LED.

    Thanks,
    Jaka