DSPRelated.com
Forums

input_sample and output_sample not working

Started by m_st...@hotmail.com March 11, 2010
Hi,

I've got Rulph Chassaing's book "Applications Using C and the TMS320C6x DSK" and I'm trying to use some of the examples - specifically fft256 and loop_intr, but they don't appear to do anything! Examples such as the tone project in CCS work fine, it seems to be anything using the functions input_sample and output_sample that doesn't work. (Everything builds and runs fine for fft256 and loop_intr, but with no output).

Has anybody ever experienced any problems with these functions? Using the function DSK6713_AIC23_write in some of the other examples works fine. I haven't edited the code from the examples at all, I've just tried loading it onto the DSP from the CD. I'm sure I must have to change some settings in CSS but I have no idea what to do - I'm new to this.

Cheers,

Mike

_____________________________________
Mike-

> I've got Rulph Chassaing's book "Applications Using C and the
> TMS320C6x DSK" and I'm trying to use some of the
> examples - specifically fft256 and loop_intr, but they don't
> appear to do anything! Examples such as the tone project
> in CCS work fine, it seems to be anything using the functions
> input_sample and output_sample that doesn't work.
> (Everything builds and runs fine for fft256 and loop_intr,
> but with no output).
>
> Has anybody ever experienced any problems with these
> functions? Using the function DSK6713_AIC23_write in some of
> the other examples works fine. I haven't edited the code
> from the examples at all, I've just tried loading it onto
> the DSP from the CD. I'm sure I must have to change some
> settings in CSS but I have no idea what to do - I'm new to
> this.

I recall that the DSKC6713_AIC23_write() and _read() functions use polling. So they burn a lot of CPU time waiting
for each audio sample to move in/out over the McBSP (serial port) connected to the AIC23.

If so then functions that take more processing time (fft256 for instance) would not enough CPU time to complete and
you would hear artifacts resulting from non-real-time operation (buzz, spikes, static, cyborg sounds, you name it).

Basically, you can think of it this way: if you use polling for audio sample I/O, then *any* processing you do must
get done in one sample period. For example with 8 kHz sampling rate, that would be 125 usec -- which is a tiny sliver
of time in the world of real-time DSP.

Instead, you would want to use interrupt based processing, where you act on an interrupt after a buffer is filled with
samples. Then you would have a chunk of time (say for instance 128 samples, or 16 msec) in which to get real-time
work done on each buffer.

I don't know Chassaing's book well, but hopefully it talks about interrupt and buffer based processing mechanisms. If
not then there should be lots of relevant discussion on group archives and also tutorials and app notes on TI's
website.

-Jeff

PS. Suggest to post on C6x as opposed to code-comp. Your issues are more about DSP processing and less about how to
use CCS.

_____________________________________