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.

TDA2PXEVM: Logo usecase to HLOS

Part Number: TDA2PXEVM

Hi Team,

I am working on vision SDK v3.07.

I am trying to port the logo usecase from rtos to hlos.


The following is the usecase where, NullSource_m4 -> Display is link added for displaying the logo

NullSource (A15) -> Decode -> VPE -> Sync -> Dup -> Gate_Alg1 -> Alg1 (DSP1) -> Display_HDMI
                              
Dup -> Gate_Alg2 -> Alg2 (DSP1) -> SgxFrmcpy (A15) -> Display_LCD
 
Dup -> Alg3 (DSP1)
 
//Dynamic overlays
//ssdOverlayLink (IPU1_0) -> Display_Grpx
 
NullSource_m4 -> Display
 

I am facing a segmentation fault on reaching the fillSrcBuf function
 [HOST] [IPU1-0]     49.845757 s:  IPC_IN_1   : Create in progress !!!
 [HOST] [IPU1-0]     49.846916 s:  IPC_IN_1   : Create Done !!!
 [HOST] [IPU1-0]     49.847312 s:  DISPLAY: Create in progress !!!
 [HOST] [IPU1-0]     49.847953 s:  DISPLAY: Create Done !!!
 [HOST] [DSP1  ]     49.845299 s:  ALGORITHM: Create Done (algId = 44) !!!
 [HOST] [DSP1  ]     49.845452 s:  IPC_OUT_0   : Create in progress !!!
 [HOST] [DSP1  ]     49.845513 s:  IPC_OUT_0   : Create Done !!!
****** Segmentation fault caught ....
Faulty address is (nil), called from 0x14cad
Totally Obtained 0 stack frames. signal number =11 
 Signal number = 11, Signal errno = 0
 SI code = 1 (Address not mapped to object)
 Fault addr = (nil) 
[bt] Execution path:

Below is the gdb prints,
Single stepping until exit from function fillSrcBuf,
which has no line number information.
 [HOST] [IPU1-0]     45.669279 s:  DISPLAY: Create in progress !!!
 [HOST] [IPU1-0]     45.669859 s:  DISPLAY: Create Done !!!
 [HOST] [HOST  ]     45.670164 s:  Calling fillSrcBuf() 
 [HOST] [HOST  ]     47.925974 s:  Inside fillSrcBuf() 
 [HOST] [HOST  ]     47.967455 s:  sizeof(NullSrcLink_GetBufInfoParams) : 1a8
 [HOST] [HOST  ]     47.980174 s: &getBufInfoPrm: 0xbeffcf30
 [HOST] [HOST  ]     47.993320 s: ptr: 0xbeffcf30
 [HOST] [HOST  ]     48.006130 s: Address of pBuffer after OSA_memVirt2Phys: (nil)
 [HOST] [HOST  ]     48.016683 s:  Inside fillSrcBuf():After System_linkControl() 
 [HOST] [HOST  ]     48.031629 s:  Inside fillSrcBuf():After UTILS_assert() 
 [HOST] [HOST  ]     48.082779 s: pBuffer: 0xbeffcf38
 [HOST] [HOST  ]     48.102604 s: pBuffer->payload: 0x9b0446b0
 [HOST] [HOST  ]     48.113066 s: pVideoFrame: 0x26c4
 [HOST] [HOST  ]     48.125907 s: pVideoFrame: 0x9b0446b0
 [HOST] [HOST  ]     48.138717 s: pVideoFrame->bufAddr[0]=(nil)
 [HOST] [HOST  ]     48.144634 s: dummy
memset () at ../sysdeps/arm/memset.S:29
29	../sysdeps/arm/memset.S: No such file or directory.

Below is the snippet of the code 

