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.

UNIVERSAL_process - inOutBufs must contain at least 1 buffer

Hello,

 

I try to use UNIVERSAL_process with inOutBufs->numBufs=0. On the DSP inOutBufs->numBufs is -1916647492. I f set inOutBufs->numBufs to 1 everything is okay - on the DSP inOutBufs->numBufs is also 1. 

 

So I assume it is not okay to use the inOutBufs with zero buffers. Is this correct?

 

C.

  • Curtis,

    Which version of codec engine are you using? The code is designed to handle the case that inOutBufs->numBufs = 0 and send this value to the alg 

    You can see what should be  happening by looking at the function  marshallMsg() in file codec_engine_x_yy\packages\ti\sdo\ce\universal\universal_stubs.c 

    This is the function that builds the message to send to the alg. In this function there is the following section of code which builds the message.

    marshallMsg()

    {  ........

        /* And finally inOutBufs. */
        if (inOutBufs == NULL) {
            /* no inOutBufs */
            msg->cmd.process.inOutBufs.numBufs = 0;
        }
        else {
            msg->cmd.process.inOutBufs.numBufs = inOutBufs->numBufs;

            for (i = 0, numBufs = 0;
                 ((numBufs < inOutBufs->numBufs) && (i < XDM_MAX_IO_BUFFERS)); i++) {
                  .......

               }

    ....

    }

     

    I suggest you use CCS to step into this function from UNIVERSAL_process() and check what is happening on the app side first.

     

  • Okay. I use CE 2_25_01_06.

    It seems that inOutBuf is NULL even when I provide an inOutBuf to UNIVERSAL_process when the number of buffers is zero.

     

    I will step into this problem.

     

    C.

  • On the remote processor side (packages/ti/sdo/ce/universal_skel.c), you'll see this snippet when it unmarshalls the arguments (mashalled by the stub):

                if (msg->cmd.process.inOutBufs.numBufs == 0) {
                    pInOutBufs = NULL;
                }

    This pInOutbufs is provided to the codec as it's inOutBufs arg.

    Whether zero inOutBuffers are indicated by providing a inOutBuf with .numBufs == 0, or via a NULL inOutBuf arg shouldn't make any difference, right?  I think the algorithm should handle either case.

    Chris