BT A2DP event handling
Posted: Wed May 24, 2023 10:20 am
Hello everyone!
I have bt -> i2s pipeline and i just noticed that i have a big delay between pushing stop button in my phone and real music stopping. I logged all events like that:
and it turned out that "start music" event handles in time, but there is about 3 sec delay to handle stop music event
Why is this happening? Thank you!
I have bt -> i2s pipeline and i just noticed that i have a big delay between pushing stop button in my phone and real music stopping. I logged all events like that:
Code: Select all
void bt_handler(esp_a2d_cb_event_t ev, esp_a2d_cb_param_t* param) {
gpio_set_level(DATA_PIN, dt);
dt = !dt;
ESP_LOGE(TAG, "Got A2DP event (dt = %d): %d, %d", dt, ev, param->media_ctrl_stat.cmd);
}
esp_a2d_register_callback(bt_handler);
Why is this happening? Thank you!