Hello,
I would like to make two independent audio players. One that plays MP3 files and the other that plays WAV files.
For this purpose I have created two initialization functions. These two functions initialize the pipeline and start a task. In attachment, I've added the code.
The pipeline created by the InitMP3Player(void) function is as follows (line 696):
flash-->spiffs_stream-->mp3_decoder-->i2s_stream-->codec_chip
The pipeline created by the InitWAVPlayer(void) function is as follows (line 764):
flash-->spiffs_stream-->wav_decoder-->i2s_stream-->codec_chip
The problem I have is to share the access to the SPIFFS. Both audio players have to subscribe to the SPIFFS and I have a problem with the queue. I get the following log:
I (342) codec: INIT MP3 PLAYER
I (346) codec: [1] Start audio codec chip
I (351) codec: [2.0] Create audio pipeline for playback
I (356) codec: [2.1] Create spiffs stream to read data from spi flash
I (364) codec: [2.2] Create MP3 decoder to decode MP3 format
I (370) STAGEFRIGHTMP3_DECODER: MP3 init
I (375) codec: [2.4] Create I2S stream to write audio data to codec chip
W (382) I2S: I2S driver already installed
I (387) codec: [2.5] Register all elements to audio pipeline
I (393) codec: [2.6] Link it together [flash_]-->spiffs_stream-->mp3_decoder-->i2s_stream-->[codec_chip]
I (403) AUDIO_PIPELINE: link el->rb, el:0x3ffd5bf0, tag:mp3_file_reader, rb:0x3ffd6680
I (412) AUDIO_PIPELINE: link el->rb, el:0x3ffd5f5c, tag:mp3_decoder, rb:0x3ffd87d4
I (420) codec: [3.0] Setup event listener
I (424) codec: [3.1] Listening event from peripherals
I (430) codec: [3.2] Listening event from pipeline
I (436) codec: INIT WAV PLAYER
I (439) codec: [1] Start audio codec chip
I (444) codec: [2.0] Create audio pipeline for playback
I (450) codec: [2.1] Create spiffs stream to read data from spi flash
I (457) codec: [2.2] Create WAV decoder to decode WAV format
I (464) codec: [2.3] Create filter to convert to 48 [kHz]
I (470) codec: [2.4] Create I2S stream to write audio data to codec chip
W (477) I2S: I2S driver already installed
I (482) codec: [2.5] Register all elements to audio pipeline
I (488) codec: [2.6] Link it together [flash_]-->spiffs_stream-->wav_decoder-->filter-->i2s_stream-->[codec_chip]
I (499) AUDIO_PIPELINE: link el->rb, el:0x3ffda620, tag:file_reader, rb:0x3ffdb41c
I (507) AUDIO_PIPELINE: link el->rb, el:0x3ffda950, tag:wav_decoder, rb:0x3ffdd570
I (515) AUDIO_PIPELINE: link el->rb, el:0x3ffdacc4, tag:filter_upsample, rb:0x3ffdf6c4
I (524) codec: [3.0] Setup event listener
I (529) codec: [3.1] Listening event from peripherals
E (534) AUDIO_EVT: Error add queue items to queue set
I (540) codec: [3.2] Listening event from pipeline
E (545) AUDIO_EVT: Error remove listener
E (550) AUDIO_EVT: C:/msys32/home/Vincent/esp/esp-adf/components/audio_pipeline/audio_event_iface.c:187 (audio_event_iface_set_listener): Error cleanup listener
E (565) AUDIO_PIPELINE: Error register event with: file_reader
When I disable one of the Init functions, the remaining audio player works correctly and I have no errors in the log.
Best regards,
Vincent
Use of SPIFFS by multiple pipeline
Use of SPIFFS by multiple pipeline
- Attachments
-
- codec.c
- (60.21 KiB) Downloaded 611 times
Who is online
Users browsing this forum: No registered users and 25 guests