Page 1 of 1

ADF v2.0和IDF v3.3.2

Posted: Thu May 14, 2020 4:17 pm
by bulazhang
快折腾了3天了,为了能体验一下ADF v2.0和IDF v3.3.2的组合

esp-adf-v2.0相应commit为cb7497f
esp-idf-v3.3.2相应commit为722043f
以examples\advanced_examples\esp_dispatcher_dueros为实验目标

1、分别配置好了ADF_PATH为E:/Workspace/ESP/esp-adf-v2.0和IDF_PATH为E:/Workspace/ESP/esp-idf-v3.3.2
2、学着将play_mp3工程的my_board_v1的custom方式,添加至esp_dispatcher_dueros中
3、make menuconfig调整好配置后,build,呵呵,一切OK,make flash
4、LOG来了

Code: Select all

I (39) boot: ESP-IDF v3.3.2-107-g722043f73-dirty 2nd stage bootloader
I (39) boot: compile time 23:40:29
I (48) boot: Enabling RNG early entropy source...
...

Code: Select all

I (612) cpu_start: App version:      1
I (613) cpu_start: Compile time:     May 14 2020 23:39:29
I (614) cpu_start: ELF file SHA256:  8a1f4af622371c15...
I (615) cpu_start: ESP-IDF:          v3.3.2-107-g722043f73-dirty
I (615) cpu_start: Starting app cpu, entry point is 0x40081560
I (597) cpu_start: App cpu up.
...

Code: Select all

I (892) DISPATCHER_DUEROS: [Step 6.0] Initialize esp player
I (892) I2S: DMA Malloc info, datalen=blocksize=1200, dma_buf_count=3
I (893) A1S: i2c port configured!!!!
I (893) I2S: DMA Malloc info, datalen=blocksize=1200, dma_buf_count=3
I (897) I2S: APLL: Req RATE: 44100, real rate: 44099.988, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 11289597.000, SCLK: 1411199.625000, diva: 1, divb: 0
I (898) A1S: i2s port configured!!!!
I (899) AUDIO_PIPELINE: link el->rb, el:0x3f807b24, tag:i2s, rb:0x3f807e5c
I (899) AUDIO_PIPELINE: link el->rb, el:0x3f807c4c, tag:filter, rb:0x3f809e9c
I (900) AUDIO_ELEMENT: [i2s-0x3f807b24] Element task created
I (901) AUDIO_ELEMENT: [raw-0x3f807d30] Element task created
I (902) AUDIO_THREAD: The filter task allocate stack on external memory
E (903) AUDIO_THREAD: Not found right xTaskCreateRestrictedPinnedToCore. Please apply the $ADF_PATH/idf_patches/idf_v3.3_freertos.patch first
E (904) AUDIO_THREAD: Error creating RestrictedPinnedToCore filter
E (905) AUDIO_ELEMENT: [filter] audio_thread_create failed
I (906) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:358, MEM Total:4278520 Bytes, Inter:171396 Bytes, Dram:154384 Bytes

I (907) AUDIO_ELEMENT: [i2s] AEL_MSG_CMD_RESUME,state:1
W (908) AUDIO_ELEMENT: [filter] Element has not create when AUDIO_ELEMENT_RESUME
I (908) I2S_STREAM: AUDIO_STREAM_READER,Rate:48000,ch:2
E (909) AUDIO_PIPELINE: audio_pipeline_resume failed
AUDIO_THREAD没有能创建成功,从日志看freertos/task.c中xTaskCreateRestrictedPinnedToCore木有,而那个patch打不上
第一轮实验失败

再回到get_start/play_mp3吧,这是基础实验
一番折腾后,好吧,我服了

Code: Select all

