Page 1 of 1

Custom Board SPH0645

Posted: Thu Mar 04, 2021 3:08 pm
by JVKran
Hi there!

I've been playing with a custom board definition for the ESP-ADF and am now facing some issues with the examples including a microphone. I just get no input... I've got one single clue that isn't resulting in any search results on some major search engines. That's the following 'E (10715) AUDIO_ELEMENT: [wav] Element already stopped'. Underneath I pasted is the entire terminal output.

I have to mention though, that I have no codec. I'm just using the example of a [custom board definition](https://github.com/espressif/esp-adf/tr ... d/play_mp3) where I made sure the SD card is initialized succesfully (can playback fine) and the Microphone Data Out pin corresponds to the I2S input of the I2C configuration. This custom board is currently based on the ESP32 S2 WROOM of the LilyGO TTGO T8 ESP32 S2 WROOM.

Oh and by the way, this is my first post. So please mention it if I've done something wrong.

Kind regards,

An interested (but confused) Jochem
  1.  
  2.  (64) boot: ESP-IDF v4.2-dirty 2nd stage bootloader
  3. I (64) boot: compile time 15:26:45
  4. I (64) boot: chip revision: 0
  5. I (66) boot.esp32s2: SPI Speed      : 80MHz
  6. I (71) boot.esp32s2: SPI Mode       : DIO
  7. I (76) boot.esp32s2: SPI Flash Size : 4MB
  8. I (81) boot: Enabling RNG early entropy source...
  9. I (86) boot: Partition Table:
  10. I (90) boot: ## Label            Usage          Type ST Offset   Length
  11. I (97) boot:  0 nvs              WiFi data        01 02 00009000 00006000
  12. I (104) boot:  1 phy_init         RF data          01 01 0000f000 00001000
  13. I (112) boot:  2 factory          factory app      00 00 00010000 00100000
  14. I (119) boot: End of partition table
  15. I (124) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f000020 size=0x0dafc ( 56060) map
  16. I (144) esp_image: segment 1: paddr=0x0001db24 vaddr=0x3ffbf260 size=0x01f70 (  8048) load
  17. I (147) esp_image: segment 2: paddr=0x0001fa9c vaddr=0x40024000 size=0x00404 (  1028) load
  18. 0x40024000: _WindowOverflow4 at C:/Users/kraan/esp/esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730
  19.  
  20. I (153) esp_image: segment 3: paddr=0x0001fea8 vaddr=0x40024404 size=0x00170 (   368) load
  21. I (162) esp_image: segment 4: paddr=0x00020020 vaddr=0x40080020 size=0x2a02c (172076) map
  22. 0x40080020: _stext at ??:?
  23.  
  24. I (206) esp_image: segment 5: paddr=0x0004a054 vaddr=0x40024574 size=0x0ace4 ( 44260) load
  25. I (225) boot: Loaded app from partition at offset 0x10000
  26. I (225) boot: Disabling RNG early entropy source...
  27. I (225) cache: Instruction cache        : size 8KB, 4Ways, cache line size 32Byte
  28. I (233) cpu_start: Pro cpu up.
  29. I (236) cpu_start: Application information:
  30. I (241) cpu_start: Project name:     record_wav
  31. I (246) cpu_start: App version:      1
  32. I (251) cpu_start: Compile time:     Mar  4 2021 15:26:18
  33. I (257) cpu_start: ELF file SHA256:  f689f9b5ef13ab60...
  34. I (263) cpu_start: ESP-IDF:          v4.2-dirty
  35. I (268) cpu_start: Single core mode
  36. D (272) memory_layout: Checking 3 reserved memory ranges:
  37. D (278) memory_layout: Reserved memory range 0x3ffb4000 - 0x3ffbf258
  38. D (284) memory_layout: Reserved memory range 0x3ffbf260 - 0x3ffc1a20
  39. D (291) memory_layout: Reserved memory range 0x3ffffa10 - 0x40000000
  40. D (297) memory_layout: Building list of available memory regions:
  41. D (303) memory_layout: Available memory region 0x3ffc1a20 - 0x3ffc4000
  42. D (310) memory_layout: Available memory region 0x3ffc4000 - 0x3ffc8000
  43. D (316) memory_layout: Available memory region 0x3ffc8000 - 0x3ffcc000
  44. D (323) memory_layout: Available memory region 0x3ffcc000 - 0x3ffd0000
  45. D (330) memory_layout: Available memory region 0x3ffd0000 - 0x3ffd4000
  46. D (336) memory_layout: Available memory region 0x3ffd4000 - 0x3ffd8000
  47. D (343) memory_layout: Available memory region 0x3ffd8000 - 0x3ffdc000
  48. D (349) memory_layout: Available memory region 0x3ffdc000 - 0x3ffe0000
  49. D (356) memory_layout: Available memory region 0x3ffe0000 - 0x3ffe4000
  50. D (363) memory_layout: Available memory region 0x3ffe4000 - 0x3ffe8000
  51. D (369) memory_layout: Available memory region 0x3ffe8000 - 0x3ffec000
  52. D (376) memory_layout: Available memory region 0x3ffec000 - 0x3fff0000
  53. D (382) memory_layout: Available memory region 0x3fff0000 - 0x3fff4000
  54. D (389) memory_layout: Available memory region 0x3fff4000 - 0x3fff8000
  55. D (396) memory_layout: Available memory region 0x3fff8000 - 0x3fffc000
  56. D (402) memory_layout: Available memory region 0x3fffc000 - 0x3ffffa10
  57. I (409) heap_init: Initializing. RAM available for dynamic allocation:
  58. D (416) heap_init: New heap initialised at 0x3ffc1a20
  59. I (421) heap_init: At 3FFC1A20 len 0003A5E0 (233 KiB): DRAM
  60. I (427) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM
  61. I (433) cpu_start: Pro cpu start user code
  62. D (491) clk: RTC_SLOW_CLK calibration value: 5765894
  63. D (497) intr_alloc: Connected src 49 to int 2 (cpu 0)
  64. D (497) intr_alloc: Connected src 73 to int 10 (cpu 0)
  65. D (497) intr_alloc: Connected src 28 to int 3 (cpu 0)
  66. D (503) FLASH_HAL: extra_dummy: 0
  67. D (506) spi_flash: trying chip: issi
  68. D (510) spi_flash: trying chip: gd
  69. D (513) spi_flash: trying chip: mxic
  70. D (517) spi_flash: trying chip: generic
  71. I (521) spi_flash: detected chip: generic
  72. I (526) spi_flash: flash io: dio
  73. I (530) cpu_start: Starting scheduler on PRO CPU.
  74. D (535) heap_init: New heap initialised at 0x3fffc000
  75. D (535) intr_alloc: Connected src 17 to int 9 (cpu 0)
  76. I (545) REC_WAV_SDCARD: [ 1 ] Mount sdcard
  77. D (545) intr_alloc: Connected src 23 to int 12 (cpu 0)
  78. D (555) intr_alloc: Connected src 34 to int 13 (cpu 0)
  79. I (605) REC_WAV_SDCARD: [ 2 ] Start codec chip
  80. I (605) REC_WAV_SDCARD: [3.0] Create audio pipeline for recording
  81. I (605) REC_WAV_SDCARD: [3.1] Create fatfs stream to write data to sdcard
  82. I (615) REC_WAV_SDCARD: [3.2] Create i2s stream to read audio data from codec chip
  83. D (625) intr_alloc: Connected src 35 to int 19 (cpu 0)
  84. I (635) REC_WAV_SDCARD: [3.3] Create wav encoder to encode wav format
  85. I (635) REC_WAV_SDCARD: [3.4] Register all elements to audio pipeline
  86. I (645) REC_WAV_SDCARD: [3.5] Link it together [codec_chip]-->i2s_stream-->wav_encoder-->fatfs_stream-->[sdcard]
  87. I (655) REC_WAV_SDCARD: [3.6] Set up  uri (file as fatfs_stream, wav as wav encoder)
  88. I (665) REC_WAV_SDCARD: [ 4 ] Set up  event listener
  89. I (665) REC_WAV_SDCARD: [4.1] Listening event from pipeline
  90. I (675) REC_WAV_SDCARD: [4.2] Listening event from peripherals
  91. I (685) REC_WAV_SDCARD: [ 5 ] Start audio_pipeline
  92. I (695) REC_WAV_SDCARD: [ 6 ] Listen for all pipeline events, record for 10 Seconds
  93. I (1715) REC_WAV_SDCARD: [ * ] Recording ... 1
  94. I (2715) REC_WAV_SDCARD: [ * ] Recording ... 2
  95. I (3715) REC_WAV_SDCARD: [ * ] Recording ... 3
  96. I (4715) REC_WAV_SDCARD: [ * ] Recording ... 4
  97. I (5715) REC_WAV_SDCARD: [ * ] Recording ... 5
  98. I (6715) REC_WAV_SDCARD: [ * ] Recording ... 6
  99. I (7715) REC_WAV_SDCARD: [ * ] Recording ... 7
  100. I (8715) REC_WAV_SDCARD: [ * ] Recording ... 8
  101. I (9715) REC_WAV_SDCARD: [ * ] Recording ... 9
  102. I (10715) REC_WAV_SDCARD: [ * ] Recording ... 10
  103. I (10715) REC_WAV_SDCARD: [ 7 ] Stop audio_pipeline
  104. W (10715) AUDIO_ELEMENT: IN-[wav] AEL_IO_ABORT
  105. E (10715) AUDIO_ELEMENT: [wav] Element already stopped
  106. W (10725) AUDIO_ELEMENT: IN-[file] AEL_IO_ABORT
  107. W (10735) AUDIO_PIPELINE: There are no listener registered
  108. W (10735) AUDIO_ELEMENT: [file] Element has not create when AUDIO_ELEMENT_TERMINATE
  109. W (10745) AUDIO_ELEMENT: [i2s] Element has not create when AUDIO_ELEMENT_TERMINATE
  110. W (10755) AUDIO_ELEMENT: [wav] Element has not create when AUDIO_ELEMENT_TERMINATE
  111.  

