Bluetooth Media Start Failed

tanmanh0707
Posts: 15
Joined: Fri Jun 23, 2023 3:26 am

Bluetooth Media Start Failed

Postby tanmanh0707 » Fri Jun 23, 2023 3:49 am

Hello,

I'm working on Node32s Arduino compatible board with Bluetooth enabled as a Media Source (i.e esp32 connects to Headphone, headset such as Airpod, Google Pixel Bud... and transfers audio data)
Recently I encountered a problem that sometimes after successfully connected to a headset, media starts failed. I received a FAILED status when trying to start media. From the APIs definition, there's not much information to identify the exact failed reason:

Code: Select all

/// A2DP media control command acknowledgement code
typedef enum {
    ESP_A2D_MEDIA_CTRL_ACK_SUCCESS = 0,        /*!< media control command is acknowledged with success */
    ESP_A2D_MEDIA_CTRL_ACK_FAILURE,            /*!< media control command is acknowledged with failure */
    ESP_A2D_MEDIA_CTRL_ACK_BUSY,               /*!< media control command is rejected, as previous command is not yet acknowledged */
} esp_a2d_media_ctrl_ack_t;
My question is, is there a way to identify why it failed such as error code or something similar? Below is the logs showing that, BT connected, AVRC received and media start failed flows:
16:56:29.270 -> [ 17271][BluetoothA2DPSource.cpp:656] bt_app_av_sm_hdlr(): [BT_AV] state APP_AV_STATE_CONNECTING, evt CONNECTION_STATE_EVT
16:56:29.270 -> [ 17282][D][BluetoothA2DPSource.cpp:624] process_user_state_callbacks(): [BT_AV]
16:56:29.270 -> [ 17289][D][BluetoothA2DPSource.cpp:632] process_user_state_callbacks(): [BT_AV] ESP_A2D_CONNECTION_STATE_EVT: Connected
16:56:29.316 -> [ 17300][D][BluetoothA2DPSource.cpp:720] bt_app_av_state_connecting(): [BT_AV] evt CONNECTION_STATE_EVT
16:56:29.316 -> [ 17309][BluetoothA2DPSource.cpp:726] bt_app_av_state_connecting(): [BT_AV] A2DP connected
16:56:29.316 -> [ 17317][BluetoothA2DPCommon.cpp:285] set_scan_mode_connectable(): [BT_AV] set_scan_mode_connectable false
16:56:29.316 -> [ 17327][BluetoothA2DPSource.cpp:730] bt_app_av_state_connecting(): [BT_AV] Connected. Cancel Discovery

16:56:30.669 -> [ 18689][D][BluetoothA2DPSource.cpp:880] bt_app_rc_ct_cb(): [RCCT] bt_app_rc_ct_cb evt 0
16:56:30.669 -> [ 18690][D][BluetoothA2DPSource.cpp:271] bt_app_work_dispatch(): [BT_API] event 0x0, param len 12
16:56:30.715 -> [ 18695][D][BluetoothA2DPSource.cpp:880] bt_app_rc_ct_cb(): [RCCT] bt_app_rc_ct_cb evt 5
16:56:30.715 -> [ 18695][D][BluetoothA2DPSource.cpp:322] bt_app_task_handler(): [BT_API] sig 0x1, 0x0
16:56:30.715 -> [ 18703][D][BluetoothA2DPSource.cpp:271] bt_app_work_dispatch(): [BT_API] event 0x5, param len 12
16:56:30.715 -> [ 18710][D][BluetoothA2DPSource.cpp:923] bt_av_hdl_avrc_ct_evt(): [RCCT] bt_av_hdl_avrc_ct_evt evt 0
16:56:30.715 -> [ 18728][BluetoothA2DPSource.cpp:929] bt_av_hdl_avrc_ct_evt(): [RCCT] AVRC conn_state evt: state 1, [24:29:34:b8:ce:73]
16:56:30.763 -> [ 18739][D][BluetoothA2DPSource.cpp:322] bt_app_task_handler(): [BT_API] sig 0x1, 0x5
16:56:30.763 -> [ 18745][D][BluetoothA2DPSource.cpp:880] bt_app_rc_ct_cb(): [RCCT] bt_app_rc_ct_cb evt 6
16:56:30.763 -> [ 18746][D][BluetoothA2DPSource.cpp:923] bt_av_hdl_avrc_ct_evt(): [RCCT] bt_av_hdl_avrc_ct_evt evt 5
16:56:30.763 -> [ 18754][E][BluetoothA2DPSource.cpp:891] bt_app_rc_ct_cb(): [RCCT] Invalid AVRC event: 6
16:56:30.763 -> [ 18763][BluetoothA2DPSource.cpp:960] bt_av_hdl_avrc_ct_evt(): [RCCT] AVRC remote features

