samples: Bluetooth: Broadcast audio sink USB headset on nRF52 Series

Broadcast audio sink USB headset on nRF52 Series with USB
support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2024-03-12 12:33:38 +01:00 committed by Carles Cufí
parent bd5e906f68
commit cd6674f7c2
15 changed files with 45 additions and 22 deletions

View file

@ -47,7 +47,8 @@ config ENABLE_LC3
bool "Enable the LC3 codec"
# By default let's enable it in the platforms we know are capable of supporting it
default y
depends on (ARCH_POSIX || SOC_NRF5340_CPUAPP)
depends on CPU_HAS_FPU && \
(ARCH_POSIX || SOC_COMPATIBLE_NRF52X || SOC_COMPATIBLE_NRF5340_CPUAPP)
select LIBLC3
select FPU

View file

@ -0,0 +1,3 @@
# Use USB Audio as audio sink
CONFIG_USE_USB_AUDIO_OUTPUT=y
CONFIG_USB_DEVICE_PRODUCT="USB Broadcast Sink"

View file

@ -0,0 +1,15 @@
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
hs_0: hs_0 {
compatible = "usb-audio-hs";
mic-feature-mute;
mic-channel-l;
mic-channel-r;
hp-feature-mute;
hp-channel-l;
hp-channel-r;
};
};

View file

@ -0,0 +1,3 @@
# Use USB Audio as audio sink
CONFIG_USE_USB_AUDIO_OUTPUT=y
CONFIG_USB_DEVICE_PRODUCT="USB Broadcast Sink"

View file

@ -0,0 +1,15 @@
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
hs_0: hs_0 {
compatible = "usb-audio-hs";
mic-feature-mute;
mic-channel-l;
mic-channel-r;
hp-feature-mute;
hp-channel-l;
hp-channel-r;
};
};

View file

@ -1,7 +1,3 @@
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_ENABLE_LC3=y
CONFIG_TARGET_BROADCAST_CHANNEL=1
# Use USB Audio as audio sink
CONFIG_USE_USB_AUDIO_OUTPUT=y
CONFIG_USB_DEVICE_PRODUCT="USB Broadcast Sink"

View file

@ -1,3 +0,0 @@
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

View file

@ -20,8 +20,10 @@ tests:
- nrf52_bsim
- nrf52833dk/nrf52820
- nrf52833dk/nrf52833
- nrf52840dongle/nrf52840
integration_platforms:
- nrf52_bsim
- nrf52833dk/nrf52833
- nrf52840dongle/nrf52840
extra_args: OVERLAY_CONFIG=overlay-bt_ll_sw_split.conf
tags: bluetooth

View file

@ -1259,7 +1259,7 @@ static int init(void)
usb_audio_register(hs_dev, &usb_ops);
err = usb_enable(NULL);
if (err != 0) {
if (err && err != -EALREADY) {
printk("Failed to enable USB\n");
return err;
}

View file

@ -1,5 +1,3 @@
CONFIG_MAIN_STACK_SIZE=4096
# Use USB Audio as input
# Use USB Audio as audio source
CONFIG_USE_USB_AUDIO_INPUT=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr Broadcast Source"

View file

@ -1,5 +1,3 @@
CONFIG_MAIN_STACK_SIZE=4096
# Use USB Audio as input
# Use USB Audio as audio source
CONFIG_USE_USB_AUDIO_INPUT=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr Broadcast Source"

View file

@ -1 +0,0 @@
CONFIG_MAIN_STACK_SIZE=4096

View file

@ -1,5 +1,3 @@
CONFIG_MAIN_STACK_SIZE=4096
# Use USB Audio as input
# Use USB Audio as audio source
CONFIG_USE_USB_AUDIO_INPUT=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr Broadcast Source"

View file

@ -1 +0,0 @@
CONFIG_MAIN_STACK_SIZE=4096

View file

@ -1 +0,0 @@
CONFIG_MAIN_STACK_SIZE=4096