Open 0x0fe opened 1 year ago
@0x0fe I'm not sure the exactly reason, I think it may be some queue has been taken or received before the QueueSetSelect. Would you enable the element and pipeline debug log and repeat again?
@jason-mao Ok good idea, i will figure how to do that and report.
@jason-mao So i enabled verbose debug for pipeline, element and event with :
esp_log_level_set("*", ESP_LOG_INFO);
esp_log_level_set("AUDIO_PIPELINE", ESP_LOG_VERBOSE);
esp_log_level_set("AUDIO_ELEMENT", ESP_LOG_VERBOSE);
esp_log_level_set("AUDIO_EVENT", ESP_LOG_VERBOSE);
here is the log (initial playback + 1 cycle.
I (992) esp_psram: SPI SRAM memory test OK
I (1056) cpu_start: Pro cpu start user code
I (1056) cpu_start: cpu freq: 240000000 Hz
I (1056) cpu_start: Application information:
I (1056) cpu_start: Project name: IDF_ADF
I (1061) cpu_start: App version: 1
I (1064) cpu_start: Compile time: Sep 8 2023 23:16:21
I (1069) cpu_start: ELF file SHA256: a385b3bf8e0f750f...
I (1074) cpu_start: ESP-IDF: 5.0.2
I (1078) cpu_start: Min chip rev: v3.0
I (1082) cpu_start: Max chip rev: v3.99
I (1086) cpu_start: Chip rev: v3.1
I (1090) heap_init: Initializing. RAM available for dynamic allocation:
I (1096) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (1101) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (1107) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (1112) heap_init: At 3FFC5B88 len 0001A478 (105 KiB): DRAM
I (1117) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (1123) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1128) heap_init: At 4009A60C len 000059F4 (22 KiB): IRAM
I (1134) esp_psram: Adding pool of 2036K of PSRAM memory to heap allocator
I (1141) spi_flash: detected chip: generic
I (1144) spi_flash: flash io: qio
W (1148) ADC: legacy driver is deprecated, please migrate to `esp_adc/adc_oneshot.h`
W (1155) i2s(legacy): legacy i2s driver is deprecated, please migrate to use driver/i2s_std.h, driver/i2s_pdm.h or driver/i2s_tdm.h
I (1167) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (1179) esp_psram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (1227) STREAM_DOWN: [ 1 ] Start audio codec chip
Device at 0x1a
Device at 0x1a
NAU88C22 ready, addr [0x1A]
HP vol:90
Spk vol:38
I (1276) STREAM_DOWN: [2.0] Create audio pipeline for playback
I (1276) STREAM_DOWN: [2.1] Create http stream to read data
I (1277) STREAM_DOWN: [2.2] Create i2s stream to write data to codec chip
I (1285) STREAM_DOWN: [2.3] Create mp3 decoder to decode mp3 file
I (1290) STREAM_DOWN: [2.4] Register all elements to audio pipeline
I (1296) STREAM_DOWN: [2.5] Link it together http_stream-->mp3_decoder-->i2s_stream-->[codec_chip]
I (1306) STREAM_DOWN: [2.6] Set up uri (http as http_stream, mp3 as mp3 decoder, and default output is i2s)
I (1314) STREAM_DOWN: [ 3 ] Start and wait for Wi-Fi network
W (1901) PERIPH_WIFI: WiFi Event cb, Unhandle event_base:WIFI_EVENT, event_id:4
I (6403) STREAM_DOWN: [ 4 ] Set up event listener
I (6404) STREAM_DOWN: [4.1] Listening event from all elements of pipeline
I (6404) STREAM_DOWN: [4.2] Listening event from peripherals
I (6409) STREAM_DOWN: [ 5 ] Start audio_pipeline
I (8433) STREAM_DOWN: [ * ] Receive music info from mp3 decoder, sample_rates=32000, bits=16, ch=2
W (69511) HTTP_STREAM: No more data,errno:0, total_bytes:843134, rlen = 0
W (71454) STREAM_DOWN: [ * ] Restart audio_pipeline
W (71454) AUDIO_ELEMENT: [http] Element already stopped
W (71455) AUDIO_ELEMENT: [mp3] Element already stopped
W (71458) AUDIO_ELEMENT: [i2s] Element already stopped
E (71471) STREAM_DOWN: [ * ] Event interface error : -1
E (71471) STREAM_DOWN: [ * ] Event interface error : -1
E (71472) STREAM_DOWN: [ * ] Event interface error : -1
I (73558) STREAM_DOWN: [ * ] Receive music info from mp3 decoder, sample_rates=32000, bits=16, ch=2
W (134845) HTTP_STREAM: No more data,errno:0, total_bytes:843134, rlen = 0
So i used the HTTP MP3 example https://github.com/espressif/esp-adf/tree/master/examples/player/pipeline_http_mp3 as a base, and i need to restart the playback after the STOP event. So i refered to another example https://github.com/espressif/esp-adf/tree/master/examples/player/pipeline_living_stream and used the same mechanism, however it could not work (content length 0) so i added pipeline_terminate, now it can work but i get 3 errors in the log. What am i doing wrong?