hi all:
my system is source of audio connect dm368 with iis.
my code :
static int init_mcbsp(unsigned int fre,unsigned int rdata_long,unsigned int xdata_long)
{
int err = 0;
unsigned int ClkGdv;
unsigned int datalong;
unsigned int buffer_32;
__raw_writel(0, IO_ADDRESS(MCBSP0_SPCR)); //MCBSP0_SPCR = 0;
__raw_writel(0x00000a00, IO_ADDRESS(MCBSP0_PCR)); //MCBSP0_PCR = 0x00000a00;//最低两位1表示数据在上升沿采样, 高几位用于设置信号时钟的来源,设为1
buffer_32 = (1<<31)|(rdata_long<<21)|(1<<18)|(1<<16)|(rdata_long<<5);//(1<<31)|(2<<21)|(1<<16)|(2<<5);//1,bit1 dely bit2 0x00010140;//接收控制寄存器
__raw_writel(buffer_32, IO_ADDRESS(MCBSP0_RCR)); //
buffer_32 = (1<<31)|(xdata_long<<21)|(1<<18)|(1<<16)|(xdata_long<<5);//0x00010140;
__raw_writel(buffer_32, IO_ADDRESS(MCBSP0_XCR)); //
if(xdata_long<5)
{
datalong = 8+4*xdata_long;
}
else
{
datalong = 32;
}
ClkGdv = DM365_MCBSP_INTERNAL_CLK/(2*fre*datalong);//计算分频系数
buffer_32 = (1<<29)|(1<<28)|(31<<16)|(15<<8)|(ClkGdv-1);
__raw_writel(buffer_32, IO_ADDRESS(MCBSP0_SRGR)); //
__raw_writel(0x03c10001, IO_ADDRESS(MCBSP0_SPCR)); //MCBSP0_SPCR = 0x03c10001;
return err;
}
init_mcbsp(48000,DM365_TX_LENGTH_16BIT,DM365_TX_LENGTH_16BIT);//音频初始化
question :
the source of audio is ok.
but the source of audio stop ,some time the aideo have noise when the source start again,
some time the video is ok.,.
the audio have not noise when the source is quite.