BT A2DP event handling

spacebiker
Posts: 11
Joined: Mon May 24, 2021 10:23 am

BT A2DP event handling

Postby spacebiker » 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:

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);
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!

Who is online

Users browsing this forum: No registered users and 115 guests