找回密码
 立即注册

使用微信账号登录

只需一步,快速开始

qcc3056 source i2s输入设置

2022-1-26 23:40| 发布者: jsjj| 查看: 3841| 评论: 2

摘要: 默认的qcc3056 source工程输入支持usb和模拟,这里教程把模拟修改为I2S输入。测试发现I2S输入做主正常,做从不正常,等待高手研究研究。1. 修改source_apps\usb_dongle\src\peripherals\audio_i2s_device.c,设置I2S ...
默认的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参数

/*! 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
};

2. 修改adk\src\domains\audio\kymera\kymera_a2dp_analog_source.c,将模拟输入接口改为I2S输入接口

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;
}

3. 编译运行,测试正常,进qact看看吧

3

路过

雷人

握手
1

鲜花

鸡蛋

刚表态过的朋友 (4 人)

相关阅读

发表评论

最新评论

引用 张18664975616 2022-2-12 09:21
很好非常好值得学习
引用 Egahp 2022-1-26 23:50
大佬nb,救急了!!

查看全部评论(2)

小黑屋|手机版|我爱蓝牙网 - 52Bluetooth

GMT+8, 2024-4-26 06:20 , Processed in 0.158792 second(s), 33 queries , Gzip On, MemCached On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

返回顶部