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