From 8e62b08e5877083b40520ed5267c5b72e97d2fe6 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Fri, 25 Apr 2025 20:24:27 +0300 Subject: [PATCH] bluez5: hfp-hf: don't change hf_state after sending AT+BCS The +BCS event may interrupt any of the initialization commands after SLC is established and by changing the state here we may lose track of the initialization sequence. There is no reason to have the hfp_hf_bcs state anyway. If the initialization sequence is over, we can remain in the hfp_hf_vgm state. --- spa/plugins/bluez5/backend-native.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/spa/plugins/bluez5/backend-native.c b/spa/plugins/bluez5/backend-native.c index 0e94227a1..f87cdbbd7 100644 --- a/spa/plugins/bluez5/backend-native.c +++ b/spa/plugins/bluez5/backend-native.c @@ -142,8 +142,7 @@ enum hfp_hf_state { hfp_hf_slc1, hfp_hf_slc2, hfp_hf_vgs, - hfp_hf_vgm, - hfp_hf_bcs + hfp_hf_vgm }; enum hsp_hs_state { @@ -2012,8 +2011,6 @@ static bool rfcomm_hfp_hf(struct rfcomm *rfcomm, char* token) /* send codec selection to AG */ rfcomm_send_cmd(rfcomm, "AT+BCS=%u", selected_codec); - rfcomm->hf_state = hfp_hf_bcs; - if (!rfcomm->transport || (rfcomm->transport->codec != selected_codec) ) { if (rfcomm_new_transport(rfcomm, selected_codec) < 0) { // TODO: We should manage the missing transport