https://www.espressif.com/sites/default/files/documentation/ESP32_FAQs__EN.pdf5.3. Coexistence
5.3.1. How do ESP32 Bluetooth dual modes coexist? And how to use dual-mode
Bluetooth?
ESP32 BT&BLE dual-mode Bluetooth is very easy to use. It does not require any special
configuration or calling functions. As a developer, all you have to know is (1) BLE calls the
BLE APIs, and (2) Classic Bluetooth calls the Classic Bluetooth APIs. For details, please
refer to ESP32 BT&BLE Dual-mode Bluetooth.
5.3.2. How do ESP32 Bluetooth and Wi-Fi coexist?
In the menuconfig menu, there is a special option called “Software controls WiFi/
Bluetooth coexistence”, which is used to control the ESP32's Bluetooth and Wi-Fi
coexistence using software, thus balancing the coexistence requirement for controlling the
RF module by both the Wi-Fi and Bluetooth modules. Please note that if Option “Software
controls WiFi/Bluetooth coexistence” is enabled, the BLE scan interval shall not exceed
0x100 slots (about 160 ms).
• If only the BLE and Wi-Fi coexistence is required, this option can be enabled or
disabled. However, if this option is not enabled, please note that the “BLE scan
interval - BLE scan window” should be larger than 150 ms, and the BLE scan interval
should be less than 500 ms.
• If the Classic Bluetooth and Wi-Fi coexistence is required, it is recommended that you
enable this option.
In ESP-IDF V3.0 and earlier versions, the performance of Classic Bluetooth and Wi-Fi
coexistence might be poor at times. However, in ESP-IDF V3.1 and later versions, we has
solved this issue. At the moment, ESP32 can simultaneously function as a Wi-Fi module
and as a Bluetooth speaker, playing music smoothly.
According to this information, you should check ESP-IDF version to be V3.1 or later. If it's lower, then better to give up or upgrade.