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.

DM814x by camera interface (port) with BT.1120 YUV input

We are working in DM8148 board. The board was designed base on  APPRO 8127IPNC . We are using the IPNC V3.2 software. we replace camera sensor(9j003) by YUV 16bit 1080P input. and camera interface port of DM814x as video in.but the image is gray.We change the part of ISS,as below:

1. \psp\iss\drivers\capture\src\issdrv_captureApi.c

 2. \psp\iss\core\src\iss_drv_isif.c

3. \psp\iss\core\src\iss_drv_ipipe.c

 

 I think there are some mistakes in our configurations.please give me some good advices to solve the problem ,thank you!

Jiger

  • Hello,

    l will try to involve someone to help here with IPNC_RDK.

    Best Regards,

    Margarita

  • Dear Margarita,

    OK, I involve Oddy to here to show the problems and our progress on the project,he is my colleague.

    thanks again.

    Jiger

  • Hi,

    We have solved  last problem,but we have a new problem in video color .It looks like Y/C components are swapped.The image attached as below.Pls give me some good advice .

    thanks.

    Jiger

  • Hi Jiger,

    You are doing YUV 16 bits capture from ISS right. I assume you have provided the snapshot of YUV 422 output from resizer - is this correct?

    How do you intend to use the YUV-422 in your dataflows? If you need it for display via HDVPSS then the HDVPSS driver supports both UV & YV formats to account for luma/chroma swap. 

    Please provide some more details on the intend use. For example, if the intention is only for encoding and streaming out, then the RSZ output from ISS should be YUV 420 and not YUV 422.

    Regards

    Rajat

  • Hi  :

    This is oddy,I am doing the DM8148(8127)IPNC camera case.the dataflows like this:BT1120--->camera interface --->(ISS)RSZ------->output.

    1.in function:MultiCh_createTriStreamFullFtr(),I did the modification:

    #ifdef IMGS_MCR_MUX  

        pCameraInstPrm->inDataFormat =SYSTEM_DF_YUV422SP_UV

    #else  

        pCameraInstPrm->inDataFormat = SYSTEM_DF_YUV420SP_VU;// original

     #endif

    in fact,setting  inDataFormat to SYSTEM_DF_YUV422SP_UV has the same result with SYSTEM_DF_YUV420SP_VU.

    2. for ISS part :src\issdrv_captureApi.c

     #ifdef IMGS_MCR_MUX    

    rsz_reg->SRC_VSZ  = 1079;    

     rsz_reg->SRC_HSZ  = 1919;

     rszA_reg->RZA_V_DIF  = 256;    

     rszA_reg->RZA_H_DIF  = 256;  

     rszA_reg->RZA_DWN_EN  = 0;    

     rszA_reg->RZA_DWN_AV  = 0;

     rszB_reg->RZB_V_DIF = 576;  

     rszB_reg->RZB_H_DIF = 682;  

     isif_reg->MODESET = 0x100C;   //for YUV 16bit    

    isif_reg->HSIZE = 120;    

    ipipe_reg->SRC_FMT = 0x3;

    isif_reg->CCDCFG = (0x0 |(7<<11) |(7<<6) | (1<<4) );

     isif_reg->CCOLP   = 58596;  

     isif_reg->CGAMMAWD  = 16; 

     isif_reg->SPH       = 0;

     ipipeif_reg->CFG2 = 0x8F ;

      gIss_captCommonObj.pModuleInstance->nLscTableIsValid       = MSP_TRUE;

      ipipe_reg->WB2_WGN_R = 600; //White Balance Register White balance gain for R in U4.9 format 0 to +15.998 default 0x0200    

      ipipe_reg->WB2_WGN_B = 750; // same to up    

       ipipe_reg->RGB1_MUL_RR = 256;    

      ipipe_reg->RGB1_MUL_GR = 0;   

      ipipe_reg->RGB1_MUL_BR = 0;   

      ipipe_reg->RGB1_MUL_RG = 0;    

      ipipe_reg->RGB1_MUL_GG = 256;   

       ipipe_reg->RGB1_MUL_BG = 0;   

      ipipe_reg->RGB1_MUL_RB = 0;   

      ipipe_reg->RGB1_MUL_GB = 0;    

      ipipe_reg->RGB1_MUL_BB = 256;  

      isif_reg->HDW = 1919;//1921;

       isif_reg->VDW = 1079;//1081; 

     #endif

    tks

     

     

  • Dear Rajat,

    We are using Camera Interface(I/F)  receiving the video data( 16bit, BT.1120.Embedded sync mode,YUV422 format) on DM8148.The hardware is base on APPRO's DM8127 IPNC and the software is IPNC RDK3.2. We connect the sensor with DM8148 board. this sensor output BT.1120/1080P(YUV422 format).We configure some ISS registers,and DM8148 board can accept the video data( 16bit,YUV422 format),but the color of the image is not right. We can confirm the senor works well.

    DM8148 board with the sensor  is the same as the HD IP camera.

    We think both U and V are reversal. how to swap U/V in ISS driver?

    Regards

    Jiger

  • Jiger,

    You cannot swap the U/V in ISS output because what you are seeing is the fixed format in which ISS RSZ outputs YUV-422.

    But this is typically not a problem because when you use YUV-422 output in any other subsystem in the SOC for example HDVPSS, the ISS output format is also supported. Also, you can switch to YUV420 output format from the RSZ incase you want to use this output diretly for encoding.

    If you can tell me what do you want to do with the YUV 422 output frame I can suggest the datapath.

    Regards

    Rajat

  • Also, I wanted to add that ISS RSZ supports in-line conversion from YUV422 to YUV420.

    Regards

    Rajat

  • Jiger

    your want to change from 

     UY VY UV VY

    to

    VY UY VY UY

    right?

    Why not just increase RSZ_SRC_HPS+1?

    Best regards,

    Christian.

     

  • Dear Rajat,

    We are developing a HD IP-Video server,with HD-SDI input ,network output. there is a FPGA as HD-SDI input receiver,the FPGA output BT.1120 16bit data.Please give me some advices on this issue,how to conversion from YUV422 to YUV420?You great help is appreciated.

    Best regards

    Jiger

  • Dear Christian and Rajat,

    Thank you very much ,our product is HD-SDI Viedo Server.The schematic of  HD-SDI Video Server as below:

    Best Regards

    Jiger

  • Dear Christian:

        the iss datasheet says:

     

    and you said:Why not just increase RSZ_SRC_HPS+1?

    in my case. which value is more appropriate for  RSZ_SRC_HPS .

    oddy

    thks

     

  • Jiger,

    Based on my understanding of your usecase, you will need only YUV420 data output for encoder and also sufficient even if you want to do preview via HDMI, SD.

    To get YUV420 output you just need to set the output format as YUV420. The driver supports it. 

    Internally what will happens is that VP will capture BT.1120 YUV 16 bits and will send to the ISIF->RSZ (DMA). The RSZ is supposed to DMA out the buffers and also has the capability to do upscale, downscale and chroma downsampling. In current case, setting output format as YUV420 will enable the chroma downsampler in RSZ which will output the YUV420 into the output buffers. The YUV420 data can be directly sent to encoder, display etc.

    Regards,

    Rajat

  • Dear Rajat,

    You said DM8148 driver supports YUV420 not YUV422 by camera interface accepting video data,but in  DM8148 manual, ISS supports YUV422(8bit or 16bit) data( 281 page of manual), please check it.

    Best Regards

    Jiger


  • Dear Christian,

    Yes ,we want to change from UY VY UV VY to VY UY VY UY,how to do it ,please give me details on configration.Now we want to try all kinds of method to solve the problems

    Best Regards

    Jiger

  • Hi Jigar,

     

    I am not sure about the ISS but VIP can support BT1120 and we could store the output in either YUYV or UYVY format. i can provide mode details on this if you are interested.

     

    Regards,

    Brijesh Jadav

  • Dear Brijesh Jadav,

    Our design is base on DM8127 IPNC .the dataflows :BT1120--->camera interface --->(ISS)RSZ------->output. We are using the Camera interface port of DM8148,not vin port.

    We need to configre ISS not HDVPSS.

    Best Regards

    Jiger

  • Dear Rajat,

    It is hard to change YUV422 data output to YUV420 data output in FPGA, can you add that ISS RSZ supports in-line conversion from YUV422 to YUV420 ?

    thanks

    Best Regards

    Jiger

  • Jiger,

    I understand. I was explaining that capture from VP can be YUV422 16bit, but output of the RSZ should be YUV 420.

    The driver already supports output of YUV420. To enable YUV420 output please make sure that 'pCameraOutPrm->dataFormat = SYSTEM_DF_YUV420SP_VU' in the mcfw usecase file.

    Regards

    Rajat

  • Dear Rajat,

    OK ,I see,and Oddy will follow it ,thank you very much.

    Regards

    Jiger

  • Dear

    I did some modifaction in file: multich_tristream_fullfeature.c, I have defined  #define IMGS_SM_MUX.

    1.

    #define IMGS_SM_MUX
    .........
    pCameraInstPrm = &cameraPrm.vipInst[0];
    pCameraInstPrm->vipInstId = SYSTEM_CAMERA_INST_VP_CSI2;
    pCameraInstPrm->videoDecoderId = MultiCh_getSensorId(gUI_mcfw_config.sensorId);
    // pCameraInstPrm->inDataFormat = SYSTEM_DF_YUV420SP_VU;//original 2013-01-08 13:35:33
    #ifdef IMGS_SM_MUX
    pCameraInstPrm->inDataFormat =SYSTEM_DF_YUV422SP_UV;
    OSA_printf("----AAAAAAAAAAAA-----inDataFormat =SYSTEM_DF_YUV422SP_UV---------\n");
    #else
    pCameraInstPrm->inDataFormat = SYSTEM_DF_YUV420SP_VU;// original 2013-01-08 13:35:39
    #endif
    pCameraInstPrm->numOutput = 2;
    /* First stream */
    pCameraOutPrm = &pCameraInstPrm->outParams[0];
    if(gIsDiplayToBeDisabled == 0)
    {
    #ifdef IMGS_SM_MUX
    pCameraOutPrm->dataFormat = SYSTEM_DF_YUV420SP_VU
    OSA_printf("----AAAAAAAAAAAA-----gIsDiplayToBeDisabled ==0---------\n");
    #else
    pCameraOutPrm->dataFormat = SYSTEM_DF_YUV422I_VYUY;
    #endif
    }
    else
    {
    pCameraOutPrm->dataFormat = SYSTEM_DF_YUV420SP_VU;
    }
    pCameraOutPrm->scEnable = FALSE;
    /* Second stream */
    pCameraOutPrm = &pCameraInstPrm->outParams[1];
    pCameraOutPrm->dataFormat = SYSTEM_DF_YUV420SP_VU;
    pCameraOutPrm->scEnable = FALSE;
    pCameraOutPrm->scOutWidth = 720;
    pCameraOutPrm->scOutHeight = 480;
    pCameraOutPrm->standard = SYSTEM_STD_NTSC;//SYSTEM_STD_PAL;
    pCameraOutPrm->outQueId = 1;
    ..........
    when i config the pCameraOutPrm->dataFormat = SYSTEM_DF_YUV420SP_VU in first stream ignore the second stream.there no stream data to ouput.

    2.
    .........
    pCameraInstPrm = &cameraPrm.vipInst[0];
    pCameraInstPrm->vipInstId = SYSTEM_CAMERA_INST_VP_CSI2;
    pCameraInstPrm->videoDecoderId = MultiCh_getSensorId(gUI_mcfw_config.sensorId);
    // pCameraInstPrm->inDataFormat = SYSTEM_DF_YUV420SP_VU;//original 2013-01-08 13:35:33
    #ifdef IMGS_SM_MUX
    pCameraInstPrm->inDataFormat =SYSTEM_DF_YUV422SP_UV;
    OSA_printf("----AAAAAAAAAAAA-----inDataFormat =SYSTEM_DF_YUV422SP_UV---------\n");
    #else
    pCameraInstPrm->inDataFormat = SYSTEM_DF_YUV420SP_VU;// original 2013-01-08 13:35:39
    #endif
    pCameraInstPrm->numOutput = 2;
    /* First stream */
    pCameraOutPrm = &pCameraInstPrm->outParams[0];
    if(gIsDiplayToBeDisabled == 0)
    {
    #ifdef IMGS_SM_MUX
    pCameraOutPrm->dataFormat = SYSTEM_DF_YUV422I_VYUY;
    OSA_printf("----AAAAAAAAAAAA-----gIsDiplayToBeDisabled ==0---------\n");
    #else
    pCameraOutPrm->dataFormat = SYSTEM_DF_YUV422I_VYUY;
    #endif
    }
    else
    {
    pCameraOutPrm->dataFormat = SYSTEM_DF_YUV420SP_VU;
    }
    pCameraOutPrm->scEnable = FALSE;
    /* Second stream */
    pCameraOutPrm = &pCameraInstPrm->outParams[1];
    pCameraOutPrm->dataFormat = SYSTEM_DF_YUV420SP_VU;
    pCameraOutPrm->scEnable = FALSE;
    pCameraOutPrm->scOutWidth = 720;
    pCameraOutPrm->scOutHeight = 480;
    pCameraOutPrm->standard = SYSTEM_STD_NTSC;//SYSTEM_STD_PAL;
    pCameraOutPrm->outQueId = 1;
    ............
    when i config the pCameraOutPrm->dataFormat = SYSTEM_DF_YUV422I_VYUY in first stream ignore the second stream.there will be stream data ouput,i can play it by VLC.but the corlor is incorrect.
    like this:

    Now.I don't know what 's the reason cause the color incrrect.can you give me some suggestions.
  • Dear Rajat,

    We have not any progress on this issue,can you give us a configuration of sample with YUV422 input by I/F port of DM8148 for our reference?or you can give us some advices on this issue.thank you very much.

    Regards

    Jiger

  • Can you attach and send the multich_tristream_fullfeature.c file? Also, please confirm if you changed any code in ISS drivers pacakge, especially \packages\ti\psp\iss\drivers\capture\src\issdrv_captureApi.c file.

    If the output is YUV422I and the same output goes to the encoder the colors will be inaccurate. The setting for converting from YUV422 to YUV420 is done by the RZA_420 register in ISS_RESIZER section of the ISS register manual. Also the inDataFormat value in the above code will not make any difference.

    I think because of some other issue in the code the YUV420 setting is not working for you and this needs to be debugged.

    Regards

    Rajat

  • Dear Rajat:

    thanks very much for your help.

    I attached the source code about the modifaction.it can be work ok but the color in abnormal.i think there are some mistake to config the rigesters about IPIPE RSZ and ISIF wish a good news from you.

    oddy

     2474.source.rar

  • Dear Rajat,

    Xue have solved the same problem after he had the same problems.The link as below.

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/221064.aspx?pi70909=1

    He said he Modify the rsz_reg,rszA_reg,rszB_reg,isif_reg,isife_reg in Iss_captCreate function in issdrv_captureApi.c.  The SPRUH30 is talk about these registers.

    But we have not progress yet untill today.please give us some advice on this issue.

    thank

    Jiger

  • oddy,

    the idea is if RSZ read the next pixel , the UY VY read sequence will be inversted.

    so what is the current RSZ_SRC_HPS value which you're using,

    and what the image will be like if you increase the value by 1 and give it to RSZ_SRC_HPS?

    Best regards,

    Christian.

     

  • FYI:

    I use RDK3.2, custom DM8148 board, video input is YUV422/Discrete sync 1080P from FPGA.

    I didn't modify usecase files at all. Most of the changes are in issdrv_captureApi.c

    @line 121:

    - #if defined IMGS_OMNIVISION_OV10630

    + #if defined IMGS_OMNIVISION_OV10630 || defined OUR_YUV_SENSOR

    in Iss_captCreate().

    #if defined OUR_YUV_SENSOR
        ipipe_reg->SRC_FMT=3;
        ipipe_reg->SRC_HPS=0;
        ipipe_reg->SRC_VPS=0;
        ipipe_reg->SRC_COL  = 27;

        ipipeif_reg->CFG1 = 0;
        ipipeif_reg->CFG2 = 0x0E;
        isif_reg->MODESET = 0x100c;   //for YUV
        isif_reg->CCDCFG = 0;
        isif_reg->SYNCEN = 1;
        isif_reg->CLDCOFST = 0;

        rsz_reg->SRC_VSZ    = 1079;
        rsz_reg->SRC_HSZ    = 1919;
        rsz_reg->SRC_HPS = 0;
        rsz_reg->SRC_VPS = 0;
        rszA_reg->RZA_O_VSZ = 1075;
        rszA_reg->RZA_O_HSZ = 1919;
        rszA_reg->RZA_SDR_Y_OFT=0x780;
        rszA_reg->RZA_SDR_Y_PTR_S=0;
        rszA_reg->RZA_SDR_Y_PTR_E=0x438;

        rszA_reg->RZA_V_DIF         = 256;
        rszA_reg->RZA_H_DIF     = 256;
        rszA_reg->RZA_DWN_EN    = 0;
        rszA_reg->RZA_DWN_AV    = 0;
    #endif

    I suggest you try the original use case, which has yuv420 ouput from resizer.

  • FYI:

    I use RDK3.2, custom DM8148 board, video input is YUV422/Discrete sync 1080P from FPGA.

    I didn't modify usecase files at all. Most of the changes are in issdrv_captureApi.c

    @line 121:

    - #if defined IMGS_OMNIVISION_OV10630

    + #if defined IMGS_OMNIVISION_OV10630 || defined OUR_YUV_SENSOR

    in Iss_captCreate().

    #if defined OUR_YUV_SENSOR
        ipipe_reg->SRC_FMT=3;
        ipipe_reg->SRC_HPS=0;
        ipipe_reg->SRC_VPS=0;
        ipipe_reg->SRC_COL  = 27;

        ipipeif_reg->CFG1 = 0;
        ipipeif_reg->CFG2 = 0x0E;
        isif_reg->MODESET = 0x100c;   //for YUV
        isif_reg->CCDCFG = 0;
        isif_reg->SYNCEN = 1;
        isif_reg->CLDCOFST = 0;

        rsz_reg->SRC_VSZ    = 1079;
        rsz_reg->SRC_HSZ    = 1919;
        rsz_reg->SRC_HPS = 0;
        rsz_reg->SRC_VPS = 0;
        rszA_reg->RZA_O_VSZ = 1075;
        rszA_reg->RZA_O_HSZ = 1919;
        rszA_reg->RZA_SDR_Y_OFT=0x780;
        rszA_reg->RZA_SDR_Y_PTR_S=0;
        rszA_reg->RZA_SDR_Y_PTR_E=0x438;

        rszA_reg->RZA_V_DIF         = 256;
        rszA_reg->RZA_H_DIF     = 256;
        rszA_reg->RZA_DWN_EN    = 0;
        rszA_reg->RZA_DWN_AV    = 0;
    #endif

    thanks very much.I will try it later.

    oddy

  • Dear :

       I have solved this problem based on Hongfeng Wang's sugesstions.only change isif_reg->SYNCEN = 0;

     

    thks

     

    oddy

     

  • oddy,

    good to see this, but you disabled ISIF?

     

    Best regards,

    Christian.

  • Dear Christian:

    if  the  isif_reg->SYNCEN = 1;there is no images to display.when this register set to 0, the image is OK. 

    I want to konw what willl happen when i disable the ISIF?