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.

add algorithm lib(compile by CCS) to DSP

Other Parts Discussed in Thread: SYSBIOS

Hello,eveyone,

I want to add a static lib to DSP,now ,I have compiled a static libary  by CCS,and I modifyed the config file to link this libary:

In the file DVRRDK_03.00.00.00\dvr_rdk\makerules\rules_c674.mk,added my lib to LIB_PATHS,

I add the header file to helloworldlink directory,then quote the function packaged in my static lib,

but when compiling the project,I encounter the erro:

my static lib is named testlib.lib.

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

# Archiving ti816x-evm:c6xdsp:debug:dvr_rdk_bios6
#
# Invoking configuro...
# Configuro done!
# Making ti816x-evm:c6xdsp:debug:dvr_rdk_bios6...
# Linking into /root/DVRRDK_03.00.00.00/dvr_rdk/../dvr_rdk/build/dvr_rdk/bin/ti816x-evm/dvr_rdk_c6xdsp_debug.xe674...
#
"/root/DVRRDK_03.00.00.00/dvr_rdk/../dvr_rdk/mcfw/src_bios6/cfg/ti816x/link_algs.cmd", line 12: warning:
   no matching section

 undefined first referenced                                                              
  symbol       in file                                                                   
 --------- ----------------                                                              
 lrint     /root/DVRRDK_03.00.00.00/dvr_rdk/../ti_tools/codecs/testlib.lib<samplerate.obj>

error: unresolved symbols remain
warning: entry-point symbol other than "_c_int00" specified:
   "ti_sysbios_family_c64p_Hwi0"
error: errors encountered during linking;
   "/root/DVRRDK_03.00.00.00/dvr_rdk/../dvr_rdk/build/dvr_rdk/bin/ti816x-evm/dv
   r_rdk_c6xdsp_debug.xe674" not built
