1# Bluetooth Audio - Basic Audio Profile configuration options
2#
3# Copyright (c) 2020 Intel Corporation
4# Copyright (c) 2022-2023 Nordic Semiconductor ASA
5
6# SPDX-License-Identifier: Apache-2.0
7#
8
9config BT_BAP_UNICAST
10	bool
11	depends on BT_CONN
12	select BT_SMP
13	select BT_ISO_UNICAST
14
15config BT_BAP_UNICAST_SERVER
16	bool "Bluetooth Unicast Audio Server Support [EXPERIMENTAL]"
17	select EXPERIMENTAL
18	select BT_PERIPHERAL
19	select BT_BAP_UNICAST
20	select BT_ISO_PERIPHERAL
21	select BT_GATT_DYNAMIC_DB
22	select BT_GATT_CACHING
23	select BT_ASCS
24	help
25	  This option enables support for Bluetooth Unicast Audio Server
26	  using Isochronous channels.
27
28config BT_BAP_UNICAST_CLIENT
29	bool "Bluetooth Unicast Audio Client Support [EXPERIMENTAL]"
30	select EXPERIMENTAL
31	select BT_BAP_UNICAST
32	select BT_ISO_CENTRAL
33	select BT_CENTRAL
34	select BT_GATT_CLIENT
35	select BT_GATT_AUTO_DISCOVER_CCC
36	select BT_GATT_AUTO_UPDATE_MTU
37	help
38	  This option enables support for Bluetooth Unicast Audio Client
39	  using Isochronous channels.
40
41config BT_AUDIO_CODEC_CFG_MAX_DATA_SIZE
42	int "Codec Specific Configuration Data Size"
43	default 19
44	range 0 255
45	help
46	  Number of octets to support for Codec Specific Configuration data.
47	  The default value 19 matches the required fields for the LC3 codec.
48
49config BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE
50	int "Codec Specific Configuration Metadata Size"
51	default 4
52	range 0 255
53	help
54	  Number of octets to support for Codec Specific Configuration metadata.
55
56config BT_AUDIO_CODEC_CAP_MAX_DATA_SIZE
57	int "Codec Capabilities Data Size"
58	default 19
59	range 0 255
60	help
61	  Number of octets to support for Codec Specific Capabilities data.
62	  The default value 19 matches the required fields for the LC3 codec.
63
64config BT_AUDIO_CODEC_CAP_MAX_METADATA_SIZE
65	int "Codec Capabilities Metadata Size"
66	default 4
67	range 0 255
68	help
69	  Number of octets to support for Codec Specific Capabilities metadata.
70
71if BT_BAP_UNICAST_CLIENT
72config BT_BAP_UNICAST_CLIENT_GROUP_COUNT
73	int "Basic Audio Unicast Group count"
74	depends on BT_BAP_UNICAST
75	default BT_ISO_MAX_CIG
76	range 1 BT_ISO_MAX_CIG
77	help
78	  This option sets the number of connected audio groups to support as
79	  the unicast client.
80
81config BT_BAP_UNICAST_CLIENT_GROUP_STREAM_COUNT
82	int "Basic Audio Profile Unicast Group Connected Isochronous Stream (CIS) count"
83	depends on BT_BAP_UNICAST_CLIENT_GROUP_COUNT > 0
84	default 1
85	range 1 BT_ISO_MAX_CHAN if BT_ISO_MAX_CHAN < 31
86	range 1 31
87	help
88	  This option sets the maximum number of CIS per unicast group to support.
89	  Since BAP streams are unidirectional, two BAP streams may use a single CIS, the number of
90	  BAP audio streams per group may be up to twice of this value.
91
92config BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT
93	int "Basic Audio Profile ASE Sink count"
94	default 2
95	range 0 255
96	help
97	  This option enables caching a number of Audio Stream Endpoint Sink
98	  instances for Basic Audio Profile on a per connection basis.
99
100config BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT
101	int "Basic Audio Profile ASE Source count"
102	default 2
103	range 0 255
104	help
105	  This option enables caching a number of Audio Stream Endpoint Source
106	  instances for Basic Audio Profile on a per connection basis.
107
108config BT_BAP_UNICAST_CLIENT_ASE_SNK
109	def_bool BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT > 0
110	select BT_AUDIO_TX
111
112config BT_BAP_UNICAST_CLIENT_ASE_SRC
113	def_bool BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT > 0
114	select BT_AUDIO_RX
115
116endif # BT_BAP_UNICAST_CLIENT
117
118config BT_BAP_BROADCAST_SOURCE
119	bool "Bluetooth Broadcast Source Audio Support [EXPERIMENTAL]"
120	select EXPERIMENTAL
121	select BT_ISO_BROADCASTER
122	select BT_AUDIO_TX
123	help
124	  This option enables support for Bluetooth Broadcast Source Audio using
125	  Isochronous channels.
126if BT_BAP_BROADCAST_SOURCE
127
128config BT_BAP_BROADCAST_SRC_SUBGROUP_COUNT
129	int "Basic Audio Broadcast Source subgroup count"
130	default 1
131	range 1 BT_ISO_MAX_CHAN if BT_ISO_MAX_CHAN < 31
132	range 1 31
133	help
134	  This option sets the maximum number of subgroups per broadcast source
135	  to support.
136
137config BT_BAP_BROADCAST_SRC_COUNT
138	int "Basic Audio Broadcaster source count"
139	default 1
140	range 1 BT_ISO_MAX_BIG
141	help
142	  This option sets the number of broadcast sources to support.
143	  One broadcast source can send multiple streams
144	  (up to BT_BAP_BROADCAST_SRC_STREAM_COUNT per broadcast source).
145
146
147config BT_BAP_BROADCAST_SRC_STREAM_COUNT
148	int "Basic Audio Broadcast Source Stream count"
149	default 1
150	range 1 BT_ISO_MAX_CHAN if BT_ISO_MAX_CHAN < 31
151	range 1 31
152	help
153	  This option sets the maximum number of streams per broadcast source
154	  to support.
155
156endif # BT_BAP_BROADCAST_SOURCE
157
158config BT_BAP_BROADCAST_SINK
159	bool "Bluetooth Broadcast Sink Audio Support [EXPERIMENTAL]"
160	select EXPERIMENTAL
161	select BT_ISO_SYNC_RECEIVER
162	select BT_AUDIO_RX
163	depends on BT_PERIPHERAL
164	depends on BT_PAC_SNK
165	depends on BT_BAP_SCAN_DELEGATOR
166	help
167	  This option enables support for Bluetooth Broadcast Sink Audio using
168	  Isochronous channels.
169
170if BT_BAP_BROADCAST_SINK
171
172config BT_BAP_BROADCAST_SNK_SUBGROUP_COUNT
173	int "Basic Audio Profile Broadcast Sink subgroup count"
174	default 1
175	range 1 BT_ISO_MAX_CHAN if BT_ISO_MAX_CHAN < 31
176	range 1 31
177	help
178	  This option sets the maximum number of subgroups per broadcast sink
179	  to support.
180
181config BT_BAP_BROADCAST_SNK_COUNT
182	int "Basic Audio Broadcaster Sink count"
183	default 1
184	range 0 BT_ISO_MAX_BIG
185	help
186	  This option sets the number of broadcast sinks to support.
187	  One broadcast sink can receive multiple streams
188	  (up to BT_BAP_BROADCAST_SNK_STREAM_COUNT per broadcast sink).
189
190config BT_BAP_BROADCAST_SNK_STREAM_COUNT
191	int "Basic Audio Broadcast Sink Stream count"
192	depends on BT_BAP_BROADCAST_SNK_COUNT > 0
193	default 1
194	range 1 BT_ISO_MAX_CHAN if BT_ISO_MAX_CHAN < 31
195	range 1 31
196	help
197	  This option sets the maximum number of streams per broadcast sink
198	  to support.
199
200endif # BT_BAP_BROADCAST_SINK
201
202config BT_BAP_SCAN_DELEGATOR
203	bool "Basic Audio Profile Scan Delegator role support [EXPERIMENTAL]"
204	select EXPERIMENTAL
205	select BT_OBSERVER
206	select BT_EXT_ADV
207	select BT_PER_ADV_SYNC
208	select BT_ISO_SYNC_RECEIVER
209	help
210	  This option enables support for the Scan Delegator role and the
211	  Broadcast Audio Scan Service (BASS).
212
213if BT_BAP_SCAN_DELEGATOR
214
215config BT_BAP_SCAN_DELEGATOR_RECV_STATE_COUNT
216	int "Scan Delegator Receive State Count"
217	default 1
218	range 1 3
219	help
220	  Sets the number of receive state characteristics present on the
221	  server. Each characteristic may hold information to sync to a
222	  periodic advertise or a broadcast isochronous stream.
223
224config BT_BAP_SCAN_DELEGATOR_MAX_METADATA_LEN
225	int "Scan Delegator Maximum Metadata Length"
226	default 32
227	range 0 255
228	help
229	  The maximum metadata length support by the BASS server.
230
231config BT_BAP_SCAN_DELEGATOR_MAX_SUBGROUPS
232	int "Scan Delegator Maximum Number of Subgroups support"
233	default 1
234	range 0 31
235	help
236	  The maximum number of BIS subgroups supported.
237
238endif # BT_BAP_SCAN_DELEGATOR
239
240config BT_BAP_BROADCAST_ASSISTANT
241	bool "Basic Audio Profile Broadcast Assistant role support [EXPERIMENTAL]"
242	select EXPERIMENTAL
243	select BT_OBSERVER
244	select BT_EXT_ADV
245	select BT_PER_ADV_SYNC
246	select BT_ISO_SYNC_RECEIVER
247	select BT_GATT_CLIENT
248	select BT_GATT_AUTO_DISCOVER_CCC
249	select BT_GATT_AUTO_UPDATE_MTU
250	help
251	  This option enables support for the Broadcast Assistant role.
252
253if BT_BAP_BROADCAST_ASSISTANT
254
255config BT_BAP_BROADCAST_ASSISTANT_RECV_STATE_COUNT
256	int "Broadcast Assistant Max Receive State Count"
257	default 1
258	range 1 255
259	help
260	  Sets the number of maximum receive stat characteristics that will be
261	  discovered and ready to use. Each characteristic may hold information
262	  to sync to a periodic advertise or a broadcast isochronous stream.
263
264endif # BT_BAP_BROADCAST_ASSISTANT
265
266config BT_BAP_DEBUG_STREAM_DATA
267	bool "Bluetooth Audio Stream data debug"
268	depends on BT_BAP_STREAM_LOG_LEVEL_DBG
269	help
270	  Use this option to enable Bluetooth Audio Stream data debug logs for
271	  the Bluetooth Audio functionality. This will enable debug logs for all
272	  audio data received and sent.
273
274config BT_BAP_STREAM
275	# Virtual/hidden option
276	bool
277	default y if BT_ASCS || BT_BAP_UNICAST_CLIENT || \
278			BT_BAP_BROADCAST_SOURCE || BT_BAP_BROADCAST_SINK
279
280rsource "Kconfig.pacs"
281rsource "Kconfig.ascs"
282