We are porting our dToF sensor from rockchip rk3568 to TI Am62ax SoC recently. Our dToF sensor output 4 streams (2 VCs and 2 data type: raw12 and raw8), and the first 2 bytes of the frame buffer for last streams(stream2, stream3) is frame id (16 bits value from 0 to 65535). Because from our test, it looks some frames are dropped, so I added the following code the check the continuity of the frame id,from the attached log, some frame-drop are happening.
bool V4l2_Dev::usrExtFrameIdMatchCheck(const char *FrameBuff)
{
bool ret = true;
u16 curFrameId = (FrameBuff[1] << 8) | FrameBuff[0];
if ((UNINITIED_FRAME_ID != last_frameId_in_raw) && ((last_frameId_in_raw + 1) != curFrameId))
{
ret = false;
DBG_ERROR("--last_frameId_in_raw: %d, curFrameId: %d for stream%d--...",
last_frameId_in_raw, curFrameId, video_device_idx);
}
else {
DBG_INFO("--last_frameId_in_raw: %d, curFrameId: %d for stream%d--...",
last_frameId_in_raw, curFrameId, video_device_idx);
}
last_frameId_in_raw = curFrameId;
return ret;
}
Would you please help to check the reason and figure out a solution?
I have some ideas/questions, please help to check whether it help too?
1. Currently, the mipi link frequency is 500M, since the mipi frequency of the TX side of our dToF sensor is 1G. Can I increase the mipi link frequency of RX side from 500M to 600 or higher? Will this help the frame-drop issue?
2. Can we change the DMA buffer speed? If yes, how to do?
3. I will try to add the buffer count when the application call VIDIOC_REQBUFS ioctl commands.
------------------log-------------------------------
[ 513.722678] Failed DMA transfer retval=3, residue=0
[2022-05-04 00:01:44.305.475.100] ERROR: <v4l2_dev.cpp-usrExtFrameIdMatchCheck() 447> --last_frameId_in_raw: 2181, curFrameId: 2206 for stream2--...
[ 513.782685] j721e-csi2rx 30102000.ticsi2rx: DMA transfer timed out for drain buffer
[2022-05-04 00:01:44.367.935.735] ERROR: <v4l2_dev.cpp-usrExtFrameIdMatchCheck() 447> --last_frameId_in_raw: 2181, curFrameId: 2206 for stream3--...
[ 513.846682] j721e-csi2rx 30102000.ticsi2rx: DMA transfer timed out for drain buffer
[ 513.854670] Failed DMA transfer retval=3, residue=0
[ 513.859802] Failed DMA transfer retval=3, residue=0
[2022-05-04 00:01:44.442.392.015] ERROR: <v4l2_dev.cpp-usrExtFrameIdMatchCheck() 447> --last_frameId_in_raw: 2206, curFrameId: 2233 for stream2--...
[2022-05-04 00:01:44.442.670.220] ERROR: <v4l2_dev.cpp-usrExtFrameIdMatchCheck() 447> --last_frameId_in_raw: 2206, curFrameId: 2233 for stream3--...