Skip to content

Commit

Permalink
Bluetooth samples: Add USB Audio to Broadcast Sink sample
Browse files Browse the repository at this point in the history
Added USB Audio output for the Broadcast Sink sample. In addition
offloading of the LC3 codec was also made. The sample supports only
mono, and a KConfig option was added to configure which audio
location to sync to.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
  • Loading branch information
fredrikdanebjer committed Jan 31, 2024
1 parent 664e710 commit 9d7676b
Show file tree
Hide file tree
Showing 3 changed files with 368 additions and 82 deletions.
21 changes: 21 additions & 0 deletions samples/bluetooth/broadcast_audio_sink/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,25 @@ config ENABLE_LC3
select LIBLC3
select FPU

config USE_USB_AUDIO_OUTPUT
bool "Use USB Audio as output"
depends on ENABLE_LC3
select USB_DEVICE_STACK
select USB_DEVICE_AUDIO
select RING_BUFFER
help
Enables USB audio as output as a USB peripheral. This does not support providing USB
audio to e.g. speakers that are also USB peripherals, but can be connected to e.g. a
phone or PC as a USB-in device (such as a USB microphone).
USB audio only supports a single audio channel.

config TARGET_BROADCAST_CHANNEL
int "Broadcast Channel Audio Location to sync to"
range 0 2
default 1
depends on USE_USB_AUDIO_OUTPUT
help
Channel Audio Location to sync to. These corresponds to the bt_audio_location,
supporting mono, left and right channels

source "Kconfig.zephyr"
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 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
CONFIG_USE_USB_AUDIO_OUTPUT=y
CONFIG_USB_DEVICE_PRODUCT="USB Broadcast Sink"
Loading

0 comments on commit 9d7676b

Please sign in to comment.