This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ov7725 DM365

Hi,

Actually we are working with dvsdk dvsdk_4_02_00_00 with the dmai_2_20_00_15 and linuxutils_2_26_01_02 and linux-2.6.32.17-psp03.01.01.39.

OV7725 is currently supported for dm365? If not, how I have to configure it to work with dm365? 

Take in consideration that in the linux-2.6.32.17-psp03.01.01.39 the ov772x has the soc-camera support. So I’ve tried to remove this support in order to use it in the dm365, and ov7725 has as output YUV 10 bit.

Thanks in advance for the support and help.

  • In the meantime , I've also wrote a more detailed description of the issue I have, attaching more documentation possible. Maybe someone could help me to make it works.

    PSP-dvsdk

    -          Psp linux-2.6.32.17-psp03.01.01.39

    -          Dvsdk dvsdk_4_02_00_00

     

    Scenario YUV mode:

    -          Ov7725 registers set as default: all the values are as shown in the doc attached OV7725_CSP2_DS (1.2) pdf

    -          Ov7725 COM 7 Register (address 0x12)  set to 0: it means that the sensor works as follows:

    o   Output format control: YUV

    o   RGB output format control GBR4:2:2

    o   Resolution: VGA

    -          OV7725 COM 3 Register (address 0x0C) set to 10: it means that the sensor work as follows:

    o   Swap Y/UV output sequence in YUV output mode

    -          Board-dm365-mn.c :

    static struct vpfe_subdev_info vpfe_sub_devs[] =

    {

                   {

                                   .module_name = "ov772x",

                                   .is_camera = 1,

                                   .grp_id = VPFE_SUBDEV_MT9P031,

                                   .num_inputs = ARRAY_SIZE(ov7725_inputs),

                                   .inputs = ov7725_inputs,

                                   .ccdc_if_params =

                                   {

    //                                            .if_type = VPFE_RAW_BAYER,

    // default output from sensor is YUV

                                                  .if_type = VPFE_YCBCR_SYNC_16,//VPFE_RAW_BAYER,

                                                  .hdpol = VPFE_PINPOL_NEGATIVE,

                                                  .vdpol = VPFE_PINPOL_NEGATIVE,

                                                  .ycswap = VPFE_DATA_C, //I add this patch to handle to possibility to swap in the dm365_ccdc.c

                                   },

                                   .board_info =

                                   {

                                                  I2C_BOARD_INFO("ov772x", 0x21),

                                                  //.platform_data = (void *)1,

                                   },

                   },

    -          Dm365_ccdc.c

    static struct ccdc_oper_config ccdc_cfg = {

                   .ycbcr = {

                                   .pix_fmt = CCDC_PIXFMT_YCBCR_16BIT,

                                   .frm_fmt = CCDC_FRMFMT_PROGRESSIVE,//CCDC_FRMFMT_INTERLACED,

                                   .win = CCDC_WIN_VGA,

                                   .fid_pol = VPFE_PINPOL_NEGATIVE,

                                   .vd_pol = VPFE_PINPOL_NEGATIVE,

                                   .hd_pol = VPFE_PINPOL_NEGATIVE,

                                   .pix_order = CCDC_PIXORDER_CBYCRY,//CCDC_PIXORDER_YCBYCR//CCDC_PIXORDER_CBYCRY,

                                   .buf_type = CCDC_BUFTYPE_FLD_INTERLEAVED,

                   },

                   .bayer = {

                                   .pix_fmt = CCDC_PIXFMT_RAW,

                                   .frm_fmt = CCDC_FRMFMT_PROGRESSIVE,

                                   .win = CCDC_WIN_VGA,

                                   .fid_pol = VPFE_PINPOL_NEGATIVE,

                                   .vd_pol = VPFE_PINPOL_NEGATIVE,

                                   .hd_pol = VPFE_PINPOL_NEGATIVE,

                                   .gain = {

                                                   .r_ye = {1, 0},

                                                   .gr_cy = {1, 0},

                                                   .gb_g = {1, 0},

                                                   .b_mg = {1, 0},

                                   },

                                   .cfa_pat = CCDC_CFA_PAT_MOSAIC,

                                   .data_msb = CCDC_BIT_MSB_9,//CCDC_BIT_MSB_11,

                                   .config_params = {

                                                   .data_size = CCDC_10_BITS,//CCDC_12_BITS,

                                                   .data_shift = CCDC_NO_SHIFT,

                                                   .col_pat_field0 = {

                                                                                  .olop = CCDC_GREEN_BLUE,

                                                                                  .olep = CCDC_BLUE,

                                                                                  .elop = CCDC_RED,

                                                                                  .elep = CCDC_GREEN_RED,

                                                   },

                                                   .col_pat_field1 = {

                                                                  .olop = CCDC_GREEN_BLUE,

                                                                  .olep = CCDC_BLUE,

                                                                  .elop = CCDC_RED,

                                                                  .elep = CCDC_GREEN_RED,

                                                   },

                                                   .test_pat_gen = 0,

                                   },

                   },

                   .data_pack = CCDC_DATA_PACK12,

    };

    -          Test and ISSUE:

    o   Run ./encode –r 640x480 –v /tm/test.264  -I 4 – t 20 this is the output

    ARM Load: 35% Video fps: 0 fps Video bit rate: 2 kbps Sound bit rate: 0 kbps Time: 00:00:01 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 20% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:02 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 12% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:03 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 12% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:04 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 11% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:06 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 13% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:07 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 17% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:08 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 15% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:09 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 18% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:10 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 12% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:12 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 13% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:13 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 19% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:14 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 15% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:15 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 15% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:16 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 12% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:18 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 13% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:19 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    ARM Load: 14% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time: 00:00:20 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 640x480 Sound Codec: N/A Sampling Freq: N/A

     

    o   No davinci.capture interrupts rise:

      0:          0       AINTC  vpfe_capture0

      1:          0       AINTC  vpfe_capture1

      3:          0       AINTC  dm365_h3a_af

      6:          0       AINTC  dm365_h3a_aew

      8:     119665       AINTC  davinci_osd

    10:          4       AINTC  IRQK_Handler

    16:          0       AINTC  edma

    17:          0       AINTC  edma_error

    29:          0       AINTC  davinci_rtc

    32:      59907       AINTC  clockevent

    33:          9       AINTC  free-run counter

    39:         56       AINTC  i2c_davinci

    40:        850       AINTC  serial

    52:          0       AINTC  eth0

    53:      16185       AINTC  eth0

    54:       3564       AINTC  eth0

    55:          0       AINTC  eth0

    o   Looking at kernel log, the system hangs in drivers/media/video/videobuf-core.c videobuf_waiton, where the state of videobuf_buffer is allways VIDEOBUF_ACTIVE

     

    Scenario RAW BAYER:

     

    -          Ov7725 registers set as default: all the values are as shown in the doc attached OV7725_CSP2_DS (1.2) pdf

    -          Ov7725 COM 7 Register (address 0x12)  set to 0x13: it means that the sensor works as follows:

    o   Output format control: Bayer RAW

    o   RGB output format control GBR4:2:2

    o   Sensor Raw enabled ( Bit[4] )

    o   Resolution: VGA

    -          Board-dm365-mn.c :

    static struct vpfe_subdev_info vpfe_sub_devs[] =

    {

                   {

                                   .module_name = "ov772x",

                                   .is_camera = 1,

                                   .grp_id = VPFE_SUBDEV_MT9P031,

                                   .num_inputs = ARRAY_SIZE(ov7725_inputs),

                                   .inputs = ov7725_inputs,

                                   .ccdc_if_params =

                                   {

    // default output from sensor is YUV

                                                  .if_type = VPFE_RAW_BAYER,

                                                  .hdpol = VPFE_PINPOL_NEGATIVE,

                                                  .vdpol = VPFE_PINPOL_NEGATIVE,

                                                  .ycswap = VPFE_DATA_C, //I add this patch to handle to possibility to swap in the dm365_ccdc.c

                                   },

                                   .board_info =

                                   {

                                                  I2C_BOARD_INFO("ov772x", 0x21),

                                                  //.platform_data = (void *)1,

                                   },

                   },

    -          Dm365_ccdc.c

    static struct ccdc_oper_config ccdc_cfg = {

                   .ycbcr = {

                                   .pix_fmt = CCDC_PIXFMT_YCBCR_16BIT,

                                   .frm_fmt = CCDC_FRMFMT_PROGRESSIVE,//CCDC_FRMFMT_INTERLACED,

                                   .win = CCDC_WIN_VGA,

                                   .fid_pol = VPFE_PINPOL_NEGATIVE,

                                   .vd_pol = VPFE_PINPOL_NEGATIVE,

                                   .hd_pol = VPFE_PINPOL_NEGATIVE,

                                   .pix_order = CCDC_PIXORDER_CBYCRY,//CCDC_PIXORDER_YCBYCR//CCDC_PIXORDER_CBYCRY,

                                   .buf_type = CCDC_BUFTYPE_FLD_INTERLEAVED,

                   },

                   .bayer = {

                                   .pix_fmt = CCDC_PIXFMT_RAW,

                                   .frm_fmt = CCDC_FRMFMT_PROGRESSIVE,

                                   .win = CCDC_WIN_VGA,

                                   .fid_pol = VPFE_PINPOL_NEGATIVE,

                                   .vd_pol = VPFE_PINPOL_NEGATIVE,

                                   .hd_pol = VPFE_PINPOL_NEGATIVE,

                                   .gain = {

                                                   .r_ye = {1, 0},

                                                   .gr_cy = {1, 0},

                                                   .gb_g = {1, 0},

                                                   .b_mg = {1, 0},

                                   },

                                   .cfa_pat = CCDC_CFA_PAT_MOSAIC,

                                   .data_msb = CCDC_BIT_MSB_9,//CCDC_BIT_MSB_11,

                                   .config_params = {

                                                   .data_size = CCDC_10_BITS,//CCDC_12_BITS,

                                                   .data_shift = CCDC_NO_SHIFT,

                                                   .col_pat_field0 = {

                                                                                  .olop = CCDC_GREEN_BLUE,

                                                                                  .olep = CCDC_BLUE,

                                                                                  .elop = CCDC_RED,

                                                                                  .elep = CCDC_GREEN_RED,

                                                   },

                                                   .col_pat_field1 = {

                                                                  .olop = CCDC_GREEN_BLUE,

                                                                  .olep = CCDC_BLUE,

                                                                  .elop = CCDC_RED,

                                                                  .elep = CCDC_GREEN_RED,

                                                   },

                                                   .test_pat_gen = 0,

                                   },

                   },

                   .data_pack = CCDC_DATA_PACK12,

    };

    -          Test and ISSUE:

    o   Run ./encode –r 640x480 –v /tm/test.264  -I 4 – t 20 , the application is able to save a video, but it is a black and white image with some pixel green, like if there is something wrong in the col_pat_field0/1. I attach a screenshot

     

    In attachment you can find:

     1.       Documentation of Sensor ov7725 with described default Register Set

    2.      Sensor Interface image

    3.       Ov7725_dm365_issue.zip that includes

    a.       Board init file

    b.      Dm365_ccdc.patch

    c.       Ov7725.patch (I tried to remove soc-camera framework)

    d.      Video.zip with the complete drivers/media/video for dm365

    4.  Kernel log in YUV scenario (there are the references to the lines of the code attached)

    The goal is to try to support ov7725 with a non-soc-camera host (like vpfe) with YUV 10 bit mode (or BT656).

    Hope you can give me some hints and support,

     

    Thanks7178.Docs-ov7725-dm365.zip