-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
samples: Bluetooth: BAP: Broadcast sink use new USB stack
Refactor the USB of the BAP broadcast sink to use the new USB stack. Signed-off-by: Emil Gydesen <[email protected]>
- Loading branch information
Showing
17 changed files
with
196 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (c) 2025 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <dt-bindings/usb/audio.h> | ||
|
||
/ { | ||
uac2_microphone: usb_audio2 { | ||
compatible = "zephyr,uac2"; | ||
status = "okay"; | ||
full-speed; | ||
audio-function = <AUDIO_FUNCTION_MICROPHONE>; | ||
|
||
/* Clock supporting 48KHz | ||
* | ||
* Since the incoming audio may be between 8 and 48 KHz, we always upsample to 48KHz | ||
*/ | ||
uac_aclk: aclk { | ||
compatible = "zephyr,uac2-clock-source"; | ||
clock-type = "internal-programmable"; | ||
frequency-control = "read-only"; | ||
sampling-frequencies = <48000>; | ||
}; | ||
|
||
/* The out_terminal supports the incoming Bluetooth LE Audio over ISO | ||
* and treats it as a microphone towards the USB host | ||
*/ | ||
out_terminal: out_terminal { | ||
compatible = "zephyr,uac2-input-terminal"; | ||
clock-source = <&uac_aclk>; | ||
terminal-type = <INPUT_TERMINAL_MICROPHONE>; | ||
front-left; | ||
front-right; | ||
}; | ||
|
||
/* USB Audio terminal from USB device to USB host */ | ||
in_terminal: in_terminal { | ||
compatible = "zephyr,uac2-output-terminal"; | ||
data-source = <&out_terminal>; | ||
clock-source = <&uac_aclk>; | ||
terminal-type = <USB_TERMINAL_STREAMING>; | ||
}; | ||
|
||
as_iso_in: in_interface { | ||
compatible = "zephyr,uac2-audio-streaming"; | ||
linked-terminal = <&in_terminal>; | ||
subslot-size = <2>; | ||
bit-resolution = <16>; | ||
}; | ||
}; | ||
}; |
2 changes: 1 addition & 1 deletion
2
samples/bluetooth/bap_broadcast_sink/boards/nrf52833dk_nrf52833.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Use USB Audio as audio sink | ||
CONFIG_USE_USB_AUDIO_OUTPUT=y | ||
CONFIG_USB_DEVICE_PRODUCT="USB Broadcast Sink" | ||
CONFIG_SAMPLE_USBD_PRODUCT="USB Broadcast Sink sample" |
20 changes: 6 additions & 14 deletions
20
samples/bluetooth/bap_broadcast_sink/boards/nrf52833dk_nrf52833.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,7 @@ | ||
zephyr_udc0: &usbd { | ||
compatible = "nordic,nrf-usbd"; | ||
status = "okay"; | ||
/* | ||
* Copyright (c) 2025 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
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; | ||
}; | ||
}; | ||
#include "../app.overlay" |
3 changes: 3 additions & 0 deletions
3
samples/bluetooth/bap_broadcast_sink/boards/nrf52840dk_nrf52840.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Use USB Audio as audio sink | ||
CONFIG_USE_USB_AUDIO_OUTPUT=y | ||
CONFIG_SAMPLE_USBD_PRODUCT="USB Broadcast Sink sample" |
7 changes: 7 additions & 0 deletions
7
samples/bluetooth/bap_broadcast_sink/boards/nrf52840dk_nrf52840.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright (c) 2025 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include "../app.overlay" |
4 changes: 3 additions & 1 deletion
4
samples/bluetooth/bap_broadcast_sink/boards/nrf52840dongle_nrf52840.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Use USB Audio as audio sink | ||
CONFIG_USE_USB_AUDIO_OUTPUT=y | ||
CONFIG_USB_DEVICE_PRODUCT="USB Broadcast Sink" | ||
CONFIG_SAMPLE_USBD_PRODUCT="USB Broadcast Sink sample" | ||
|
||
CONFIG_BOARD_SERIAL_BACKEND_CDC_ACM=n |
20 changes: 6 additions & 14 deletions
20
samples/bluetooth/bap_broadcast_sink/boards/nrf52840dongle_nrf52840.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,7 @@ | ||
zephyr_udc0: &usbd { | ||
compatible = "nordic,nrf-usbd"; | ||
status = "okay"; | ||
/* | ||
* Copyright (c) 2025 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
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; | ||
}; | ||
}; | ||
#include "../app.overlay" |
2 changes: 1 addition & 1 deletion
2
samples/bluetooth/bap_broadcast_sink/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Use USB Audio as audio sink | ||
CONFIG_USE_USB_AUDIO_OUTPUT=y | ||
CONFIG_USB_DEVICE_PRODUCT="USB Broadcast Sink" | ||
CONFIG_SAMPLE_USBD_PRODUCT="USB Broadcast Sink sample" |
7 changes: 7 additions & 0 deletions
7
samples/bluetooth/bap_broadcast_sink/boards/nrf5340_audio_dk_nrf5340_cpuapp.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright (c) 2025 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include "../app.overlay" |
2 changes: 1 addition & 1 deletion
2
samples/bluetooth/bap_broadcast_sink/boards/nrf5340dk_nrf5340_cpuapp.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Use USB Audio as audio sink | ||
CONFIG_USE_USB_AUDIO_OUTPUT=y | ||
CONFIG_USB_DEVICE_PRODUCT="USB Broadcast Sink" | ||
CONFIG_SAMPLE_USBD_PRODUCT="USB Broadcast Sink sample" |
20 changes: 6 additions & 14 deletions
20
samples/bluetooth/bap_broadcast_sink/boards/nrf5340dk_nrf5340_cpuapp.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,7 @@ | ||
zephyr_udc0: &usbd { | ||
compatible = "nordic,nrf-usbd"; | ||
status = "okay"; | ||
/* | ||
* Copyright (c) 2025 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
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; | ||
}; | ||
}; | ||
#include "../app.overlay" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.