Open jjj19950710 opened 3 months ago
How to set a2dp encoding format to SBC for l2cap layer interface?
Hi @jjj19950710 ,
Thanks
Thank you for your reply! Replace the main.c file in the bt_l2cap_client project and modify the CMakeLists.txt file:
idf_component_register(SRCS "main.c"
"bt_app_core.c"
INCLUDE_DIRS "."
"${IDF_PATH}/components/bt/host/bluedroid/stack/include"
"${IDF_PATH}/components/bt/host/bluedroid/common/include"
"${IDF_PATH}/components/bt/common/include"
"${IDF_PATH}/components/bt/host/bluedroid/stack/avct/include"
"${IDF_PATH}/components/bt/host/bluedroid/stack/avdt/include")
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
Enable a2dp configuration
I already know the reason for the timeout issue and I have now resolved it.
The second question: Currently, I am only connecting to the non-a2dp aptX HD stream endpoint. I hope to register the SBC encoding format on the development board so that I can establish a connection with the stream endpoint on Bluez.How should I do it in the main.c file.
Hi @jjj19950710 May I ask if you want to support both SBC and aptX encoding and decoding?
Hi @xiongweichao,It is also possible to set only the supported SBC encoding format.It would be best if you could support both.
Hi @jjj19950710 ,
Please try the following modifications.
idf_component_register(SRCS "main.c"
"bt_app_core.c"
INCLUDE_DIRS "."
"${IDF_PATH}/components/bt/host/bluedroid/stack/include"
"${IDF_PATH}/components/bt/host/bluedroid/common/include"
"${IDF_PATH}/components/bt/common/include"
"${IDF_PATH}/components/bt/host/bluedroid/stack/avct/include"
"${IDF_PATH}/components/bt/host/bluedroid/external/sbc/decoder/include"
"${IDF_PATH}/components/bt/host/bluedroid/external/sbc/encoder/include"
"${IDF_PATH}/components/bt/host/bluedroid/stack/avdt/include")
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
#include "oi_codec_sbc.h"
Not sure if it meets your requirements. Please let me know if you have any questions.
Thanks
Answers checklist.
IDF version.
v5.0.1
Espressif SoC revision.
ESP32
Operating System used.
Windows
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
CMD
Development Kit.
ESP32
Power Supply used.
USB
What is the expected behavior?
The l2cap interface is connected to the a2dp channel, and after successful connection, the query capability features are cyclically sent through the write interface, hoping to continue querying.
What is the actual behavior?
The l2cap interface is connected to the a2dp channel. After successful connection, the query capability feature is cyclically sent through the write interface. After 3700 rounds, the underlying l2cap interface cannot be called again, and the prompt "l2cap-vfsw_write exit for time out" appears。
Steps to reproduce.
1、The tested device is Bluez on Linux system 2、Modify the PSM of the connection:esp_bt_l2cap_connect(sec_mask, 0x0019, s_peer_bda); 3、Establish a2dp interaction process after channel opening 4、Register the l2cap callback function to retrieve the callback packet.Loop send getcapabilities
Debug Logs.
More Information.
No response