Page 1 of 1

I2S驱动异常

Posted: Thu Aug 18, 2022 2:44 am
by HQ.Tan
芯片为ESP32,A2DP发送音频流到I2S从机,I2S流配置为

#define I2S_STREAM_CFG() { \
.type = AUDIO_STREAM_WRITER, \
.i2s_config = { \
.mode = I2S_MODE_SLAVE | I2S_MODE_TX | I2S_MODE_RX, \
.sample_rate = 44100, \
.bits_per_sample = 32, \
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, \
.communication_format = I2S_COMM_FORMAT_STAND_MSB, \
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL2 | ESP_INTR_FLAG_IRAM, \
.dma_buf_count = 2, \
.dma_buf_len = 256, \
.tx_desc_auto_clear = true, \
.use_apll = false, \
.fixed_mclk = 0, \
.mclk_multiple = 0, \
}, \
.i2s_port = I2S_NUM_0, \
.use_alc = false, \
.volume = 0, \
.out_rb_size = 4096, \
.task_stack = 4096, \
.task_core = 1, \
.task_prio = 23, \
.stack_in_ext = false, \
.multi_out_num = 0, \
.uninstall_drv = true, \
.need_expand = true, \
.expand_src_bits = 16, \
}

左声道存在很严重的杂音,

将配置中修改 .channel_format = I2S_COMM_FORMAT_STAND_MSB,直接出错:
W (10580) BT_APPL: new conn_srvc id:19, app_id:1
W (11196) A2DP_STREAM: discard a2dp(0x3ffda894) sink pkt, A2DP_STREAM_QUEUE_SIZE value needs to be expanded
W (11203) A2DP_STREAM: discard a2dp(0x3ffda894) sink pkt, A2DP_STREAM_QUEUE_SIZE value needs to be expanded
W (11296) A2DP_STREAM: discard a2dp(0x3ffda894) sink pkt, A2DP_STREAM_QUEUE_SIZE value needs to be expanded
W (11302) A2DP_STREAM: discard a2dp(0x3ffda894) sink pkt, A2DP_STREAM_QUEUE_SIZE value needs to be expanded

Re: I2S驱动异常

Posted: Thu Jun 01, 2023 2:44 pm
by CCER_CCER
您在代码中配置的是立体声,右声道是正常的吗?若右声道也不正常,您需要确认您的 Codec 配置的是否为 MSB 格式,若此配置与 ESP32 的 I2S 不匹配则会产生噪音