I (39) boot: ESP-IDF v3.3.2-107-g722043f73-dirty 2nd stage bootloader
I (39) boot: compile time 00:11:40
I (48) boot: Enabling RNG early entropy source...
I (48) boot: SPI Speed      : 40MHz
I (48) boot: SPI Mode       : DIO
I (48) boot: SPI Flash Size : 4MB
I (48) boot: Partition Table:
I (49) boot: ## Label            Usage          Type ST Offset   Length
I (50) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (51) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (52) boot:  2 factory          factory app      00 00 00010000 00100000
I (53) boot: End of partition table
I (53) boot_comm: chip revision: 1, min. application chip revision: 0
I (54) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x2c254 (180820) map
I (119) esp_image: segment 1: paddr=0x0003c27c vaddr=0x3ffb0000 size=0x020c4 (  8388) load
I (122) esp_image: segment 2: paddr=0x0003e348 vaddr=0x40080000 size=0x00400 (  1024) load
I (123) esp_image: segment 3: paddr=0x0003e750 vaddr=0x40080400 size=0x018c0 (  6336) load
I (126) esp_image: segment 4: paddr=0x00040018 vaddr=0x400d0018 size=0x29858 (170072) map
I (186) esp_image: segment 5: paddr=0x00069878 vaddr=0x40081cc0 size=0x0d800 ( 55296) load
I (218) boot: Loaded app from partition at offset 0x10000
I (218) boot: Disabling RNG early entropy source...
I (218) psram: This chip is ESP32-D0WD
I (220) spiram: Found 64MBit SPI RAM device
I (220) spiram: SPI RAM mode: flash 40m sram 40m
I (221) spiram: PSRAM initialized, cache is in low/high (2-core) mode.
I (221) cpu_start: Pro cpu up.
I (222) cpu_start: Application information:
I (222) cpu_start: Project name:     play_mp3
I (223) cpu_start: App version:      v2.0-64-gcb7497f-dirty
I (224) cpu_start: Compile time:     May 15 2020 00:10:42
I (224) cpu_start: ELF file SHA256:  a40836b1ba07abb1...
I (225) cpu_start: ESP-IDF:          v3.3.2-107-g722043f73-dirty
I (226) cpu_start: Starting app cpu, entry point is 0x400812ec
I (0) cpu_start: App cpu up.
I (1108) spiram: SPI SRAM memory test OK
I (1108) heap_init: Initializing. RAM available for dynamic allocation:
I (1109) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (1109) heap_init: At 3FFB31B0 len 0002CE50 (179 KiB): DRAM
I (1110) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (1110) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1111) heap_init: At 4008F4C0 len 00010B40 (66 KiB): IRAM
I (1112) cpu_start: Pro cpu start user code
I (1113) spiram: Adding pool of 4096K of external SPI memory to heap allocator
I (117) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (118) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (118) PLAY_MP3_FLASH: [ 1 ] Start audio codec chip
W (1118) AC101: reset succeed
I (1238) PLAY_MP3_FLASH: [ 2 ] Create audio pipeline, add all elements to pipeline, and subscribe pipeline event
I (1238) PLAY_MP3_FLASH: [2.1] Create mp3 decoder to decode mp3 file and set custom read callback
I (1238) PLAY_MP3_FLASH: [2.2] Create i2s stream to write data to codec chip
I (1238) PLAY_MP3_FLASH: [2.3] Register all elements to audio pipeline
I (1238) PLAY_MP3_FLASH: [2.4] Link it together [mp3_music_read_cb]-->mp3_decoder-->i2s_stream-->[codec_chip]
I (1248) PLAY_MP3_FLASH: [ 3 ] Set up  event listener
I (1248) PLAY_MP3_FLASH: [3.1] Listening event from all elements of pipeline
I (1248) PLAY_MP3_FLASH: [ 4 ] Start audio_pipeline
E (1248) AUDIO_THREAD: Not found right xTaskCreateRestrictedPinnedToCore. Please apply the $ADF_PATH/idf_patches/idf_v3.3_freertos.patch first
E (1248) AUDIO_THREAD: Error creating RestrictedPinnedToCore mp3
E (1248) AUDIO_ELEMENT: [mp3] audio_thread_create failed
W (1248) AUDIO_ELEMENT: [mp3] Element has not create when AUDIO_ELEMENT_RESUME
E (1248) AUDIO_PIPELINE: audio_pipeline_resume failed
W (1248) AUDIO_PIPELINE: Without stop, st:6
W (1248) AUDIO_PIPELINE: Without wait stop, st:6
W (1248) AUDIO_ELEMENT: [mp3] Element has not create when AUDIO_ELEMENT_TERMINATE

Re: ADF v2.0和IDF v3.3.2

Posted: Thu May 14, 2020 4:27 pm
by bulazhang
啥叫逼急了,一直用的TortoiseGit工具,自己太Low,一点不熟悉

双击patch文件,TortoiseGitUDiff终于将idf_v3.3_freertos.patch加上了

一番clean再build,哈哈,声音出来了。开心 :lol: :lol: :lol: ,然后就是再想,为啥不直接将patch加入到task.c/task.h中呢? :?:

Code: Select all