make[2]: *** [/root/DVRRDK_03.00.00.00/dvr_rdk/../dvr_rdk/build/dvr_rdk/bin/ti816x-evm/dvr_rdk_c6xdsp_debug.xe674] erro 1
make[1]: *** [apps] erro 2
make: *** [dvr_rdk_bios6] erro 2
####
#### [DM816X_ETV] platform build [dvr_rdk] ERROR !!!
####

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Looking forward to your reply,Thanks

 

  • I am sure that your posting is exactly what I want to know,so may I share it.I will be feel exciting if you permit me to do so.There are two conventional built-in methods of developing Python with C/C++. The first is composing an expansion, which includes developing a wrapper for C that Python imports, creates, and then can perform. The second is built-in way of developing these 'languages' is known as embedding, and is where C and C++ are given immediate accessibility the Python translator.


    tags

    http://www.mmomesos.com/
    http://www.mmo2buy.com/RS2007-Gold.html
    http://www.fifacoins2buy.com/
    http://www.solorsgold.com/gold

  • Is your library called testlib.lib. If so the library is getting linked in. The problem is library invokes a function called lrint  from samplerate.c which is not defined in the library. You will have to determine which library defines that function and link that library also. If you have a standalone test app for your testlib.lib you can figure this out from the map file.

  • Hello Badri,

    Thank for your reply,but

    I haven't understand your meaning for the last sentence.

    Yes,My library is named  testlib.lib,and I have writen a test file to quote the library function,and when compiling,inorder to link the mathematical function(like lrint ),I added  a option "-lm", but I don't know how to link the mathematical function in the DVR_RDK's DSP.

  • Which library implements function lrinit ? It is not testlib.lib. It is some other library.You should link that also .What does option "-lm" do ? I don't see an option like that for c6x compiler.

  • Thanks Badri,

      I have found the problem,As you say,the function "lrint" is used in inappropriate way.But now I encounter another problem.I have writed a simply demo:

    read data from file0-------->ipcbitsOutHost------->ipcBitInDSP-------->MyLINK------>ipcBitsOutDSP------->ipcBitsInHost-------->write data to file1.

    MyLINK is run in DSP,it does nothing,only copy data to its outbuffer,Now the problem is that,I compare the file0 and the file1,there are big differences between them,I don't known what lead to this  differences.I have doubt the problem's  reason is MyLINK's outbuffer,but I haven't find the unreasonable codes.

    This attachment isThe main part of MyLINK.Look forward to your guidance.

    /*
     *  audioProcessLink_priv.c
     *
     *  Created on: Sep 29, 2013
     *      Author: mdm
     */
    #include "audioProcessLink_priv.h"
    #include <mcfw/src_bios6/utils/utils_mem.h>
    
    static Int32 audioProcessLink_createOutObj(audioProcessLink_Obj * pObj)
    {
    	audioProcessLink_OutObj *pOutObj;
        System_LinkChInfo *pOutChInfo;
        Int32  status;
        UInt32 bufIdx;
        Int i,j,queueId,chId;
        UInt32 totalBufCnt;
    
        /*************************************************************************/
        for(queueId = 0; queueId < AUDIOPROCESS_LINK_MAX_OUT_QUE; queueId++)
        {
            pOutObj = &pObj->outObj[queueId];
    
            pObj->outObj[queueId].numAllocPools = 1;
    
            pOutObj->bufSize[0] = AUDIOPROCESS_LINK_OUT_BUF_SIZE;
    
            /*********************************************************************/
            /* Set the buffer alignment as per need. Typically 128 suggested for */
            /* better cache and DMA efficiency.                                  */
            /*********************************************************************/
    
            pOutObj->bufSize[0] = VpsUtils_align(pOutObj->bufSize[0],
            		AUDIOPROCESS_BUFFER_ALIGNMENT);
    
            status = Utils_bitbufCreate(&pOutObj->bufOutQue, TRUE, FALSE,
                pObj->outObj[queueId].numAllocPools);
            UTILS_assert(status == FVID2_SOK);
    
            totalBufCnt = 0;
    
            /*********************************************************************/
            /* Allocate output buffers                                           */
            /*********************************************************************/
            for (i = 0; i < pOutObj->numAllocPools; i++)
            {
                pOutObj->outNumBufs[i] = (pObj->createArgs.maxChannels * pObj->createArgs.numBufsPerCh);
    
                ///*
                for (j = 0; j < pObj->createArgs.maxChannels; j++)
                //for (j = 0; j < pOutObj->outNumBufs[i]; j++)
                {
                    pOutObj->ch2poolMap[j] = i;
                }//*/
                status = Utils_memBitBufAlloc(&(pOutObj->outBufs[totalBufCnt]),
                                              pOutObj->bufSize[i],
                                              pOutObj->outNumBufs[i]);
                UTILS_assert(status == FVID2_SOK);
                for (bufIdx = 0; bufIdx < pOutObj->outNumBufs[i]; bufIdx++)
                {
                    UTILS_assert((bufIdx + totalBufCnt) < AUDIOPROCESS_LINK_MAX_OUT_FRAMES);
                    pOutObj->outBufs[bufIdx + totalBufCnt].allocPoolID = i;
                    pOutObj->outBufs[bufIdx + totalBufCnt].doNotDisplay = 0;
                    status = Utils_bitbufPutEmptyBuf(&pOutObj->bufOutQue,
                        &pOutObj->outBufs[bufIdx + totalBufCnt]);
                    UTILS_assert(status == FVID2_SOK);
                }
                totalBufCnt += pOutObj->outNumBufs[i];
            }
        }
    
        pObj->info.numQue = AUDIOPROCESS_LINK_MAX_OUT_QUE;
    
        /*************************************************************************/
        /* queInfo is used by next link to create it's instance.                 */
        /* Set numCh - number of channel information                             */
        /*************************************************************************/
    
        for (queueId = 0u; queueId < AUDIOPROCESS_LINK_MAX_OUT_QUE; queueId++)
        {
            pObj->info.queInfo[queueId].numCh = pObj->inQueInfo.numCh;
        }
    
        for (chId = 0u; chId < pObj->inQueInfo.numCh; chId++)
        {
            for (queueId = 0u; queueId < AUDIOPROCESS_LINK_MAX_OUT_QUE; queueId++)
            {
                pOutChInfo = &pObj->info.queInfo[queueId].chInfo[chId];
                pOutChInfo->bufType = SYSTEM_BUF_TYPE_VIDBITSTREAM;
                pOutChInfo->codingformat = NULL;
                pOutChInfo->memType = NULL;
                pOutChInfo->scanFormat = pObj->inQueInfo.chInfo[chId].scanFormat;
                pOutChInfo->width = pObj->inQueInfo.chInfo[chId].width;
                pOutChInfo->height = pObj->inQueInfo.chInfo[chId].height;
            }
        }
    
        return (status);
    }
    Int32 audioProcessLink_create(audioProcessLink_Obj * pObj, audioProcessLink_CreateParams * pPrm)
    {
        Int32 status;
        Vps_printf(" %d: AUDIOPROCESSLINK : Create in progress !!!\n", Utils_getCurTimeInMsec());
        memcpy(&pObj->createArgs, pPrm, sizeof(*pPrm));
    
        Int32 linkid = SYSTEM_DSP_LINK_ID_IPC_BITS_IN_0;
        status = System_linkGetInfo(pPrm->inQueParams.prevLinkId, &pObj->inTskInfo);
    
        UTILS_assert(status == FVID2_SOK);
        UTILS_assert(pPrm->inQueParams.prevLinkQueId < pObj->inTskInfo.numQue);
        memcpy(&pObj->inQueInfo,
            &pObj->inTskInfo.queInfo[pPrm->inQueParams.prevLinkQueId],
            sizeof(pObj->inQueInfo));
        UTILS_assert(pObj->inQueInfo.numCh <= AUDIOPROCESS_LINK_MAX_CH);
    
        if (pObj->createArgs.createOutBuf)
            audioProcessLink_createOutObj(pObj);
    
        Vps_printf(" %d: AUDIOPROCESSLINK : Create Done !!!\n", Utils_getCurTimeInMsec());
        return FVID2_SOK;
    }
    Int32 audioProcessLink_Run(audioProcessLink_Obj * pObj)
    {
    //	/*
        System_LinkInQueParams *pInQueParams;
        Utils_BitBufHndl *bufOutQue;
        Bitstream_Buf *pOutBuf;
        UInt32        bufId;
        Int32         status;
    
    	UInt8 inbufNum = 0;
        int i = 0;
        unsigned char *inbuf;
        unsigned char *outbuf;
    
        Bitstream_BufList bufList,outBitBufList;
    
        pInQueParams = &pObj->createArgs.inQueParams;
        bufOutQue = &pObj->outObj[0].bufOutQue;
        System_getLinksFullBufs(pInQueParams->prevLinkId,pInQueParams->prevLinkQueId, &bufList);
        if(bufList.numBufs > 0)
        {
            outBitBufList.numBufs = 0;
            //Vps_printf("MYAUDIObufferList_numberBuffers[%d]\n",bufList.numBufs);
            for (bufId = 0; bufId < bufList.numBufs; )
            {
            	if(pObj->createArgs.createOutBuf)
            	{
            		pOutBuf = NULL;
    
                    status = Utils_bitbufGetEmptyBuf(bufOutQue,&pOutBuf,0, BIOS_NO_WAIT);
                    //UTILS_assert(status == FVID2_SOK);
                    if(pOutBuf)
                    {
                    	//inbuf = (unsigned char*)bufList.bufs[bufId]->addr;
                        //outbuf = (unsigned char*)pOutBuf->addr;
                        memcpy(pOutBuf->addr,bufList.bufs[bufId]->addr,bufList.bufs[bufId]->fillLength);
                    	//for(i = 0;i < 100; i++)
                    	{
                    		//Vps_printf("in data[0x%x],outdata[0x%x]",inbuf,outbuf);
                    	}
    
                        pOutBuf->fillLength = bufList.bufs[bufId]->fillLength;
                        pOutBuf->channelNum = 0;
                        pOutBuf->allocPoolID = 0;
                        outBitBufList.bufs[outBitBufList.numBufs] = pOutBuf;
    
                        outBitBufList.numBufs++;
                    	bufId++;
                    }
            	}
            }
            System_putLinksEmptyBufs(pInQueParams->prevLinkId,pInQueParams->prevLinkQueId, &bufList);
            if(pObj->createArgs.createOutBuf)
            {
            	//Vps_printf("outBitBufList_numberBuffers[%d]\n",outBitBufList.numBufs);
    
                status = Utils_bitbufPutFull(bufOutQue,&outBitBufList);
                UTILS_assert(status == FVID2_SOK);
                System_sendLinkCmd(pObj->createArgs.outQueParams.nextLink,SYSTEM_CMD_NEW_DATA);
            }
        }
        status = FVID2_SOK;
    }
    
    Int32 audioProcessLink_delete(audioProcessLink_Obj * pObj)
    {
    
    }
    

    and this is the thread run on A8:

    static Void audio_CbFxn_IPCBitsInHLOSLINK(Void * cbPrm)
    {
    	OSA_SemHndl * hSem = (OSA_SemHndl *) cbPrm;
    	OSA_semSignal(hSem);
    }
    //static Void * audio_GetEmptyBuffersfromIPCBitsOutHLOSLINK(Void * Prm)
    static Void * audio_IPCBitsOutHLOSLinkRunning(Void * Prm)
    {
    	IpcBitsOutLinkHLOS_BitstreamBufReqInfo reqInfo;
    	Bitstream_BufList emptyBufList;
    	Bitstream_BufList BufList;
    	Bitstream_Buf *pBuf;
    	Bitstream_Buf *pBuf1;
    	UInt32 linkId = SYSTEM_HOST_LINK_ID_IPC_BITS_OUT_0;
    	Int i;
    	Int status;
    	UInt32 minBufSize = 1024;
    	P_CHANNEL_DISCRIPTOR  pChannels;
    	pChannels = (P_CHANNEL_DISCRIPTOR)(Prm);
        unsigned char buf[4410];
    	FILE  *fp;
    	fp = fopen("/mnt/test0.pcm","r+b");
        unsigned char *test;
    	reqInfo.numBufs   = 5;
    	reqInfo.reqType   = IPC_BITSOUTHLOS_BITBUFREQTYPE_BUFSIZE;
    
    	for (i = 0; i < reqInfo.numBufs; i++)
    	{
    		reqInfo.u[i].minBufSize = minBufSize;
    		reqInfo.u[i].chNum = 0;
    	}
        for(i = 0;i < 4410;i++)
        {
        	buf[i] = i;
        }
    	while (1)
    	{
    		emptyBufList.numBufs = 0;
    		IpcBitsOutLink_getEmptyVideoBitStreamBufs(linkId, &emptyBufList, &reqInfo);
    		OSA_printf("line[%d],emptybuffNum[%d]\n",__LINE__,emptyBufList.numBufs);
    
    		for(i = 0; i < emptyBufList.numBufs; i++)
    		{
    			pBuf = emptyBufList.bufs[i];
    			pBuf->fillLength  = 1024;
    			pBuf->channelNum  = 0;
    
    			//Cache_inv(pBuf->addr, bufSize, Cache_Type_ALL, TRUE);
    			//memcpy(pBuf->addr,buf,pBuf->fillLength);
    			pBuf->codingType  = 0;
    			//pBuf->frameHeight = 720;
    			//pBuf->frameWidth  = 576;
    			//fseek(fp,0,SEEK_SET);
    			fread(pBuf->addr,pBuf->fillLength,1,fp);
    			//test = (unsigned char*)pBuf->addr;
    		}
    		IpcBitsOutLink_putFullVideoBitStreamBufs(linkId, &emptyBufList);
    		usleep(200000);
    	}
    }
    
    static Void * audio_IPCBitsInHLOSLinkRunning(Void * Prm)
    {
    	UInt32 linkId = SYSTEM_HOST_LINK_ID_IPC_BITS_IN_0;
    	P_CHANNEL_DISCRIPTOR  pChannels;
    	pChannels = (P_CHANNEL_DISCRIPTOR)(Prm);
    
    	Bitstream_BufList fullBufList;
    	Bitstream_Buf *pBuf;
    	Int status;
    	int i = 0,j = 0,bufId;
    	FILE  *fp;
    	fp = fopen("/mnt/test0_back.pcm","w+b");
        unsigned char *test;
        test = (unsigned char *)malloc(4410);
    	while (1)
    	{
    		OSA_semWait(&semFullIn, OSA_TIMEOUT_FOREVER);
    		IpcBitsInLink_getFullVideoBitStreamBufs(SYSTEM_HOST_LINK_ID_IPC_BITS_IN_0, &fullBufList);
    		OSA_printf("buffer number[%d]",fullBufList.numBufs);
    		for(bufId = 0;bufId < fullBufList.numBufs; bufId++)
    		{
    			pBuf = fullBufList.bufs[bufId];
    			//memcpy(test,pBuf->addr,pBuf->fillLength);
    			///*
    			test = (unsigned char*)pBuf->addr;
    			//OSA_printf("***************[bufid--%d]**********************\n",bufId);
    			for(j = 0;j < 100; j++)
    			{
    				printf("[0x%2x],",*test++);
    
    			}//*/
    
    			fwrite(test,pBuf->fillLength,1,fp);
    			//OSA_printf("buffersize=%d,",pBuf->fillLength);
    			//memcpy(buffer,pBuf->addr,pBuf->fillLength);
    		}
    		IpcBitsInLink_putEmptyVideoBitStreamBufs(SYSTEM_HOST_LINK_ID_IPC_BITS_IN_0, &fullBufList);
    		usleep(200000);
    	}
    	pthread_exit((void *) 0);
    }
    
    Int startIpc(P_CHANNEL_DISCRIPTOR pChannel)
    {
        OSA_ThrHndl                 getBuffThr;
        OSA_ThrHndl                 putBuffThr;
        Int32                       status;
    
        OSA_semCreate(&(semFullIn), 64, 0);
    	status = OSA_thrCreate(&getBuffThr, audio_IPCBitsOutHLOSLinkRunning,
    			17, 0, (void *) pChannel);
    
    	status = OSA_thrCreate(&putBuffThr, audio_IPCBitsInHLOSLinkRunning,
    			17, 0, (void *) pChannel);
    	return status;
    }
    
    void audio_Chain_ES_ITC_0_02_00_1(P_CHANNEL_DISCRIPTOR pChannels)
    {
    	IpcBitsOutLinkHLOS_CreateParams  	audio_ipcBitsOutHostPrm;
    	IpcBitsInLinkRTOS_CreateParams      audio_ipcBitsInDspPrm;
        //HelloWorldLink_CreateParams         algPrm;
        audioProcessLink_CreateParams       algPrm;
    
        IpcBitsOutLinkRTOS_CreateParams     audio_ipcBitsOutDspPrm;
        IpcBitsInLinkHLOS_CreateParams      audio_ipcBitsInHostPrm;
    
    	UInt32 audio_ipcBitsOutHostId;
    	UInt32 audio_ipcBitsInDspId;
        UInt32 algId,audio_ipcBitsOutDspId,audio_ipcBitsInHostId;
        CHAINS_INIT_STRUCT(IpcBitsOutLinkHLOS_CreateParams,audio_ipcBitsOutHostPrm);
        CHAINS_INIT_STRUCT(IpcBitsInLinkRTOS_CreateParams,audio_ipcBitsInDspPrm);
        CHAINS_INIT_STRUCT(audioProcessLink_CreateParams,algPrm);
        CHAINS_INIT_STRUCT(IpcBitsOutLinkRTOS_CreateParams,audio_ipcBitsOutDspPrm);
        CHAINS_INIT_STRUCT(IpcBitsInLinkHLOS_CreateParams,audio_ipcBitsInHostPrm);
    
        audio_ipcBitsOutHostId  = SYSTEM_HOST_LINK_ID_IPC_BITS_OUT_0;
        audio_ipcBitsInDspId    = SYSTEM_DSP_LINK_ID_IPC_BITS_IN_0;
        algId                   = SYSTEM_LINK_ID_AUDIO_AEC_0;
       //algId                   = SYSTEM_LINK_ID_HELLOWORLD_0;
        audio_ipcBitsOutDspId   = SYSTEM_DSP_LINK_ID_IPC_BITS_OUT_0;
        audio_ipcBitsInHostId   = SYSTEM_HOST_LINK_ID_IPC_BITS_IN_0;
    
    	//startAudioCaptEnc(pChannels);
    
    	audio_ipcBitsOutHostPrm.inQueInfo.numCh = 1;
        int i = 0;
    	for (i = 0;i < audio_ipcBitsOutHostPrm.inQueInfo.numCh;i++) {
    		System_LinkChInfo *pChInfo;
    		pChInfo = &audio_ipcBitsOutHostPrm.inQueInfo.chInfo[i];
    		pChInfo->bufType        = 0; // NOT USED
    		pChInfo->codingformat   = 0; // NOT USED
    		pChInfo->dataFormat     = 0; // NOT USED
    		pChInfo->memType        = 0; // NOT USED
    		pChInfo->startX         = 0; // NOT USED
    		pChInfo->startY         = 0; // NOT USED
    		pChInfo->width          = 720;//352;
    		pChInfo->height         = 576;//288;
    		pChInfo->pitch[0]       = 0; // NOT USED
    		pChInfo->pitch[1]       = 0; // NOT USED
    		pChInfo->pitch[2]       = 0; // NOT USED
    		pChInfo->scanFormat     = SYSTEM_SF_PROGRESSIVE;
    		//ipcBitsOutHostPrm->maxQueueDepth[i]   =         MAX_BUFFERING_QUEUE_LEN_PER_CH;
    		//ipcBitsOutHostPrm->chMaxReqBufSize[i] =         352 * 288;
    		//numBufPerCh = NUM_BUFS_PER_CH_BITSOUT_AEC;
    		//ipcBitsOutHostPrm->totalBitStreamBufferSize[i] =  ipcBitsOutHostPrm->chMaxReqBufSize[i] *  numBufPerCh; } ipcBitsOutHostPrm->baseCreateParams.noNotifyMode = FALSE; ipcBitsOutHostPrm->baseCreateParams.notifyNextLink = TRUE; ipcBitsOutHostPrm->baseCreateParams.numOutQue = 1; ipcBitsOutHostPrm->inQueInfo.numCh = numCh;
    	}
    
        audio_ipcBitsOutHostPrm.baseCreateParams.numOutQue                    = 1;
        audio_ipcBitsOutHostPrm.baseCreateParams.numChPerOutQue[0]            = 1;
        audio_ipcBitsOutHostPrm.bufPoolPerCh                                  = 0;
        audio_ipcBitsOutHostPrm.numBufPerCh[0]                                = VIDBITSTREAM_MAX_BITSTREAM_BUFS;
        audio_ipcBitsOutHostPrm.baseCreateParams.outQueParams[0].nextLink     = audio_ipcBitsInDspId;
        audio_ipcBitsOutHostPrm.baseCreateParams.noNotifyMode                 = FALSE;
        audio_ipcBitsOutHostPrm.baseCreateParams.notifyNextLink               = TRUE;
        audio_ipcBitsOutHostPrm.baseCreateParams.notifyPrevLink               = TRUE;
    
        audio_ipcBitsInDspPrm.baseCreateParams.inQueParams.prevLinkId       = audio_ipcBitsOutHostId;
        audio_ipcBitsInDspPrm.baseCreateParams.inQueParams.prevLinkQueId    = 0;
        audio_ipcBitsInDspPrm.baseCreateParams.numOutQue                    = 1;
        audio_ipcBitsInDspPrm.baseCreateParams.outQueParams[0].nextLink     = algId;
    
        audio_ipcBitsInDspPrm.baseCreateParams.noNotifyMode                 = FALSE;
        audio_ipcBitsInDspPrm.baseCreateParams.notifyPrevLink               = TRUE;
        audio_ipcBitsInDspPrm.baseCreateParams.notifyNextLink               = TRUE;
    
        algPrm.inQueParams.prevLinkId           = audio_ipcBitsInDspId;
        algPrm.inQueParams.prevLinkQueId        = 0;
        algPrm.createOutBuf                     = TRUE;
        algPrm.numBufsPerCh                     = 5;
        algPrm.maxChannels                      = 1;
        algPrm.outQueParams.nextLink            = audio_ipcBitsOutDspId;
    
        audio_ipcBitsOutDspPrm.baseCreateParams.inQueParams.prevLinkId      = algId;
        audio_ipcBitsOutDspPrm.baseCreateParams.inQueParams.prevLinkQueId   = 0;
        audio_ipcBitsOutDspPrm.baseCreateParams.numOutQue                   = 1;
        audio_ipcBitsOutDspPrm.baseCreateParams.numChPerOutQue[0]           = 1;
        audio_ipcBitsOutDspPrm.baseCreateParams.outQueParams[0].nextLink    = audio_ipcBitsInHostId;
        audio_ipcBitsOutDspPrm.baseCreateParams.noNotifyMode                = FALSE;
        audio_ipcBitsOutDspPrm.baseCreateParams.notifyNextLink              = TRUE;
        audio_ipcBitsOutDspPrm.baseCreateParams.notifyPrevLink              = TRUE;
    
        audio_ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkId        = audio_ipcBitsOutDspId;
        audio_ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkQueId     = 0;
        audio_ipcBitsInHostPrm.baseCreateParams.numOutQue                     = 1;
        audio_ipcBitsInHostPrm.baseCreateParams.numChPerOutQue[0]             = 1;
        audio_ipcBitsInHostPrm.baseCreateParams.notifyNextLink                = TRUE;
        audio_ipcBitsInHostPrm.baseCreateParams.notifyPrevLink                = TRUE;
        audio_ipcBitsInHostPrm.baseCreateParams.noNotifyMode                  = FALSE;
        audio_ipcBitsInHostPrm.baseCreateParams.outQueParams[0].nextLink      = SYSTEM_LINK_ID_INVALID;
        audio_ipcBitsInHostPrm.cbFxn = audio_CbFxn_IPCBitsInHLOSLINK;
        audio_ipcBitsInHostPrm.cbCtx = &semFullIn;
    
        System_linkCreate(audio_ipcBitsOutHostId, &audio_ipcBitsOutHostPrm, sizeof(audio_ipcBitsOutHostPrm));
        System_linkCreate(audio_ipcBitsInDspId, &audio_ipcBitsInDspPrm, sizeof(audio_ipcBitsInDspPrm));
        System_linkCreate(algId, &algPrm, sizeof(algPrm));
        System_linkCreate(audio_ipcBitsOutDspId, &audio_ipcBitsOutDspPrm, sizeof(audio_ipcBitsOutDspPrm));
        System_linkCreate(audio_ipcBitsInHostId, &audio_ipcBitsInHostPrm, sizeof(audio_ipcBitsInHostPrm));
    
        System_linkStart(audio_ipcBitsInHostId);
        System_linkStart(audio_ipcBitsOutDspId);
        System_linkStart(algId);
        System_linkStart(audio_ipcBitsInDspId);
        System_linkStart(audio_ipcBitsOutHostId);
    
    	startIpc(pChannels);
        while(1)
        {
        	Char ch = Chains_getChar();
        	if(ch=='p')
        	System_linkControl(algId, SYSTEM_CMD_NEW_DATA, NULL, 0, TRUE);
        }
    }
    

    Look forward to your guidance.

    Thank!

  • You should do Cache_wbInv to make cache coherent with DDR in function

    audioProcessLink_Run

     

    memcpy(pOutBuf->addr,bufList.bufs[bufId]->addr,bufList.bufs[bufId]->fillLength);

    Cache_wbInv(pOutBuf->addr,bufList.bufs[bufId]->fillLength,Cache_Type_ALL,TRUE);

  • Thanks for your reply,now I can get the same data from file0 and file1.

  • Hello Badri,

        Now I'm confused about the use of cache and SR1,Does that mean,if a bufer is alloced  from SR1,then I must do Cache write back invalidate or Cache invalidate when I use this buffer.

      If I alloc a buffer from SR1,but I only use it on A8,Do I need to use the fuction Cache_inv & Cache_wbInv? I want to When I use SR1,In which case could I use Cache write back invalidate and Cache invalidate .

    Thank!

     

  • On c674 DSP all memory regions expect

    "SR0","REMOTE_DEBUG_MEM", "ETH_OFFLOAD" are _cached_

     

    Refer /dvr_rdk/mcfw/src_bios6/cfg/ti816x/FC_RMAN_IRES_c6xdsp.cfg where cacheability for c674 is set by configuring MAR registers.

    On A8, SR1 is cached.SR0 is not cached. SR2 is not accessible on A8.

    You should do cache coherency operation whenever you send buffer to remote code or receive a buffer from remote core.

       - A8 should do Cache_inv when it received the buffer back from DSP. This is already handled in ipcBitsInHostLink on A8.

       - A8 should do Cache_wbInv when it sends buffer to DSP. This is already handled in ipcBitsOutHost link

     

    On c674 DSP

       - c674 should do Cache_inv when it received the buffer back from A8. You should add this functionality  in your algLink

       - c674 should do Cache_wbInv when it sends buffer to A8.  You should add this functionality  in your algLink

     

    If c674 never writes to buffer then doing Cache_wbInv before sending buffer is not required

    Refer this post for additional details:http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/275906/963312.aspx#963312

  • Hi,all

    In DM8127 IPNC RDK 3.5,there are some DMVA algorithms encapsured in a lib file called dmval_elf.ae674.

    After long hardships time,I have encapsurd myself algorithm(using malloc to get heap buf) and genrated myself.ae674 library file with  XDM Genalg Wizards,Also,i can call these library function from a link dsp.However,the running result is so abnormal comparing with that directly running C source code in IPNC RDK .

    why ?

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/303658.aspx

    please give me a hand for this issue.

    thank you.

  • Thanks very much for your so detailed reply for my colleague.