| 默认的qcc3056 source工程输入支持usb和模拟,这里教程把模拟修改为I2S输入。 测试平台大概说明下, mde2.6 adk toolkit 1.2.9.25 ADK-21.1-CS-r00073.2 测试发现I2S输入做主正常,做从不正常,等待高手研究研究。 1. 修改source_apps\usb_dongle\src\peripherals\audio_i2s_device.c,设置I2S参数 [code]/*! Default I2S configuration data for this chip */
const i2s_config_t device_i2s_config =
{
.master_mode = 1, /*!< Default to slave mode for pure I2S output */
.data_format = 0, /*!< I2S left justified */
.bit_delay = 1, /*!< I2S delay 1 bit */
.bits_per_sample = 16, /*!< 16-bit data words per channel */
.bclk_scaling = 64, /*!< 32 bit clocks per data word per channel */
.mclk_scaling = 0, /*!< External master clock disabled */
.enable_pio = PIN_INVALID
};[/code]2. 修改adk\src\domains\audio\kymera\kymera_a2dp_analog_source.c,将模拟输入接口改为I2S输入接口 [code]static Source kymeraA2dpAnalogSource_GetSource(audio_channel channel, uint8 inst, uint32 rate)
{
#define SAMPLE_SIZE 24 /* only if 24 bit resolution is supported this can be 24 */
Source source;
#ifdef ENABLE_I2S_INPUT
source = StreamAudioSource(AUDIO_HARDWARE_I2S, inst, channel);
AudioI2SConfigureSource(source, rate, SAMPLE_SIZE);
#else
analogue_input_params params = {
.pre_amp = FALSE,
.gain = 0x0c, /* for line-in set to 0dB */
.instance = 0, /* Place holder */
.enable_24_bit_resolution = FALSE};
DEBUG_LOG_VERBOSE("SourcekymeraWiredAnalog_GetSource, Get source for Channel: %u, Instance: %u and Sample Rate: %u", channel, inst, rate);
params.instance = inst;
source = AudioPluginAnalogueInputSetup(channel, params, rate);
#endif
PanicFalse(SourceConfigure(source, STREAM_AUDIO_SAMPLE_SIZE, SAMPLE_SIZE));
return source;
}[/code]3. 编译运行,测试正常,进qact看看吧 |
GMT+8, 2025-12-27 20:55 , Processed in 0.088796 second(s), 29 queries , Gzip On, MemCached On.
Powered by Discuz! X3.5
© 2001-2025 Discuz! Team.