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.

Using the TI Telecom lib on the OMAP L138 DaVinci platform

Hi.

I have been asked to set up a demonstration of audio processing based around the Logic PD Experimenter ZOOM platform TMDSEXPL138. This is the OMAP L138 platform.

I am very new to the whole CCSv4 TI tool chain, the OMAP L138, and DSP development in general so trying to run the Telecom Library's AER functionality has been an uphill struggle.

The demonstration I have been asked is to take a wav file from the Linux file system running under Arago/OpenEmbedded, process it using the noise reduction elements of the AER algorithm and put the result of the processing back to the Linux file system in wav format.

In my research I have come to the conclusion that there are a couple of  approaches to this:

  1. Use the C6Accel functionality to put the Telecom Library onto the DSP and then allow C6Accel to allow me to work with the Linux file system to put and retrieve the audio data to the AER functional calls and by doing so implicitly using the DSP.
  2. Some how wrap the AER library into the XDAIS wrapper and locate it within the CODEC engine. Then call the new "codec" via the DaVinci media interface (VISA) passing in the file as a stream for processing and receiving the result.

The second approach seems a bigger ask than the first and currently outside of my comfort zone. However the first seems achievable. Given the first approach is possible, I would appreciate some guidance of how I should indicate to C6Accel that the library should be executed  DSP rather than the ARM?

On a separate question: is there a ideal memory map in linker command format for using with an AER project? The .CMD linker file shipped with the test project is not suitable for direct use with the memory maps for the OMAP L138.

Thanks in advance for any assistance given.

Duncan.

  • Further to the above, I have been trying to work with the AER API and have got so far but have been stopped by an error return from the aerNew() function call. I get a return value of 1 which from the AER codes description is  aer_ERR_NOTCREATED. This suggests that aerCreate has not be called but it has been.

    
    
    #include <stdio.h> 
    #include <stdlib.h>
    #include "aer.h"
    void aerEvent( void *handle, aerInfo_t *pAer_info );
    void aerDebug( void *handle, tuint dbgMsg, tuint dbgCode, tuint dbgSize, tuint* pDbgData );
    void main(void) {

    ecomemBuffer_t *pBuffer = NULL;
    tint numBuffers;
    void **aerInstance = malloc( sizeof( void * ) );
    aerSizeConfig_t sizeCfg;
    aerCreateConfig_t aerCreateCfg;
    aerNewConfig_t aerNewCfg;
    tint aerError = aer_NOERR;

    aerCreateCfg.config_bitfield = 0;
    aerCreateCfg.max_sampling_rate = aer_SRATE_16K;
    aerCreateCfg.eventOut = aerEvent;
    aerCreateCfg.debugInfo = aerDebug;

    printf("Initialising AER library\n");
    if ( aerCreate( &aerCreateCfg ) != aer_NOERR )
    {
    exit( 1 );
    }

    sizeCfg.config_bitfield = 0;
    sizeCfg.max_tail_length = 160 * 125; /* 160 units of 125 usecs must be integral multiple of 20 */
    sizeCfg.max_y2x_delay = 125; /* usec */

    if ( aerGetSizes( &numBuffers, (const ecomemBuffer_t **) &pBuffer, &sizeCfg ) != aer_NOERR )
    {
    exit( 2 );
    }

    aerNewCfg.handle = NULL;
    aerNewCfg.sizeCfg = sizeCfg;

    *aerInstance = NULL;

    if ( aerError = aerNew( aerInstance, numBuffers, pBuffer, &aerNewCfg ) != aer_NOERR )
    {
    exit( 3 );
    }

    if ( aerDelete( aerInstance, numBuffers, pBuffer ) != aer_NOERR )
    {
    exit( 4 );
    }

    printf("Closing down the AER library\n");
    return;
    }
    void aerEvent( void *handle, aerInfo_t *pAer_info )
    {
    }
    void aerDebug( void *handle, tuint dbgMsg, tuint dbgCode, tuint dbgSize, tuint* pDbgData )
    {
    }
    
    
    Any suggestions would be really appreciated.
    
    
    Duncan.
  • Hi Duncan,

    Firstly, error code aer_ERR_NOTCREATED cannot be returned by aerNew(). It can only be returned by aerGetSizes().

    Secondly, I don't see from your code how the buffers requested by AER are allocated. That's why aerNew() returns an error. Please refer to the example code in aer/test/siusim/siuaer.c.

    In addition, the max_tail_length must be in integral of 160, i.e. 20msec in units of 125-us.

    Regards,

    Jianzhong

  • Dear Jianzhong,

    Thank you for your answer much appreciated and you have been very helpful in moving things forward.

    Sorry about the confusion abut the aer_ERR_NOTCREATED return code. I should have said that the value of the error code returned from aerNew() was 1 and had assumed that since aer_ERR_NOTCREATED has value 1 that this was the error. Does the error code of 1 relate to the buffers not being set up correctly?

    It is very useful for me that you have indicated that the key to the aerNew() function returning OK is to set up the buffers are per the siu_alloc_aer_buffs() function in the test application. Is the allocation of the various buffers in the manner done in the test application described in the API? I think if this has not been done, then it would be a very useful addition to the API guide.

    Furthermore could you indicate whether the way that the memory is carefully assigned via SECTION directives in the linker command file shipped with the test application is critical to using the library?

    I would suggest that the API is shipped with examples of suggested linker file contents for the various C6000 targets.

    Thanks again for your help. I will post again with the AER buffer set-up I used on the OMAP L138 to get aerNew() to return successfully for interested API users.

    Duncan.

  • Duncan,

    Functin aerNew() doesn't return error code of 1. It can only return either 0, 2, or 5. Please refer to the documentation below.

         error code              description
         aer_NOERR               success
         aer_ERR_INVALIDPAR      *aerInst is not NULL or nbufs is not correct
         aer_ERR_NOMEMORY        properties of certain buffer are bad:
                                 - size is not zero but base address is NULL,
                                 - alignment and base address are not consistent,
                                 - volatility does not meet requirement.

    Regards,

    Jianzhong

  • Hi Jianzhong,

    You are quite correct. Due to a rather silly error whereby I assigned the return value of the areNew() call in the if condition, I  obtained the result of a successful assignment i.e. 1 rather  revealing the actual error. By altering the source to the following:

    aerError = aerNew( aerInstance, numBuffers, pBuffer, &aerNewCfg );
    if ( aerError != aer_NOERR )
    {
    exit( 3 );
    }

    The error revealed was ERR_INVALIDPAR. Apologies for this mistake. 

    Duncan.