thebambuproject

  • Jan 25, 2024
  • Joined Apr 25, 2023
  • 1 best answer
  • @thebambuproject Sorry for delay. I checked again with DepthAI 2.23.0, and FSYNC should work, with one of LEFT or RIGHT OV9282 set as OUTPUT. IMX378 doesn't have the output capability for now.

    I noticed few issues with your code, regarding the GPIO configuration. Pushed the changes on a fork here:
    alex-luxonis/tmp-fsync-testae681eb

    • DeviceConfig/BoardConfig to be set before creating the Device object (as it's done as early init, before the pipeline is loaded. Attempting to set GPIO6 didn't have effect before
    • GPIO41 from RVC2 SoC to not be touched, or configured as input (default). It is interconnected to camera FSYNC/FSIN/XVS signals, and if driven (high or low), would create bus contention, with higher drive strength from SoC side which would cancel out the sensor-generated signal. Would likely result in no frames from IMX378, but OV9282 would still stream at configured FPS even in sync INPUT mode with missing signal (sensor particularity). For the given OAK-FFC-4P hardware revision (up to R5, inclusive), only GPIO6 needs to be driven high to interconnect A+D and B+C sync lines on baseboard.

    Relevant changes:

    // Important for device/board config to be tweaked before sending the pipeline to Device constructor.
    // Also in case the pipeline is sent separately (startPipeline after Device creation), then config must be passed to Device constructor instead
    dai::Device::Config c = pipeline.getDeviceConfig();
    c.board.gpio[6] = dai::BoardConfig::GPIO(dai::BoardConfig::GPIO::Direction::OUTPUT, dai::BoardConfig::GPIO::Level::HIGH);
    // c.board.gpio[41] = dai::BoardConfig::GPIO(dai::BoardConfig::GPIO::Direction::INPUT, dai::BoardConfig::GPIO::Level::LOW);
    pipeline.setBoardConfig(c.board);
    dai::Device device(pipeline);

    When hardware sync works, the capture timestamps should get very close together (less than 0.2ms between OV9282 and IMX378). Sequence numbers may be different, we'll try to fix that in FW. But timestamps should be good (and that's also what StereoDepth uses internally to sync left and right). With the extra code to print timestamps, I'm getting:

    DISP 0 ts-offset: 4.110202 device_ts: 2.493684
    RGB  0 ts-offset: 4.265498 device_ts: 2.648979
    DISP 1 ts-offset: 4.235205 device_ts: 2.618687
    
    RGB  1 ts-offset: 4.390498 device_ts: 2.773979
    DISP 3 ts-offset: 4.390339 device_ts: 2.773820
    
    RGB  2 ts-offset: 4.515498 device_ts: 2.898979
    DISP 4 ts-offset: 4.515337 device_ts: 2.898818
    
    RGB  3 ts-offset: 4.640498 device_ts: 3.023979
    DISP 5 ts-offset: 4.640338 device_ts: 3.023819
    
    RGB  4 ts-offset: 4.765498 device_ts: 3.148979
    DISP 6 ts-offset: 4.765336 device_ts: 3.148817
    
    RGB  5 ts-offset: 4.890498 device_ts: 3.273979
    DISP 7 ts-offset: 4.890337 device_ts: 3.273818
    
    RGB  6 ts-offset: 5.015497 device_ts: 3.398979
    DISP 8 ts-offset: 5.015336 device_ts: 3.398817
    
    RGB  7 ts-offset: 5.140498 device_ts: 3.523979
    DISP 9 ts-offset: 5.140336 device_ts: 3.523817
    
    RGB  8 ts-offset: 5.265497 device_ts: 3.648979
    DISP 10 ts-offset: 5.265336 device_ts: 3.648818
    
    RGB  9 ts-offset: 5.390497 device_ts: 3.773979
    DISP 11 ts-offset: 5.390335 device_ts: 3.773816
    
    RGB  10 ts-offset: 5.515497 device_ts: 3.898979
    DISP 12 ts-offset: 5.515337 device_ts: 3.898818
    
    RGB  11 ts-offset: 5.640497 device_ts: 4.023979
    DISP 13 ts-offset: 5.640336 device_ts: 4.023817

    If things still don't work, possible to post a picture with your setup? We'll confirm if the camera modules used are good for sync as-is.