cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Adventurer
Adventurer
813 Views
Registered: ‎08-01-2018

VPSS configuration issues when connected to VDMA

Jump to solution

Hello,

      I am tring to do a YUV422 to RGB conversion using VPSS IP cores and then save the image in VDMA.

     VPSS(YUV422->YUV44)   -> VPSS(YUV444->RGB) -> VDMA

   

     Because the VDMA expects RGB I have the following parameters for VDMA: Hsize = 2592 * 4; // bytes per pixel  =4

                                                                                                                                            Vsize = 1944;

 

     I use 2 instances of VPSS, one to do YUV422 to YUV444 conversion and the second on to do YUV444 -> RGB conversion

     I think I do not set correctly Hactive and Vactive params in the 2 VPSS as I always get line less than expected error in the vdma.

     I have read different posts on this topic on this forums and I do not exactly how to set correctly the VPSS params: pixel per clock, bytes per colour and HActive.

    I am using this pipeline for still images and not a streaming video.

    I have the following VPSS config. At least I have no errors in configuring the subsytems(I have the debug calls at end) but the receving VDMA complains about either line size error /mismatch or less than expected and datamover internal error:

 

widthIn = 2592;
heightIn = 1944;

widthOut = 2592/*1920*/;
heightOut = 1944/*1080*/;

XVprocSs *InstancePtr1 = (XVprocSs*)malloc(sizeof(XVprocSs));
XVprocSs *InstancePtr2 = (XVprocSs*)malloc(sizeof(XVprocSs));


XVprocSs_Config *CfgPtr1 = XVprocSs_LookupConfig(XPAR_VCAM_STILL_IMAGE_Y422TOY444_DEVICE_ID);

 

if (CfgPtr1 != NULL)
XVprocSs_CfgInitialize(InstancePtr1, CfgPtr1, XPAR_VCAM_STILL_IMAGE_Y422TOY444_BASEADDR);


XVprocSs_Stop(InstancePtr1);

 

XVprocSs_Config *CfgPtr2 = XVprocSs_LookupConfig(XPAR_VCAM_STILL_IMAGE_YUVTORGB_DEVICE_ID);
XVprocSs_CfgInitialize(InstancePtr2, CfgPtr2, XPAR_VCAM_STILL_IMAGE_YUVTORGB_BASEADDR);
XVprocSs_Stop(InstancePtr2);

resIdIn = XVidC_GetVideoModeId(widthIn, heightIn, StreamIn2.FrameRate,
FALSE);

resIdOut = XVidC_GetVideoModeId(widthOut, heightOut, StreamOut2.FrameRate,
FALSE);


//StreamOut.VmId = resIdOut;
StreamIn1.VmId = XVIDC_VM_1920x1080_30_P;
StreamIn1.Timing.HActive = widthIn;
StreamIn1.Timing.VActive = heightIn;
StreamIn1.ColorFormatId = XVIDC_CSF_YCRCB_422;
StreamIn1.ColorDepth = XVIDC_BPC_6; //(XVidC_ColorDepth)InstancePtr1->Config.ColorDepth;
StreamIn1.PixPerClk = XVIDC_PPC_2; //(XVidC_PixelsPerClock)InstancePtr1->Config.PixPerClock;
StreamIn1.FrameRate = XVIDC_FR_UNKNOWN;
StreamIn1.IsInterlaced = 0;

status = XVprocSs_SetVidStreamIn(InstancePtr1, &StreamIn1);
if (status != XST_SUCCESS) {
xil_printf("Unable to set input video stream parameters correctly\r\n");
return XST_FAILURE;
}
//StreamOut.VmId = resIdOut;
StreamOut1.VmId = XVIDC_VM_1920x1080_30_P;
StreamOut1.Timing.HActive = widthIn;
StreamOut1.Timing.VActive = heightIn;
StreamOut1.ColorFormatId = XVIDC_CSF_YCRCB_444;
StreamOut1.ColorDepth = XVIDC_BPC_8; //(XVidC_ColorDepth)InstancePtr1->Config.ColorDepth;
StreamOut1.PixPerClk = XVIDC_PPC_2; //(XVidC_PixelsPerClock)InstancePtr1->Config.PixPerClock;
StreamOut1.FrameRate = XVIDC_FR_UNKNOWN;
StreamOut1.IsInterlaced = 0;