Void fillSrcBuf(SVS_3DObj *pUcObj)
{
    Int32 status;
    UInt32 ht, bufCnt, logoStartX, logoStartY, offset;
    UInt8 *srcAddr, *dstAddr;
    NullSrcLink_GetBufInfoParams getBufInfoPrm;
    System_Buffer *pBuffer;
    System_VideoFrameBuffer *pVideoFrame;
	float* ptr = NULL;
	
    Vps_printf(" Inside fillSrcBuf() ");
    /**
     *  Get the Null source buffer info
     */
    getBufInfoPrm.chId = 0U;
    status = System_linkControl(
                    pUcObj->NullSource_m4LinkID,
                    NULL_SRC_LINK_CMD_GET_BUF_INFO,
                    &getBufInfoPrm,
                    sizeof(NullSrcLink_GetBufInfoParams),
                    TRUE);
                    
     Vps_printf(" sizeof(NullSrcLink_GetBufInfoParams) : %x", sizeof(NullSrcLink_GetBufInfoParams));  
	 Vps_printf("&getBufInfoPrm: %p",&getBufInfoPrm);
	 
	 ptr = &getBufInfoPrm;
	 
	 Vps_printf("ptr: %p",ptr);
	 //pBuffer = OSA_memVirt2Phys((unsigned int)ptr, OSA_MEM_REGION_TYPE_AUTO);
	 
	 Vps_printf("Address of pBuffer after OSA_memVirt2Phys: %p",pBuffer);
     Vps_printf(" Inside fillSrcBuf():After System_linkControl() ");
     UTILS_assert (SYSTEM_LINK_STATUS_SOK == status);
     Vps_printf(" Inside fillSrcBuf():After UTILS_assert() "); //done

	//pBuffer->hlosTranslationDisable = 0U;
	//Vps_printf("pBuffer->hlosTranslationDisable = %lu", pBuffer->hlosTranslationDisable);

    for (bufCnt = 0;bufCnt < getBufInfoPrm.numBuf;bufCnt ++)
    {
        pBuffer = &getBufInfoPrm.buffer[bufCnt];
		//pBuffer = (void *) OSA_memVirt2Phys((unsigned int) pBuffer, OSA_MEM_REGION_TYPE_AUTO);
		Vps_printf("pBuffer: %p",pBuffer);
		Vps_printf("pBuffer->payload: %p",pBuffer->payload);
		Vps_printf("pVideoFrame: %p",pVideoFrame);
        pVideoFrame = pBuffer->payload;
		Vps_printf("pVideoFrame: %p",pVideoFrame);
		Vps_printf("pVideoFrame->bufAddr[0]=%p", pVideoFrame->bufAddr[0]);
		dummy_func();
        memset(
            pVideoFrame->bufAddr[0],
            0xFF,
            (INPUT_FRAME_RESOLUTION_WIDTH * INPUT_FRAME_RESOLUTION_HEIGHT));
		Vps_printf("pVideoFrame->bufAddr[1]=%p", pVideoFrame->bufAddr[1]);
		dummy_func();
        memset(
            pVideoFrame->bufAddr[1],
            0x80,
            (INPUT_FRAME_RESOLUTION_WIDTH * INPUT_FRAME_RESOLUTION_HEIGHT/2));
		Vps_printf("Both memset done");
		dummy_func();
        /* copy TI logo */
        logoStartX = (INPUT_FRAME_RESOLUTION_WIDTH - TILOGO_WIDTH)/2;
        logoStartY = (INPUT_FRAME_RESOLUTION_HEIGHT - TILOGO_HEIGHT)/2;
        offset = (logoStartY * INPUT_FRAME_RESOLUTION_WIDTH) + logoStartX;
        dstAddr = (UInt8*)((UInt32)pVideoFrame->bufAddr[0] + offset);
        srcAddr = tiLogo_640_224;
        for(ht = 0;ht < TILOGO_HEIGHT;ht++)
        {
            memcpy(dstAddr, srcAddr, TILOGO_WIDTH);
            dstAddr += INPUT_FRAME_RESOLUTION_WIDTH;
            srcAddr += TILOGO_WIDTH;
        }

What could be going wrong here ?

Regards,
Padmesh