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