Zero bytes frame on MIPI-CSI2 i.MX8MQ

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Zero bytes frame on MIPI-CSI2 i.MX8MQ

1,268 Views
ManuelL
Contributor I

Hello,

I am implementing a driver for the tc358743 chip using NXP EVK, currently, when I try to capture the video stream using v4l2-ctrl, I receive buffers with the expected frame rate.

v4l2-ctl --device /dev/video1 --stream-mmap --set-fmt-video=width=1920,height=1080

but the buffers received only has zero bytes. I have tried with 2 different resolutions 1080p30 and 720p60, in both cases, the frame rate received is correct.

I have tried to confirm if this buffer with zero bytes is the frame read from the address CSI_CSIDMASA_FB1 and CSI_CSIDMASA_FB2, So after writing the data in the video buffer 2 I am get the virtual address and I print the information of different parts of the buffer (see patch below) and I still see the zero bytes.

--- a/drivers/media/platform/mxc/capture/mx6s_capture.c
+++ b/drivers/media/platform/mxc/capture/mx6s_capture.c
@@ -1095,8 +1095,26 @@ static void mx6s_csi_frame_done(struct mx6s_csi_dev *csi_dev,
                to_vb2_v4l2_buffer(vb)->sequence = csi_dev->frame_count;
                if (err)
                        vb2_buffer_done(vb, VB2_BUF_STATE_ERROR);
-               else
+               else {
+                       int idx = 0;
+                       unsigned char *video_buffer;
                        vb2_buffer_done(vb, VB2_BUF_STATE_DONE);
+                       video_buffer = vb2_plane_vaddr(vb, 0);
+                       /* Check initial buffer values */
+                       for(idx = 0; idx < 8; ++idx){
+                               dev_info(csi_dev->dev, "%d 0x%X\n",idx, video_buffer[idx]);
+                       }
+                       for(idx = 5*240; idx < 5*240 + 8; ++idx){
+                               dev_info(csi_dev->dev, "%d 0x%X\n",idx, video_buffer[idx]);
+                       }
+                       /* Check Chroma values */
+                       for(idx = 1080*1920; idx < 1080*1920 + 8; ++idx){
+                               dev_info(csi_dev->dev, "%d 0x%X\n",idx, video_buffer[idx]);
+                       }
+                       for(idx = 1080*1920 + 240; idx < 1080*1920 + 248; ++idx){
+                               dev_info(csi_dev->dev, "%d 0x%X\n",idx, video_buffer[idx]);
+                       }
+               }
        }
 
        csi_dev->frame_count++;

 

Why I am getting frame buffers but with zero bytes? Any suggestions?

Regards,

0 Kudos
Reply
1 Reply

817 Views
joanxie
NXP TechSupport
NXP TechSupport

pls dump the csi registers to check, did you get any signal from csi?

0 Kudos
Reply