status = XVprocSs_SetVidStreamOut(InstancePtr1, &StreamOut1);
if (status != XST_SUCCESS) {
xil_printf("Unable to set output video stream parameters correctly\r\n");
return XST_FAILURE;
}

//StreamOut.VmId = resIdOut;
StreamIn2.VmId = XVIDC_VM_1920x1080_30_P;
StreamIn2.Timing.HActive = widthIn;
StreamIn2.Timing.VActive = heightIn;
StreamIn2.ColorFormatId = XVIDC_CSF_YCRCB_444;
StreamIn2.ColorDepth = XVIDC_BPC_8 ; //(XVidC_ColorDepth)InstancePtr2->Config.ColorDepth;
StreamIn2.PixPerClk = XVIDC_PPC_2 ; //(XVidC_PixelsPerClock)InstancePtr2->Config.PixPerClock;
StreamIn2.FrameRate = XVIDC_FR_UNKNOWN;
StreamIn2.IsInterlaced = 0;

status = XVprocSs_SetVidStreamIn(InstancePtr2, &StreamIn2);
if (status != XST_SUCCESS) {
xil_printf("Unable to set input video stream parameters correctly\r\n");
return XST_FAILURE;
}
//StreamOut.VmId = resIdOut;
StreamOut2.VmId = XVIDC_VM_1920x1080_30_P;
StreamOut2.Timing.HActive = widthOut;
StreamOut2.Timing.VActive = heightOut;
StreamOut2.ColorFormatId = XVIDC_CSF_RGB;
StreamOut2.ColorDepth = XVIDC_BPC_8; //(XVidC_ColorDepth)InstancePtr2->Config.ColorDepth;
StreamOut2.PixPerClk = XVIDC_PPC_2 ; //(XVidC_PixelsPerClock)InstancePtr2->Config.PixPerClock;
StreamOut2.FrameRate = XVIDC_FR_UNKNOWN;
StreamOut2.IsInterlaced = 0;

status = XVprocSs_SetVidStreamOut(InstancePtr2, &StreamOut2);
if (status != XST_SUCCESS) {
xil_printf("Unable to set output video stream parameters correctly\r\n");
return XST_FAILURE;
}

status = XVprocSs_SetSubsystemConfig(InstancePtr1);
if (status != XST_SUCCESS) {
xil_printf("XVprocSs_SetSubsystemConfig failed %d\r\n", status);
return XST_FAILURE;
}

status = XVprocSs_SetSubsystemConfig(InstancePtr2);
if (status != XST_SUCCESS) {
xil_printf("XVprocSs_SetSubsystemConfig failed %d\r\n", status);
return XST_FAILURE;
}

XVprocSs_Start(InstancePtr1);

XVprocSs_Start(InstancePtr2);

//Query video processing subsystem configuration
XVprocSs_ReportSubsystemConfig(InstancePtr1);
XVprocSs_LogDisplay(InstancePtr1);

XVprocSs_ReportSubsystemConfig(InstancePtr2);
XVprocSs_LogDisplay(InstancePtr2);

 

Thanks,

      Mihaita

 

  

Tags (2)
0 Kudos
Reply
1 Solution

Accepted Solutions
Moderator
Moderator
677 Views
Registered: ‎11-09-2015

Hi @mivascu85 

You are saying that you have 4 bytes per pixels but you TDATA width is 24.

24/8 = 3... So you have 3 byte per pixels. This is probably why you have a line error.


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**

View solution in original post

0 Kudos
Reply
8 Replies
Moderator
Moderator
761 Views
Registered: ‎11-09-2015

Hi @mivascu85 

What is the size of your picture? I do not understand this:

widthIn = 2592;
heightIn = 1944;

Also I did an example in my Video Series 28: Using the VPSS IP in Color Space Converter mode. Did you already look at it?

Regards


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Reply
Adventurer
Adventurer
749 Views
Registered: ‎08-01-2018

Hello,

 

     Yes, I have modified that, I noticed it was not supported by VPSS. The picture size is 1920x1080 now. I have looked at your example and made a few changes which renders my code more or less tha same as in your example but I still get line error in VDMA:

 

widthIn = 1920;
heightIn = 1080;

widthOut = 1920/*1920*/;
heightOut = 1080/*1080*/;

