Example hanging after play stops

__vnv__
Posts: 14
Joined: Sat Feb 16, 2019 9:42 pm

Example hanging after play stops

Postby __vnv__ » Mon Apr 15, 2019 2:53 pm

Hello everyone,

trying to run: https://github.com/espressif/esp-adf/bl ... _example.c

I have issue that my players stops playing and hangs, won't go into finishing:

if (queue_set_member == i2s_queue) {
continue;
}

if (queue_set_member == i2s_queue
&& msg.cmd != AEL_MSG_CMD_REPORT_STATUS
&& (int) msg.data == AEL_STATUS_ERROR_PROCESS) {
break;
}
if (mp3_decoder == i2s_queue
&& msg.cmd != AEL_MSG_CMD_REPORT_STATUS
&& (int) msg.data == AEL_STATUS_OUTPUT_DONE) {
break;
}

}

if (xQueueRemoveFromSet(i2s_queue, queue_set) != pdPASS) {
ESP_LOGE(TAG, "Error remove i2s_queue from queue_set");
}
if (xQueueRemoveFromSet(mp3_queue, queue_set) != pdPASS) {
ESP_LOGE(TAG, "Error remove mp3_queue from queue_set");
}
vQueueDelete(i2s_queue);
vQueueDelete(queue_set);
vQueueDelete(queue_set);
audio_element_deinit(i2s_stream_writer);
audio_element_deinit(mp3_decoder);
rb_destroy(ringbuf);
}

Interesting part of the code is one where it check if (queue_set_member == i2s_queue) and then if (queue_set_member == i2s_queue + SOME OTHER STUFF TO CHECK. How it is possible to break out of for when there is no such condition??

Could someone please help out how to break out of for loop (detect end of play).
I see that it is happening because log says:
E (124118) EXAMPLE: [3.0] Create i2s stream to write data to codec chip
E (124118) EXAMPLE: [3.1] Create mp3 decoder to decode mp3 data
I (124118) STAGEFRIGHTMP3_DECODER: MP3 init
E (124128) EXAMPLE: [3.2] Associate custom read callback to mp3 decoder
E (124138) EXAMPLE: [3.3] Create a ringbuffer and insert it between mp3 decoder and i2s writer
E (124148) EXAMPLE: [ 4 ] Start audio elements
I (124148) STAGEFRIGHTMP3_DECODER: MP3 opened
I (124168) STAGEFRIGHTMP3_DECODER: I2S setup: sample_rate = 44100 : channels = 1
E (124168) EXAMPLE: [ * ] Receive music info from mp3 decoder, sample_rates=44100, bits=16, ch=1
I (127848) STAGEFRIGHTMP3_DECODER: MP3 decodig done
I (127848) STAGEFRIGHTMP3_DECODER: Closed

Who is online

Users browsing this forum: No registered users and 2 guests