Re: Custom Board SPH0645

Posted: Sun Jun 06, 2021 10:03 am
by JVKran
For any future visitors; I ended up ditching the SPH0645 since it appears to be incompatible with the I2S timing of the ESP32. The INMP441 or (newer) CMM-4030D work perfectly!

Re: Custom Board SPH0645

Posted: Thu Aug 26, 2021 5:33 pm
by Johny Mielony
Hi,
could You please tell how You managed to work INMP441 microphone?
I'm struggling with it fore some time and only thing I can get is noise.
I have a custom board with connected UDA1334 DAC, which works as it should.

Re: Custom Board SPH0645

Posted: Fri Aug 27, 2021 10:59 am
by JVKran
Hi Johny,

Of course I can! Using the I2S configuration underneath in combination with the sd-card example results in a clear recording. You of course have to replace I2S_STREAM_CFG_DEFAULT with I2S_STREAM_CFG_INMP.

Code: Select all

#define I2S_STREAM_CFG_INMP() {                                              \
    .type = AUDIO_STREAM_READER,                                                \
    .i2s_config = {                                                             \
        .mode = i2s_mode_t(I2S_MODE_MASTER | I2S_MODE_RX),                    \
        .sample_rate = 44100,                                                   \
        .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT,                           \
        .channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,                           \
        .communication_format = I2S_COMM_FORMAT_STAND_I2S,                            \
        .intr_alloc_flags = ESP_INTR_FLAG_LEVEL2 | ESP_INTR_FLAG_IRAM,          \
        .dma_buf_count = 6,                                                     \
        .dma_buf_len = 400,                                                     \
        .use_apll = true,                                                       \
        .tx_desc_auto_clear = true,                                             \
        .fixed_mclk = 0                                                         \
    },                                                                          \
    .i2s_port = I2S_NUM_0,                                                      \
    .use_alc = false,                                                           \
    .volume = 0,                                                                \
    .out_rb_size = I2S_STREAM_RINGBUFFER_SIZE,                                  \
    .task_stack = I2S_STREAM_TASK_STACK,                                        \
    .task_core = I2S_STREAM_TASK_CORE,                                          \
    .task_prio = I2S_STREAM_TASK_PRIO,                                          \
    .stack_in_ext = false,                                                      \
    .multi_out_num = 0,                                                         \
    .uninstall_drv = true,                                                      \
}
Hope this could be of help.

Kind regards,

Jochem

Re: Custom Board SPH0645

Posted: Mon Oct 11, 2021 8:32 am
by nisam faras
hi can you please guide me how you did that?? do i need to make custom function for that
i replaced I2S_STREAM_CFG_DEFAULT with I2S_STREAM_CFG_INMP in main file but flashing shows error "implicit declaration of function 'I2S_STREAM_CFG_INMP'; did you mean 'I2S_STREAM_CFG_DEFAULT'?"
please tell me how can i achieve any recording out of my esp32 audio kit..... i am only getting blank audio....