From patchwork Tue Jul 16 14:21:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 812892 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013033.outbound.protection.outlook.com [52.101.67.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80A6119B3D1 for ; Tue, 16 Jul 2024 14:22:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.33 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721139742; cv=fail; b=Fg5mbdSF6TINPCcBFuHvYN6TxQWau9XNLlDWWKijo86N7UXFAEF1mx+PbOHbZ0uJSQKwGrLNXT/RAMmqjq9r3RZGQxVhJ6N+s0dXrf5lndymfZd2subPcDLMbtdlrbJfUnIIo7QQ+Grp0Ae2DRJgGSWCRci7GueHStWAicilDDQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721139742; c=relaxed/simple; bh=IB072IM0FxWIKeRlt5J+Y4R8zII/dlrQb1FAnhJYdtU=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=KgRB9xHDpBwBYR6SCWrXG32p9kK9jzfXfAz7+7io8M2FNcsvBPVnKC6MtJdnMpkxSZIiz+Qna336wauMj+QXid2muTWipdSU1RPTCUAqdHBUd9IbRA158i6zuSxg6CN/pvGFCBZoti2+Vl0/cRCZtxWQt9KNKVPoluENl57HnfE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=mRn5+gr2; arc=fail smtp.client-ip=52.101.67.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="mRn5+gr2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WGLkktZ9WAg5Qslo2MJjG2PQBFq3gW7yYTVEFh3Btg61DqWJvrAKDyXtmeud8ITFgFE3w2xlr5WzOLbAl2eyFlgPaPP9O1KOxHv5oL7ErPEzrXuQjzWJXqx6KXXDWphr0tbGAfsHI98JixhUbSHywx2pCYkf71LInWR+ce35dU2Rf1pfXPCD7lHNPUYmxN9KfG/orzDnXErQ3p8UjRs3EJvB741YtDUFbaCIH13uK/ZWDl9hCfS1+IggJGEHgwHG0YaYVwGFS+9UMKy8NORjs4m8Z4c+UoRJvNIuZOL+HDIcQgo0R0FYNzJL8Bz2gNhh0LES8MAmqDXplcq15rC8bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CeCpoOsqTfW7SWK2PEStvP7SqG/2Ifnk02U9MhHcRl4=; b=sxvvObR1H8wVxmEYQ06AzpY3pQOoxK4DElOCiCSVdwyDXcQp7TpbfiF1zvt3xdXVFJCxMlaglngljjrSfE3wWzaV2T8Y+DDP03FgRf2kW7h7utIdHkIf3tbZ/WBsqOtfXOxRsdoMWidspGKI9JGIIA9/21lLwK/ljUHCJ+V7E6ym7QWqaZxc+MrHjncdMJn642HKx8cR5XiZquWwZlSjsQMoSK70wEa5SVWXRgi8xy4CpkrmW5uN73lvFoT2gQIQpbqJap5tE4/8Gzo33C23i+zXjmeWocrYH0d8/8XfeF7t15FVjIXsrJG8WnMdQaZiSNNdQMxxBJyw2pUEDYjzXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CeCpoOsqTfW7SWK2PEStvP7SqG/2Ifnk02U9MhHcRl4=; b=mRn5+gr2DyuMa3/jhC0mtlhVlOHDTm8clqvaydkePZcQdqpzQSd0UaPz7JzMBSdITRe2pqzDUCb8hh1LRFUZIW/7LS4C8H+u/kKoySvVEJOacGkNgRaZhZZaJsV4wY2AZ8EovGwOvXyqHLe+PO9ssuH4T3sym6e+ZnkweISalUE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by AM7PR04MB6789.eurprd04.prod.outlook.com (2603:10a6:20b:107::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Tue, 16 Jul 2024 14:22:17 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654%4]) with mapi id 15.20.7762.027; Tue, 16 Jul 2024 14:22:17 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 00/10] Initial implementation of BAP Broadcast Assistant Date: Tue, 16 Jul 2024 17:21:57 +0300 Message-Id: <20240716142207.4298-1-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 X-ClientProxiedBy: AM0PR04CA0129.eurprd04.prod.outlook.com (2603:10a6:208:55::34) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|AM7PR04MB6789:EE_ X-MS-Office365-Filtering-Correlation-Id: a6621d91-e279-40fe-361b-08dca5a2b246 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: KE1ykW/DFpVA+Z40ydfSQy1rva+Q7Ezeej7dHddQ0C3yaWmk/0R4KmLV1UNJaoaIPMb0UKowqGFfwygT0miYtykfDV/ankJlJ/RqsRM3+dIK3H/Pg4ZwvEvtGapTDwXR19MgyoKzYIyauS+bq32+VRcRZA2ze3h/nQkOAVOEbaEAm8vzyfqNhDmBfliZkb2BI/Bs2HnW9CdhhNsSSbkRlT/kptw73J8Lw3b1oIORoAQYq32A861E03iDo3k4Y6G9gMqMFWCJZqsvXhbSk5B3OQ2Plp9/9rhgOAkW6LiSC9gn2XMRWutZYLcXCPRM5KvY1RqzWozh0BrUF24uHhiPW/y0VpXbxQ6+DBHWoSMlt16aU15iMXaBXJ+NklJEWzuhjGFrvL9bM8xFRdUeYfX5HH3i4nFifK9QJEHApHJq3T5UhUgeW46seepZk5cKX4COdu2sOFoAjZBH7VYrSKfm2X75xuwsq6NhmyO221vPbUJl0PKDsEL8bp9QTG7D4cTInCARIVOCr1xXrQShr1hGhPVC/oUvGi+Hhi7XQ9NrK+szxRstOegCoYnbe0SadT4JWLwosirIunlAVyRZWQJ8oCdpySKqo2UVyF2+FK5vSFRLv1bpE1+U1vVCPCPYODwhcFlMI6KLlO5sM10q1DrymdKmpRUisyRSbKP8aVO5kq4f/UsbGCepd+ubo02RtL3o0c2nAr10F3lDX8tLyv3TJazu9d5q17pHMPhpJzhNRIKCuEynZy9oG7RR3I97Q+U5pqilom98iPlzwDJWYxmr0NBwHtjJhoqojZAqcCe1hA4BsVBmb8TpAj2T51AD8rAW3LS5rrgnXvWBWtv3OO2zznquH3GOd9kLnA2TYSY19aIeuYarL3JPUC32O7Zur+/GkLe2CbjKn1/HfbPvgTosRd2frx9J/EKxOl05V7ZEEwCZ/qljCvgB1Q1fRRrodNuabsB2qIXYHveVupy0jyM0oz/vtzDeOv74MRqX2rqfGbHB7Mu0RBiunr4o4K3+93KtnMEgx05gtaL9MfHOCsnQNYH/kLRfcA1p2L1k3193RxzHc4afg+KY/VajsibMvtDrNkgUCo9k7x6tPUwtUN1BZOhIpIRnaoOB9+6DCa/yU2d10UPGBlEN8KTzggA9kswYof2mowsEfIOZJSAhnY2LqZdVgPqLQj38rQ8eWSO9V0NCvBOVY2BTW2+I6XzL4hm0JQJWAZ+3D25ViXpfDQfi3XSyJO6vB77/MsQiL34qp500kLh5x+CTSqxKFnHcks2/6RSbBSZwNQEzDj7ue4hH9l3XBEk/yvINoY+K6ztiyJrhFWUznzmwpfdB1GwI0E75AeSJG9Vb1OibLZMIWcs5mg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8898.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Y0JQOVB+JJYut/b7/5oJCLiacAo9g8HD9L2GT0GDczKDHFF/ZhYhZby8GYI0pJYMOH0sHDHjwWsrzv1YlnmR7fITpod+s+z8+p5eLt/2kAnGTCC2bzUngOpbbKkMrm0Tooltm51oPq4m8EhwPPzdjMtj/M1RoJlj2I5yPpNySbg/krJF3a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/eWajmo23kPNfrMbzhGn6DrgLOcCTYhdj/2MjY+koAcAZViPCSeOoGvEs6c6Zf8IdT6rRWUlh/1rC+7RAxGJdx3NOKU2qhFZpIketOpIUuDjMrWjXsuV8ihc5RvjIWg6QdlZkfhBaiRG67p7HFpc36oQc9p+XzWJd+GPTbq3BQe+eVX/1nLsDeT/Sprl0SDMA7phTgdmRNQxkhirCgDovvZV3Qvi5yxALQifTtZlpGVIifQjHFL/7u7gY31BSE84XGVf+iAkKplp4biVPCk0KHs+gFluw3vQzJ3gjBESpJTTqZU+SOBpm0LuD2uSbnpDxAjJndBy6/xGWg4B1EApdROhzxdQLdOAOwrOqxv439A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6621d91-e279-40fe-361b-08dca5a2b246 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2024 14:22:17.5396 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9K4Pn6GRi1pgDSnrQ3jahJFdYtU7kqnLUChDwuS95kHqaFwqx2xV9DOEFdYSW9qa7M3W9PpScSQXvi6g5Zvvqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6789 This patch adds an initial implementation of the BAP Broadcast Assistant role. The core implementation resides in the BASS plugin (the BAP Broadcast Assistant is a BASS Client). The BAP plugin implements the callback to probe Broadcast Sources and parse the BASE. Information about each detected stream is notified to the BASS plugin, which will compare stream audio capabilities with the capabilities supported by the peer Scan Delegator (discovered by reading the Sink PAC characteristic). For each match, the BASS plugin registers a MediaAssistant DBus object. The MediaAssistant methods will be implemented in a following patch. This patch also introduces the assistant submenu in bluetoothctl, to enumerate MediaAssistant objects as they are created. Commands that the user can call on a MediaAssistant object will be implemented in a following patch. Below is a bluetoothctl log which demonstrates a Broadcast Assistant connecting to a Scan Delegator, scanning a Broadcast Source and enumerating MediaAssistant objects: client/bluetoothctl [bluetooth]# [CHG] Controller 00:60:37:31:7E:3F Pairable: yes [bluetooth]# AdvertisementMonitor path registered [bluetooth]# scan on [bluetooth]# [NEW] Device 00:60:37:94:A6:A3 00-60-37-94-A6-A3 [bluetooth]# connect 00:60:37:94:A6:A3 Attempting to connect to 00:60:37:94:A6:A3 [CHG] Device 00:60:37:94:A6:A3 Connected: yes [00-60-37-94-A6-A3]# Connection successful [00-60-37-94-A6-A3]# [NEW] Device 15:65:78:B6:52:F6 15-65-78-B6-52-F6 [00-60-37-94-A6-A3]# [NEW] Assistant /org/bluez/hci0/src_15_65_78_B6_52_F6/dev_00_60_37_94_A6_A3/bis1 [00-60-37-94-A6-A3]# [NEW] Assistant /org/bluez/hci0/src_15_65_78_B6_52_F6/dev_00_60_37_94_A6_A3/bis2 [00-60-37-94-A6-A3]# scan off [00-60-37-94-A6-A3]# Diovery stopped [00-60-37-94-A6-A3]# disconnect Attempting to disconnect from 00:60:37:94:A6:A3 [00-60-37-94-A6-A3]# Successful disconnected [CHG] Device 00:60:37:94:A6:A3 Connected: no [bluetooth]# [DEL] Assistant /org/bluez/hci0/src_15_65_78_B6_52_F6/dev_00_60_37_94_A6_A3/bis1 [bluetooth]# [DEL] Assistant /org/bluez/hci0/src_15_65_78_B6_52_F6/dev_00_60_37_94_A6_A3/bis2 Iulia Tanasescu (10): shared/bap: Add separate API to merge caps shared/bap: Update bt_bap_verify_bis to receive caps shared/bap: Remove unused param from bt_bap_verify_bis shared/bap: Allow checking bis caps against peer caps shared/bap: Append bcast sink pacs to Sink PAC char bap: Add API to get bt_bap matching device shared/bass: Add API to get GATT client reference bass: Register MediaAssistant objects bap: Notify scanned BISes to BASS client: Add assistant submenu Makefile.plugins | 4 +- Makefile.tools | 3 +- client/assistant.c | 164 +++++++++++++++++++++++++++ client/assistant.h | 13 +++ client/main.c | 5 +- profiles/audio/bap.c | 40 ++++++- profiles/audio/bap.h | 10 ++ profiles/audio/bass.c | 257 ++++++++++++++++++++++++++++++++++++++++++ profiles/audio/bass.h | 13 +++ src/shared/bap.c | 59 ++++++---- src/shared/bap.h | 9 +- src/shared/bass.c | 8 ++ src/shared/bass.h | 1 + unit/test-bap.c | 13 +-- 14 files changed, 555 insertions(+), 44 deletions(-) create mode 100644 client/assistant.c create mode 100644 client/assistant.h create mode 100644 profiles/audio/bap.h create mode 100644 profiles/audio/bass.h base-commit: 73266377b0185c56c921b8cece257df428612d73