16:56:36.446 -> [ 24473][D][BluetoothA2DPSource.cpp:479] bt_app_gap_callback(): [BT_AV] state APP_AV_STATE_CONNECTED - evt 13
16:56:36.494 -> [ 24473][BluetoothA2DPSource.cpp:546] bt_app_gap_callback(): [BT_AV] ESP_BT_GAP_MODE_CHG_EVT mode:0
16:56:37.465 -> screen_load_icons[1091]
16:56:38.487 -> [ 26486][D][BluetoothA2DPSource.cpp:271] bt_app_work_dispatch(): [BT_API] event 0xff00, param len 0
16:56:38.487 -> [ 26486][D][BluetoothA2DPSource.cpp:322] bt_app_task_handler(): [BT_API] sig 0x1, 0xff00
16:56:38.487 -> [ 26491][BluetoothA2DPSource.cpp:656] bt_app_av_sm_hdlr(): [BT_AV] state APP_AV_STATE_CONNECTED, evt
16:56:38.487 -> [ 26500][D][BluetoothA2DPSource.cpp:624] process_user_state_callbacks(): [BT_AV]
16:56:38.487 -> [ 26508][D][BluetoothA2DPSource.cpp:760] bt_app_av_state_connected(): [BT_AV] bt_app_av_state_connected evt 65280
16:56:38.535 -> [ 26518][D][BluetoothA2DPSource.cpp:819] bt_app_av_media_proc(): [BT_AV] bt_app_av_media_proc evt 65280
16:56:38.535 -> [ 26527][BluetoothA2DPSource.cpp:824] bt_app_av_media_proc(): [BT_AV] a2dp media ready checking ...
16:56:38.535 -> [ 26536][D][BluetoothA2DPSource.cpp:271] bt_app_work_dispatch(): [BT_API] event 0x3, param len 16
16:56:38.535 -> [ 26544][D][BluetoothA2DPSource.cpp:322] bt_app_task_handler(): [BT_API] sig 0x1, 0x3
16:56:38.535 -> [ 26552][BluetoothA2DPSource.cpp:656] bt_app_av_sm_hdlr(): [BT_AV] state APP_AV_STATE_CONNECTED, evt MEDIA_CTRL_ACK_EVT
16:56:38.582 -> [ 26563][D][BluetoothA2DPSource.cpp:624] process_user_state_callbacks(): [BT_AV]
16:56:38.582 -> [ 26570][D][BluetoothA2DPSource.cpp:760] bt_app_av_state_connected(): [BT_AV] bt_app_av_state_connected evt 3
16:56:38.582 -> [ 26580][D][BluetoothA2DPSource.cpp:819] bt_app_av_media_proc(): [BT_AV] bt_app_av_media_proc evt 3
16:56:38.582 -> [ 26588][I][BluetoothA2DPSource.cpp:830] bt_app_av_media_proc(): [BT_AV] a2dp media ready, starting ...

16:56:48.478 -> [ 36486][D][BluetoothA2DPSource.cpp:271] bt_app_work_dispatch(): [BT_API] event 0xff00, param len 0
16:56:48.478 -> [ 36486][D][BluetoothA2DPSource.cpp:322] bt_app_task_handler(): [BT_API] sig 0x1, 0xff00
16:56:48.478 -> [ 36491][I][BluetoothA2DPSource.cpp:656] bt_app_av_sm_hdlr(): [BT_AV] state APP_AV_STATE_CONNECTED, evt
16:56:48.525 -> [ 36501][D][BluetoothA2DPSource.cpp:624] process_user_state_callbacks(): [BT_AV]
16:56:48.525 -> [ 36508][D][BluetoothA2DPSource.cpp:760] bt_app_av_state_connected(): [BT_AV] bt_app_av_state_connected evt 65280
16:56:48.525 -> [ 36518][D][BluetoothA2DPSource.cpp:819] bt_app_av_media_proc(): [BT_AV] bt_app_av_media_proc evt 65280

16:56:53.602 -> [ 41602][D][BluetoothA2DPSource.cpp:271] bt_app_work_dispatch(): [BT_API] event 0x3, param len 16
16:56:53.602 -> [ 41602][D][BluetoothA2DPSource.cpp:322] bt_app_task_handler(): [BT_API] sig 0x1, 0x3
16:56:53.602 -> [ 41607][I][BluetoothA2DPSource.cpp:656] bt_app_av_sm_hdlr(): [BT_AV] state APP_AV_STATE_CONNECTED, evt MEDIA_CTRL_ACK_EVT
16:56:53.602 -> [ 41618][D][BluetoothA2DPSource.cpp:624] process_user_state_callbacks(): [BT_AV]
16:56:53.648 -> [ 41625][D][BluetoothA2DPSource.cpp:760] bt_app_av_state_connected(): [BT_AV] bt_app_av_state_connected evt 3
16:56:53.648 -> [ 41635][D][BluetoothA2DPSource.cpp:819] bt_app_av_media_proc(): [BT_AV] bt_app_av_media_proc evt 3
16:56:53.648 -> [ 41644][I][BluetoothA2DPSource.cpp:847] bt_app_av_media_proc(): [BT_AV] a2dp media start failed.


Thank you,
Manh

Who is online

Users browsing this forum: No registered users and 53 guests