DSPRelated.com
Forums

Problem with codec aic23 on 6455 DSK

Started by Riksa February 1, 2011
i cannot put the audio data from input line to the output line..
when i debug the program, it wasn't halted..
here is my source code, i really need your help..

----------------------------------

#include "dsk_appcfg.h"
#include "tonecfg.h"
#include "dsk6455.h"
#include "dsk6455_aic23.h"

#define buffsize 512

Int16 inputleft[buffsize];
Int16 inputright[buffsize];
Int16 bufferright[buffsize];
Int16 bufferleft[buffsize];

DSK6455_AIC23_Config configline = {
0x001f,
0x001f,
0x00d8,
0x00d8,
0x0011,
0x0001,
0x0000,
0x0043,
0x008c,
0x0001
};

void main()
{
DSK_AIC23_CodecHandle hCodecline;
int i;
DSK6455_init();
while(1)
{
for (i=0;i {
hCodecline=DSK_AIC23_openCodec(0,&configline);
DSK6455_AIC23_config(0,&configline);
while(!DSK6455_AIC23_read32(hCodecline,(Uint32 *)inputleft[i]));
while(!DSK6455_AIC23_write32(hCodecline,bufferleft[i]));
while(!DSK6455_AIC23_read32(hCodecline,(Uint32 *)inputright[i]));
while(!DSK6455_AIC23_write32(hCodecline,bufferright[i]));
};
for (i=0;i<512;i++)
{
bufferleft[i]=inputleft[i];
bufferright[i]=inputright[i];
};
}
}
----------------------------------

thx, Best Regards, Riksa

_____________________________________
Riksa,

I could give a long, detailed answer, with code snips, but; I think the best way is:

The CCS /examples sub directory should have a project named dsk_apt or dsp_apt.
This example show the code for audio ==>aic23 ==> McBSP ==> processing ==> McBSP
==> aic23 ==> processed audio.
It includes the appropriate use of the CSL and other libraries.

I think it is for mono audio, so you will need to tweak it for stereo audio.

If you cannot find the appropriate example on the CCS install directory tree,
then you can download it from either SpectrumDigital.com or TI.com.

Usually there are two versions, one for BIOS and one without BIOS.

R. Williams
---------- Original Message -----------
From: "Riksa"
To: c...
Sent: Mon, 31 Jan 2011 06:49:27 -0000
Subject: [c6x] Problem with codec aic23 on 6455 DSK

> i cannot put the audio data from input line to the output line..
> when i debug the program, it wasn't halted..
>
> here is my source code, i really need your help..
>
> ----------------------------------
>
> #include "dsk_appcfg.h"
> #include "tonecfg.h"
> #include "dsk6455.h"
> #include "dsk6455_aic23.h"
>
> #define buffsize 512
>
> Int16 inputleft[buffsize];
> Int16 inputright[buffsize];
> Int16 bufferright[buffsize];
> Int16 bufferleft[buffsize];
>
> DSK6455_AIC23_Config configline = {
> 0x001f,
> 0x001f,
> 0x00d8,
> 0x00d8,
> 0x0011,
> 0x0001,
> 0x0000,
> 0x0043,
> 0x008c,
> 0x0001
> };
>
> void main()
> {
> DSK_AIC23_CodecHandle hCodecline;
> int i;
> DSK6455_init();
> while(1)
> {
> for (i=0;i > {
> hCodecline=DSK_AIC23_openCodec(0,&configline);
> DSK6455_AIC23_config(0,&configline);
> while(!DSK6455_AIC23_read32(hCodecline,(Uint32 *)inputleft[i]));
> while(!DSK6455_AIC23_write32(hCodecline,bufferleft[i]));
> while(!DSK6455_AIC23_read32(hCodecline,(Uint32 *)inputright[i]));
> while(!DSK6455_AIC23_write32(hCodecline,bufferright[i]));
> };
> for (i=0;i<512;i++)
> {
> bufferleft[i]=inputleft[i];
> bufferright[i]=inputright[i];
> };
> }
> }
> ----------------------------------
>
> thx, Best Regards, Riksa
------- End of Original Message -------

_____________________________________
Riksa,

You will want to read certain of the T.I. documents to understand what actually
needs to be performed in your code.

A good start would be SPRC118, which contains a set of drivers for the AIC23.
Then SPRU401j.pdf which contains the API for CSL library.
Then SPRC488c.zip which contains the McBSP documentation and code examples.
Then SPRA636a.zip which contains the EDMA documentation and code examples.

Under a separate email, I have sent you a file for audio I/O named dsk_apt.c
(the complete dsk_apt project can be downloaded from TI/spectrum Digital)

You will still need to write the sub routine to initialize the AIC23.
BTW: The AIC23 only needs to be initialized once, not every time though the
loop as your code is doing.
Note the appropriate McBSP must be initialized and running before you can write
through the McBSP to initialize the AIC23.

R. Williams

---------- Original Message -----------
From: "Riksa"
To: c...
Sent: Mon, 31 Jan 2011 06:49:27 -0000
Subject: [c6x] Problem with codec aic23 on 6455 DSK

> i cannot put the audio data from input line to the output line..
> when i debug the program, it wasn't halted..
>
> here is my source code, i really need your help..
>
> ----------------------------------
>
> #include "dsk_appcfg.h"
> #include "tonecfg.h"
> #include "dsk6455.h"
> #include "dsk6455_aic23.h"
>
> #define buffsize 512
>
> Int16 inputleft[buffsize];
> Int16 inputright[buffsize];
> Int16 bufferright[buffsize];
> Int16 bufferleft[buffsize];
>
> DSK6455_AIC23_Config configline = {
> 0x001f,
> 0x001f,
> 0x00d8,
> 0x00d8,
> 0x0011,
> 0x0001,
> 0x0000,
> 0x0043,
> 0x008c,
> 0x0001
> };
>
> void main()
> {
> DSK_AIC23_CodecHandle hCodecline;
> int i;
> DSK6455_init();
> while(1)
> {
> for (i=0;i > {
> hCodecline=DSK_AIC23_openCodec(0,&configline);
> DSK6455_AIC23_config(0,&configline);
> while(!DSK6455_AIC23_read32(hCodecline,(Uint32 *)inputleft[i]));
> while(!DSK6455_AIC23_write32(hCodecline,bufferleft[i]));
> while(!DSK6455_AIC23_read32(hCodecline,(Uint32 *)inputright[i]));
> while(!DSK6455_AIC23_write32(hCodecline,bufferright[i]));
> };
> for (i=0;i<512;i++)
> {
> bufferleft[i]=inputleft[i];
> bufferright[i]=inputright[i];
> };
> }
> }
> ----------------------------------
>
> thx, Best Regards, Riksa
------- End of Original Message -------

_____________________________________