DSPRelated.com
Forums

PCM audio samples from .txt file

Started by gimm...@yahoo.co.uk July 5, 2006
Hello All,

I need suggestions for a problem I need to solve.

I am running an example similar to the dsk_apps provided for the C6713; an audio loopback using the McASP and EDMA transfers. The program works perfectly on the EVM. Now I have to port this over to our custom board, which has the audio in only, i.e there is no way to loop the audio back out. Therefore, I'm trying to write the contents of the buffers in the DSP to a file. After I get it right, I can make the buffers big enough so it can hold sufficient audio data for analysis.

Here's what I've tried so far. The EDMA is setup to transfer audio data received on the McASP to a block of memory. Once the block is full, the entire block is copied to a transmit buffer also in memory. At the same time the receive buffer in memory is also copied to a file.

I believe that even during the routine that copies the rx buffer to a file the EDMA still functions in the background and keeps updating the buffer. So the file I have is not one entire buffer but samples from several buffers. Is there a way I can halt the entire program including EDMA transfers so I can get a copy of one whole buffer to a file?

The audio is sampled at 48kHz on the AIC23B. The AIC23B is connected to the DM642 using the McASP and the samples are of 32-bit length.

The samples are copied to a .txt file. It is my understanding that the samples copied to the file are in PCM format and knowing the sampling rate and resolution should be sufficient to play it back. Please let me know if this is correct, and how I can play it back.

Any suggestions? Thanks for your time.

Dinesh
Dinesh-

So your board still has AIC23B, like DSK 6713? If that's the case, why
can't you hook up audio output just temporarily for debug purposes?

Seems easy. Then you can focus on software differences between 6713 and
DM642, and go one step-at-a-time. In your board design you could have put
optional audio output commponents, to be populated only during debug or
for future product purposes.

-Jeff

Might it have been a good idea to include that codec
>
> I need suggestions for a problem I need to solve.
>
> I am running an example similar to the dsk_apps provided for the C6713; an
> audio loopback using the McASP and EDMA transfers. The program works
> perfectly on the EVM. Now I have to port this over to our custom board,
> which has the audio in only, i.e there is no way to loop the audio back
> out. Therefore, I'm trying to write the contents of the buffers in the DSP
> to a file. After I get it right, I can make the buffers big enough so it
> can hold sufficient audio data for analysis.
>
> Here's what I've tried so far. The EDMA is setup to transfer audio data
> received on the McASP to a block of memory. Once the block is full, the
> entire block is copied to a transmit buffer also in memory. At the same
> time the receive buffer in memory is also copied to a file.
>
> I believe that even during the routine that copies the rx buffer to a file
> the EDMA still functions in the background and keeps updating the buffer.
> So the file I have is not one entire buffer but samples from several
> buffers. Is there a way I can halt the entire program including EDMA
> transfers so I can get a copy of one whole buffer to a file?
>
> The audio is sampled at 48kHz on the AIC23B. The AIC23B is connected to
> the DM642 using the McASP and the samples are of 32-bit length.
>
> The samples are copied to a .txt file. It is my understanding that the
> samples copied to the file are in PCM format and knowing the sampling rate
> and resolution should be sufficient to play it back. Please let me know if
> this is correct, and how I can play it back.
>
> Any suggestions? Thanks for your time.
>
> Dinesh