DSPRelated.com
Forums

regarding real time implementation of g.729a on DSK c6416

Started by nittin_2 June 17, 2010
Hi all,

I am doing real time implementation of G.729a(taken frm ITU-T site) on ti c6416 DSK.I have simulated and verified the code in simulator(non real time) but when im porting it on kit,i m unable to hear the sound.(im using DSK c6416 and using MIC and Headphone on the kit for testing and referring the example code for audio playback dsk_app).

Even i try to simply copy the input to output along with CODEC routines(to check whether loopback works in presence of CODEC routines),it does'nt work

let my CODEC has three routines A(),B() and C()

My main program is
main()
{
A();//codec routines included just to verify whether loop back works in there presence
B();//codec routines
C();//codec routines
for(i=0;i output=input;//simply copying audio data taken from AIc23 input,not proceeing the //input using CODEC
}

if i comment one routine,(major time consuming routine),then audio playback is working fine.Does it mean that Codec is not completing its routine in 10msec(i m taking 80samples frame@8KHz).When i halt the target ,it shows ---- in mem window meaning it is not executing on valid mem location?
Do i need to specify in more detail
Thanx in advance,

_____________________________________
nittin,

Besides the AIC23, the McBSP that is doing the I/O and the McBSP that is
outputing the control info to the AIC23 also have to be setup.

For best response, it would also be a good idea to setup two EDMA linked events
for the audio input and another two EDMA linked events for the audio output.

It may also be necessary to up the 'volume' control(s) of the AIC23 to produce
usable signal levels.

BTW:
polling will not be fast enough, use interrupts and the EDMA facilities.

R. Williams

---------- Original Message -----------
From: "nittin_2"
To: c...
Sent: Thu, 17 Jun 2010 09:15:32 -0000
Subject: [c6x] regarding real time implementation of g.729a on DSK c6416

> Hi all,
>
> I am doing real time implementation of G.729a(taken frm ITU-T site) on
> ti c6416 DSK.I have simulated and verified the code in simulator(non
> real time) but when im porting it on kit,i m unable to hear the
> sound.(im using DSK c6416 and using MIC and Headphone on the kit for
> testing and referring the example code for audio playback dsk_app).
>
> Even i try to simply copy the input to output along with CODEC
> routines(to check whether loopback works in presence of CODEC routines)
> ,it does'nt work
>
> let my CODEC has three routines A(),B() and C()
>
> My main program is
> main()
> {
> A();//codec routines included just to verify whether loop back works
> in there presence B();//codec routines C();//codec routines
> for(i=0;i > from AIc23 input,not proceeing the //input using CODEC }
>
> if i comment one routine,(major time consuming routine),then audio
> playback is working fine.Does it mean that Codec is not completing its
> routine in 10msec(i m taking 80samples frame@8KHz).When i halt the
> target ,it shows ---- in mem window meaning it is not executing on
> valid mem location? Do i need to specify in more detail Thanx in
> advance,
------- End of Original Message -------

_____________________________________
nittin,

Before giving any thought to hearing the sound output, it would be a good idea
to verify that the input audio signal is getting into the DSP.

The CCS works well as a debug tool for looking at the signals.
Some execution tracing, some profiling, and some breakpoints so the actual input
signal values can be examined would be a reasonable stating point.

Could you post the actual link to the code that you are implementing from the
ITU-T site?

R. Williams

---------- Original Message -----------
From: "nittin_2"
To: c...
Sent: Thu, 17 Jun 2010 09:15:32 -0000
Subject: [c6x] regarding real time implementation of g.729a on DSK c6416

> Hi all,
>
> I am doing real time implementation of G.729a(taken frm ITU-T site) on
> ti c6416 DSK.I have simulated and verified the code in simulator(non
> real time) but when im porting it on kit,i m unable to hear the
> sound.(im using DSK c6416 and using MIC and Headphone on the kit for
> testing and referring the example code for audio playback dsk_app).
>
> Even i try to simply copy the input to output along with CODEC
> routines(to check whether loopback works in presence of CODEC routines)
> ,it does'nt work
>
> let my CODEC has three routines A(),B() and C()
>
> My main program is
> main()
> {
> A();//codec routines included just to verify whether loop back works
> in there presence B();//codec routines C();//codec routines
> for(i=0;i > from AIc23 input,not proceeing the //input using CODEC }
>
> if i comment one routine,(major time consuming routine),then audio
> playback is working fine.Does it mean that Codec is not completing its
> routine in 10msec(i m taking 80samples frame@8KHz).When i halt the
> target ,it shows ---- in mem window meaning it is not executing on
> valid mem location? Do i need to specify in more detail Thanx in
> advance,
------- End of Original Message -------

_____________________________________
nitin,

the 'copy' function should not be used for processing of data.

In the example audio loopback code, (dsk_app.c) there is the function
processBufferSwi()
that is triggered by a SWI trap.
That function has a max execution time window of "the length of time to read one
buffer of data", in this case you say 80 samples of data.
Any longer an execution time will cause the loss of data.

The 'copy' function is only to move data either from the inactive input buffer
to the inactive process buffer
OR
from the inactive process buffer to the inactive output buffer.

What do your functions A(), B(), and C() do?
have you tried to code them so they will optimize to straight line assembly?
Are you using the optimizer features?

Do you realize that some/all of the copying of the buffers can be eliminated by
'on the fly' changing of the buffer pointers in the EDMA registers?

Do you realize that the 'copy' function is called twice for each block of data?

As I said above, put all the processing into the processBufferSwi() function.

R. Williams

---------- Original Message -----------
From: nitin tandon
To: Richard Williams , c...
Cc: nitin tandon
Sent: Thu, 17 Jun 2010 21:46:25 -0700 (PDT)
Subject: Re: [c6x] regarding real time implementation of g.729a on DSK c6416

> Hi Richards,Thanx for ur prompt reply.Actually i am already following
> the things u have mentioned.I have done exercise of audio loopback
> "dsk_app"(probably u have gone thru that too). I just want to see whether
> loopback works in presense of g.729a routines(as these routines will
> be going to introduce delay),afterwards i am planning to include
> that routines to process input in next step. Audio loop back example
> code portion before adding routines(as it is taken from dsk_app)void
> copyData(Int16 *inbuf, Int16 *outbuf, Int16 length){ Int16 i > 0; for (i = 0; i < length; i++)
> outbuf[i] =inbuf[i]; }Audio loop back example code
> portion after adding routinesvoid copyData(Int16 *inbuf, Int16 *outbuf,
> Int16 length){ Int16 i = 0; A();//cvsd routines B(); C()
> ; for (i = 0; i < length; i++)
> outbuf[i] =inbuf[i]; }
>
> I have changed sample rate of AIc23 codec to 8 KHz and BUFFSIZE to
> 80(ealier in example it was 1000,but frame size of G.729a is 80,so i
> have changed it).Now i am unable to hear speech in presence of all
> routines.If i exclude one major routine ,then audio playbackis
> working. is there something related to execution time of routines or
> memory issue. Can it be possible to real time implement g.729a c
> code(taken from ITU-T site)on TMSc6416 DSK running on 1GHz.Tell me
> if some more details are required. Thanks in advance, Nitin Tandon
>
> Scientist 'C'
>
> Airborne Radio
>
> DEAL,Raipur road
>
> Dehradun-248001
>
> Ph:9927229673
>
> office no. 0135-2787083-3213(ext)
>
> --- On Fri, 6/18/10, Richard Williams wrote:
>
> From: Richard Williams
> Subject: Re: [c6x] regarding real time implementation of g.729a on DSK
> c6416 To: "nittin_2" , c... Date:
> Friday, June 18, 2010, 12:00 AM
>
>
>
> nittin,
>
> Before giving any thought to hearing the sound output, it would be a
> good idea
>
> to verify that the input audio signal is getting into the DSP.
>
> The CCS works well as a debug tool for looking at the signals.
>
> Some execution tracing, some profiling, and some breakpoints so the
> actual input
>
> signal values can be examined would be a reasonable stating point.
>
> Could you post the actual link to the code that you are implementing
> from the
>
> ITU-T site?
>
> R. Williams
>
> ---------- Original Message -----------
>
> From: "nittin_2" To: c...
>
> Sent: Thu, 17 Jun 2010 09:15:32 -0000
>
> Subject: [c6x] regarding real time implementation of g.729a on DSK c6416
>
> > Hi all,
>
> > > I am doing real time implementation of G.729a(taken frm ITU-T site) on
>
> > ti c6416 DSK.I have simulated and verified the code in simulator(non
>
> > real time) but when im porting it on kit,i m unable to hear the
>
> > sound.(im using DSK c6416 and using MIC and Headphone on the kit for
>
> > testing and referring the example code for audio playback dsk_app).
>
> > > Even i try to simply copy the input to output along with CODEC
>
> > routines(to check whether loopback works in presence of CODEC routines)
>
> > ,it does'nt work
>
> > > let my CODEC has three routines A(),B() and C()
>
> > > My main program is
>
> > main()
>
> > {
>
> > A();//codec routines included just to verify whether loop back works
>
> > in there presence B();//codec routines C();//codec routines
>
> > for(i=0;i >
> > from AIc23 input,not proceeing the //input using CODEC }
>
> > > if i comment one routine,(major time consuming routine),then audio
>
> > playback is working fine.Does it mean that Codec is not completing its
>
> > routine in 10msec(i m taking 80samples frame@8KHz).When i halt the
>
> > target ,it shows ---- in mem window meaning it is not executing on
>
> > valid mem location? Do i need to specify in more detail Thanx in
>
> > advance,
>
> ------- End of Original Message -------
>
>
------- End of Original Message -------

_____________________________________
Nitin,

I ask before, what is the link to the ITU-T site where the original source code
exists?
I would like to take a look at that code.

R. Williams

---------- Original Message -----------
From: nitin tandon
To: Richard Williams , c...
Cc: nitin tandon
Sent: Thu, 17 Jun 2010 21:46:25 -0700 (PDT)
Subject: Re: [c6x] regarding real time implementation of g.729a on DSK c6416

> Hi Richards,Thanx for ur prompt reply.Actually i am already following
> the things u have mentioned.I have done exercise of audio loopback
> "dsk_app"(probably u have gone thru that too). I just want to see whether
> loopback works in presense of g.729a routines(as these routines will
> be going to introduce delay),afterwards i am planning to include
> that routines to process input in next step. Audio loop back example
> code portion before adding routines(as it is taken from dsk_app)void
> copyData(Int16 *inbuf, Int16 *outbuf, Int16 length){ Int16 i > 0; for (i = 0; i < length; i++)
> outbuf[i] =inbuf[i]; }Audio loop back example code
> portion after adding routinesvoid copyData(Int16 *inbuf, Int16 *outbuf,
> Int16 length){ Int16 i = 0; A();//cvsd routines B(); C()
> ; for (i = 0; i < length; i++)
> outbuf[i] =inbuf[i]; }
>
> I have changed sample rate of AIc23 codec to 8 KHz and BUFFSIZE to
> 80(ealier in example it was 1000,but frame size of G.729a is 80,so i
> have changed it).Now i am unable to hear speech in presence of all
> routines.If i exclude one major routine ,then audio playbackis
> working. is there something related to execution time of routines or
> memory issue. Can it be possible to real time implement g.729a c
> code(taken from ITU-T site)on TMSc6416 DSK running on 1GHz.Tell me
> if some more details are required. Thanks in advance, Nitin Tandon
>
> Scientist 'C'
>
> Airborne Radio
>
> DEAL,Raipur road
>
> Dehradun-248001
>
> Ph:9927229673
>
> office no. 0135-2787083-3213(ext)
>
> --- On Fri, 6/18/10, Richard Williams wrote:
>
> From: Richard Williams
> Subject: Re: [c6x] regarding real time implementation of g.729a on DSK
> c6416 To: "nittin_2" , c... Date:
> Friday, June 18, 2010, 12:00 AM
>
>
>
> nittin,
>
> Before giving any thought to hearing the sound output, it would be a
> good idea
>
> to verify that the input audio signal is getting into the DSP.
>
> The CCS works well as a debug tool for looking at the signals.
>
> Some execution tracing, some profiling, and some breakpoints so the
> actual input
>
> signal values can be examined would be a reasonable stating point.
>
> Could you post the actual link to the code that you are implementing
> from the
>
> ITU-T site?
>
> R. Williams
>
> ---------- Original Message -----------
>
> From: "nittin_2" To: c...
>
> Sent: Thu, 17 Jun 2010 09:15:32 -0000
>
> Subject: [c6x] regarding real time implementation of g.729a on DSK c6416
>
> > Hi all,
>
> > > I am doing real time implementation of G.729a(taken frm ITU-T site) on
>
> > ti c6416 DSK.I have simulated and verified the code in simulator(non
>
> > real time) but when im porting it on kit,i m unable to hear the
>
> > sound.(im using DSK c6416 and using MIC and Headphone on the kit for
>
> > testing and referring the example code for audio playback dsk_app).
>
> > > Even i try to simply copy the input to output along with CODEC
>
> > routines(to check whether loopback works in presence of CODEC routines)
>
> > ,it does'nt work
>
> > > let my CODEC has three routines A(),B() and C()
>
> > > My main program is
>
> > main()
>
> > {
>
> > A();//codec routines included just to verify whether loop back works
>
> > in there presence B();//codec routines C();//codec routines
>
> > for(i=0;i >
> > from AIc23 input,not proceeing the //input using CODEC }
>
> > > if i comment one routine,(major time consuming routine),then audio
>
> > playback is working fine.Does it mean that Codec is not completing its
>
> > routine in 10msec(i m taking 80samples frame@8KHz).When i halt the
>
> > target ,it shows ---- in mem window meaning it is not executing on
>
> > valid mem location? Do i need to specify in more detail Thanx in
>
> > advance,
>
> ------- End of Original Message -------
>
>
------- End of Original Message -------

_____________________________________
Nitin,

BTW:
unless the incoming data packets are at a data rate of 8khz, the setting of the
block size to 80 probably will not capture a complete block of data.

Do you have any way to set block boundaries to match the 80 data count of the
incoming audio blocks? If not, then does the software have any way to use a
'moving window' so a single audio block of data is processed at a time?

R. Williams
---------- Original Message -----------
From: nitin tandon
To: Richard Williams , c...
Cc: nitin tandon
Sent: Thu, 17 Jun 2010 21:46:25 -0700 (PDT)
Subject: Re: [c6x] regarding real time implementation of g.729a on DSK c6416

> Hi Richards,Thanx for ur prompt reply.Actually i am already following
> the things u have mentioned.I have done exercise of audio loopback
> "dsk_app"(probably u have gone thru that too). I just want to see whether
> loopback works in presense of g.729a routines(as these routines will
> be going to introduce delay),afterwards i am planning to include
> that routines to process input in next step. Audio loop back example
> code portion before adding routines(as it is taken from dsk_app)void
> copyData(Int16 *inbuf, Int16 *outbuf, Int16 length){ Int16 i > 0; for (i = 0; i < length; i++)
> outbuf[i] =inbuf[i]; }Audio loop back example code
> portion after adding routinesvoid copyData(Int16 *inbuf, Int16 *outbuf,
> Int16 length){ Int16 i = 0; A();//cvsd routines B(); C()
> ; for (i = 0; i < length; i++)
> outbuf[i] =inbuf[i]; }
>
> I have changed sample rate of AIc23 codec to 8 KHz and BUFFSIZE to
> 80(ealier in example it was 1000,but frame size of G.729a is 80,so i
> have changed it).Now i am unable to hear speech in presence of all
> routines.If i exclude one major routine ,then audio playbackis
> working. is there something related to execution time of routines or
> memory issue. Can it be possible to real time implement g.729a c
> code(taken from ITU-T site)on TMSc6416 DSK running on 1GHz.Tell me
> if some more details are required. Thanks in advance, Nitin Tandon
>
> Scientist 'C'
>
> Airborne Radio
>
> DEAL,Raipur road
>
> Dehradun-248001
>
> Ph:9927229673
>
> office no. 0135-2787083-3213(ext)
>
> --- On Fri, 6/18/10, Richard Williams wrote:
>
> From: Richard Williams
> Subject: Re: [c6x] regarding real time implementation of g.729a on DSK
> c6416 To: "nittin_2" , c... Date:
> Friday, June 18, 2010, 12:00 AM
>
>
>
> nittin,
>
> Before giving any thought to hearing the sound output, it would be a
> good idea
>
> to verify that the input audio signal is getting into the DSP.
>
> The CCS works well as a debug tool for looking at the signals.
>
> Some execution tracing, some profiling, and some breakpoints so the
> actual input
>
> signal values can be examined would be a reasonable stating point.
>
> Could you post the actual link to the code that you are implementing
> from the
>
> ITU-T site?
>
> R. Williams
>
> ---------- Original Message -----------
>
> From: "nittin_2" To: c...
>
> Sent: Thu, 17 Jun 2010 09:15:32 -0000
>
> Subject: [c6x] regarding real time implementation of g.729a on DSK c6416
>
> > Hi all,
>
> > > I am doing real time implementation of G.729a(taken frm ITU-T site) on
>
> > ti c6416 DSK.I have simulated and verified the code in simulator(non
>
> > real time) but when im porting it on kit,i m unable to hear the
>
> > sound.(im using DSK c6416 and using MIC and Headphone on the kit for
>
> > testing and referring the example code for audio playback dsk_app).
>
> > > Even i try to simply copy the input to output along with CODEC
>
> > routines(to check whether loopback works in presence of CODEC routines)
>
> > ,it does'nt work
>
> > > let my CODEC has three routines A(),B() and C()
>
> > > My main program is
>
> > main()
>
> > {
>
> > A();//codec routines included just to verify whether loop back works
>
> > in there presence B();//codec routines C();//codec routines
>
> > for(i=0;i >
> > from AIc23 input,not proceeing the //input using CODEC }
>
> > > if i comment one routine,(major time consuming routine),then audio
>
> > playback is working fine.Does it mean that Codec is not completing its
>
> > routine in 10msec(i m taking 80samples frame@8KHz).When i halt the
>
> > target ,it shows ---- in mem window meaning it is not executing on
>
> > valid mem location? Do i need to specify in more detail Thanx in
>
> > advance,
>
> ------- End of Original Message -------
>
>
------- End of Original Message -------

_____________________________________
Nitin,

Have you opened the registers window and looked at the actual contents of the PC
and stack registers?

Have you tried to open the stack window to look at the back trace of the call
stack?

have you used the contents of the stack register to perform the back trace by
hand to determine where the program went 'into the weeds'?

Have you re-ran the program with a break point at the begining of the problem
function and single stepped through the function, watching all key register
values, loop counters, pointers, etc to see what part of the code is causing the
problem?

R. Williams

---------- Original Message -----------
From: nitin tandon
To: Richard Williams , c...
Cc: nitin tandon
Sent: Fri, 18 Jun 2010 01:30:53 -0700 (PDT)
Subject: Re: [c6x] regarding real time implementation of g.729a on DSK c6416

> Hi Richard,
> You have given right indication.I have'nt gave it a try as loopback is
> working in presense of soome CODEC functions which shows that input
> data from AIc23 is indeed reaching the CPU. Included routines are
> (earlier i mentioned them as A B and C respectively) A( ):
> Pre_Process(new_speech, L_FRAME); B( ): Coder_ld8a(prm);
> //major time consuming routine C( ): prm2bits_ld8k( prm, serial);
> I have measured the execution time of all routine except that measure
> time consuming routine(B( )).It comes out ~0.1msec well OK but as i
> included that computationally intensive routine also. Audio playback
> stops,When i manually halt the target,PC halts at ------ in
> disassembly showing no mem locn.I am thinking whether there is some
> resourse crunch in terms of Memory,execution time or something
> other.The link of ITU-T is: www.itu.int/rec/T-REC-G.729-199611-S!AnnA/en
>
> lNitin Tandon
> Scientist 'C'
> Airborne Radio
> DEAL,Raipur road
> Dehradun-248001
> Ph:9927229673
> office no. 0135-2787083-3213(ext)
>
> --- On Fri, 6/18/10, Richard Williams wrote:
>
> From: Richard Williams
> Subject: Re: [c6x] regarding real time implementation of g.729a on DSK
> c6416 To: "nittin_2" , c... Date:
> Friday, June 18, 2010, 12:00 AM
>
> nittin,
>
> Before giving any thought to hearing the sound output, it would be a
> good idea to verify that the input audio signal is getting into the DSP.
>
> The CCS works well as a debug tool for looking at the signals.
> Some execution tracing, some profiling, and some breakpoints so the
> actual input signal values can be examined would be a reasonable
> stating point.
>
> Could you post the actual link to the code that you are implementing
> from the ITU-T site?
>
> R. Williams
>
> ---------- Original Message -----------
> From: "nittin_2"
> To: c...
> Sent: Thu, 17 Jun 2010 09:15:32 -0000
> Subject: [c6x] regarding real time implementation of g.729a on DSK c6416
>
> > Hi all,
> >
> > I am doing real time implementation of G.729a(taken frm ITU-T site) on
> > ti c6416 DSK.I have simulated and verified the code in simulator(non
> > real time) but when im porting it on kit,i m unable to hear the
> > sound.(im using DSK c6416 and using MIC and Headphone on the kit for
> > testing and referring the example code for audio playback dsk_app).
> >
> > Even i try to simply copy the input to output along with CODEC
> > routines(to check whether loopback works in presence of CODEC routines)
> > ,it does'nt work
> >
> > let my CODEC has three routines A(),B() and C()
> >
> > My main program is
> > main()
> > {
> > A();//codec routines included just to verify whether loop back works
> > in there presence B();//codec routines C();//codec routines
> > for(i=0;i > > from AIc23 input,not proceeing the //input using CODEC }
> >
> > if i comment one routine,(major time consuming routine),then audio
> > playback is working fine.Does it mean that Codec is not completing its
> > routine in 10msec(i m taking 80samples frame@8KHz).When i halt the
> > target ,it shows ---- in mem window meaning it is not executing on
> > valid mem location? Do i need to specify in more detail Thanx in
> > advance,
> ------- End of Original Message -------
------- End of Original Message -------

_____________________________________
Hi Richards,Thanx for ur prompt reply.Actually i am already following the things u have mentioned.I have done exercise of 
audio loopback "dsk_app"(probably u have gone thru that too). I just want to see whether 
loopback works in presense of g.729a routines(as these routines will be going to 
introduce delay),afterwards i am planning to include that routines to process input in 
next step.
Audio loop back example code portion before adding routines(as it is taken from dsk_app)void copyData(Int16 *inbuf, Int16 *outbuf, Int16 length){    Int16 i = 0;       for (i = 0; i < length; i++)                              outbuf[i]  =inbuf[i];
}Audio loop back example code portion after adding routinesvoid copyData(Int16 *inbuf, Int16 *outbuf, Int16 length){    Int16 i = 0;   A();//cvsd routines B(); C();        for (i = 0; i < length; i++)                              outbuf[i]  =inbuf[i];
}

I have changed sample rate of AIc23 codec to 8 KHz and BUFFSIZE to 80(ealier in example 
it was 1000,but frame size of G.729a is 80,so i have changed it).Now i am unable to hear 
speech in presence of all routines.If i exclude one major routine ,then audio playbackis 
working. is there something related to execution time of routines or memory issue.
Can it be possible to real time implement g.729a c code(taken from ITU-T site)on 
TMSc6416 DSK running on 1GHz.Tell me if some more details are required.
Thanks in advance,
Nitin Tandon

Scientist 'C'

Airborne Radio

DEAL,Raipur road

Dehradun-248001

Ph:9927229673

office no. 0135-2787083-3213(ext)

--- On Fri, 6/18/10, Richard Williams wrote:

From: Richard Williams
Subject: Re: [c6x] regarding real time implementation of g.729a on DSK c6416
To: "nittin_2" , c...
Date: Friday, June 18, 2010, 12:00 AM

 

nittin,

Before giving any thought to hearing the sound output, it would be a good idea

to verify that the input audio signal is getting into the DSP.

The CCS works well as a debug tool for looking at the signals.

Some execution tracing, some profiling, and some breakpoints so the actual input

signal values can be examined would be a reasonable stating point.

Could you post the actual link to the code that you are implementing from the

ITU-T site?

R. Williams

---------- Original Message -----------

From: "nittin_2"

To: c...

Sent: Thu, 17 Jun 2010 09:15:32 -0000

Subject: [c6x] regarding real time implementation of g.729a on DSK c6416

> Hi all,

>

> I am doing real time implementation of G.729a(taken frm ITU-T site) on

> ti c6416 DSK.I have simulated and verified the code in simulator(non

> real time) but when im porting it on kit,i m unable to hear the

> sound.(im using DSK c6416 and using MIC and Headphone on the kit for

> testing and referring the example code for audio playback dsk_app).

>

> Even i try to simply copy the input to output along with CODEC

> routines(to check whether loopback works in presence of CODEC routines)

> ,it does'nt work

>

> let my CODEC has three routines A(),B() and C()

>

> My main program is

> main()

> {

> A();//codec routines included just to verify whether loop back works

> in there presence B();//codec routines C();//codec routines

> for(i=0;i
> from AIc23 input,not proceeing the //input using CODEC }

>

> if i comment one routine,(major time consuming routine),then audio

> playback is working fine.Does it mean that Codec is not completing its

> routine in 10msec(i m taking 80samples frame@8KHz).When i halt the

> target ,it shows ---- in mem window meaning it is not executing on

> valid mem location? Do i need to specify in more detail Thanx in

> advance,

------- End of Original Message -------
Hi Richard,
You have given right indication.I have'nt gave it a try as loopback is working in presense of soome CODEC functions which shows that input data from AIc23 is indeed reaching the CPU. Included routines are (earlier i mentioned them as A B and C respectively)
A( ): Pre_Process(new_speech, L_FRAME);

B( ): Coder_ld8a(prm); //major time consuming routine

C( ): prm2bits_ld8k( prm, serial);
I have measured the execution time of all routine except that measure time consuming routine(B( )).It comes out ~0.1msec well OK but as i included that computationally intensive routine also.
Audio playback stops,When i manually halt the target,PC halts at ------ in disassembly showing no mem locn.I am thinking whether there is some resourse crunch in terms of Memory,execution time or something other.The link of ITU-T is:

www.itu.int/rec/T-REC-G.729-199611-S!AnnA/en

lNitin Tandon
Scientist 'C'
Airborne Radio
DEAL,Raipur road
Dehradun-248001
Ph:9927229673
office no. 0135-2787083-3213(ext)

--- On Fri, 6/18/10, Richard Williams wrote:
From: Richard Williams
Subject: Re: [c6x] regarding real time implementation of g.729a on DSK c6416
To: "nittin_2" , c...
Date: Friday, June 18, 2010, 12:00 AM
nittin,

Before giving any thought to hearing the sound output, it would be a good idea
to verify that the input audio signal is getting into the DSP.

The CCS works well as a debug tool for looking at the signals.
Some execution tracing, some profiling, and some breakpoints so the actual input
signal values can be examined would be a reasonable stating point.

Could you post the actual link to the code that you are implementing from the
ITU-T site?

R. Williams

---------- Original Message -----------
From: "nittin_2"
To: c...
Sent: Thu, 17 Jun 2010 09:15:32 -0000
Subject: [c6x] regarding real time implementation of g.729a on DSK c6416

> Hi all,
>
> I am doing real time implementation of G.729a(taken frm ITU-T site) on
> ti c6416 DSK.I have simulated and verified the code in simulator(non
> real time) but when im porting it on kit,i m unable to hear the
> sound.(im using DSK c6416 and using MIC and Headphone on the kit for
> testing and referring the example code for audio playback dsk_app).
>
> Even i try to simply copy the input to output along with CODEC
> routines(to check whether loopback works in presence of CODEC routines)
> ,it does'nt work
>
> let my CODEC has three routines A(),B() and C()
>
> My main program is
> main()
> {
> A();//codec routines included just to verify whether loop back works
> in there presence B();//codec routines C();//codec routines
> for(i=0;i > from AIc23 input,not proceeing the //input using CODEC }
>
> if i comment one routine,(major time consuming routine),then audio
> playback is working fine.Does it mean that Codec is not completing its
> routine in 10msec(i m taking 80samples frame@8KHz).When i halt the
> target ,it shows ---- in mem window meaning it is not executing on
> valid mem location? Do i need to specify in more detail Thanx in
> advance,
------- End of Original Message -------
nitin,

the '*2' in the call to memset() is because memset operates on 8bit bytes and
each of the entries in the buffers is 16 bits, I.E. 2 bytes.

The example code from dsk_app.c only sets up 1 audio input channel.
so no left/right channel data inputs.

The example code has two threads that take a lot of CPU time and should be
eliminated.
Those extra threads are for the functions BlinkLED() and Load()
When you remove the source code for those two functions, you will also need to
update the BIOS configuration file to eliminate those two threads.

Have you stepped through the A,B,C functions with the debugger facilities to
determine where the program is failing?

If the time limits are being overrun during the execution of the A,B,C functions
then I suspect the failure is from stack overrun.
(caused by being in an interrupt service routine too long.)

Have you examined the A,B,C functions to determine if you can modify them for
faster execution/ shorter execution time?

R. Williams

---------- Original Message -----------
From: nitin tandon
To: Richard Williams , c...
Cc: nitin tandon
Sent: Wed, 23 Jun 2010 21:41:09 -0700 (PDT)
Subject: Re: [c6x] regarding real time implementation of g.729a on DSK c6416

> heLLO William,
> Thank u very much for ur answer.Yes i should have placed the code in
> right place. I have done that but still the same problem is
> persisting.i think placing the code in either processbufferSWI() fn or
> copydatafn() may not make any difference as the first function is
> calling the second one.Plz elaborate if i am wrong. One more thing i
> want to clarify.In the original example with BUFFSIZE00,in main()fn
>
> memset((void *)gBufferXmtPing, 0, BUFFSIZE * 4 * 2);
>
>
> is declared;i think it means setting 8000 16 bit memory location to
> zero.The factor 2 is taken for Left and right channel,am i right. I
> have given a sine wave as input,and stored the input and output in
> original program using watch window.With the results ,i concluded that
> input/output is stored in form"L1L2......L1000R1R2............R1000"
> rather than " L1R1L2R2......L512R512",meaning when i am receiving data
> from Codec in rcvPING buffer,1000 samples i receive will get filled in
> 1000 left channel location and 1000 right channel location of 16 bit
> each .Plz clarify.
>
> BTW: i m trying to do debugging as u have mentioned.I will get back to
> u with results Very very grateful to u,
>
> --- On Fri, 6/18/10, Richard Williams wrote:
>
> From: Richard Williams
> Subject: Re: [c6x] regarding real time implementation of g.729a on DSK
> c6416 To: "nitin tandon" , c...
> Date: Friday, June 18, 2010, 2:45 PM
>
> Nitin,
>
> Have you opened the registers window and looked at the actual contents
> of the PC and stack registers?
>
> Have you tried to open the stack window to look at the back trace of
> the call stack?
>
> have you used the contents of the stack register to perform the back
> trace by hand to determine where the program went 'into the weeds'?
>
> Have you re-ran the program with a break point at the begining of the
> problem function and single stepped through the function, watching all
> key register values, loop counters, pointers, etc to see what part of
> the code is causing the problem?
>
> R. Williams
>
> ---------- Original Message -----------
> From: nitin tandon
> To: Richard Williams , c...
> Cc: nitin tandon
> Sent: Fri, 18 Jun 2010 01:30:53 -0700 (PDT)
> Subject: Re: [c6x] regarding real time implementation of g.729a on DSK
> c6416
>
> > Hi Richard,
> > You have given right indication.I have'nt gave it a try as loopback is
> > working in presense of soome CODEC functions which shows that input
> > data from AIc23 is indeed reaching the CPU. Included routines are
> > (earlier i mentioned them as A B and C respectively) A( ):
> > Pre_Process(new_speech, L_FRAME); B( ): Coder_ld8a(prm);
> > //major time consuming routine C( ): prm2bits_ld8k( prm, serial);
> > I have measured the execution time of all routine except that measure
> > time consuming routine(B( )).It comes out ~0.1msec well OK but as i
> > included that computationally intensive routine also. Audio playback
> > stops,When i manually halt the target,PC halts at ------ in
> > disassembly showing no mem locn.I am thinking whether there is some
> > resourse crunch in terms of Memory,execution time or something
> > other.The link of ITU-T is: www.itu.int/rec/T-REC-G.729-199611-S!AnnA/en
> >
> > lNitin Tandon
> > Scientist 'C'
> > Airborne Radio
> > DEAL,Raipur road
> > Dehradun-248001
> > Ph:9927229673
> > office no. 0135-2787083-3213(ext)
> >
> > --- On Fri, 6/18/10, Richard Williams wrote:
> >
> > From: Richard Williams
> > Subject: Re: [c6x] regarding real time implementation of g.729a on DSK
> > c6416 To: "nittin_2" , c... Date:
> > Friday, June 18, 2010, 12:00 AM
> >
> > nittin,
> >
> > Before giving any thought to hearing the sound output, it would be a
> > good idea to verify that the input audio signal is getting into the DSP.
> >
> > The CCS works well as a debug tool for looking at the signals.
> > Some execution tracing, some profiling, and some breakpoints so the
> > actual input signal values can be examined would be a reasonable
> > stating point.
> >
> > Could you post the actual link to the code that you are implementing
> > from the ITU-T site?
> >
> > R. Williams
> >
> > ---------- Original Message -----------
> > From: "nittin_2"
> > To: c...
> > Sent: Thu, 17 Jun 2010 09:15:32 -0000
> > Subject: [c6x] regarding real time implementation of g.729a on DSK c6416
> >
> > > Hi all,
> > >
> > > I am doing real time implementation of G.729a(taken frm ITU-T site) on
> > > ti c6416 DSK.I have simulated and verified the code in simulator(non
> > > real time) but when im porting it on kit,i m unable to hear the
> > > sound.(im using DSK c6416 and using MIC and Headphone on the kit for
> > > testing and referring the example code for audio playback dsk_app).
> > >
> > > Even i try to simply copy the input to output along with CODEC
> > > routines(to check whether loopback works in presence of CODEC routines)
> > > ,it does'nt work
> > >
> > > let my CODEC has three routines A(),B() and C()
> > >
> > > My main program is
> > > main()
> > > {
> > > A();//codec routines included just to verify whether loop back works
> > > in there presence B();//codec routines C();//codec routines
> > > for(i=0;i > > > from AIc23 input,not proceeing the //input using CODEC }
> > >
> > > if i comment one routine,(major time consuming routine),then audio
> > > playback is working fine.Does it mean that Codec is not completing its
> > > routine in 10msec(i m taking 80samples frame@8KHz).When i halt the
> > > target ,it shows ---- in mem window meaning it is not executing on
> > > valid mem location? Do i need to specify in more detail Thanx in
> > > advance,
> > ------- End of Original Message -------
> ------- End of Original Message -------
------- End of Original Message -------

_____________________________________