根据官网步骤 环境部署完成后 编译play_mp3 成功, 运行失败 因为自己的板子没有codec芯片 所以控制台报错iic读设备失败 是正常的,
然后尝试编译play_mp3_dac 编译出现错误:
i2s_stream.h中
error: 'I2S_MODE_DAC_BUILT_IN' undeclared
I2S_MODE_DAC_BUILT_IN 这个宏定义 在自己本身的idf 或者是adf目录下的idf 的某个头文件 都是有定义的 定义的值是16 但是这里就是会包错误, 在自己原先的idf 的iis dac例程编译也没报这个错误
强行在i2s_stream.h中 将I2S_MODE_DAC_BUILT_IN直接写成16 编译没出问题 然后下载到
开发板中
运行出现下图日志错误
Code:
Select all
W (1244) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (1258) cpu_start: Star
ting scheduler on PRO CPU.
I (1263) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (1263) PLAY_MP3_FLASH: [ 1 ] Create audio pipeline, add all elements to pipeline, and subscribe pipeline event
I (1273) PLAY_MP3_FLASH: [1.1] Create mp3 decoder to decode mp3 file and set custom read callback
I (1283) PLAY_MP3_FLASH: [1.2] Create i2s stream to write data to ESP32 internal DAC
I (1293) PLAY_MP3_FLASH: [1.3] Register all elements to audio pipeline
I (1303) PLAY_MP3_FLASH: [1.4] Link it together [mp3_music_read_cb]-->mp3_decoder-->i2s_stream-->[ESP32 DAC]
I (1313) PLAY_MP3_FLASH: [ 2 ] Set up event listener
I (1323) PLAY_MP3_FLASH: [2.1] Listening event from all elements of pipeline
I (1323) PLAY_MP3_FLASH: [ 3 ] Start audio_pipeline
I (1353) PLAY_MP3_FLASH: [ * ] Receive music info from mp3 decoder, sample_rates=44100, bits=16, ch=2
I (8113) PLAY_MP3_FLASH: [ 4 ] Stop audio_pipeline
E (8113) AUDIO_ELEMENT: [mp3] Element already stopped
E (8113) AUDIO_ELEMENT: [i2s] Element already stopped
W (8123) AUDIO_PIPELINE: There are no listener registered
W (8123) AUDIO_ELEMENT: [i2s] Element has not create when AUDIO_ELEMENT_TERMINATE
W (8133) AUDIO_ELEMENT: [mp3] Element has not create when AUDIO_ELEMENT_TERMINATE
各位大佬 在此我有两个不解:
1、上述问题产生的原因以及解决办法
2、 为什么本地已经有idf了 adf里面的子模块还需要下载idf 而且我看跟着官网例程走下来的话, 实际上adf用的idf 还是在原先的idf上 并没有将idf_path修改到adf内部子模块的idf啊 所以我在想上述的问题会不会是这个原因。。
刚入门这块 如果问题太过拙劣 请见谅啊
照理说, 这个play_mp3_dac 不依赖任何外部器件 编译下载应该是能运行的至少, 不知是否我配置有误, 我已经在menuconfig中 使能了psram 以及选择了esp32-s2的那个开发板