Skip to content

Commit

Permalink
samples: Add USB Audio to broadcast audio source
Browse files Browse the repository at this point in the history
Adds support for using a connected host to
broadcast audio via USB Audio.

Offload LC3 encoding to separate thread.

Signed-off-by: Lars Knudsen <[email protected]>
  • Loading branch information
larsgk authored and carlescufi committed Nov 14, 2023
1 parent 1fbcccd commit 78714b1
Show file tree
Hide file tree
Showing 5 changed files with 297 additions and 80 deletions.
9 changes: 9 additions & 0 deletions samples/bluetooth/broadcast_audio_source/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@ config ENABLE_LC3
select LIBLC3
select FPU

config USE_USB_AUDIO_INPUT
bool "Use USB Audio as input"
# By default, use the USB Audio path is disabled.
default n
depends on ENABLE_LC3
select USB_DEVICE_STACK
select USB_DEVICE_AUDIO
select RING_BUFFER

source "Kconfig.zephyr"
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# 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_MAIN_STACK_SIZE=4096

# Use USB Audio as input
CONFIG_USE_USB_AUDIO_INPUT=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr Broadcast Source"

# Two streams in one subgroup (stereo)
CONFIG_BT_BAP_BROADCAST_SRC_SUBGROUP_COUNT=1
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# 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_MAIN_STACK_SIZE=4096
2 changes: 0 additions & 2 deletions samples/bluetooth/broadcast_audio_source/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ CONFIG_BT_ISO_TX_BUF_COUNT=4
CONFIG_BT_ISO_TX_MTU=60

CONFIG_BT_DEVICE_NAME="Broadcast Audio Source"

CONFIG_BT_TINYCRYPT_ECC=y
Loading

0 comments on commit 78714b1

Please sign in to comment.