Bluetooth HFP-AG: ESP32 IDF Example Template Bug: Noise or No Connection

ESPI_1
Posts: 10
Joined: Thu Feb 27, 2020 7:08 am

Bluetooth HFP-AG: ESP32 IDF Example Template Bug: Noise or No Connection

Postby ESPI_1 » Wed Apr 01, 2020 10:35 am

using the Original Espressif HFP-AG example does not work properly
-> "Noise" in Speaker or "no Connection"


STEPS:
Creating a new / Espressif-IDF-Project / from template
Selecting "bluetooth/bluedroid/classic_bt/hfp_ag"

Keep the original "sdkconfig" unchanged

Compile, download - OK

Got the expected "HFP AG Command-Page" in the Terminal

When entering
hf con;

I got the Error:
W (13900) BT_APPL: AG found collision (ACL) ...
W (39150) BT_RFCOMM: rfc_find_lcid_mcb LCID reused LCID:0x43 current:0x0
W (39150) BT_RFCOMM: RFCOMM_DisconnectInd LCID:0x43
W (39150) BT_L2CAP: L2CAP - rcvd conn req for unknown PSM: 25
W (39570) BT_RFCOMM: rfc_find_lcid_mcb LCID reused LCID:0x45 current:0x0
W (39580) BT_RFCOMM: RFCOMM_DisconnectInd LCID:0x45

Effects:

I can only establish a connection with one BT-Device, the same one I sucessfully used in former A2DP Test-on this ESP32-Modul.
But there is no Audio-Channel with only Noise -

Next step: sdkconfig: I switched to SCO to HCI at 2 places,
but bt_app_hf_outgoing_cb in bt-app-hf.c seems to remain without invocation.
(fix: I fill the whole Buffer with sinus-data)

Trying to connect any other of my BT-HFP-Devices completly fails.


Question:
Any Ideas, where to search? Configuration? Clear any old BT-ConnectionList?

ESPI_1
Posts: 10
Joined: Thu Feb 27, 2020 7:08 am

Re: Bluetooth HFP-AG: ESP32 IDF Example Template Bug: Noise or No Connection

Postby ESPI_1 » Wed Apr 01, 2020 11:19 pm

Hallo espressif-Team It seems to be a bug in the BT-Library - can you check it - I have no source.

Switching BT DEBUG LOG LEVEL to "Verbose", I see there is an error some statements earlier

D (1395) BT_BTC: btc_hf_cb_handler: event = BTA_AG_ENABLE_EVT
E (1395) BT_BTC: btc_hf_cb_handler: Invalid index -1

Looking for "BTA_AG_ENABLE_EVT" in the Internet, I found an quite similarbugfix under
https://gitlab.com/Codeaurora/platform_ ... c7b9332b1a

  1. btif/src/btif_hf.c
  2. {
  3.     tBTA_AG *p_data = (tBTA_AG *)p_param;
  4.     bdstr_t bdstr;
  5. -   int idx = p_data->hdr.handle - 1;
  6. +   int idx;
  7.     BOOLEAN ignore_rfc_fail = false;
  8.  
  9.     BTIF_TRACE_IMP("%s: event=%s", __FUNCTION__, dump_hf_event(event));
  10.  
  11. +  // for BTA_AG_ENABLE_EVT/BTA_AG_DISABLE_EVT, p_data is NULL
  12. +    if (event == BTA_AG_ENABLE_EVT || event == BTA_AG_DISABLE_EVT)
  13. +        return;
  14.  
  15. +    // p_data is NULL for any other event, return
  16. +    if (p_data == NULL)
  17. +    {
  18. +        BTIF_TRACE_ERROR("%s: data is NULL", __FUNCTION__);
  19. +        return;
  20. +    }
  21.  
  22. +    idx = p_data->hdr.handle - 1;
  23.     if ((idx < 0) || (idx >= BTIF_HF_NUM_CB))
  24.     {
  25.         BTIF_TRACE_ERROR("%s: Invalid index %d", __FUNCTION__, idx);

Who is online

Users browsing this forum: Google [Bot] and 148 guests