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.

[OMAP3530] building and running speex codec

Other Parts Discussed in Thread: OMAP3530

Hi all,

I am trying to compile and run speex codec (http://speex.org/) on beagleboard with OMAP3530. We use ALSA for audio I/O and codec engine for our framework. We have several questions:

1. When compiled and running on DSP speex use four global pointer declared as extern

extern char *spxGlobalHeapPtr, *spxGlobalHeapEnd;
extern char *spxGlobalScratchPtr, *spxGlobalScratchEnd;

which should be created in main app. In the main functions example it is initialized as

#pragma DATA_SECTION(spxHeap, ".myheap");
static char spxHeap[SPEEX_PERSIST_STACK_SIZE];

#pragma DATA_SECTION(spxScratch, ".myheap");
static char spxScratch[SPEEX_SCRATCH_STACK_SIZE];

If we are using g711 codecs example in codec engine where we should declare ".myheap" section?

2. As another approach we use scratch buffer to initialize the global pointer. But this lead to error message :

DSP MMU Error Fault! MMU_IRQSTATUS = [0x10]. Virtual DSP addr reference that generated the interrupt = [0x82f01000].

We only declare it in G711ENC.

Int G711ENC_SUN_alloc(const IALG_Params *g711Params, IALG_Fxns **pf,
    IALG_MemRec memTab[])
{
    /* Request memory for G711 object */
    memTab[0].size = sizeof(G711ENC_SUN_Obj);
    memTab[0].alignment = 0;
    memTab[0].space = IALG_EXTERNAL;
    memTab[0].attrs = IALG_PERSIST;

    memTab[GLOBALHEAP].size        = SPEEX_PERSIST_STACK_SIZE;
    memTab[GLOBALHEAP].alignment   = 2;
    memTab[GLOBALHEAP].space       = IALG_EXTERNAL;
    memTab[GLOBALHEAP].attrs       = IALG_PERSIST;

    memTab[GLOBALSCRATCH].size        = SPEEX_SCRATCH_STACK_SIZE;
    memTab[GLOBALSCRATCH].alignment   = 2;
    memTab[GLOBALSCRATCH].space       = IALG_DARAM0;
    memTab[GLOBALSCRATCH].attrs       = IALG_SCRATCH;

    return (NUMBUFS);
}

and

Int G711ENC_SUN_initObj(IALG_Handle handle, const IALG_MemRec memTab[],
    IALG_Handle p, const IALG_Params *algParams)
{
    G711ENC_SUN_Obj *g711Enc = (Void *)handle;
    const ISPHENC1_Params *params = (ISPHENC1_Params *)algParams;
    Int status = IALG_EOK;

 .....

#ifdef MANUAL_ALLOC
    spxGlobalHeapPtr = (char*)memTab[GLOBALHEAP].base;
    spxGlobalHeapEnd = (char*)memTab[GLOBALHEAP].base + memTab[GLOBALHEAP].size;

    spxGlobalScratchPtr = (char*)memTab[GLOBALSCRATCH].base;
    spxGlobalScratchEnd = (char*)memTab[GLOBALSCRATCH].base + memTab[GLOBALSCRATCH].size;
#endif

....

}

How we can fix this?

Thank you.

Best regards,

Arif