Closed laodi-chen closed 7 months ago
@TempoTian 哪个好心人能帮咱看看这个问题
我本地用Mini板子跑了下是没有问题的,我看你的log也没有什么问题,对比正常的log 可以看下喇叭有没有插错口,靠近耳机的才是喇叭口,也可以插入耳机听听看
I (1486) TONE_MP3_EXAMPLE: [ 4 ] Listen for all pipeline events
I (1486) TONE_MP3_EXAMPLE: [ * ] Receive music info from mp3 decoder, sample_rates=16000, bits=16, ch=1
W (1596) TONE_STREAM: No more data,ret:0 ,info.byte_pos:5400
W (3296) TONE_MP3_EXAMPLE: [ * ] Stop event received
I (3296) TONE_MP3_EXAMPLE: [ 5 ] Stop audio_pipeline
W (3296) AUDIO_ELEMENT: [tone] Element already stopped
W (3306) AUDIO_ELEMENT: [mp3] Element already stopped
W (3306) AUDIO_ELEMENT: [i2s] Element already stopped
W (3316) AUDIO_PIPELINE: There are no listener registered
W (3316) AUDIO_ELEMENT: [tone] Element has not create when AUDIO_ELEMENT_TERMINATE
W (3326) AUDIO_ELEMENT: [i2s] Element has not create when AUDIO_ELEMENT_TERMINATE
W (3336) AUDIO_ELEMENT: [mp3] Element has not create when AUDIO_ELEMENT_TERMINATE
@TempoTian 老哥真的不行,喇叭绝对没插错,耳机也试过了都是响一声就没了,我把工程文件打包了要不你看看,这块板子voip和http MP3都可以,唯独这个不行,我也换过电脑编译下载也一样,idf4.4.7 adf-master https://static-web-file-001.obs.cn-north-4.myhuaweicloud.com/bin/pipeline_flash_tone.zip
这个是I2S driver的Regression,可以尝试rollback一下下面的代码: esp-adf/components/hal/i2s_hal.c
void i2s_hal_tx_set_channel_style(i2s_hal_context_t *hal, const i2s_hal_config_t *hal_cfg)
{
uint32_t chan_num = 2;
uint32_t chan_bits = hal_cfg->chan_bits;
uint32_t data_bits = hal_cfg->sample_bits;
#if SOC_I2S_SUPPORTS_TDM
bool is_mono = (hal_cfg->chan_fmt == I2S_CHANNEL_FMT_ALL_RIGHT) ||
(hal_cfg->chan_fmt == I2S_CHANNEL_FMT_ALL_LEFT);
#else
bool is_mono = (hal_cfg->chan_fmt == I2S_CHANNEL_FMT_ONLY_RIGHT) ||
(hal_cfg->chan_fmt == I2S_CHANNEL_FMT_ONLY_LEFT);
#endif
/* Set channel number and valid data bits */
#if SOC_I2S_SUPPORTS_TDM
chan_num = hal_cfg->total_chan;
i2s_ll_tx_set_active_chan_mask(hal->dev, hal_cfg->chan_mask >> 16);
i2s_ll_tx_set_chan_num(hal->dev, chan_num);
#else
// 主要是这一行
i2s_ll_tx_set_chan_mod(hal->dev, hal_cfg->chan_fmt < I2S_CHANNEL_FMT_ONLY_RIGHT ? hal_cfg->chan_fmt : (hal_cfg->chan_fmt >> 1)); // 0-two channel;1-right;2-left;3-righ;4-left
#endif // SOC_I2S_SUPPORTS_TDM
#if SOC_I2S_SUPPORTS_PDM_CODEC
if (hal_cfg->mode & I2S_MODE_PDM) {
// Fixed to 16 while using mono mode and 32 while using stereo mode
data_bits = hal_cfg->chan_fmt == I2S_CHANNEL_FMT_RIGHT_LEFT ? 32 : 16;
chan_bits = data_bits;
}
#endif
i2s_ll_tx_set_sample_bit(hal->dev, chan_bits, data_bits);
i2s_ll_tx_enable_mono_mode(hal->dev, is_mono);
/* Set communication format */
bool shift_en = hal_cfg->comm_fmt == I2S_COMM_FORMAT_STAND_I2S ? true : false;
uint32_t ws_width = i2s_hal_get_ws_bit(hal_cfg->comm_fmt, chan_num, chan_bits);
i2s_ll_tx_enable_msb_shift(hal->dev, shift_en);
i2s_ll_tx_set_ws_width(hal->dev, ws_width);
#if SOC_I2S_SUPPORTS_TDM
uint32_t half_sample_bits = chan_num * chan_bits / 2;
#if SOC_I2S_SUPPORTS_PDM_CODEC
if (hal_cfg->mode & I2S_MODE_PDM) {
half_sample_bits = 16; // Fixed to 16 in PDM mode
}
#endif
i2s_ll_tx_set_half_sample_bit(hal->dev, half_sample_bits);
#endif
}
@TempoTian 能用了,妙手回春啊大夫
Environment
Problem Description
例程是从adf中复制出来的 原本的例程没有经过任何修改,只是编译运行这样 我也尝试过自己定义提示音烧录,但是效果一样,每次运行都只播放了提示音的大概前0.1s 喇叭没有坏掉,耳朵也没有坏掉 我把录音放到下面了
Debug Logs
提示音烧录日志
https://github.com/espressif/esp-adf/assets/40551848/7a5afd1b-24fb-4623-b332-2ab3efcb857e
bin+elf.zip