一:增加打印信息(main.xc)奢米,打印全局變量信息:printinfor()
void printinfor()
{
printstr("XUD_TILE="); printintln(XUD_TILE);
printstr("AUDIO_IO_TILE="); printintln(AUDIO_IO_TILE);
printstr("DSD_CHANS_DAC="); printintln(DSD_CHANS_DAC);
printstr("I2S_CHANS_DAC="); printintln(I2S_CHANS_DAC);
printstr("I2S_CHANS_ADC="); printintln(I2S_CHANS_ADC);
printstr("I2S_WIRES_ADC="); printintln(I2S_WIRES_ADC);
printstr("I2S_WIRES_DAC="); printintln(I2S_WIRES_DAC);
printstr("NUM_USB_CHAN_IN="); printintln(NUM_USB_CHAN_IN);
printstr("NUM_USB_CHAN_OUT="); printintln(NUM_USB_CHAN_OUT);
printstr("MAX_FREQ="); printintln(MAX_FREQ);
printstr("NATIVE_DSD="); printintln(NATIVE_DSD);
printstr("OUTPUT_FORMAT_COUNT="); printintln(OUTPUT_FORMAT_COUNT);
printstr("NATIVE_DSD_FORMAT_NUM="); printintln(NATIVE_DSD_FORMAT_NUM);
printstr("MIXER="); printintln(MIXER);
printstr("STREAM_FORMAT_OUTPUT_1_RESOLUTION_BITS="); printintln(STREAM_FORMAT_OUTPUT_1_RESOLUTION_BITS);
printstr("STREAM_FORMAT_OUTPUT_2_RESOLUTION_BITS="); printintln(STREAM_FORMAT_OUTPUT_2_RESOLUTION_BITS);
printstr("STREAM_FORMAT_OUTPUT_3_RESOLUTION_BITS="); printintln(STREAM_FORMAT_OUTPUT_3_RESOLUTION_BITS);
printstr("HS_STREAM_FORMAT_OUTPUT_1_SUBSLOT_BYTES="); printintln(HS_STREAM_FORMAT_OUTPUT_1_SUBSLOT_BYTES);
printstr("HS_STREAM_FORMAT_OUTPUT_2_SUBSLOT_BYTES="); printintln(HS_STREAM_FORMAT_OUTPUT_2_SUBSLOT_BYTES);
printstr("HS_STREAM_FORMAT_OUTPUT_3_SUBSLOT_BYTES="); printintln(HS_STREAM_FORMAT_OUTPUT_3_SUBSLOT_BYTES);
printstr("STREAM_FORMAT_INPUT_1_RESOLUTION_BITS="); printintln(STREAM_FORMAT_INPUT_1_RESOLUTION_BITS);
printstr("STREAM_FORMAT_INPUT_2_RESOLUTION_BITS="); printintln(STREAM_FORMAT_INPUT_2_RESOLUTION_BITS);
printstr("STREAM_FORMAT_INPUT_3_RESOLUTION_BITS="); printintln(STREAM_FORMAT_INPUT_3_RESOLUTION_BITS);
};
//在usb_audio_core前調(diào)用printinfor()函數(shù)瘫析。
printinfor();
usb_audio_core(c_mix_out------------------
Real-time xscope的console輸出:
二:增加波形顯示(audio.xc):左右聲道波形顯示挥等,xscope
1、在函數(shù)DoSampleTransfer()中添加紅色語句
#if NUM_USB_CHAN_OUT > 0
#pragma loop unroll
for(int i = 0; i < NUM_USB_CHAN_OUT; i++)
{
int tmp = inuint(c_out);
samplesOut[i] = tmp;
}
#endif
xscope_int(LVALUE,samplesOut[0]); //**注意:輸出無符號數(shù)據(jù)*
xscope_int(RVALUE,samplesOut[1]);
2鸦难、在項目中添加config.xscope文件挚躯,內(nèi)容如下
<xSCOPEconfigioMode="none" enabled="true">//**注意type和datatype中沒有“xscope_”的前綴*
<Probe name="LValue" type="CONTINUOUS"datatype="UINT" units="Value" enabled="true"/>
<Probe name="RValue" type="CONTINUOUS"datatype="UINT" units="Value" enabled="true"/>
</xSCOPEconfig>*
3、捕捉的圖形顯示(正弦波輸出48KHz集漾,32bit切黔,注意捕捉的圖形不對)
4砸脊、將下面的datatype由“UINT”改成“INT”型,輸出波形正確
<Probe name="LValue"type="CONTINUOUS" datatype="INT" units="Value"enabled="true"/>
三:改Makefile纬霞,DSD out, 2ch ADC, 2ch DAC,No midi, No SPDIF i/o, No ADAT i/o
XCC_FLAGS_2i2o2xxxxd = $(BUILD_FLAGS)
-DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0
-DADAT_TX=0 -DADAT_RX=0
-DDSD_CHANS_DAC=2 -DI2S_CHANS_DAC=4 -DI2S_CHANS_ADC=4
-DNUM_USB_CHAN_OUT=6 -DNUM_USB_CHAN_IN=6
XCC_FLAGS_2i2o2xxxxd = $(BUILD_FLAGS)
-DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0
-DADAT_TX=0 -DADAT_RX=0
-DDSD_CHANS_DAC=2 -DI2S_CHANS_DAC=2 -DI2S_CHANS_ADC=2
-DNUM_USB_CHAN_OUT=6 -DNUM_USB_CHAN_IN=6
INCLUDE_ONLY_IN_2i2o2xxxxd =
XCC_FLAGS_2i2o2xxxxd = $(BUILD_FLAGS)
-DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0
-DADAT_TX=0 -DADAT_RX=0
-DDSD_CHANS_DAC=2 -DI2S_CHANS_DAC=2 -DI2S_CHANS_ADC=2
-DNUM_USB_CHAN_OUT=4 -DNUM_USB_CHAN_IN=4
INCLUDE_ONLY_IN_2i2o2xxxxd =
XCC_FLAGS_2i2o2xxxxd = $(BUILD_FLAGS) \ -DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0 \ -DADAT_TX=0 -DADAT_RX=0 \ -DDSD_CHANS_DAC=2 \ -DI2S_CHANS_DAC=2 -DI2S_CHANS_ADC=2 \ -DNUM_USB_CHAN_OUT=2 -DNUM_USB_CHAN_IN=2 INCLUDE_ONLY_IN_2i2o2xxxxd = 錄音/回放沒有問題凌埂。