from IDF v3.3.5 and ADF v2.0
to IDF v4.4 and ADF v2.4
In the project a SSL connection and a audio player is used.
Unfortunatly since the upgrade we get a allocation error after a while when the SSL Connection is still active.
The main problem is that the mp3_decoder reallocates the memory evertime the pipeline is restarted.
This was not the case in the old version, we could not detect any reallocation there.
[The relinking part in the code below is only called on startup]
We were not able to set the mp3_decoder so that it keeps its buffer and does not free and reallocate it.
Is there a way to fix the buffer for the mp3_decoder and reuse it without reallocating it everytime?
It seems that the decoder has a different allocation routine sometimes
because the available heap size varies after the call to run the pipeline.
This is the code we use to restart the pipeline:
- //Stop the current playing
- audio_pipeline_stop(pipeline);
- audio_pipeline_wait_for_stop(pipeline);
- //Relink if the mapping changed
- //Which is only the case in the first call
- if (relink)
- {
- audio_pipeline_terminate_with_ticks(pipeline, portMAX_DELAY);
- audio_pipeline_remove_listener(pipeline);
- audio_pipeline_unlink(pipeline);
- audio_pipeline_link(pipeline, mapping, 4);
- audio_pipeline_set_listener(pipeline, evt);
- }
- audio_element_set_uri(AddSource, uri);
- //Resetting state
- audio_pipeline_reset_ringbuffer(pipeline);
- audio_pipeline_reset_elements(pipeline);
- audio_pipeline_change_state(pipeline, AEL_STATE_INIT);
- //Starting pipe
- audio_pipeline_run(pipeline);