Suggestion for improving WIFI + BT Classic coexistence for audio streaming

espwifi
Posts: 1
Joined: Thu Aug 18, 2022 2:13 pm

Suggestion for improving WIFI + BT Classic coexistence for audio streaming

Postby espwifi » Thu Aug 18, 2022 2:28 pm

I am occasionally getting "BT_L2CAP: l2cab is_cong_cback_context" with audio glitch due lack of RF bandwidth for BT.

I have followed https://docs.espressif.com/projects/esp ... exist.html

Is there anything better, we can do for improving the situation for the following use case

Pipeline is follows:
Mp3 from http->wifi->mp3 decoder->resample->ad2p source->BT

I think, since wifi bandwidth is less and BT RF bandwidth is more,
# Is there more option to fine tune the coexistence experience for above use case?
# Is there any coexistence API to see WIFI or BT consuming RF cycles at given point of time?
# What would ideal way of debugging this issue?

Environment:

SDK version: 4.4.2

# BT controller init:

esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
if (esp_bt_controller_init(&bt_cfg) != ESP_OK) {
loge("%s initialize controller failed\n", __func__);

# Also added esp_coex_preference_set(ESP_COEX_PREFER_BT) in application code

# Config

# BT
CONFIG_BT_ENABLED=y
CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y
CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y
CONFIG_BT_BLE_ENABLED=n
CONFIG_BTDM_CTRL_MODEM_SLEEP=n
CONFIG_BT_BLUEDROID_ENABLED=y
CONFIG_BT_CLASSIC_ENABLED=y
CONFIG_BT_A2DP_ENABLE=y
CONFIG_BTDM_CTRL_PINNED_TO_CORE_1=y
CONFIG_BTDM_CTRL_PINNED_TO_CORE=1
CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1=y
CONFIG_BT_BLUEDROID_PINNED_TO_CORE=1

# WIFI + BT
CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y

# CPU
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
CONFIG_ESP32_REV_MIN_3=y
CONFIG_ESP32_REV_MIN=3

# SPIRAM
CONFIG_ESP32_SPIRAM_SUPPORT=y
CONFIG_SPIRAM_BOOT_INIT=y
CONFIG_SPIRAM_USE_MALLOC=y
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y

Who is online

Users browsing this forum: No registered users and 127 guests