Skip to content

Commit 2127aa8

Browse files
committed
audio: bt: add ESP32-C6 Bluetooth LE Audio pipeline endpoint and static routing
- Add Bluetooth LE Audio (BAP / LC3 @ 48kHz stereo) support utilizing the onboard ESP32-C6 co-processor via SDIO / GPIO 54 power control. - Implement bt_audio component with zero-heap static ring buffers (10ms SDU). - Implement bt_service to manage C6 power, scanning, and LE Audio broadcast. - Extend sof_static_pipeline with dynamic 3-way endpoint routing: Route 0: USB <-> DAI (Default) Route 1: BT <-> DAI (DUT Audio Bridge) Route 2: USB <-> BT (PC to Bluetooth Broadcast) - Add Kcontrols: ID 8 (BT Stream Switch), ID 9 (BT Stream Volume), ID 10 (Audio Endpoint Route). - Add interactive shell commands: 'sof bt <status|broadcast|scan|power>' and 'sof route <usb_dai|bt_dai|usb_bt>'. - Verified 100% pass on pre-commit loopback test suite (I2S: 93.88dB, PDM: 82.44dB, DMIC: 19.66dB).
1 parent 6a0f013 commit 2127aa8

14 files changed

Lines changed: 1009 additions & 3 deletions

File tree

‎app/boards/esp32p4_function_ev_board_esp32p4_hpcore.conf‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ CONFIG_COMP_DCBLOCK=y
2323
CONFIG_COMP_MULTIBAND_DRC=y
2424
CONFIG_COMP_TDFB=y
2525
CONFIG_COMP_USB_AUDIO=y
26+
CONFIG_COMP_BT_AUDIO=y
2627
CONFIG_COMP_TONE=y
2728
CONFIG_COMP_LEVEL_MULTIPLIER=y
2829
CONFIG_COMP_SEL=y

‎app/src/main.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <rtos/sof.h>
1717
#include <sof/init.h>
1818
#include <sof/audio/pipeline/sof_static_pipeline.h>
19+
#include <sof/audio/bt_service.h>
1920
#endif
2021

2122
LOG_MODULE_REGISTER(main, LOG_LEVEL_DBG);
@@ -71,6 +72,11 @@ static int sof_app_main(void)
7172
} else {
7273
LOG_ERR("Failed to initialize USB device context");
7374
}
75+
76+
#if defined(CONFIG_COMP_BT_AUDIO)
77+
/* Initialize Bluetooth Audio Service and power on ESP32-C6 coprocessor */
78+
bt_service_init();
79+
#endif
7480
#endif
7581

7682
#ifdef CONFIG_ARCH_POSIX_LIBFUZZER

‎src/audio/CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
1717
add_subdirectory(pcm_converter)
1818
add_subdirectory(pipeline)
1919
add_local_sources_ifdef(CONFIG_COMP_USB_AUDIO sof usb_audio.c)
20+
add_local_sources_ifdef(CONFIG_COMP_BT_AUDIO sof bt_audio.c bt_service.c)
2021

2122
if(CONFIG_COMP_BASEFW_IPC4 AND NOT CONFIG_LIBRARY)
2223
add_local_sources(sof base_fw.c)

‎src/audio/Kconfig‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ config COMP_USB_AUDIO
5757
help
5858
Enable USB Audio Class 2 (UAC2) streaming component for SOF.
5959

60+
config COMP_BT_AUDIO
61+
bool "Bluetooth Audio streaming component"
62+
default y if PLATFORM_ESP32P4
63+
help
64+
Enable Bluetooth Audio streaming component for SOF.
65+
6066
config COMP_CHAIN_DMA
6167
bool "Chain DMA component"
6268
depends on IPC_MAJOR_4

0 commit comments

Comments
 (0)