XVprocSs *InstancePtr1 = (XVprocSs*)malloc(sizeof(XVprocSs));
XVprocSs *InstancePtr2 = (XVprocSs*)malloc(sizeof(XVprocSs));

XVprocSs_Config *CfgPtr1 = XVprocSs_LookupConfig(XPAR_VCAM_STILL_IMAGE_Y422TOY444_DEVICE_ID);

 

if (CfgPtr1 != NULL)
XVprocSs_CfgInitialize(InstancePtr1, CfgPtr1, CfgPtr1->BaseAddress);


XVprocSs_Stop(InstancePtr1);

 

XVprocSs_Config *CfgPtr2 = XVprocSs_LookupConfig(XPAR_VCAM_STILL_IMAGE_YUVTORGB_DEVICE_ID);
XVprocSs_CfgInitialize(InstancePtr2, CfgPtr2, CfgPtr2->BaseAddress);
XVprocSs_Stop(InstancePtr2);

resIdIn = XVidC_GetVideoModeId(widthIn, heightIn, XVIDC_FR_60HZ,
FALSE);

resIdOut = XVidC_GetVideoModeId(widthOut, heightOut, XVIDC_FR_60HZ,
FALSE);


//Get the resolution details

TimingPtr = XVidC_GetTimingInfo(resIdIn);
StreamIn1.VmId = resIdIn;
StreamIn1.Timing = *TimingPtr;
StreamIn1.Timing.HActive = widthIn;
StreamIn1.Timing.VActive = heightIn;
StreamIn1.ColorFormatId = XVIDC_CSF_YCRCB_422;
StreamIn1.ColorDepth = (XVidC_ColorDepth)InstancePtr1->Config.ColorDepth;
StreamIn1.PixPerClk = (XVidC_PixelsPerClock)InstancePtr1->Config.PixPerClock;
StreamIn1.FrameRate = XVIDC_FR_60HZ;
StreamIn1.IsInterlaced = 0;

status = XVprocSs_SetVidStreamIn(InstancePtr1, &StreamIn1);
if (status != XST_SUCCESS) {
xil_printf("Unable to set input video stream parameters correctly\r\n");
return XST_FAILURE;
}

StreamOut1.VmId = resIdIn;
StreamOut1.Timing = *TimingPtr;
StreamOut1.Timing.HActive = widthIn;
StreamOut1.Timing.VActive = heightIn;
StreamOut1.ColorFormatId = XVIDC_CSF_YCRCB_444;
StreamOut1.ColorDepth = /*XVIDC_BPC_8*/ (XVidC_ColorDepth)InstancePtr1->Config.ColorDepth;
StreamOut1.PixPerClk = /*XVIDC_PPC_2*/ (XVidC_PixelsPerClock)InstancePtr1->Config.PixPerClock;
StreamOut1.FrameRate = XVIDC_FR_60HZ;
StreamOut1.IsInterlaced = 0;

status = XVprocSs_SetVidStreamOut(InstancePtr1, &StreamOut1);
if (status != XST_SUCCESS) {
xil_printf("Unable to set output video stream parameters correctly\r\n");
return XST_FAILURE;
}

StreamIn2.VmId = resIdIn;
StreamIn2.Timing = *TimingPtr;
StreamIn2.Timing.HActive = widthIn;
StreamIn2.Timing.VActive = heightIn;
StreamIn2.ColorFormatId = XVIDC_CSF_YCRCB_444;
StreamIn2.ColorDepth = (XVidC_ColorDepth)InstancePtr2->Config.ColorDepth;
StreamIn2.PixPerClk = (XVidC_PixelsPerClock)InstancePtr2->Config.PixPerClock;
StreamIn2.FrameRate = XVIDC_FR_60HZ;
StreamIn2.IsInterlaced = 0;

status = XVprocSs_SetVidStreamIn(InstancePtr2, &StreamIn2);
if (status != XST_SUCCESS) {
xil_printf("Unable to set input video stream parameters correctly\r\n");
return XST_FAILURE;
}

