Reply by Jeff Brower October 5, 20062006-10-05
Umer-

> Thanks for ur reply. The code snippet that u have mentioned (i.e.
> loopback) is already working and i hav already tried it out. But I just
> want to store the audio input in some buffer array or any thing else. And
> then I want to loop it back after sometime (in seconds just like after
> introducing some delay). Please look in to my code to understand wht i
> am trying to do. This is my first assignment to configure DSK and a
> preliminary demo (abt which my question is). After that i will start
> learning DSP concepts and tutorials and manuals of CCS. So kindly help
> me to get this first step.

I know what you're trying to do, and I know what's wrong with your code. But I'm not
going to debug your assignment for you.

The point of my reply is to show that you are assuming too many steps between the
initial working code, and your objective -- which is a typical student error. If you
go carefully, step-by-step, then you can figure it out. I'll give you 2 hints: a)
don't make separate for-loops, and b) use a single, circular buffer with input and
output pointers shifted from each other.

Good luck!

-Jeff

> Umer-
> >
> >> So did u find answer to your query? I am really a new comer in
> >> DSP domain and unknown to working C5510 in detail. I want to read
> >> audio input from mic and store it.Then i want to play it back to
> >> headphone.
> >>
> >> This is my main():
> >
> >First I would try something very simple to verify your DSK board, tool
> >set-up, build options, memory map, and other basic factors are Ok:
> >
> >void main() {
> >
> >DSK5510_AIC23_CodecHandle hCodec;
> >Int16 left,right;
> >
> > /* Initialize the board support library, must be called first */
> > DSK5510_init();
> >
> > /* Start the codec */
> > hCodec = DSK5510_AIC23_openCodec(0, &config);
> >
> > /* Audio loopback */
> > while (TRUE) {
> >
> > while (!DSK5510_AIC23_read16(hCodec, &left));
> > while (!DSK5510_AIC23_read16(hCodec, &right));
> >
> > while(!DSK5510_AIC23_write16(hCodec, left));
> > while(!DSK5510_AIC23_write16(hCodec, right));
> > }
> >
> > DSK5510_AIC23_closeCodec(hCodec);
> >}
> >
> >This should enable audio loopback -- you should hear whatever is on the
> >inputs. Does that much work? If so, then you can go step-by-step to add
> >the functionality you need, testing each step carefully.
> >
> >Also, here is a nice page for generating a sine wave with DSK 5510:
> >
> > http://www.tkt.cs.tut.fi/kurssit/3516/exercises/fall05/test_audioIO.c
> >
> >-Jeff
> >> void main()
> >> {
> >>
> >> DSK5510_AIC23_CodecHandle hCodec;
> >> Int16 i,j,k,left,right;
> >> Int16 input1[8000];
> >> Int16 input2[8000];
> >> /* Initialize the board support library, must be called first */
> >> DSK5510_init();
> >>
> >> /* Start the codec */
> >> hCodec = DSK5510_AIC23_openCodec(0, &config);
> >>
> >> /* Generate a 1KHz sine wave for 5 seconds */
> >> for (i = 0; i < 10; i++)
> >> {
> >> for (j = 0; j < 8000; j++)
> >> {
> >> /* Read a sample from left channel */
> >> while (!DSK5510_AIC23_read16(hCodec, &left));
> >> input1[j]=left;
> >>
> >> /* Read a sample from right channel */
> >> while (!DSK5510_AIC23_read16(hCodec, &right));
> >> input2[j]= right;
> >> }
> >>
> >> }
> >> for (i = 0; i < 10; i++)
> >> {
> >> for(k=0; k {
> >> while(!DSK5510_AIC23_write16(hCodec, input1[k]));
> >> /* Send a sample to the right channel */
> >> while(!DSK5510_AIC23_write16(hCodec, input2[k]));
> >> }
> >> }
> >> /* Close the codec */
> >> DSK5510_AIC23_closeCodec(hCodec);
> >> }
> >>
> >> But it is not giving any output. What to do?
> >> kindly help me where i am going wrong. I will be waiting for ur reply
> >>
> >> regards,
> >> Umer
> >> >
> >> > hello everybody
> >> > i m an student doing project "Real time
> >> > implementation of G.723.1 on TMS320VC5510"
> >> > right now i am ready with optimised code which is
> >> > running in CCS simulator by taking i/p from file and
> >> > putting o/p in2 file
> >> > but now my next step is to run it in to DSK board for
> >> > that i have to take i/p from mike and taken o/p from
> >> > headphone
> >> > and for that i have to interface adc/dac of that
> >> > particular board which uses AIC23 as a codec.
> >> > i tried 2 get some idea from audio project available
> >> > in TI but not getting the flow as i don't aquant with
> >> > DSP-BIOS also
> >> > please any1 sugest me how to proceed or else can
> >> > anybody send me programme to interface codec withought
> >> > using DSP-BIOS
> >> >
> >> > sorry for long mail
> >> > waiting for early reply as i have to submit my project
> >> > bbye
> >> > Alpana
> >> > M.E.(GCOEP)
> >> > Pune