erik , near a month later, I go a little far with this… I think this is a disaster, an unstable solution…
Lets take an optimal solution for frame syncing:
First of all, if you simply change in this example to 4K resolution, example dies, well… I suppose FPS are high and 4K images are heavy, camRgb->setVideoNumFramesPool(10), its big for 4K images. Lets try with 5 on pool and 20 on FPS. Stops in less than 10 seconds… Stoping means that frames not arriving to python script and no sync...
Disparity aligned frames with 4K seems heavier than Color ones.
[19443010E156DF1200] [1.2.2] [2.669] [Script(4)] [debug] RECV STREAM: rgb TS: 0:00:02.470649 SEQ:2
[19443010E156DF1200] [1.2.2] [2.670] [Script(4)] [debug] SYNC S:disp TS: 0:00:02.471298 SEQ:2
[19443010E156DF1200] [1.2.2] [2.672] [Script(4)] [debug] SYNC S:rgb TS: 0:00:02.470649 SEQ:2
[19443010E156DF1200] [1.2.2] [2.679] [Script(4)] [debug] RECV STREAM: rgb TS: 0:00:02.537083 SEQ:3
[19443010E156DF1200] [1.2.2] [2.684] [Script(4)] [debug] RECV STREAM: rgb TS: 0:00:02.603561 SEQ:4
RECV is when i recieve frame on host, into sync python script, SYNC is where there is a match.
As you can see rgb frames quick start misaligning.
Lets try 10 frames, 5 on pool. it start on relative good sync, but wait…
[19443010E156DF1200] [1.2.2] [30.427] [Script(4)] [debug] RECV STREAM: disp TS: 0:00:30.058952 SEQ:277
[19443010E156DF1200] [1.2.2] [30.428] [Script(4)] [debug] SYNC S:disp TS: 0:00:30.058952 SEQ:277
[19443010E156DF1200] [1.2.2] [30.429] [Script(4)] [debug] SYNC S:rgb TS: 0:00:30.057370 SEQ:277
[19443010E156DF1200] [1.2.2] [30.461] [Script(4)] [debug] RECV STREAM: rgb TS: 0:00:30.257445 SEQ:279
[19443010E156DF1200] [1.2.2] [30.470] [Script(4)] [debug] RECV STREAM: disp TS: 0:00:30.158988 SEQ:278
[19443010E156DF1200] [1.2.2] [30.471] [Script(4)] [debug] SYNC S:disp TS: 0:00:30.158988 SEQ:278
[19443010E156DF1200] [1.2.2] [30.473] [Script(4)] [debug] SYNC S:rgb TS: 0:00:30.157021 SEQ:278
[19443010E156DF1200] [1.2.2] [30.575] [Script(4)] [debug] RECV STREAM: rgb TS: 0:00:30.357096 SEQ:280
[19443010E156DF1200] [1.2.2] [30.580] [Script(4)] [debug] RECV STREAM: disp TS: 0:00:30.259023 SEQ:279
[19443010E156DF1200] [1.2.2] [30.581] [Script(4)] [debug] SYNC S:disp TS: 0:00:30.259023 SEQ:279
[19443010E156DF1200] [1.2.2] [30.583] [Script(4)] [debug] SYNC S:rgb TS: 0:00:30.257445 SEQ:279
[19443010E156DF1200] [1.2.2] [30.685] [Script(4)] [debug] RECV STREAM: rgb TS: 0:00:30.457522 SEQ:281
In some cases, streams start to missalign between, sync didnt find candidates, then cameras on trace log reports that frames continue arriving, but script didnt sync anything, an nothing comes to it. Cameras remains in a unknow state, not closed state.
[19443010E156DF1200] [1.2.2] [2.608] [Script(4)] [debug] RECV STREAM: disp TS: 0:00:02.346922 SEQ:0
[19443010E156DF1200] [1.2.2] [2.609] [Script(4)] [debug] RECV STREAM: rgb TS: 0:00:02.415929 SEQ:0
[19443010E156DF1200] [1.2.2] [2.611] [Script(4)] [debug] RECV STREAM: disp TS: 0:00:02.446951 SEQ:1
[19443010E156DF1200] [1.2.2] [2.612] [Script(4)] [debug] RECV STREAM: rgb TS: 0:00:02.515579 SEQ:1
[19443010E156DF1200] [1.2.2] [2.615] [Script(4)] [debug] RECV STREAM: disp TS: 0:00:02.546984 SEQ:2
[19443010E156DF1200] [1.2.2] [2.662] [Script(4)] [debug] RECV STREAM: rgb TS: 0:00:02.615229 SEQ:2
[19443010E156DF1200] [1.2.2] [2.762] [Script(4)] [debug] RECV STREAM: rgb TS: 0:00:02.713880 SEQ:3
[19443010E156DF1200] [1.2.2] [2.816] [system] [info] Memory Usage - DDR: 157.02 / 340.34 MiB, CMX: 2.47 / 2.50 MiB, LeonOS Heap: 46.78 / 77.23 MiB, LeonRT Heap: 8.03 / 41.14 MiB
[19443010E156DF1200] [1.2.2] [2.816] [system] [info] Temperatures - Average: 54.97C, CSS: 55.51C, MSS 54.64C, UPA: 55.07C, DSS: 54.64C
[19443010E156DF1200] [1.2.2] [2.816] [system] [info] Cpu Usage - LeonOS 21.90%, LeonRT: 76.51%
[19443010E156DF1200] [1.2.2] [2.861] [Script(4)] [debug] RECV STREAM: rgb TS: 0:00:02.813531 SEQ:4
[19443010E156DF1200] [1.2.2] [3.817] [system] [info] Memory Usage - DDR: 157.02 / 340.34 MiB, CMX: 2.47 / 2.50 MiB, LeonOS Heap: 46.78 / 77.23 MiB, LeonRT Heap: 8.03 / 41.14 MiB
[19443010E156DF1200] [1.2.2] [3.817] [system] [info] Temperatures - Average: 54.26C, CSS: 54.86C, MSS 53.33C, UPA: 54.64C, DSS: 54.21C
[19443010E156DF1200] [1.2.2] [3.817] [system] [info] Cpu Usage - LeonOS 10.14%, LeonRT: 9.38%
DepthAi have not a Reset pipeline or device reset, you must reinit pipeline, after this error let device unclosed, next time to try open pipeline it generates a XLINK_NO_DEVICE and on the next try it starts working.
As a resume, you may try lower FPS till something tolerable, but cameras at any point start to missaligned and stop, this is an erratic behaviour, hard to find, and hard to atack in a production device robust and ready to work for hours…
Can you give me and advise to make this more stable? Im using later API version and Firmware. Its a way to reset camera? Its a way to know when camera dies, when syncing stops...
As a reference with problem
luxonis/depthai238