StreamOut2.VmId = resIdOut;
StreamOut2.Timing = *TimingPtr;
StreamOut2.Timing.HActive = widthOut;
StreamOut2.Timing.VActive = heightOut;
StreamOut2.ColorFormatId = XVIDC_CSF_RGB;
StreamOut2.ColorDepth = (XVidC_ColorDepth)InstancePtr2->Config.ColorDepth;
StreamOut2.PixPerClk = (XVidC_PixelsPerClock)InstancePtr2->Config.PixPerClock;
StreamOut2.FrameRate = XVIDC_FR_60HZ;
StreamOut2.IsInterlaced = 0;

status = XVprocSs_SetVidStreamOut(InstancePtr2, &StreamOut2);
if (status != XST_SUCCESS) {
xil_printf("Unable to set output video stream parameters correctly\r\n");
return XST_FAILURE;
}

status = XVprocSs_SetSubsystemConfig(InstancePtr1);
if (status != XST_SUCCESS) {
xil_printf("XVprocSs_SetSubsystemConfig failed %d\r\n", status);
return XST_FAILURE;
}

status = XVprocSs_SetSubsystemConfig(InstancePtr2);
if (status != XST_SUCCESS) {
xil_printf("XVprocSs_SetSubsystemConfig failed %d\r\n", status);
return XST_FAILURE;
}

XVprocSs_Start(InstancePtr1);

XVprocSs_Start(InstancePtr2);

0 Kudos
Reply
Adventurer
Adventurer
734 Views
Registered: ‎08-01-2018

I am wondering how could I further investigate the interface between VPSS and VDMA to see if the VPSS writes exactly the frame size/stride as expected by the VDMA.

 

   If I have VPSS with width = 1920, height=1080, output stream RGB mode. I would expect the stride to be calculated based on colour mode?

    and VDMA with HoriSizeInput = stride = 1920 *4, VertSizeInput=1080 and the VDMA has line less than expected error(XAXIVDMA_SR_ERR_LSZ_LESS_MASK) in status register  which means stride is not 1920*4 in the VPSS .

   I do not see Stride option in the XVidC_VideoTiming structure so I do not know how to explictily set the stride for VPSS. i assumed it is calculated based on the colour mode.

 I have tried both XVIDC_CSF_MEM_RGBX8 and XVIDC_CSF_RGB for the output stream Again I am trying to copy still images, no stream.

 But I still get VDMA stride related errors  and I assume the VPSS is not configured or working as expected

   Could somebody help me on this topic?

 

Thanks,

      Mihaita

 

 

0 Kudos
Reply
Moderator
Moderator
709 Views
Registered: ‎11-09-2015

HI @mivascu85 

What is the width of TDATA on the AXI4S connected to the VDMA?

Are you in 10 bits per component?

Did you check that the resolution sent through the VPSS is correct? Did you try with a TPG IP? You might want to try first with the TPG IP make sure the VDMA is working fine with your configuration.

Regards,


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Reply
Adventurer
Adventurer
703 Views
Registered: ‎08-01-2018

Hello,

 

    Thanks for your answer.

   TDATA for S2MM is 24U.

   I did not used TPG yet. I used Xylon ISP for which I set the frame size to be the one configured for VPSS and VDMA. And use test pattern for the camera sensor. I have CAMERA -> ISP -> VPSS1(YUV422 to YUV444) -> VPSS2(YUV444 to RGB) -> VDMA pipeline

  The VPSS MAX_DATA_WIDTH parameter is 8. Therefore the ColorDepth of the VPSS instances is XVIDC_BPC_8

   

Thanks,

       Mihaita

 

 

 

 

0 Kudos
Reply
Adventurer
Adventurer
702 Views
Registered: ‎08-01-2018

Forgot to mention the VDMA is working fine with that configuration. Is only when I introduce the 2 VPSS instances in the pipeline I get VDMA line error. Thanks

0 Kudos
Reply
Moderator
Moderator
678 Views
Registered: ‎11-09-2015

Hi @mivascu85 

You are saying that you have 4 bytes per pixels but you TDATA width is 24.

24/8 = 3... So you have 3 byte per pixels. This is probably why you have a line error.


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**

View solution in original post

0 Kudos
Reply
Adventurer
Adventurer
666 Views
Registered: ‎08-01-2018

Hello,

 

   Thanks for your reply and your time. Quite obvious no? For some reason S2MM and MM2S had different TDATA width for the VDMA.

 

Thanks,

      Mihaita

 

0 Kudos
Reply