From 4c86a5cc8d59618c97173dc225571f31e5ebc4fa Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Wed, 13 Nov 2024 16:19:41 +0100 Subject: [PATCH] Bluetooth: BAP: Depend on BT_PAC_{SNK,SRC} instead of select Modify ASCS and BAP Broadcast sink to depend on the PAC options instead of selecting them. Since Kconfig does not support "depends on X if Y", a select for PAC_{SRC,SNK} is used depending on ASCS_ASE_{SRC,SNK}. Signed-off-by: Emil Gydesen --- samples/bluetooth/bap_unicast_server/prj.conf | 2 ++ samples/bluetooth/cap_acceptor/prj.conf | 2 ++ samples/bluetooth/hap_ha/prj.conf | 2 ++ samples/bluetooth/tmap_peripheral/prj.conf | 2 ++ subsys/bluetooth/audio/Kconfig.ascs | 2 -- subsys/bluetooth/audio/Kconfig.bap | 5 +++-- subsys/bluetooth/audio/shell/audio.h | 6 +++--- tests/bluetooth/audio/ascs/prj.conf | 2 ++ tests/bluetooth/shell/audio.conf | 4 ++-- tests/bluetooth/tester/overlay-le-audio.conf | 2 ++ 10 files changed, 20 insertions(+), 9 deletions(-) diff --git a/samples/bluetooth/bap_unicast_server/prj.conf b/samples/bluetooth/bap_unicast_server/prj.conf index bc8bb687dab..566baa8e830 100644 --- a/samples/bluetooth/bap_unicast_server/prj.conf +++ b/samples/bluetooth/bap_unicast_server/prj.conf @@ -8,7 +8,9 @@ CONFIG_BT_GATT_CACHING=y CONFIG_BT_GATT_DYNAMIC_DB=y CONFIG_BT_BAP_UNICAST_SERVER=y CONFIG_BT_ASCS=y +CONFIG_BT_PAC_SNK=y CONFIG_BT_ASCS_MAX_ASE_SNK_COUNT=2 +CONFIG_BT_PAC_SRC=y CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT=1 CONFIG_BT_ISO_TX_BUF_COUNT=2 # Support an ISO channel per ASE diff --git a/samples/bluetooth/cap_acceptor/prj.conf b/samples/bluetooth/cap_acceptor/prj.conf index 15882dbd846..816ed1dcc9a 100644 --- a/samples/bluetooth/cap_acceptor/prj.conf +++ b/samples/bluetooth/cap_acceptor/prj.conf @@ -17,7 +17,9 @@ CONFIG_BT_ATT_PREPARE_COUNT=1 # Support an ISO channel per ASE CONFIG_BT_ASCS=y +CONFIG_BT_PAC_SNK=y CONFIG_BT_ASCS_MAX_ASE_SNK_COUNT=1 +CONFIG_BT_PAC_SRC=y CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT=1 # Support an ISO channel per ASE diff --git a/samples/bluetooth/hap_ha/prj.conf b/samples/bluetooth/hap_ha/prj.conf index 93d624a5095..72d21beaccb 100644 --- a/samples/bluetooth/hap_ha/prj.conf +++ b/samples/bluetooth/hap_ha/prj.conf @@ -22,7 +22,9 @@ CONFIG_BT_ATT_PREPARE_COUNT=1 CONFIG_BT_AUDIO=y CONFIG_BT_BAP_UNICAST_SERVER=y CONFIG_BT_ASCS=y +CONFIG_BT_PAC_SNK=y CONFIG_BT_ASCS_MAX_ASE_SNK_COUNT=1 +CONFIG_BT_PAC_SRC=y CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT=1 # Support an ISO channel per ASE CONFIG_BT_ISO_MAX_CHAN=2 diff --git a/samples/bluetooth/tmap_peripheral/prj.conf b/samples/bluetooth/tmap_peripheral/prj.conf index f37bb44f2c0..ebe30c75486 100644 --- a/samples/bluetooth/tmap_peripheral/prj.conf +++ b/samples/bluetooth/tmap_peripheral/prj.conf @@ -31,7 +31,9 @@ CONFIG_BT_MCC=y # Support an ISO channel per ASE CONFIG_BT_ASCS=y +CONFIG_BT_PAC_SNK=y CONFIG_BT_ASCS_MAX_ASE_SNK_COUNT=1 +CONFIG_BT_PAC_SRC=y CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT=1 # Support an ISO channel per ASE CONFIG_BT_ISO_MAX_CHAN=2 diff --git a/subsys/bluetooth/audio/Kconfig.ascs b/subsys/bluetooth/audio/Kconfig.ascs index 750c62730bc..21f05dd5200 100644 --- a/subsys/bluetooth/audio/Kconfig.ascs +++ b/subsys/bluetooth/audio/Kconfig.ascs @@ -30,11 +30,9 @@ config BT_ASCS_MAX_ASE_SRC_COUNT config BT_ASCS_ASE_SNK def_bool BT_ASCS_MAX_ASE_SNK_COUNT > 0 - select BT_PAC_SNK config BT_ASCS_ASE_SRC def_bool BT_ASCS_MAX_ASE_SRC_COUNT > 0 - select BT_PAC_SRC config BT_ASCS_MAX_ACTIVE_ASES int "Number of simultaneously supported ASE sessions" diff --git a/subsys/bluetooth/audio/Kconfig.bap b/subsys/bluetooth/audio/Kconfig.bap index 6180f4d818a..c24849c6b2b 100644 --- a/subsys/bluetooth/audio/Kconfig.bap +++ b/subsys/bluetooth/audio/Kconfig.bap @@ -16,8 +16,9 @@ config BT_BAP_UNICAST_SERVER depends on BT_PERIPHERAL depends on BT_ISO_PERIPHERAL depends on BT_ASCS - depends on BT_PACS depends on BT_BONDABLE + select BT_PAC_SRC if BT_ASCS_ASE_SNK + select BT_PAC_SNK if BT_ASCS_ASE_SRC help This option enables support for Bluetooth Unicast Audio Server using Isochronous channels. @@ -159,7 +160,7 @@ endif # BT_BAP_BROADCAST_SOURCE config BT_BAP_BROADCAST_SINK bool "Bluetooth Broadcast Sink Audio Support" depends on BT_ISO_SYNC_RECEIVER - select BT_PAC_SNK + depends on BT_PAC_SNK depends on BT_PERIPHERAL depends on BT_BAP_SCAN_DELEGATOR help diff --git a/subsys/bluetooth/audio/shell/audio.h b/subsys/bluetooth/audio/shell/audio.h index 97478158324..a02724bd75f 100644 --- a/subsys/bluetooth/audio/shell/audio.h +++ b/subsys/bluetooth/audio/shell/audio.h @@ -196,9 +196,9 @@ struct broadcast_sink { #if defined(CONFIG_BT_BAP_UNICAST) #define UNICAST_SERVER_STREAM_COUNT \ - COND_CODE_1(CONFIG_BT_ASCS, \ - (CONFIG_BT_ASCS_MAX_ASE_SNK_COUNT + CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT), \ - (0)) + COND_CODE_1(CONFIG_BT_ASCS_ASE_SRC, (CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT), (0)) + \ + COND_CODE_1(CONFIG_BT_ASCS_ASE_SNK, (CONFIG_BT_ASCS_MAX_ASE_SNK_COUNT), (0)) + #define UNICAST_CLIENT_STREAM_COUNT \ COND_CODE_1(CONFIG_BT_BAP_UNICAST_CLIENT, \ (CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT + \ diff --git a/tests/bluetooth/audio/ascs/prj.conf b/tests/bluetooth/audio/ascs/prj.conf index 83cedefe0e5..84b05139ed0 100644 --- a/tests/bluetooth/audio/ascs/prj.conf +++ b/tests/bluetooth/audio/ascs/prj.conf @@ -10,7 +10,9 @@ CONFIG_BT_GATT_CACHING=y CONFIG_BT_GATT_DYNAMIC_DB=y CONFIG_BT_AUDIO=y CONFIG_BT_ASCS=y +CONFIG_BT_PAC_SNK=y CONFIG_BT_ASCS_MAX_ASE_SNK_COUNT=2 +CONFIG_BT_PAC_SRC=y CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT=2 CONFIG_BT_ASCS_MAX_ACTIVE_ASES=1 CONFIG_BT_BAP_UNICAST_SERVER=y diff --git a/tests/bluetooth/shell/audio.conf b/tests/bluetooth/shell/audio.conf index 78bdd8575a2..b50446e99fc 100644 --- a/tests/bluetooth/shell/audio.conf +++ b/tests/bluetooth/shell/audio.conf @@ -67,8 +67,6 @@ CONFIG_BT_ISO_RX_MTU=310 CONFIG_BT_AUDIO=y CONFIG_BT_BAP_UNICAST_SERVER=y -CONFIG_BT_ASCS_MAX_ASE_SNK_COUNT=2 -CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT=2 CONFIG_BT_BAP_UNICAST_CLIENT=y CONFIG_BT_BAP_UNICAST_CLIENT_GROUP_STREAM_COUNT=4 @@ -79,7 +77,9 @@ CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE=255 CONFIG_BT_AUDIO_CODEC_CAP_MAX_METADATA_SIZE=255 CONFIG_BT_ASCS=y +CONFIG_BT_PAC_SNK=y CONFIG_BT_ASCS_MAX_ASE_SNK_COUNT=2 +CONFIG_BT_PAC_SRC=y CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT=2 CONFIG_BT_BAP_BROADCAST_SOURCE=y CONFIG_BT_BAP_BROADCAST_SRC_SUBGROUP_COUNT=4 diff --git a/tests/bluetooth/tester/overlay-le-audio.conf b/tests/bluetooth/tester/overlay-le-audio.conf index c82b799e56e..44d476f968e 100644 --- a/tests/bluetooth/tester/overlay-le-audio.conf +++ b/tests/bluetooth/tester/overlay-le-audio.conf @@ -69,7 +69,9 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255 # ASCS CONFIG_BT_ASCS=y +CONFIG_BT_PAC_SNK=y CONFIG_BT_ASCS_MAX_ASE_SNK_COUNT=2 +CONFIG_BT_PAC_SRC=y CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT=2 # Support an ISO channel per ASE