Code: Select all
if(event->cmd == JACK_INSERTED)
{
ESP_LOGW("_periph_event_handle", "Change pipeline to i2s");
audio_pipeline_terminate(pipeline);
audio_pipeline_run(pipeline_i2s);
switched_to_i2s = true;
}
else if(event->cmd == JACK_REMOVED && switched_to_i2s)
{
ESP_LOGW("_periph_event_handle", "Change pipeline to bt");
audio_pipeline_terminate(pipeline_i2s);
audio_pipeline_run(pipeline);
switched_to_i2s = false;
}
Code: Select all
W (93740) AUDIO_PIPELINE: Pipeline already started, state:3
Code: Select all
ESP_LOGW("_periph_event_handle", "Change pipeline to bt");
audio_pipeline_stop(pipeline_i2s);
audio_pipeline_reset_ringbuffer(pipeline);
audio_pipeline_reset_elements(pipeline);
audio_pipeline_change_state(pipeline, AEL_STATE_INIT);
audio_pipeline_run(pipeline);
switched_to_i2s = false;
What am I doing wrong? Why doesn't it stop?
Thank you!