From patchwork Wed Mar 20 14:41:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 781387 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2084.outbound.protection.outlook.com [40.107.13.84]) (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 D6B1947F78 for ; Wed, 20 Mar 2024 14:42:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.13.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710945763; cv=fail; b=lDmH47XW8eMPrv81K1Jlk1t23COZubXLx/F2U7w6YlwAiynNexV+gysBwIp6icEcHQk2C7mHsUGWAP0aa/QxlbcMnx5N0/aCJQ7r3tiia8t++iKXjS8G/b+dQWoB//nNds0m/B3U0qFtmz+D8ofrI8DK943Xjly16OPgWcm3hCo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710945763; c=relaxed/simple; bh=iyrL9TJEnXdJXQSjbEE6i1yCIe7EPfvrMzuB+cpbFJ0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ntF9opYApxSWiSkvaNjsYuQ4+TKzNd9NxRy7vidFkqSfWtTqHN2qDoO4DCHzLX+PJj5kLzxBSvDlFrN/Q0LK7KTVB9nopoA6jianSkhcUJJ7SXLfyPdGUQmRxH3gxK7Ep2oxVigZhdFEIdULuAYSQ8r+7OWAoDnwYIeqW4BFUVU= 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=XHb5Fx0s; arc=fail smtp.client-ip=40.107.13.84 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="XHb5Fx0s" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EElLi3P0H9rDJwYY9irgsniYiiGSqjp+eO1pI3pF6dHyigzOIIMjh+uTZ4qpytO3yFV1UqcbSxt78gN3GS4ZBNHEvvTKeA9aBEl5eD9Qfi7/L7DTMzXH0+75vvX68bWm1WREaC2AZuIAD2N4Pi/ioJT+irGS04x9YHTeuCpKUAm7hzZ+2D+kM3kLTspoi2H5im9tBFny0C+9t3Cb4qxreTrkQf7nj9w4NEpBPY5gpss8ME44s2vSy5tzXd2gA87x755cOuvkguA2yWW/2ASmYVEHUiMJ8zg2yl4l6Cmlh89+0y7vQbhuw/5EBzOc5Xc5MsCCdH8kj5v4U+990zhcrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=kk2DlPY77Fp7NC7UCmAgs8dDq9nVBBDKl7lHQw4igvA=; b=LdB7YvggoXXyLasTHKps3ZRtIxwV5UNv+SKUqAO++MEKEQBaxKGfip8/jfc4FMGWGg77jaw+gjm5lMDMB5GJC0aJlnYGps1DHIAqm+/v/ynaq24M+Ee47htd/sYgwtOB732TyQ8V1bH/pvJsq3uo0ecL9E//q3QF/jaEu4rJ4+hq380OflCROZHWM7XXZoDaWgwGbKQ5bihAyhybHOO02N8d7fHtyTsFP3U6Oxv3wUtojHs8XCVQnEwEMy2B+8kRlW2WgfDp9fenYiiZ7sgaaIt3qrr5rpj4MYjYrP3wPiRX+97oI0QVI7jPyhaVwcrwt3t1c5pW8u+wZCic0tkVPQ== 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=kk2DlPY77Fp7NC7UCmAgs8dDq9nVBBDKl7lHQw4igvA=; b=XHb5Fx0s3xmDT9bvxOFVhxT0J7otzhE1i0Hs7HfY/cr5/MNyA57uSAtACTvn6MpTdH4K6zyN6UURMUC6m4+2t8rliJDenXbc3K/UeIUSmge+yIpoivjaXYgJWRypkoSBT9qqK1uHtbqheq7KD8MU4mopgEb2mLEisHXMfgnZdIc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by PAXPR04MB8797.eurprd04.prod.outlook.com (2603:10a6:102:20c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.25; Wed, 20 Mar 2024 14:42:38 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::7bc8:c6eb:cb72:91cf]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::7bc8:c6eb:cb72:91cf%5]) with mapi id 15.20.7386.025; Wed, 20 Mar 2024 14:42:38 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ 1/2] bap: Add bcast source support for MediaEndpoint Codec Date: Wed, 20 Mar 2024 16:41:52 +0200 Message-Id: <20240320144153.46408-2-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240320144153.46408-1-silviu.barbulescu@nxp.com> References: <20240320144153.46408-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AS4PR09CA0018.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::6) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) 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: VI1PR04MB10073:EE_|PAXPR04MB8797:EE_ X-MS-Office365-Filtering-Correlation-Id: 7885ece7-e2bd-4836-c62e-08dc48ebfd22 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7V4uABTBZIVBZ1JfHVN9t0WjtxYGdIbwYFMHIYBMbKv5RsFcXXhQuj9ASTC+jTAR2GK/ovmJBs0vbda2OPtTIXLP8bF4FtVD1m3ITyQ2y6tjZZjY2i6c8yx7G3ybcqVuAA5xbBOyqxYfhlM3mZ0IVPBXMww3zTCjKRyiUs4wjfGUcBgY+q3ldv1oP0cTmEt5VO+IGnEQPTjUNl+fBhL2yRl9WxqvohLw0/xk+JFcmH2RUpYRcVpBc3hcfTuyl2attWQ38N/PUXnbPyVZ/pHvffoM+V+RKTT7hQhxv3Y+6yQjHuQYvvJOZLbg9mTlgTOkOH4n6aVihfSXghMNRoAE4UCP9z59Slnddl9CJRkqvI4WIcRYwrmWEMZ/z67/mV1VvXNzV7PcMUYd2lvNh8VwBFOq0HtnoMxcplgwtJHrWPhKVmt80MFfXVUS/MntujZ+d+bQ2a8n6POu5GIgvbUHTo8TLdbS+XL0yLblRSCTDTfnSdUvxkePri0C9/cm6N+EFabA3/45ypGGsgKieP+GfcepVy+gmDJ5tkMl75RPfI6PMxwstv6/wWgIbuXuOVSsnyJWZx4AvV1Bv9iMIK/33jlqOzmkf9kPijtSqeLHHFqeTz/gUjlDK1TMIva7DZ5RGgpTaDS2MQyOP5OmJfEIv7K/TSPjNh62wg4As+L53lU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB10073.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(1800799015)(366007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fCEyY6H0ABk+B/TL37i/mzOfuV9kchfbL7wjEu92cZNW1858J+nuuLoLD4iJ6PLebP+P4MArPR6Fb6N9XLEl6gQXVPLfL8p5Rin1ShnN8v66dApr0BR9kOuU4D+vbHjxqTJJjIkBS048QnNWo1/xyEmesAMOCTr7S/kEVsPuGffhpllIT6ACSUmPXZvo3UfxkqyW+3uP6sMdkTXHAdfZ211iSkD2IrLNUg0/Yg8ggQnu07DI0pQ6p0SHUdSkJToAEVRP5vlZSwJObnejc6cBq//Bh4HIAe97jVJ8InhvVo/Ulhjyg2G6RLS1eqQdPnJ9zT/yJeUlL5H6xEptE/pX0BLQE1flEizoWn3mi+iNb2Oq1jvSjV//AJl7BVfHSWMijPcEh5R+SGa+bfqEeZ9gyuFZiFIKRhioUx0Z+8g8+ircNlmZBOqVnKa8neLk4GSYdYmOJ3J3abqhEVsMQ47Px3Jomq2YR8cfymSiHwp6hrIx9hCAOzUovCM7ujWCwx/yBRrYHEIjaNZaxi+vCQcKDDni44AxSl5osgMzunHZoBWpg6O1VrHyfQbpyRt7ORmvvxtThs7c16aOZ0lU4DWLASlzCdq80o9t6m2l52T5mPQwyrbSutYSUMGMgERefHOQVCqMtzpQIFpetBteSlu7GmuhfnXQbdgvUSjNoxSLBIFD6ZLoQG7VjYwCubQVcwNA/fHSd6Y1eB0pIujQST4XXS2bZHKPi3aAxHS+2cxZNYoFmmRU+KhcM44/i8xryv3Il9ymic3BjonZ8zjv4vqKi+Tpk7ApNkE8x2ANeCJtxFxw3goyka5gHRn9VfEd5C7namzFhpDWG35RpHz7fInf5OQncuFU6nLm4bdeJuOXcz3Ii/qN5QuJVTgkvc6Cnh0qzh1M7/KL7wq1+awWW8IwpW2avBTIlWcjuJ60XJt6sK2ac4Ul7IaHmbMH4yUwV0q/4YWbZNjjpl+01+GmBPk7eMZClpDmz4TTEVyiTIXURXaxjMY9V3uL6Jyse2Pl9UzhqYozJ+q6oori+Mb3AYtePAB2enmsVW4thmciJ2hwPDexXlhxeLeeFwC5QFZNav2ETNY/wDBwPk11whQ/IgIYAaDUmH9DhsXiTAjC6kRQh20Bdc1DNEGzWPO2AGD/F0IloATcWcWyPpKP0DZqWmT6n1CuHweWIDpW1Ez5+aD6LDj3eF9Pl53NYHoHufSwBY+oz2OJpVic/QMwXhZCZxBOtrlaOaFjjeViaYezMwP0Qk7n/09dfRU070whWp/QI8VoJMWAks5Uza5NwjWm04SgTKYweaZiDkeXRMKZdD93kNNxfy3VjfVJH3htt6HAFywjf8pe6G7bUL0nZpOyezC/4xANi+TOKjVqlfpzYMjL+UP1wdG1tQYixGBhoLo7m0ZnCOlEaLM6iWlkLBUWKUcF1stmVQiwzVHngvhVzCAiem3DmOhx2tPRkn8zENOnO+Y1r/2qT9ZkfV/5Z8k1tMueWVIedLJjX6pdltXApOsDO7j9xju9xEitD5SH2xzR1a43KL3ewQT+wtEq+/AKySi9H/IOGa06QDPgW2+R0DgVW4gvNShC7O+EezTVws0Zdp12wV69oNvGdnYDqm3vUPhtAQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7885ece7-e2bd-4836-c62e-08dc48ebfd22 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2024 14:42:38.2122 (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: CCpY41bKmzAgHzN0F+EtG4ZhCsA1FKhYCRZM98aEFmHOcj2fjXydWyYGzth/mD4y10J+FGTHBD5PNRSAz/FL3G3C3S2z8zrRCCK5zsRKBrM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8797 MediaEndpoint property Codec returns 0 for the broadcast source endpoint --- profiles/audio/bap.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 964ba9c21..3ab13a51e 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -277,7 +277,13 @@ static gboolean get_codec(const GDBusPropertyTable *property, struct bap_ep *ep = data; uint8_t codec; - bt_bap_pac_get_codec(ep->rpac, &codec, NULL, NULL); + /* For broadcast source, rpac is null so the codec + * is retrieved from the lpac + */ + if (ep->rpac == NULL) + bt_bap_pac_get_codec(ep->lpac, &codec, NULL, NULL); + else + bt_bap_pac_get_codec(ep->rpac, &codec, NULL, NULL); dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, &codec); From patchwork Wed Mar 20 14:41:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 781898 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2084.outbound.protection.outlook.com [40.107.13.84]) (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 38C01481A6 for ; Wed, 20 Mar 2024 14:42:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.13.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710945766; cv=fail; b=Q84Yu6uZr+r1huCrnd+4NfrJXbt0NncboE1OFvUlNhRrLR7Mxxs2IrUJ7R+93piC9lvJq2prRYH/gQfi6R6gxREYj3UfUlCYTVwVeOq+TgZX20CagI8qjsUUHR4fU+G4Hx+iO74WoDSBvfpDjteFQX5578fgJs4XJcYnvq73rJA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710945766; c=relaxed/simple; bh=ig7zUv0/RG4x5AvLsqYkjwcSygU9Jxgx24RxTBUUT2A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=UrDWai49ShrQhSD6ih1EU25VkQWZdrydoeoYLbXR67KXRlOqcoo2NQU3O/WBIX7X8r/tZZlgpdVO/mAndfBDO+3g6TFMbBYos5B7GN/iW1JtRSywLzcinRS3sQxxWoCbWcG1qV4nHqRoY0M3eISsc4/K2IVohOGrKDIoD+Z3/Do= 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=TIHbLTVr; arc=fail smtp.client-ip=40.107.13.84 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="TIHbLTVr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e2t3GyJqj+IDghlYzzaSa6G92Q0FkcNAoF8rzuxNf3DHQboLEpV9WuIbiI6H0SQhwiDNub91pDP1fbTsZnAKOm0l+GshamKb2wzcyY5FWZvcaLCsk+ZsrqgwuTen6QSf7JUboQ3Wa3TnpAtAsxlv8rAVJIkyA0MYfTfyAMNqIp8QCufXKYfWS36Kq0YyKor6Hsl1QmQS9rgig6emVGoHA8GI/kNQ9I1OIY47Y1Wl531rLPRZVSH+UTS9ITC3nmhui4ZS0V68ajGbe0XEq3ZzgYYswmBIyCU4kUWIJ8KLkQ064JoVJV05ooG8Je3i47MXvxcxp2ERBJ8iaMGvfGzOyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=VvL1N8TfC0FdQQ7dm1THQHUouWdD/UKkYi8/uhTYU5Q=; b=oSPD3fvDWk4ZcCCi2rKWVyv2z1yKjlggqTwzvUwfr8dp3Az9c3CXJyaTkASrMoYaXYCAtYg72rarzy7hEucII0s3BkKkPnAy6ZGi0nqyIi7L810OtW4Fpw1XY/QqhOV+JoZGSW+RwJ7RpjNSQgkPuLvTW4kW1yKOScJt2NSBskwgHmxsM9EQX+r5vuktahR90wWWoU5jjvAiUJ1Af7lYMoQflyrqhqaI9yaAzN64bNBG/VaBtZkzpZXDnjE/UakA6Zx66u8o6BPoIUDs+Yzqx+VwxBnRsYDpjLem5Y0+tijatRC7Dr1OJNbzYOl1WT8WlRBLBJj3mmzQHgRU8weOug== 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=VvL1N8TfC0FdQQ7dm1THQHUouWdD/UKkYi8/uhTYU5Q=; b=TIHbLTVrgP6kK+bZEI2lJRxbdWXSYUVanxtnOEf2P9efpWFoGGh8yEc6RAHes9vExRkqNimJHUQ9RqHCC+6t6t+Bgetmcl5WagypfzU4l4MCcETjUfHPCMMGnE8bKULh0mzkF1LXQ2KiBnbahwRx8BrwWFp85a9EiG5Jzd4kG6s= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by PAXPR04MB8797.eurprd04.prod.outlook.com (2603:10a6:102:20c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.25; Wed, 20 Mar 2024 14:42:40 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::7bc8:c6eb:cb72:91cf]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::7bc8:c6eb:cb72:91cf%5]) with mapi id 15.20.7386.025; Wed, 20 Mar 2024 14:42:40 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ 2/2] player: Allow endpoint config without local endpoint argument Date: Wed, 20 Mar 2024 16:41:53 +0200 Message-Id: <20240320144153.46408-3-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240320144153.46408-1-silviu.barbulescu@nxp.com> References: <20240320144153.46408-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AS4PR09CA0022.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::14) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) 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: VI1PR04MB10073:EE_|PAXPR04MB8797:EE_ X-MS-Office365-Filtering-Correlation-Id: 559e1ab2-cb9d-447f-2c3f-08dc48ebfe86 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xDMwTTA0pq1J/w1WVd4WAUn2wY5CwltNLXn3sW8/9qKvxiE6BZA0r9OSnCwbOM07LvZDNxBsXj2TV/vrUu0V0tA72kzNX96PEeShH1E1BGm5ZxgxvlLii1pequV2/SANqzpQCU9s61Qfvny8Y02qJ9/sqoKdtbgjXvsjBzjjr8g8N1um7R/3qj8pb95Q6RVgVmuyWR6XuB0LtU/CAONgAGDOlY3vgGf0k7XK9XyMpnLs0J9l4TCSwTncahp+RMT8n2f9oz4X6KXAVqhtcOUc6a6O9Lt/dHTVvI9/6nDFl1JaF+WngNIH3Aam/W3Hss778E63WP+WEeNFXiJkFg1WBgfC/F9gXMV5ZAO+UMj1GltKqV04KMDB23VyvW96mxwJw3RbrAbfZ6haJb18CkvV8kZiBMQBVR6mtV7pOELMitz5QhjQoyYpqYOsNBY9T8ogisFyQejVnzIu5tlndpMJ90p1Wb/CP+4LV0jiUdeoU/LImUkF9KKKqlQkSoKVo+Qsl84XvxZH0yGV2a4OzyHSp82lmkOeAmU3xX/bdCPyh8OWjd24JiFK0HftL+wNvI3+QASCndNqZGt5Y6WxaYmyqbw7qJ+B9k4b+qBJkzKwnKAxw8cnp7yL651wjTvjgdjymy4sH/6i0HHY4L7r/jczBbxONc4puzO9MescNJaJpeg= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB10073.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(1800799015)(366007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: w3trSEcNgA4KiBGwLBTJEz1W+ME2smOOb0azwbHOoQYAU0MdCe2+c030IqGuf43PoZJrPQoPniuysZtpIXWFUmrhLKkI1UoZRHIuD0B8J/s350dbHDR5TH1onYGWDpe6QVp6BxIqCFimzqnVXi18XuvFUAkHsuCXsmVf1R/wtFL54M4pMla82rmxTIV+ji16wmwW37QvKrGcOqRhcfTJCWIqOHJGbY+gDYOsNmsWscFPhWf4EDJdOZYly3TWuVMe8lEVXn4z1LH4Zk39XZZcr9lExfn+8Vx6iBDuNwrt8kKfzNr4eN/C22Sw31PTgyiw/PElY7k4x63J4wPS7rDcVx1XSHriJRClgZ6kK08zc7GOdAW8X/WkM/gXRx9soSPWwAe4+X42qOFq6LvG0idfdkb+s03PNbIEYffXs2y2Bu2fyNLJF2jro7LDEtki17dRdvmVo88DRN/L1SYMIwzD3Zo1tIISUVmqFDSPENKFQqV5QGNIqwBfeR/ckDagmQPBIwKslmHqlJj64lOZiAAKMb+zTueXZVtZRuwTZzmdz+PoY5407bUQJ0lujTXn3uI9bYI8vpXCDs3gWyU48pBqwGzFse7m2Pt1jZz2nPWeCzBKpqgIbUIvf/XGWWf8lP/TxASg9eApF7c1GnXvqGx4UksJa0JOEhfEuVhP8/dwMsSEa4EO5LAUTaJ8FSXcLnySdefKTu4Xjk17w88gKWSl7jatHxs0ksOn3g+WbP+ikx8fwyrDzmOXgZEF9Uhlyd90Omvc+L5NOrGui+Qmq9lqL/WsRIs0BrDBo9ixB3uDJOKeZ9I4N5XLKCVR91slux8FX41vI/VHBHO2rAouH1f3oH0UrVPIDmlBQriwpvuoxzRTDsjuy1CBHY+KPLkooYmM9dXM822th2gIA5VM26OGAJjZKpIiZ6wR7fqHUUHKz7NoBWEzxEjOCaDG+tjuXN1/lHrOsxXeKjXKjBYJ3j5XvY33FlewPj3VhV4pLLLDggvIGIEjrgtfasc39yQdDX43Am/mQo4sua9giqEleKQ8bIzaADbj+ZIW63GS3G5IqPsSAqL7I/wic8Wi0UzzRyNf2KSisB6Bje++LiaVE4twZhz2L57bEZYXW4uOkjpriJer9fG717NxDIdf8cN7bI3j+yjqoADsWbjAWAcPvQEKlMjNSsrXQp6+21Gq9/AiGdmXcsk+NB5bP+Am4vbt5yjMCf8TOdRXoenNUwzB0BqCuGCx6YgDYxVwa5fbD9CfCxHqucw5DWJ9c3gDryS7lrtfueV9F3mJImNIisXl7NwwFkxEtHh7LtZ6a3c9QAnEfbh5Lu+/1X7cfhl6v5Ee3vVUAOZfYOqFEVHTz8B1GnMUObLKNITGTO1ykhA/z5zH863c3ORxM4IvsPyfBLQDOMyEeqOt8PONi3QBzCrrMLOnH7fMhW2VvV7RmPfb36Zz+NlS0YxVoO4VUnbYiy72YLgDPn2YpNalKibcsflpDq2O4wQrLC5UeTjXKoxlLrD4bDPx8MPHos5RcvN/N0mRbfmPZ0a4RGnDmAZuyFnqnCbDuIrwO8s4+wtEL079oc9eJmFO89mGCycJ/Fz3AflYpp5iDK9NbsgA0YbiqtEVUu6Wgg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 559e1ab2-cb9d-447f-2c3f-08dc48ebfe86 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2024 14:42:40.6024 (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: Ufts/71W9wTqjhPda8upJvP/YzZl51fESi9I5qSSHfB5MPOyql+1ZT5OcJauKnOBBWdx6ABWD2pKJxe1tGeB5U+pKdtWUJoWV6wKbInYdWE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8797 Update endpoint config command to create local endpoint for broadcast endpoint, this will be used to configure a broadcast source\sink if register endpoint is done from another application like PipeWire --- client/player.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 3 deletions(-) diff --git a/client/player.c b/client/player.c index ab33bfc46..b02a40423 100644 --- a/client/player.c +++ b/client/player.c @@ -3662,10 +3662,15 @@ static void endpoint_set_config_bcast(struct endpoint_config *cfg) config_endpoint_iso_group, cfg); } +static void endpoint_init_defaults(struct endpoint *ep); static void cmd_config_endpoint(int argc, char *argv[]) { + DBusMessageIter iter; struct endpoint_config *cfg; - const struct codec_preset *preset; + const struct codec_preset *preset = NULL; + const struct capabilities *cap; + uint8_t codec; + const char *uuid; cfg = new0(struct endpoint_config, 1); @@ -3680,8 +3685,75 @@ static void cmd_config_endpoint(int argc, char *argv[]) /* Search for the local endpoint */ cfg->ep = endpoint_find(argv[2]); if (!cfg->ep) { - bt_shell_printf("Local Endpoint %s not found\n", argv[2]); - goto fail; + /* If argc != 3 then argv[2] should be the + * local endpoint. Return error. + */ + if (argc != 3) { + bt_shell_printf("Local Endpoint %s not found\n", + argv[2]); + goto fail; + } + + /* If local endpoint is not found verify if this is a + * broadcast remote endpoint because this can be an + * endpoint config command with remote endpoint and + * preset. In this case we have to create its own + * local endpoint. + */ + if (!g_dbus_proxy_get_property(cfg->proxy, "UUID", &iter)) + return; + dbus_message_iter_get_basic(&iter, &uuid); + + /* The local endpoint must have the UUID of local pac but + * the remote endpoint has the UUID of the remote pac, so + * based on this information we determine the UUID for the + * local endpoint. + */ + if (!strcmp(uuid, BAA_SERVICE_UUID)) + uuid = BCAA_SERVICE_UUID; + else if (!strcmp(uuid, BCAA_SERVICE_UUID)) + uuid = BAA_SERVICE_UUID; + else { + /* This should be a local endpoint because is not + * a broadcast endpoint. + */ + bt_shell_printf("Local Endpoint %s not found\n", + argv[2]); + goto fail; + } + + if (!g_dbus_proxy_get_property(cfg->proxy, "Codec", &iter)) + return; + + dbus_message_iter_get_basic(&iter, &codec); + + /* Verify if the local endpoint already exists */ + cfg->ep = endpoint_find(uuid); + if ((!cfg->ep) || (cfg->ep->codec != codec)) { + /* Get capabilities to create the local endpoint */ + cap = find_capabilities(uuid, codec); + if (!cap) { + bt_shell_printf( + "Capabilities not found for UUID %s, codec id %d", + uuid, codec); + goto fail; + } + + cfg->ep = endpoint_new(cap); + endpoint_init_defaults(cfg->ep); + } + + /* Verify if argv[2] parameter is a valid preset */ + preset = preset_find_name(cfg->ep->preset, argv[2]); + if (!preset) { + bt_shell_printf("Preset %s not found\n", + argv[2]); + /* Free created endpoint */ + local_endpoints = g_list_remove(local_endpoints, + cfg->ep); + endpoint_free(cfg->ep); + goto fail; + } } if (argc > 3) { @@ -3690,7 +3762,9 @@ static void cmd_config_endpoint(int argc, char *argv[]) bt_shell_printf("Preset %s not found\n", argv[3]); goto fail; } + } + if (preset) { cfg->caps = g_new0(struct iovec, 1); /* Copy capabilities */ util_iov_append(cfg->caps, preset->data.iov_base,