cancel
Showing results for 
Search instead for 
Did you mean: 

Integrating BLE Audio source and sink in a single project

aboabra
Associate II

Hello,

I am currently working on integrating the Auracast examples BLE_Audio_PBP_Sink and BLE_Audio_PBP_Source.
The main objective is to design a speaker capable of switching between Source and Sink roles depending on the state of a button.

However, I am uncertain whether this approach is actually feasible. From what I have seen, the BLE Audio source files appear to be fixed and not meant to be modified, while the surrounding code and configuration suggest that each firmware build is designed to function either as a Source or as a Sink, but not both simultaneously. There are numerous configuration options and macros tied directly to the BLE device role, and this role seems to be determined at compilation time, rather than dynamically at runtime.

After reviewing the STM documentation (Bluetooth LE Audio - STM32WBA Architecture and Integration), I found some warnings related to this limitation. Specifically, in section 3.2 it states:

"Warning:
The values of the parameters of the MACRO shall be equal to the values of the fields submitted in the parameters of the Audio profiles configuration in CAP_Init().
In cases where the parameters do not match, the CAP_Init() could fail because the Audio Stack will fail to allocate the memory required by the Audio profile, or the CAP_Init() could leave unused memory allocated for the context of the Audio profile."

Based on this information, it seems that the BLE Audio profile configuration is tightly bound to compile-time definitions and cannot be modified after initialization.

Has anyone explored the possibility of dynamically switching between Source and Sink roles within a single firmware? Or alternatively, is there a recommended approach for implementing a project that requires this kind of flexible role switching?

Thank you in advance for your help,
aboabra

0 REPLIES 0