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.

Sets BT_DATA_BROADCAST_NAME to BT_DEVICE_NAME
for discovery on receivers not using BT_DEVICE_NAME.

Offload LC3 encoding to separate thread.

Limits streams to one channel.

Signed-off-by: Lars Knudsen <[email protected]>
  • Loading branch information
larsgk committed Nov 6, 2023
1 parent d5a1a8b commit c6cf525
Show file tree
Hide file tree
Showing 2 changed files with 306 additions and 78 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
# For LC3 the following configs are needed
CONFIG_FPU=y
CONFIG_LIBLC3=y

# When Host is fixed, CONFIG_BT_CTLR_ISO_TX_BUFFER_SIZE can inherit the CONFIG_BT_ISO_TX_MTU value.
CONFIG_BT_ISO_TX_MTU=40
# 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_BT_ISO_TX_MTU=60

# LC3 lib requires floating point support in the c-lib NEWLIB is one way of getting that.
CONFIG_NEWLIB_LIBC=y
CONFIG_MAIN_STACK_SIZE=4096

# USB Audio related configs
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr Broadcast Source"
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
CONFIG_USB_DEVICE_AUDIO=y

# Two streams in one subgroup
CONFIG_BT_ISO_MAX_CHAN=2
CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT=2
CONFIG_BT_BAP_BROADCAST_SRC_SUBGROUP_COUNT=1

# Audio buffer
CONFIG_RING_BUFFER=y

# Additional BT settings
CONFIG_BT_ECC=y
CONFIG_BT_TINYCRYPT_ECC=y
Loading

0 comments on commit c6cf525

Please sign in to comment.