Part Number: TMDSLCDK6748
Other Parts Discussed in Thread: OMAPL138
Hi,
I am currently working on the McASP example provided in RTOS on the 6748LCDK board. I have questions regarding the code:
1) Is it possible to just get one sample at a time from the input/mic port, process it immediately and forward it to the output speaker/audio port? How can this be done? Currently the code is setup to get 128 samples (a total of 128*4 = 512 bytes, since each sample is 32bit word) in to the rx buffer and write the same number of bytes to the output buffer. How can I change this to just one sample at a time, ie, 4 bytes or 32 bits at a time in the buffer?
2) I need a clear understanding about how the control flow of the audio task is. My current understanding is that the McASP fetches samples from the audio codec and writes them onto a 512 byte memory rx-buffer. Only when this buffer is filled with 512 bytes, the audio task is able to process the samples and output to the tx-buffer. Once the 512 byte output buffer is filled, McASP services the tx-buffer and sends samples to the codec to output it to the speaker. I am not 100% sure if this is correct. However, if it indeed is, then that means that the rx-buffer HAS to be filled up before the samples can be process and the tx-buffer HAS to be filled up for the samples to be output.
Now, when I use timestamps to determine the time taken for each cycle of copying input/rx-buffer to output/tx-buffer, this comes out to be 2.73 milliseconds. However, given the sampling rate is 44100Hz then 128 samples should take atleast 2.9 milliseconds (128/44100) + some overhead to write these samples to the memory. There seems to be a discrepancy in here. Is my understanding of the way things are working incorrect? Is the rx-buffer starting to get processed even before 128 samples are written to buffer memory?
It would be good if someone can provide me with precise details.
Thanks.