I (39) boot: ESP-IDF v3.3.2-107-g722043f73-dirty 2nd stage bootloader
I (39) boot: compile time 00:11:40
I (48) boot: Enabling RNG early entropy source...
I (48) boot: SPI Speed      : 40MHz
I (48) boot: SPI Mode       : DIO
I (48) boot: SPI Flash Size : 4MB
I (48) boot: Partition Table:
I (49) boot: ## Label            Usage          Type ST Offset   Length
I (50) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (51) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (52) boot:  2 factory          factory app      00 00 00010000 00100000
I (53) boot: End of partition table
I (53) boot_comm: chip revision: 1, min. application chip revision: 0
I (54) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x2c24c (180812) map
I (119) esp_image: segment 1: paddr=0x0003c274 vaddr=0x3ffb0000 size=0x020c4 (  8388) load
I (122) esp_image: segment 2: paddr=0x0003e340 vaddr=0x40080000 size=0x00400 (  1024) load
I (123) esp_image: segment 3: paddr=0x0003e748 vaddr=0x40080400 size=0x018c8 (  6344) load
I (126) esp_image: segment 4: paddr=0x00040018 vaddr=0x400d0018 size=0x29830 (170032) map
I (186) esp_image: segment 5: paddr=0x00069850 vaddr=0x40081cc8 size=0x0d874 ( 55412) load
I (218) boot: Loaded app from partition at offset 0x10000
I (218) boot: Disabling RNG early entropy source...
I (219) psram: This chip is ESP32-D0WD
I (220) spiram: Found 64MBit SPI RAM device
I (221) spiram: SPI RAM mode: flash 40m sram 40m
I (221) spiram: PSRAM initialized, cache is in low/high (2-core) mode.
I (221) cpu_start: Pro cpu up.
I (222) cpu_start: Application information:
I (222) cpu_start: Project name:     play_mp3
I (223) cpu_start: App version:      v2.0-64-gcb7497f-dirty
I (224) cpu_start: Compile time:     May 15 2020 00:10:42
I (225) cpu_start: ELF file SHA256:  a32a2f7870db89b3...
I (225) cpu_start: ESP-IDF:          v3.3.2-107-g722043f73-dirty
I (226) cpu_start: Starting app cpu, entry point is 0x400812f0
I (0) cpu_start: App cpu up.
I (1108) spiram: SPI SRAM memory test OK
I (1109) heap_init: Initializing. RAM available for dynamic allocation:
I (1109) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (1109) heap_init: At 3FFB31B0 len 0002CE50 (179 KiB): DRAM
I (1110) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (1111) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1112) heap_init: At 4008F53C len 00010AC4 (66 KiB): IRAM
I (1112) cpu_start: Pro cpu start user code
I (1113) spiram: Adding pool of 4096K of external SPI memory to heap allocator
I (117) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (118) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (118) PLAY_MP3_FLASH: [ 1 ] Start audio codec chip
W (1118) AC101: reset succeed
I (1238) PLAY_MP3_FLASH: [ 2 ] Create audio pipeline, add all elements to pipeline, and subscribe pipeline event
I (1238) PLAY_MP3_FLASH: [2.1] Create mp3 decoder to decode mp3 file and set custom read callback
I (1238) PLAY_MP3_FLASH: [2.2] Create i2s stream to write data to codec chip
I (1238) PLAY_MP3_FLASH: [2.3] Register all elements to audio pipeline
I (1238) PLAY_MP3_FLASH: [2.4] Link it together [mp3_music_read_cb]-->mp3_decoder-->i2s_stream-->[codec_chip]
I (1248) PLAY_MP3_FLASH: [ 3 ] Set up  event listener
I (1248) PLAY_MP3_FLASH: [3.1] Listening event from all elements of pipeline
I (1248) PLAY_MP3_FLASH: [ 4 ] Start audio_pipeline
I (1278) PLAY_MP3_FLASH: [ * ] Receive music info from mp3 decoder, sample_rates=44100, bits=16, ch=2
I (8018) PLAY_MP3_FLASH: [ 5 ] Stop audio_pipeline
W (8018) AUDIO_ELEMENT: [mp3] Element already stopped
W (8018) AUDIO_ELEMENT: [i2s] Element already stopped
W (8018) AUDIO_PIPELINE: Without stop, st:1
W (8018) AUDIO_PIPELINE: Without wait stop, st:1
W (8028) AUDIO_PIPELINE: There are no listener registered
W (8028) AUDIO_ELEMENT: [i2s] Element has not create when AUDIO_ELEMENT_TERMINATE
W (8028) AUDIO_ELEMENT: [mp3] Element has not create when AUDIO_ELEMENT_TERMINATE

Re: ADF v2.0和IDF v3.3.2

Posted: Fri May 15, 2020 5:29 am
by xjp131
请问下这个补丁应该如何打呢?每太看懂你的流程,能详细说说么?谢谢

Re: ADF v2.0和IDF v3.3.2

Posted: Fri May 15, 2020 9:01 am
by bulazhang
Git工具的使用我也不熟练,直接给你task.c和task.h,替换掉IDF 3.3.2中的吧

Re: ADF v2.0和IDF v3.3.2

Posted: Fri May 15, 2020 3:02 pm
by xjp131
太感谢您了,替换后唤醒马上有反应了!再次表示感谢!