Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

Audio sample, buf[count] is updated with some valid data, after MEM_alloc in function prime()

$
0
0

Hi, 

I'm using OMAP L137, DSP/BIOS 5.33.01, with PSP 1.30.01 Audio sample code.

While using the sample code, i found that in the function prime() of audiosample_io.c file, after the 

buffer pointer is initialized with 0, SIO_ISSUE is called to load to the empty buffers to IN STREAM, but when i read the memory location, 

I saw that the 0's where overwritten with some values.

static Void prime()
{
    Int32        count = 0;

    /* Allocate buffers for the SIO buffer exchanges */
    for(count = 0; count < (NUM_BUFS ); count ++)
    {
        buf[count] = (Ptr)MEM_calloc(0, BUFSIZE * RX_NUM_SERIALIZER, BUFALIGN);
        if(NULL == buf[count])
        {
            LOG_printf(&trace,"\r\nMEM_calloc failed.\n");
        }
    }

    /* Allocate buffers for the SIO buffer exchanges */
    for(count = NUM_BUFS; count < (NUM_BUFS * 2); count ++)
    {
        buf[count] = (Ptr)MEM_calloc(0, BUFSIZE * TX_NUM_SERIALIZER, BUFALIGN);
        if(NULL == buf[count])
        {
            LOG_printf(&trace,"\r\nMEM_calloc failed.\n");
        }
    }

    for(count = 0; count < NUM_BUFS; count ++)
    {
        /* Issue the first & second empty buffers to the input stream */
        SIO_issue(inStream, buf[count], BUFSIZE * RX_NUM_SERIALIZER, NULL);
    }

    for(count = NUM_BUFS; count < (NUM_BUFS * 2); count ++)
    {
        SIO_issue(outStream, buf[count], BUFSIZE * TX_NUM_SERIALIZER,NULL);
    }
}

Can someone please kindly let me know, what is writing these values into the empty buffers, right after the memory allocation?

my own code, relies on the rcv input, and i want the buffer to return 0's, and should update the buffer with values only when i play something through the line in.

Since because of this data that is already updated in the In-Stream,  i couldn't get my own code to work according to my requirement.

Would really appreciate quick response.

Kind Regards, 

Nancy


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>