From patchwork Thu Jul 25 11:58:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Pruteanu X-Patchwork-Id: 13741850 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012061.outbound.protection.outlook.com [52.101.66.61]) (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 22FBD3C3C for ; Thu, 25 Jul 2024 11:59:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721908774; cv=fail; b=ZzsYWHSOx9El/pInXAggErm87bnjIaEFGigbubOh1Y5EctQRC4riaxAuxTr7qO1vc4rYCHV+lB+5wRcdn186sq8z/RPSIFsfb5RvEAi0JsWKZr1KWFBd8UqRXqCSuqsV8sqkqxWSzBj7nRaxct+2FEru15s3pHfBjWyQOYm7W6g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721908774; c=relaxed/simple; bh=b1sZdaoedYLsmMfIzF14uaUK/tZfaVq+31D2enW01Rc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=H/Wn1iTIcqb8pglqadAi5vvcgjTPLh0Bh5Iyq2tEHY9CyG01lqc8uTOFg5RnOR50GTDJc/an5IICadc16/ImPQ3RJcv8BKqo455hLwNihG8d6tKZC1VcSRO/N6/QRMR5XgoVGN3X/6NC3JIWX2DElQfod9cU0OyhssfLGjhI/6E= 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=mPmJMFmd; arc=fail smtp.client-ip=52.101.66.61 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="mPmJMFmd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xlvt0uBVMcJxOhhoubGldlM/7lBj4Imm/6+Y6Xb5PHEF1/rkWHeTyT7NVuG4V4wVpcuuRuy/dj5bLmElZXw4Gp+O7boJS8cBW1fMGzWQUhM7c2ze012/b6ikWqkbDoccrKoFSvq9VDhwbWbIT3ff9NgeHxKqCe2hk6hDaY7dkSGMlQEAwm7A2aTvjRhsrgOUFWA3mPLJPvLukVd7bkohnbriSGJShEwjzIgyHrcuVOdf3IRSgN9yrlpIijSZe0oG6eKaesmazj28NE+CxoWVzj+J4ozcS1PePQZiWizIEFBqTK1R+yYF9gS6IGROIDKaG1tyu8NwEdF19CFpdrCBBQ== 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=CRFEQtpW0VRs9rCpYINHiN20l23/jQ7nzxrZnlTzKeM=; b=QhPRAP4VnT6MrW8WXUVXCgrRinyqLQdbKYMSxDseW4VN38y+ttT77udpjJnVTlrcpi2PIQIP9UkJ+aZReoY6gtSL2FMt+NOmXgOkvLCq2vl7bWos7jAk8X0YOk/nafsGsBb/wqVzR7ulJ5t0XzmNsA1ftAsNNwP9DV2IovjNMcVbTXmM6ivxr3ACMPHdr3zMNL59tvqJS2Z3ONomYtxwarjvHCd7ynr/hIwZQUHhH9PxcJPYoRvcbO+qGUh3tel47pr8VWM6EcReYBsX4l6I0QRhjvwPYDLI0G01meF6792xXMRb98ZYD4mMXcIS5j1OyYe+/zg8+ioIXqytJTp4pA== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CRFEQtpW0VRs9rCpYINHiN20l23/jQ7nzxrZnlTzKeM=; b=mPmJMFmd8RmFOWzK8+FqHCj/Jj7AnaiNeOWYt+Zj8cF0PgOX3z5sZJLnTqTeD3H9wur3Gnp/GV5U2ZZvKbMEjZQLbni0S3AiTOD8+KAcxSdb75gMWX555aZjUD1QFKZo6JSgrWWrV5ngnNUdBKmBGo2kcmWqEQiAIYAYwNFmtP4KPe9sQocdtUNKrHrDkvJJaMZOV/IzsPrSSjd7fC/fm7g0Uf4DAOJL62mipObxu39gNHGCNoW8iv7jmvVlAkCr1tUrn1I8EKtPhaX9Cm5kENJDmN3N9uQw+rSulPzm2x/AwhiUeRgsov0TCmYSP+rnoOAecDcd7krZ/I6i+UIdnQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9088.eurprd04.prod.outlook.com (2603:10a6:150:23::20) by PA1PR04MB10795.eurprd04.prod.outlook.com (2603:10a6:102:491::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.28; Thu, 25 Jul 2024 11:59:28 +0000 Received: from GV1PR04MB9088.eurprd04.prod.outlook.com ([fe80::8775:dba3:39ac:3277]) by GV1PR04MB9088.eurprd04.prod.outlook.com ([fe80::8775:dba3:39ac:3277%2]) with mapi id 15.20.7784.017; Thu, 25 Jul 2024 11:59:28 +0000 From: Vlad Pruteanu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, iulia.tanasescu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, pav@iki.fi, Vlad Pruteanu Subject: [PATCH BlueZ v2 1/5] doc/media: Add 'broadcasting' state and 'Select' method Date: Thu, 25 Jul 2024 14:58:50 +0300 Message-Id: <20240725115854.234781-2-vlad.pruteanu@nxp.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240725115854.234781-1-vlad.pruteanu@nxp.com> References: <20240725115854.234781-1-vlad.pruteanu@nxp.com> X-ClientProxiedBy: MI1P293CA0026.ITAP293.PROD.OUTLOOK.COM (2603:10a6:290:3::10) To GV1PR04MB9088.eurprd04.prod.outlook.com (2603:10a6:150:23::20) 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: GV1PR04MB9088:EE_|PA1PR04MB10795:EE_ X-MS-Office365-Filtering-Correlation-Id: 4dd7dd91-8d7b-414b-62e1-08dcaca13c60 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: wCmxJ3wUlYtLx+YzZmHWqV6ShGGqbemrCFd8FejChhBQnih9KPo6FrWV9cP8iYbz+SpC8wJv0G+vO9nUXDDUxNxGsX4HIpOoAif93IpJT4axDvz3LgMwRmlg+twt10CAB2ZJ5ottu+1h8gE3YRfgErfJ7J/rbgUvMU+V5nJ6sERT6/amwdVqTe0/nHsRy5ehGErdUowQh4p5MQdddGLBt5Rt3DUcpSyilivHcGPcyl67okqOR+u20CJzNGPD2o5KJjWb4hZVS72zCF3h1dKni1PR0KulGixoTijvnTH7+yVrhhYFf3FmB/9k7F73af/ho/7H4YF66a222hePGvhEYo5BCDwMGubWWCL3XqrGS4zEtlyeQMP2EoXvzC0UB/68u6JCcLmoRotb1RCY7XsRByKv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L:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9088.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uGHFL4oivMQNBtrmjYsniaHUBbzJlRez2CDnQUgfVm6FOl4rq0mMLdXyTvIQ7MIBedTIF+oz3aROK+WZpNwU0stc5SyR/z5qBUMAwd4Z2wG6juKeWgxaibaseDutYcV6J3IgfVAGgGgqflUoCkXsHLgUrQrvmCJkuSi61xBJzANOdjBOEVyxV2wyzYczlktoXdt65blev9tvx2YincPacalyk9LKdIqDshwpxAxd6VH//GlfK0xbclzqanXENrM/vOY/sZwq1FnEGmLFDUAc7qK1AfjE10oYkS/+Ai1j5qG1zr2rTBf4PFmcX8JBj4M/6NTljeZbaZ3dVSmyogky0KLMFPhxLeml+EsmeGFmqG539kpfJlAwvAS/efgJ/6BWki1Ls4d/Jlvztt0NNN9ZEvBWHueTsFk/wrmtaDvZbE3C4ABBoOnEKggkJgatXOWCWraWOl61B95xXOu8z3AlqzMBBL3gG8r8nbnktq+GYkCxI5al0uTWsIklhpYIbCkSMkUpxYa0tTx+O2O9AvCr4yKXHRljkEUaqwDY8No9XaWsCPfAQDpUa61E6VeivpFcLVtEDuqwPmKz9zKiwk+vjgLE0hUDNDop8s9ySYTmzDYB2J4ESsPjybinqPUQJezixSlQdN/+CgQavHKF2dAn5ST749DYctsy1bDmHdwx6ZXqj+mnvQ/zGTajB6w1OaHLaxu9J3N8sZYMPhbbwUjW4sKXYbxpROHwfxQKDstWsVNuroYo7Eq3n3Z/AAQtwITQKXK4GUNmKXaaZ3aCWLwwDNUXoaiF/RsQfnWBGSgm2GqKkinhcFxsL14JEN6ItEbMlrfIvEzaeQRJeXTJltBV/8gxifPbRfC3WWw3TtAr0O7C1jpgN61YzxF5DS0OSKzvL4vbCAJk2aIFTswNe2tMA4gtl0Ko2bOw8naff1EcIrlARRb1/Zw2D8Xqh0oT4SIn0+IGqUhcWoi5sEHfK6AAie8aOJ6HqodTRgosXGWvPU+XFW5JH4ZuEzV79doB5N/WnMoeb3GO5Q2b4THfqvoRpBNYRNZp8pxZCLVx6VuPXmyW7TSi1o056UD0fAb1KtWr2IPOOFZHs3k+LnCh5MElzP8Q6k6mDYoEHiV3RyZSEYbKY+V/igCvhfeZkp+61rDLc2c1jfyXK5aMBRHwoL9pv6O0LCEatFzHBwYpoS6qzXrq/7sVbkqlCah5Gy2zRgcQHv6jduy+sHx2XTOufA2SvgZoDYd0WaZ9P4njeyguMN+B+3dHUA8rxMzLnA7QkT0fJjYt14fsCS0gPVVvoScuSt7VAfhwfs60+Skokfe6m0lq8LCHQHeoT56H7lJP26zpOY56V5jhFXrRvydxeT+8jMk+Kbihb21zOtsQZB3CULoIccvVoSyz5NCW93/mZK1a9AcfuVu7lbOlmINejeXY8bE+zjrvfzegsOFLA6RY33GBYV/EFSMfxZ+D/9UexPP2KmPTOJoxMQqFNt7nO7CvhA56rRnDz7PZYwfs49Vb/+hsvZK9ZxwGsPXY9HjTyBznj5PyY+BDp7HnqRg3xC0ycXXChfPvLjcBOjVClVMaWcNqQK9oLOh62BIO/2Ajfs7q X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4dd7dd91-8d7b-414b-62e1-08dcaca13c60 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9088.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2024 11:59:28.4226 (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: YMt341sRGaFWXit2hsvIO5WfIKUM+ER6rrj9v6fd9C/BpKtMKGUvKK/oipEAM/0u2IwQZY4zvNZINHfVRQji4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10795 This adds a new state for transports created by the Broadcast Sink. Such transports will remain in the 'idle' state until the user calls 'Select' on them, at which point they will be moved to 'broadcasting'. This allows the user to select the desired BIS as the audio server automatically acquires transports that are in this state. --- doc/org.bluez.MediaTransport.rst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/org.bluez.MediaTransport.rst b/doc/org.bluez.MediaTransport.rst index 6e95df8f2..47346d36b 100644 --- a/doc/org.bluez.MediaTransport.rst +++ b/doc/org.bluez.MediaTransport.rst @@ -7,7 +7,7 @@ BlueZ D-Bus MediaTransport API documentation -------------------------------------------- :Version: BlueZ -:Date: September 2023 +:Date: July 2024 :Manual section: 5 :Manual group: Linux System Administration @@ -51,6 +51,18 @@ void Release() Releases file descriptor. +void Select() +`````````````` + + Applicable only for transports created by a broadcast sink. This moves + the transport from 'idle' to 'broadcasting'. Since the audio server + automatically acquires transports that are in this state, the user can + thus select which BISes he wishes to sync to. + + Possible Errors: + + :org.bluez.Error.NotAuthorized: + Properties ---------- @@ -84,6 +96,8 @@ string State [readonly] :"idle": not streaming :"pending": streaming but not acquired + :"broadcasting": streaming but not acquired, applicable only for transports + created by a broadcast sink :"active": streaming and acquired uint16 Delay [readwrite, optional] From patchwork Thu Jul 25 11:58:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Pruteanu X-Patchwork-Id: 13741851 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012061.outbound.protection.outlook.com [52.101.66.61]) (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 8F16619938A for ; Thu, 25 Jul 2024 11:59:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721908776; cv=fail; b=DwdaqI3mLHwPpwhzWFTQmVFeW72JhdHRKPi7pykXjvGDIovENYcYeOXCKx1Ap5bp1dVREn47y66hAbEBntpPmYSF3+Gn4cIrUcrF99fVKc/htlLidV9kotfsjhgYIPNHZ6X1pebA7nfNl0oPHVpxvi3Ih7RnbXkrsyKA+jlNjq0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721908776; c=relaxed/simple; bh=czaSDfnJVKCrrkGXMQAvEltIA7s3kIsEDsFBSbxx2B0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=iwWPdyVEeFDoy6IoJLrpAnWenpTRDbau25RGoH38TdH5pDvf+bxIjqJ5StA9ba1Pwqw6LbUExa+ZYt/pP+3HaFkCuqB6HfVoiDH6O2THFJYvMBuP6Ej4ebeDRbxv1dwdCOXjza97vUYyoQ55jQNiVKhJNqbWzd9dQELW3tWOHoQ= 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=NdP2rPV5; arc=fail smtp.client-ip=52.101.66.61 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="NdP2rPV5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DGGBBoH05dEtJZ+r9VdKjQo9JPJ4Z493Xk6cEC7egTzqTGknrmB2nxPCAQCjx6630YHjCWl6XiGYDcoGFCCueLsuXt7TziqTaAzdNult/4xPhuDrVIQikTgSOlNZwoaT7FPbQbou/LteRnGRbbwORQksHLiCOeStYqIwL/Z90AmkCMcrn+FtLTseNVFVL7GlL2vuuAfyfHjJovrCDn59+vyrIUzOVxR4vKL64GCcEmp51Bi8OJENbsPEjjAkCR+bl9XEnN1wgVqJLeJKfImRQqTTC/345kczsd+P57X6MhP5WSG2IGKl5Aox9IXi5w8Vq19HWRlk+vY68jdcGsSRXg== 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=FzzAhPYXwU0UJNjZ/EMvu71JfpR/pRsC1GViYxA2wdI=; b=DtgUVqr0yE+Hzv+Ai5/FU0msy5O5kZTXgQyhX4axbiN8uCX0Bm0Fr4igY7OOAbrYgZavTCOjAKiCbqCn8zszRu2/aMOmXQOifzqthCc9EAH3lS3ueASqlUisDdQgnvIEjLPDQIw3zoF5e5aY2MX/bjJIB0CulNbZw3p/jwJ7a1Y0HtxUxYxNgeR9XLPkDNnAkCWYohCNQrtcBtCWCHKKYmborIXtlOElSJONRpBWob751AZZXrAkifnptdw9sFFwn08Cm60de3RTlugY/rBV7gphPNMS+pqZxgQvMQas+3aWVNdAyd+5bksUY2Fo/jLiT7tkJlOpqB8uAbbpQQwj5w== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FzzAhPYXwU0UJNjZ/EMvu71JfpR/pRsC1GViYxA2wdI=; b=NdP2rPV54zNKmood/Tb8Jft9f4gi1Y2HasX4DLR2sMbaVobmnC28MVOfgLx3LYqqBN++08uFeguClZ49rKcq9rYIhs3CDg7BNboA9MFY40CI6dnqibvWi3TtLk6Z9C7eSuuTTCCDaGMtNAgoLvn6wmG06Keob5EWBgIaDFRbPs8WI6YbWThoYqsn6EDA0o4caKRpXT+HzNOff/loKBER+7++hMaYQSyDAhDJvFYiCT/tPZ7sFfBNjmRH056yDNyB96zRzfxKXTC3zz1jdFvHp8TfoF903Ta1qAsFSIZ7R+H5/RR8bZHETngOLshXM+/0DNmI3QrqH9OgfTa6fRTeVQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9088.eurprd04.prod.outlook.com (2603:10a6:150:23::20) by PA1PR04MB10795.eurprd04.prod.outlook.com (2603:10a6:102:491::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.28; Thu, 25 Jul 2024 11:59:30 +0000 Received: from GV1PR04MB9088.eurprd04.prod.outlook.com ([fe80::8775:dba3:39ac:3277]) by GV1PR04MB9088.eurprd04.prod.outlook.com ([fe80::8775:dba3:39ac:3277%2]) with mapi id 15.20.7784.017; Thu, 25 Jul 2024 11:59:30 +0000 From: Vlad Pruteanu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, iulia.tanasescu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, pav@iki.fi, Vlad Pruteanu Subject: [PATCH BlueZ v2 2/5] transport: Add 'broadcasting' state Date: Thu, 25 Jul 2024 14:58:51 +0300 Message-Id: <20240725115854.234781-3-vlad.pruteanu@nxp.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240725115854.234781-1-vlad.pruteanu@nxp.com> References: <20240725115854.234781-1-vlad.pruteanu@nxp.com> X-ClientProxiedBy: MI1P293CA0026.ITAP293.PROD.OUTLOOK.COM (2603:10a6:290:3::10) To GV1PR04MB9088.eurprd04.prod.outlook.com (2603:10a6:150:23::20) 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: GV1PR04MB9088:EE_|PA1PR04MB10795:EE_ X-MS-Office365-Filtering-Correlation-Id: f179e0f5-af48-4636-7b86-08dcaca13d90 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: iIphvhTe7+7HV/RBXPgcDeMv+J2rkJcMyMf7+FGY7AYs16JpT9VttFevYIOOD8WyOQOu4F3x2lEqXySMv0I42Kajro8mL22opZ86ZjDu1GqjQ9JfUKEi+clyavabbdzW9VMfQ0xgUhcRfRqJbKFMsTld8U1SDOsXzX+MyCouVHQLWUTPPESbpzCy2K3CfJfz3t0eT3Po/DIq1YMuoST4fxNQBUBEFt9BiIO5jF5bWWw3k57p7XMGQUDLCf52rtG2E8j9/caPT/e41/wL1YO6lGLeVYPQsrkTvJRbtVA3zgatPpjeEB5u7qtHUm4RGjIHxAvM54J8+IbkFgY9NIFNEYkPFBvhPfJicqQ3sSMtURWnSlNL85KvykIv8s6UmWPYubnNLs7azsoG7/SbxpdMaULO925eeNFkq5nUqfQeSBFUX6h/jfaOmtCq0bhB1Gw3kf/o/0jDlwu9U1sohI6PPc3ScjivvOn7+oqaWtcc0WAsTz5oxpQgfl9g1/+9ipzaFy6BVp/390qUrLJXHTtQgZ5b1t9tCGoC/LCL0odtkfV2wxCixesoCJR9cUUIsBa3J/y0Ywh5aoaRfTa9FDK1B4EbSwRwAO5jZqJ0MVjyro5ZpqOJ3CQMQCigFxFWJu/3+NXrvLbhJWMKNfQGOUj7uVb41GK9oqmPe1hde8BA0t3K/9cI6SP+CCBO/aL4HK8eEkav1MoXCNiKU2CnsGHqM/oZVHEYl/HGlAV0wfRQi8azsFhtvdeS09tHWaprA7+1XaoSOJio5Vl3Y5XLn7VJyLLFqn2UoRi+GM+ZL2xHnB1O5FgO5m3vbqIyuL2HKwPrOIjSiotUeDgtS3MB9DHOJWbi2KQjGP9SFF1b6hOY41FAbCNjgR2FI9g6VNefZzSbOhl7O3jPaZL2zEIJzyM6cnQOLykH9tiN15Xlzob+RhrCddkrFEIblKAkUpHckBABdHiCsdcF29EUAV5KsEDddol2fPwxIfaaKsuZi3R8UJYDH9oD/4oEX5ZuhgrqkCk/DcKAc+ImF5DzHo5iYYgP/6pFvpzpTQpok/2h9BH/R8sX0k+XEkH00oMDvU2/6wW8/b0TedjyLHPkz71VBSNWjM7ZLw3UqM6CIUgmmkLqTIv2jdQYKnDwXmx8NE1hVV41I3RloukDEIAPEBFPuBYu5eGaBgcXaHxU2HK+euF0ZtbXfXKQ3JXQ2iT3he3SVbd89BdlyMXMXB/0NG6bDqsSgH/PTqjUArXxGKK62qb/SiDYvfmWPHbeNW3NJYXniDLM0CBP5p8eoyBtmSEwVmoo7NFnYo2udXdD72Hxif5tu67+NDlSoCyRY26B1WZ/fZvi6c83Yi1JVLKOueIEI6WHBgliDa4kkV7b3CZ7c++BjQyk9s9l5B6Pyd+40dOH0eqfYyHKywRhwbXGH61SH/dtkQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9088.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: grlWvvf2rRXwEAg61WWwhrpWcugLWdwm9gspzyoLxO8pM+S/Yk7rscdbXe3HmRIbaE8VtouFM5KY4TVVYen2mBHX+YvltTnc6uzrGYngCjvmbjbBKwxIIigkhVR33FEIslY07hYbrsLvy/jUh+s2lkyhpsRjWX4dKpgRR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FX32LWVPYGbc7lW+T8Ax5wmjvI2ZfThI5BO2tN4pt/qLFtk98UF9bL8LDHuR33Mnxcfae0t4dWvwq3gsxvWUYP/1u89kRFzQx1E3yzDeAN/JTI2ZSqzbqWMUuQqXKqsHLuDbW/8ea6ofzC9pi3iASuXGPFUBR9/PFfz0lgrW62sBjIL0/oKOlBawDsJu/KMtCBfjpjmyOJyhQE3gsRcptC6LL1vWRk7oeP7Ah1tKqQ/av+EvHLLEjfZ1GZtHfmpzkGljF6igmvBSedtKebHHMDvXkiplVNgPfXnaloXUOis5ZvlTCbCX4zddbx+eFXKpI1RtcnRrpgqottnOgJyEwQD7 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f179e0f5-af48-4636-7b86-08dcaca13d90 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9088.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2024 11:59:30.4453 (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: zo9S59AFkxo4ZkKha6kgVNyRdHLweFnaDeu3GNXVu+qZFas3B0ptskA/Hgib0/++BdKHcHXsEHcigmqGtnbNVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10795 This adds a new state for transports created by the Broadcast Sink device as a result of scanning a Broadcast Source. Such transports will remain in the 'idle' state until the user selects them using 'transport.select', at which point they will be moved to 'broadcasting'. --- profiles/audio/transport.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index 922911cf3..0a890c0ac 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -51,6 +51,10 @@ typedef enum { TRANSPORT_STATE_IDLE, /* Not acquired and suspended */ TRANSPORT_STATE_PENDING, /* Playing but not acquired */ + /* Playing but not acquired, applicable only for transports + * created by a broadcast sink + */ + TRANSPORT_STATE_BROADCASTING, TRANSPORT_STATE_REQUESTING, /* Acquire in progress */ TRANSPORT_STATE_ACTIVE, /* Acquired and playing */ TRANSPORT_STATE_SUSPENDING, /* Release in progress */ @@ -59,6 +63,7 @@ typedef enum { static const char *str_state[] = { "TRANSPORT_STATE_IDLE", "TRANSPORT_STATE_PENDING", + "TRANSPORT_STATE_BROADCASTING", "TRANSPORT_STATE_REQUESTING", "TRANSPORT_STATE_ACTIVE", "TRANSPORT_STATE_SUSPENDING", @@ -139,6 +144,8 @@ static const char *state2str(transport_state_t state) return "idle"; case TRANSPORT_STATE_PENDING: return "pending"; + case TRANSPORT_STATE_BROADCASTING: + return "broadcasting"; case TRANSPORT_STATE_ACTIVE: case TRANSPORT_STATE_SUSPENDING: return "active"; @@ -152,6 +159,7 @@ static gboolean state_in_use(transport_state_t state) switch (state) { case TRANSPORT_STATE_IDLE: case TRANSPORT_STATE_PENDING: + case TRANSPORT_STATE_BROADCASTING: return FALSE; case TRANSPORT_STATE_REQUESTING: case TRANSPORT_STATE_ACTIVE: @@ -679,7 +687,8 @@ static DBusMessage *try_acquire(DBusConnection *conn, DBusMessage *msg, if (transport->state >= TRANSPORT_STATE_REQUESTING) return btd_error_not_authorized(msg); - if (transport->state != TRANSPORT_STATE_PENDING) + if ((transport->state != TRANSPORT_STATE_PENDING) && + (transport->state != TRANSPORT_STATE_BROADCASTING)) return btd_error_not_available(msg); owner = media_owner_create(msg); @@ -1281,7 +1290,8 @@ static void transport_update_playing(struct media_transport *transport, str_state[transport->state], playing); if (playing == FALSE) { - if (transport->state == TRANSPORT_STATE_PENDING) + if ((transport->state == TRANSPORT_STATE_PENDING) || + (transport->state == TRANSPORT_STATE_BROADCASTING)) transport_set_state(transport, TRANSPORT_STATE_IDLE); else if (transport->state == TRANSPORT_STATE_ACTIVE) { /* Remove owner */ From patchwork Thu Jul 25 11:58:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Pruteanu X-Patchwork-Id: 13741852 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2064.outbound.protection.outlook.com [40.107.20.64]) (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 F2B671993A3 for ; Thu, 25 Jul 2024 11:59:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721908778; cv=fail; b=BnW+B5/6ntpZUZD6380DK5AwRe5SrUNWf8qxYYQtC3uPotQued+5EqWY7FYq4VDfzB7pQudof05+ElXVXNk47W2I/TZ8sAm1WrjAlWOU1OpEhARvjWa6QYtH4QMf8e50CNDv1zofQrJChlet9YURX8097U5FyyJShiPGUAIduhY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721908778; c=relaxed/simple; bh=ScA4UPNj3WGmvMkJvYFNz9vuwePqO/1d7vp86uw3AAA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Tz1bNBlW+Nhyo46MLN4WAQBnKCZeOuS9SEKVCGjX9l66I+V7JmK2kji8jXtBmymmtJxG7OeWFGbm9KWWyNXPQxQFcMATqHrJ6R89FpnD4+tA2+mXa2QyVySz2JYN/lWIEotJRTHiIpx/P5pZcnJA8QEOc/AsEfZ5vNE+mUNarTk= 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=nLuy+5Qp; arc=fail smtp.client-ip=40.107.20.64 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="nLuy+5Qp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QnH1DEXyfyodSpSGo0KpKPMGqihtC5KhvoAnUt7sWPkuyzqYnrTvXpF8DdQowiOtIN+LrayPY7Oshxx31sfW39f8m7sJdwJM4XWSSdSsbg2a6IJOHAoiFUhM1QZoGWATuS9irMPGi+AtRgk3AX7mtDbKyEIwBnAEHPb3tJUwrTjo7NBnv/We6gtQOcX0ZfeJ1ls3DoYE+VaJnxAGw0DqK/NB5s4agJH3K9U5JAgv7PvvHCjG/RO8/Yy41XlUcoC6Cc0N0N1JorXERq0BIDwz9hUR5+QvUzoS3fd7SZLaeOg4SVyV40etR5rUDKfMia/Mel19qoZ4ANVswkrCnTiiBw== 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=8UTYtrHGcPISsbUfQTgBM7QWrrsGXrIK7EhT5vVwByM=; b=DuON0ADBGTa9IQ6/1jYWpNbtre45/xl08CZYZs9Nz/7Z2+/pYXVpQDNyrrLg/aqex/dqXR9TGuzx8Y4ga5RZovA4t8He6BwqmRlBI0e/euAR/jjocukfhpYXX2WIuKgc6E8QwP73RAKSbDGpIX+XYcYgU7YBWpGNh5ITgZfXb6W3bkhRYCuPofRPels/ZZdgv5rJY2m6zpK+3z7N0O8ysxK9RmhuD+CmsEWwbgBWniPTGJwmjDiipln+BgLXVg4YcY6bsvooJJbbnW+AVuB4kiUwf5bgpNSfPVt4akrNI6SnV/7Pn2Yd8nmEuCIubZIy7XAmQrf3FbopzJ904d1J3Q== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8UTYtrHGcPISsbUfQTgBM7QWrrsGXrIK7EhT5vVwByM=; b=nLuy+5QpU5n1j6Ywoh0phOANsCte+H0iGFQ5ElmeZ+HsXbCwHuU9TcpXCvAKCfSVjFnBScOXMhL+Idoyb4KG2HVVaTJhgK2VbbS5+Dl3Q8tKuZWdjOWCd85iEOpskLk8eiyk6s1mqlABYS637lRUUdtFYlv1dprTphKTyOlx8ob3atv5Pu+rlLXFCDuEjUfvJouERmgdhGhWkj3kGK29VOHrc2Q2GFpDkoSacDJeT4/NbhaAGn783hXgquh1kLPrrilpsWqddNjuCrS5mX5yFi8lIbJXOzSgrSEvX43iNM314ype8BEO3/Svj4WPNqcBPLKBuL/S2KlfST61co5X1Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9088.eurprd04.prod.outlook.com (2603:10a6:150:23::20) by PA4PR04MB7661.eurprd04.prod.outlook.com (2603:10a6:102:e3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Thu, 25 Jul 2024 11:59:34 +0000 Received: from GV1PR04MB9088.eurprd04.prod.outlook.com ([fe80::8775:dba3:39ac:3277]) by GV1PR04MB9088.eurprd04.prod.outlook.com ([fe80::8775:dba3:39ac:3277%2]) with mapi id 15.20.7784.017; Thu, 25 Jul 2024 11:59:34 +0000 From: Vlad Pruteanu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, iulia.tanasescu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, pav@iki.fi, Vlad Pruteanu Subject: [PATCH BlueZ v2 3/5] transport: Add "select" method Date: Thu, 25 Jul 2024 14:58:52 +0300 Message-Id: <20240725115854.234781-4-vlad.pruteanu@nxp.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240725115854.234781-1-vlad.pruteanu@nxp.com> References: <20240725115854.234781-1-vlad.pruteanu@nxp.com> X-ClientProxiedBy: MI1P293CA0026.ITAP293.PROD.OUTLOOK.COM (2603:10a6:290:3::10) To GV1PR04MB9088.eurprd04.prod.outlook.com (2603:10a6:150:23::20) 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: GV1PR04MB9088:EE_|PA4PR04MB7661:EE_ X-MS-Office365-Filtering-Correlation-Id: e6fe7150-4ec8-4e34-2ab8-08dcaca13fdf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: sw+cW657G/zB2MevT2h9XWvRd0Iqg9OA/2EE9eNaDWxNawYOLhJlG6OKGfG9OCvCINTxZZRVp9AmcuRL89WAd7P+isZ160AjtKu4zK2pb++H8Kh8ztr3DYAWD+Bx7JM+vEWWHZWB+f8/joIgdH7f54L9A+cishbs3S6Mii5/39yyBPYJuDi0mUB43S1Umxfpno4AQQ9LHu7inkfhXx+qC+htef1b3k/8fvS/G5Ye3UT8YIaXQpNLeUdmmjK0B7zuDOmmpIPSbylY5Uo343r9Fovi/RI/hiwT5Tes8PoCldEwNAZBZAD1BoXykQ/EZGFHmk4imUcoKTMNZiixTtQw7oQIdEc+hMOnYt+dS93kK7sVV9Zegzf/ZqiLqPAoh1mgDO0aMtMoJ5mprh6W+ej3w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RV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9088.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: M8J4DLSE+e9aTlSiHOU8oJJ5C5IxV/+uCMV9tRJgdusvoqwxk6t+uQ7Ni/hdJ7rdscnSMhuEyDo4C/mo43qHwa9+bZm+nLN4g2QClR8GkADNYQ0liEEPpFZ/HIWfXGT17qI3ouLUP4DWbZq/vtYj51Wvg0EwIYPx9l7XVchIMnFiYESV5LkwJheCeJ+sQigBolGgONNz5gteK/KcSAhkI+GdSTNfWKshiEUK7Lxijb5TWYo2Vs9D8kzkAcBMDSLCYSHH2r8Pm6OO9mHzeci1nVdJTuKcLq5OPAZ5gKZm8+2lwVPjM5DGIMZhH5V6MYbCn5h7ePL/v24PEHECNa9Zi1urZeFllfJEjBJSjcMIf9ML+thssZZ9wuQu1Vb1gu62AMF9IK0KwFG3I3+jTMOU4+KBpz6dr5g128Zku/l5gLju72I++YZnVou0R76N2FX8Kam8z5CS5aUi+zhV91teaOWK4WpnKFOQt54VftcvxWIpfOYaDO3Tsy0nvxQHNtPoKo4EdYxo4aLAdB4Yega67yVU7vx09Chb9Xe9c/BRVUnBG1V31dvQyp8ibajlvTFzPN1mrtdEEWIRZc2TjzibSkKl1TIQFbjmP2BUFS6LjYWWFYxifMiAl9NhE/5dJbHldUGpzFfmUrgUm8LhoM4kw9Q2dZKBsFVcZSsVUVjb12rPPUn9j5mElnmIOg42JU73cnLbR7T7O17cde24qEQJdxzF/XknFckebMxH+aNWKL35ylo6VXeu3x+2nSMAZTgpw4uKjtO/9RravOGJQ9A4F6fap00nsqty+1PXQMY+EN0zKvrOirAgLUSQ4YrvWQJ7CSXa19c0OwuZt7/QgDrpKu4oHZOlASRwvGjPXacCOWmPhoOoftV8RHMiZGvyHeyIXEJ9zYgUZvAik2o0fIR7zyo8PBqJlmj6gSvQOkUtiKAQFrzi++dUAEbI45btU20FLwfYX2DO433LYoF/8O42IAP5FS5FQTd7lUBISGVYTfLi5D+jZDidch0VJdKFdCAS547jEw2EWGdz5A9P9jJzIBf/5WaQT7HIembYIuDz4uzczoV1D5OjeTC8zPtGlnIgYKeH8ZYi/5D5G6PlD8CFddGd35eH7njOUf8jPgdq/EjmWF+FPBc/vdoUH6yw3masL9lIKYjDWMzyDbDzDL+j2gyq3YqOpxoWRBQwm+VpB1SXskR4Tt1Fha1zF6WMc6OUk9vQgGrc2GekfJoOrIiUvEzGlr6pGl9pBnN4wEFwkoT5KpyTqO4EcPOmGao/WkuAKipxGrmQpZe7i7wH3GwpCbvGMKaX3h9PbdXOPlk1MShrWsii5KuP7yJF3SvXjAGuucTDzA97OFRn5KPojwWiCYB082gbdjKzmiONTeLW5BdAhpD0jIoL1Gkrhwu0KUQGt2mAnTpRN919yIGkr+OijXlgTXc1oecY6Ii+Wio5aLYUMi7QsVV1G/u8PNmEQjRUb+aUiq8W4nEwrMhU+buMSl1TEQEsqZBXOl6vVvR5c8B1/OjUymld7SOWcp3FwPYtxetP/B5CFAk2UqraI0y9zaEwtxiaSWkJu1XpgmXfnngL706vcAp0mpovFRugDeqF X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e6fe7150-4ec8-4e34-2ab8-08dcaca13fdf X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9088.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2024 11:59:34.2698 (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: UzPOTPTgcCLl6TSXs/GlWd7GHaKSnEBXXrAGmOw2Zfh/F2CMoUETzQOAtuXAmmFPVRuGD6jyOwmM0yyg5MbmNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7661 This adds the "select" method for Broadcast transports. It's role is to change the transport's state from idle to broadcasting. This allows the user to select the desired stream when running the setup with PipeWire since it acquires any transport that is broadcasting. --- profiles/audio/transport.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index 0a890c0ac..bf2215a0f 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -972,6 +972,9 @@ static gboolean get_endpoint(const GDBusPropertyTable *property, return TRUE; } +static DBusMessage *select_transport(DBusConnection *conn, DBusMessage *msg, + void *data); + static const GDBusMethodTable transport_methods[] = { { GDBUS_ASYNC_METHOD("Acquire", NULL, @@ -984,6 +987,8 @@ static const GDBusMethodTable transport_methods[] = { { "mtu_w", "q" }), try_acquire) }, { GDBUS_ASYNC_METHOD("Release", NULL, NULL, release) }, + { GDBUS_ASYNC_METHOD("Select", + NULL, NULL, select_transport) }, { }, }; @@ -1302,6 +1307,25 @@ static void transport_update_playing(struct media_transport *transport, transport_set_state(transport, TRANSPORT_STATE_PENDING); } +static DBusMessage *select_transport(DBusConnection *conn, DBusMessage *msg, + void *data) +{ + struct media_transport *transport = data; + + if (transport->owner != NULL) + return btd_error_not_authorized(msg); + + if (transport->state >= TRANSPORT_STATE_REQUESTING) + return btd_error_not_authorized(msg); + + if (!strcmp(media_endpoint_get_uuid(transport->endpoint), + BAA_SERVICE_UUID)) { + transport_update_playing(transport, TRUE); + } + + return NULL; +} + static void sink_state_changed(struct btd_service *service, sink_state_t old_state, sink_state_t new_state, From patchwork Thu Jul 25 11:58:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Pruteanu X-Patchwork-Id: 13741853 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2064.outbound.protection.outlook.com [40.107.20.64]) (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 378E3199258 for ; Thu, 25 Jul 2024 11:59:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721908781; cv=fail; b=IRH3pUWOmFg8gx7UCSdNh8yeEo7fpbaLWjOl3xcCxCrtOYWC0/6X4iLlTIJBfli4CviOSn/KrSu++eQy+MgXTSfvcrfe5omW4gKT5zs7CQYh2P+MP1jfrjcm8S/D8o7PDZWsF1IkyVehNkVcVMPKaLYKj6mequB/osj3JKhoPiw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721908781; c=relaxed/simple; bh=CmmC6iFRScey7GGcg8bk+zTx0yNf3xCzVlu0pe4Gbgc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=eOTOsmVBzN/lWhDcCnkvKopC+Dseygx4/NBd3Fygk3GzDdeHybatX7OxfMXxiwA8BQ8P86AT8Jw/38u+an9HtDKhiHKwcRW2HK5bLs5VFPYG8aKGc2JXEI+1KC9H3xpuHv+sEAgmTm6o00Dts54IAw79ux7gLBjw043HUzu03L4= 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=MRzjD7se; arc=fail smtp.client-ip=40.107.20.64 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="MRzjD7se" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=i/Pa/JBXpm72VWIeQBEdlfHcm20Vmcr/jZxakXTzeBnjRhzgU/5xwlZwvT7usXQDWJX3/KXTX/IaGVYmPZ7P1BrJ1mPa+SoD1sJCPKizisLzLdvof4RdopBE9FEKlp0/2Xuwg6+KGG3p7NdKN7lWKdsyqrYVdv0rsBN9IpU4ZAbYA8KKBAIA1nYv+5SNw45uZp4wCEC0jpj5/a35RqUAV7m6BqEFjod1xNslt/Cvrf6kFQQZCUc9/2ILTTf3tewqEZMfMlaH8tbha3si16xCJseJvJzmzll5DgyQ93hcY8HXS53sDwrsu9/72ht2jgh6MFSq6fqhp/xNyle4u7L9xw== 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=BAJw/dRco6+vXcKltrgyg5zGhdHLB5te2nNGHf+j2sE=; b=btwj88z/oX+GOFL6bBbHxqo88i8s6ryGEOMU5cbPX5WenjB9sbvpAwrParOOhGaP+vMncW6mriYP8Ibod72XbJXOifsU74lRSWNCE2DOna7ow6w+1MLE7q+XueVX+wisgNwXHUuN1C9oXyJuUXxZSSvyxZWKrvPuy1s18XRUDDMU6fmk5dVyHfC95WFv3chpxzUPvy7rAVky/S34DEB368aqsm5HTXtaE3798LyGCFbC/0V9ldlgx7p+WEqY5jIJctkfny19iWRDWjvF3XvaHhke6umtKCU3V3iu6ymPq0HTTLARZVnzh8M2Wuk46V59JbuaAqhV6/58kG3cuPqeTA== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BAJw/dRco6+vXcKltrgyg5zGhdHLB5te2nNGHf+j2sE=; b=MRzjD7senWtDp7OCeLtH2mpw/T5U3U9GQJ9ZCTOC4tSQrIPk1swpb2ATk8c4Ga+VlmlA4ubHNIpo6EbfU7G/qgU139Duv4FjYxxYy4Ukpnv2xhiFXMXambOedjx8pTZxZyyM8O7MDVUudwCpunOp7Hg4zdplgmXRTgmZt7mA0+8ezbBdPho0I5M2HquH2RgncGOhpONDbRyl3IRSHQu/iyOmjfWXWR2K/bLWQzznrbz3tXYWmryHeMX72/mPnxVZIeL9haDSbjc6Mc8TncnWdUrlxtl5VIYPtDHLnFey5Io9Xm0RvgqQgw7KAbciyoVaWwLJg3LsPtcO61fBWkOo5g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9088.eurprd04.prod.outlook.com (2603:10a6:150:23::20) by PA4PR04MB7661.eurprd04.prod.outlook.com (2603:10a6:102:e3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Thu, 25 Jul 2024 11:59:36 +0000 Received: from GV1PR04MB9088.eurprd04.prod.outlook.com ([fe80::8775:dba3:39ac:3277]) by GV1PR04MB9088.eurprd04.prod.outlook.com ([fe80::8775:dba3:39ac:3277%2]) with mapi id 15.20.7784.017; Thu, 25 Jul 2024 11:59:36 +0000 From: Vlad Pruteanu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, iulia.tanasescu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, pav@iki.fi, Vlad Pruteanu Subject: [PATCH BlueZ v2 4/5] client/player: Expose transport "select" method to the user Date: Thu, 25 Jul 2024 14:58:53 +0300 Message-Id: <20240725115854.234781-5-vlad.pruteanu@nxp.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240725115854.234781-1-vlad.pruteanu@nxp.com> References: <20240725115854.234781-1-vlad.pruteanu@nxp.com> X-ClientProxiedBy: MI1P293CA0026.ITAP293.PROD.OUTLOOK.COM (2603:10a6:290:3::10) To GV1PR04MB9088.eurprd04.prod.outlook.com (2603:10a6:150:23::20) 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: GV1PR04MB9088:EE_|PA4PR04MB7661:EE_ X-MS-Office365-Filtering-Correlation-Id: ea6a0d5e-7737-4b0e-6314-08dcaca14116 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: /4mfgfEFWO3C0Umke1RGAClQX4bI9Pw4GG8Z5VNJgPxum4GYZpkp88i26Pv/gnIuZZS+DJtU6PB3yRLtZuDzcLgnXnpOeip9EbCtvn1AUY40C+9xFi4cy7HzRttFfYuYSWtjx1CdD/khQh319db160mjIDViUbjAlu1mMokBc1yeyIKF9Ou4wI7l3CUsfsYzldFbHh484w2of2TPmnzEfAmaWbM6kpyQRhEr77Ton0+YDPKxfAkRet0aaQD+CWoahy4BSIVSTvNTNOvlINWPsHgVt1APf/Cc8ky7AFtltroXU27eScxY4CHV1jDkWz9YcjcRz8Q25ZrcO17g+molTZF5Ta3SeKmwZVmvHzmbJlH4silA1Oe9glcwMT371gcAcfsw7LOj9AAcBJklkRnKqHaSyxU19NTWrwRu1W5MhxlDcqFVBznjkiDPZG0DGL3iXKt0cbfAYw9eIbAX10g17qnARFb78XAneV92FPB419EJH/FNdaDaT/KMOZFjZH1jqeWBabf+HhdQE2BWhsG95aa7HKorjiNP9jez70MTuJe+0ECPUkBhh7txh+KbZDtiaehoem0MQhpipuNs7/lu1FsCNqFCOpkGJ5TF+jxn888z6SohY5nNg+oDTR+7ULhY0cQ4hUC2qD12bnMKkyzb95V+XW1nvVWNDD4I3myC4YsjmYeH95WQkk+ITRyKZRZk+td1ryVhC3+GPR0CArZ/fl9YKpmqITOlUc+qeHFHo3WNw1f++DLvKa7lW76IknxPuMFGaHMGV7KaQaEkEVm8UK0OSJzb3lIiIb4SfUgWdadCins89yUTyI6fEk/NUJd7rekRQI+ZAb78EQYhIOwdJAJ7ce3VL4oJZ/iH0NAaX4QuCfR6aOEawRpGXJD0T8uynEDsgRzvsS4Na1cGIHx5l7/Z8nAyoMRbxuwX/boA8ynGuLyVI9Kix1ikCet40nNkytpcFQarsbXZQtAkaBMUEEuI+7cldPLnZV6fNePvon5HtlyHlSBMqGx9vOuO+2FfSzs0wPhpXH0qy0RogTbMz5jxXPyr2Ufa5W/DTXiCrdfD+4kNYQR7OhcrNfz+3ztZ5JYAQMFsz+l5dAYjEyAtOZGdBCdjJWYV3lPn7SPq/UNop2e8XGPyBjLOlSF4Ew/Gzmt13i/EZMIISZDWDiCibNC2sJmtnAgO5Q4Rs4h/aX888+V7xUqx5c+WpRnbj1zfydOMlvzbmKrxtOyKTIIpcQlxIeR/rveh0IsNtj38yckZ1Fs2ApzwLm/6fN5F9/yUQrywqAZcgAcQDrkiio/ccv0VTcQS4OGI2Uhfgk84x/u1njcY2qUvdv8NpyS6SGgyOyKi+PizmhGoKZB0z7mp59yMMWCpoRMXMNcDuB10p5qsQa6OvE+1InL/UvyIBN3ucHNUPxDMRoIlhVxKtGyjLQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9088.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Qhmoi83wfoGLOod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T3nsOqNj6ihm+oX9nY/zM+tGpTG0VDFZmBCzQbsg7xm3nSHDdUwywsv87bXWkARQNMXTuIQyPwu9zhdEyAyjHBErpm1Qf3W5k8GF9G0dTjHCGM/MtGAKMHCXt0YeOPN4EvyN5Ut1q49W9VkglrjvpSEjIOFbLV/iit+vMVulaTRCWpsWH+xWNbqtu8sBzAm43M12Cvh7QJB3rqbclb79GF67SS1scnzWHkHWGtpQh2Bvu5fE00VWpCSjpmfNNrpYKJ54y4muPjFkOD/IXtGKgeoNX3jW2kmAXgo8XlPa9sawhDUVbP8077B8V+oWtlD24Ul1B7YVC5y6UbMAY9zEVzhF6Xy6LPcUc3A4c3Xw/bAXM67gicFE/707ELa20k8gvUnXeZj8PctoD7MFiWdD1H3n1QFW6AdOgCGEl4Qf1BEkiZ5Z7VLVdBcCOcfHMklZxNP3bib/2I9nNcx7OixT1BEh+QHMlZSEAM/94UxppiPJcOr1ZeyyTMbLD X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea6a0d5e-7737-4b0e-6314-08dcaca14116 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9088.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2024 11:59:36.4550 (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: uYtSIx8iYxQ5A9OPw7tQmBW9BSJoVrLTmdwW9qGsjd3sfdh2waw8psc94YUaZ/bc6M1ZMNMVEH0Zg595AnIC1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7661 This exposes the "select" method for Broadcast transports. This allows the user to select the desired stream when running the setup with PipeWire since it acquires any transport that is broadcasting. --- client/player.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/client/player.c b/client/player.c index 2480ed64b..30b73c9cd 100644 --- a/client/player.c +++ b/client/player.c @@ -4634,6 +4634,23 @@ static void acquire_reply(DBusMessage *message, void *user_data) return bt_shell_noninteractive_quit(EXIT_FAILURE); } +static void select_reply(DBusMessage *message, void *user_data) +{ + DBusError error; + + dbus_error_init(&error); + + if (dbus_set_error_from_message(&error, message) == TRUE) { + bt_shell_printf("Failed to select: %s\n", error.name); + dbus_error_free(&error); + return bt_shell_noninteractive_quit(EXIT_FAILURE); + } + + bt_shell_printf("Select successful"); + + return bt_shell_noninteractive_quit(EXIT_SUCCESS); +} + static void prompt_acquire(const char *input, void *user_data) { GDBusProxy *proxy = user_data; @@ -4855,6 +4872,38 @@ static void cmd_acquire_transport(int argc, char *argv[]) return bt_shell_noninteractive_quit(EXIT_SUCCESS); } +static void transport_select(GDBusProxy *proxy, bool prompt) +{ + if (!g_dbus_proxy_method_call(proxy, "Select", NULL, + select_reply, proxy, NULL)) { + bt_shell_printf("Failed select transport\n"); + return; + } +} + +static void cmd_select_transport(int argc, char *argv[]) +{ + GDBusProxy *proxy; + int i; + + for (i = 1; i < argc; i++) { + proxy = g_dbus_proxy_lookup(transports, NULL, argv[i], + BLUEZ_MEDIA_TRANSPORT_INTERFACE); + if (!proxy) { + bt_shell_printf("Transport %s not found\n", argv[i]); + return bt_shell_noninteractive_quit(EXIT_FAILURE); + } + + if (find_transport(proxy)) { + bt_shell_printf("Transport %s already acquired\n", + argv[i]); + return bt_shell_noninteractive_quit(EXIT_FAILURE); + } + + transport_select(proxy, false); + } +} + static void release_reply(DBusMessage *message, void *user_data) { struct transport *transport = user_data; @@ -5283,6 +5332,9 @@ static const struct bt_shell_menu transport_menu = { { "volume", " [value]", cmd_volume_transport, "Get/Set transport volume", transport_generator }, + { "select", "", cmd_select_transport, + "Select Transport", + transport_generator }, {} }, }; From patchwork Thu Jul 25 11:58:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Pruteanu X-Patchwork-Id: 13741854 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2064.outbound.protection.outlook.com [40.107.20.64]) (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 6B050199389 for ; Thu, 25 Jul 2024 11:59:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721908783; cv=fail; b=Fr952IOQoaEr/HPyk6B0yA9CXxlaajlhAd9EeIS7DJzYnVdhssRAXRBkaV0i0wOJFZL4vQ07QsVQlbhPYnS4Cz00nAYeBGSJau2/CULU/wXXEKsONYcYSjYPLlmOptoDiLGRcJdn8VsdWGXo/WaI4h7CMpOTSG2qEGRgmN+uiRA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721908783; c=relaxed/simple; bh=ino9CKwMHj0DBv+NzvmAiU/tjI+GV83RaIoS0wgg9DM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=o+Q2V+6rao/pgv0FE1m5qN8Me0djZijGnK220qvyfDMdrdZkPi4nDCFSmtfx+x43DCBQK6g8X4ojFURdoMoyJAYGHOyr15WgfNQ6YRK90SQ76W9mE4Sk7ncze9USuWKBkhqfIgBXBnIedw1qn9U5jcLBkVsyzNlyzcPkw77cqpo= 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=AdWXK9Wx; arc=fail smtp.client-ip=40.107.20.64 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="AdWXK9Wx" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=S5kXK5QxLfOxfDzB0cCyAWp5RTlqcbCRk4At+YTejbdR0XHFz00+gxpv7AhYR0rO5hsS0vB/ofKUpBItgNzwB3eTeZ4s8PbGKKVysA9LlPTNcSr1vkQyRycqwhAkH5oF5Mj5n1iMq2amLMnHISr1J1C5Jxfl4kUMA/7HesGmqG2pnwvz69HGXTdKW6YoqZFmczZbN34FVuROkKf9J9l4ZGPJY/uiPRDCEWOcvkYDhMXsKuHLzwUZubEfoa9o3TP9ehs14eJvrl23MqUhp3C/WYruLr/jI/4NOVvOPs4hbQ7JUYqj363qhcBAyddXq53W2leDYYKPpQwgWzIE4h9hUw== 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=c+RSGohamDFPS6Q8CA4NUxM5hKKveX6/oZNLOFjw3qU=; b=k/jgz7LWmixxwsS7TwVCPJ+obiEzRXAZbMsmOfgZb8MjZu7cqyo0+MHe8+1xidDHDsY/ggY0A2D+olcezH2C4Z78jCgB5LsY2cGWQsLhl4hVFb0anzoPdAiy0pMQZQcyb5iaogAq4Lkb1ZvaYahTO8mWwNS+dJOar9551pJ3Nj7DCKDBBhr6lRk+UV5k7wbkVtORI9aAgl4IOKB6QgzLwuXG83fpJRry0m5vRw9bVRMWrr0Q7uJlp/u0T+GoGJziq77ccQifIwXXhrJd9/dZqwIjk7jdppCSxDAQl/yHSs4UEodcVuGoMQxd+pTxyI/ewwxbp+rpevCgOeqkJQl1nA== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c+RSGohamDFPS6Q8CA4NUxM5hKKveX6/oZNLOFjw3qU=; b=AdWXK9Wx/5ftYYq9VjvukB2OjVh5I9FZg1JDEzZJVXYaxIlLnHA05ATynVaGFfWDm8CEDx2J4gZlD+2dUsnLjKeTnlPoVWgqcooNs2tAXTTIQBDwFiUOdt5leOjnDgN/Oi1xsdoxDRi15AsxoKKmkULW3MHxFZI9hva5k/sEoQ73yyTMZk2oLcjlP38bQDtFQCur011bSKRFH6lcnKjVtWzVQLzRhKlfZtbGgDIeI3LRIayCdHd+LCyqpOgPMmdtAGcPCo913813jKDVqUXEa8KOxojPnmfQvZ91Wnx7X3Lcx4A7s9aYGZU48b5ipex4EE8SwRXQNw6qdGW6FJgWuw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9088.eurprd04.prod.outlook.com (2603:10a6:150:23::20) by PA4PR04MB7661.eurprd04.prod.outlook.com (2603:10a6:102:e3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Thu, 25 Jul 2024 11:59:38 +0000 Received: from GV1PR04MB9088.eurprd04.prod.outlook.com ([fe80::8775:dba3:39ac:3277]) by GV1PR04MB9088.eurprd04.prod.outlook.com ([fe80::8775:dba3:39ac:3277%2]) with mapi id 15.20.7784.017; Thu, 25 Jul 2024 11:59:38 +0000 From: Vlad Pruteanu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, iulia.tanasescu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, pav@iki.fi, Vlad Pruteanu Subject: [PATCH BlueZ v2 5/5] transport: Broadcast sink: wait for user to select transport Date: Thu, 25 Jul 2024 14:58:54 +0300 Message-Id: <20240725115854.234781-6-vlad.pruteanu@nxp.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240725115854.234781-1-vlad.pruteanu@nxp.com> References: <20240725115854.234781-1-vlad.pruteanu@nxp.com> X-ClientProxiedBy: MI1P293CA0026.ITAP293.PROD.OUTLOOK.COM (2603:10a6:290:3::10) To GV1PR04MB9088.eurprd04.prod.outlook.com (2603:10a6:150:23::20) 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: GV1PR04MB9088:EE_|PA4PR04MB7661:EE_ X-MS-Office365-Filtering-Correlation-Id: e7d0c4d3-099c-4232-a638-08dcaca14254 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: wduzzD5KLJOmZrxEcmPGzv7vi1MFieuYDzcpf+vfMCQAb6YKsJUroMgOt2MnWrusqXLfnxx/huOE9U7bJtj6slFGTyY8hq358Haq94L2LC2JdRCJ/DT53I0jwV6+jioBHuW9wGM5GTcUcaTs0VPUmCBUWvNQigcjmI8Zv3cDx5MkFXAi71pzyuCrm5gqSlwKqznzNV9q+dTHcKzj8Fu0SrD17CweuX2J8vJwCmOI5XiZ3BxzU4tcVeEfrHl6pzMf3ueZIIr7fCFsmneRBmNDvf7OVDo1G1iUOCjOEqvSTk6izZNW7rpXJPef2frJuPDnB2MrGr7Xj6wrZqAq9yrHv5x5LNkXywA8lBEDWvHWi5RpsnnoPSYJqHZFCwv1HehrEAAar6kpkiJWBllBHg+ggdQT3bhusKOYSAZVXIRCa9asDLXBcvsbfBOfOXn6eCa5P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urprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5n7wjjnwdEIcJbfz8ZyhwqiIRomegiKg8z6ko/3zdWPDewz/VJl36ePr9SSKJNy9D+kFeh5hsCqq+tMS8eNApLd+zfsahdCmUA9Zk264K01Lh2SWrPLH85I/J1ZphERuK/qCvJzqSfrz/STvwkqzow0eur8yWaL5+LAm3fdOx64fBkEKVXkGV9PXRj0WSx1eLm3HcesyedmK8AurOAGuBlF6zCNXhuF1HclfHGzK3lvXktADSMnVqe+UfBIOj9XiUYJiIR0e0A5Mz+qzRjCqx02mdG/Pb6ABI+/nsqS4bHSSMyk/c/N5G9oj96u5CrSdhS4+SkHbMqRWSdJimlNaDyKmTn9btJEOdsNSoQVYr2NC1Xq4FUfUM8htC1Eh//sDT5dofnVpRcs/NwCj73wo7hdVNwm1p2zO6AxmQfgrE+kyVsMMFaxEzkHI3PI4ArXPKChooTbrffEkMa+/YWvuQ2mTB1Rq/5qam3XAuPC1psuDfyG7t1i+49HMQx5tCw+ksmRWTYeO+1U4EeK8NNN5RB2dI42UQ08SGR2Rf6mRtvrbqDG0tWgc8uWNvi9ANCU55AnzGceja3DoCG2KAm9+JPRDmJfnH75sCbkCaKGpOFFHFy60B9iNHZoS/ZY56EXo6v6L2w7CX98TmY3h0p8TfzOSKEDIhU4EBPeBSpvUgZKWPD4v//IHJ7ZhogtNRa9elOetllA3Ybeiy1OxRKLKc8RrH6RLA9AOhGV9iIutcf+ARew48jqfxrhZHOibyMNsQespNFl23ZgRMuuODZwTQRz9jBonlmSWPC4I7qw/CeZP1NGbZS5qJKKV2rthC98PM49lz6bjh3JkejFQKpUHNseJfZ67wiIHgJ3TR1Z2c1vGv2WDtfXBWByCvQEvGQ7oHrEiFbAgz7PHtSzeEOO3iJKZiVEMPhezkaNboNOds8mZs9rO0mI399WCyOtKNfd2XZS0+NBTsjeiyRsxOZsHhZNKnB5olUUnTJJaPm3b5Ak4orcj7IpWX8xw2+7myaOktZDbM/rFN6Kfjg2oCPrlhHfW9D8PI33sc6iw3JWgoZikDdh16i06oneLD1dfG/SHreYhEx4MYMVJ0Y2ddau2tMvlXiwVpK8M2R6OQHkJ/oeDuYZpHyd9XlEUMsLtrqtO6+CnCZTUwuIvyj0DCFZQ3t67Ec8JpnCosFLVkBD/r642yiL9jYqiaI2zakSTWUqeIwl+cYhJG/NrPsrBUePL9ntgRKSw9QxED3wXuL8HDKX6YO+MimkGlfuOBcqE8fX54BG9X7IAis9Mzt6/SdEYqGerHaZFzug1qeX5H37J+wJVOgl0apK9aAB9bK6EYC2tAvGgz5pZm6BAm1tsZc0qT+Nj/KSHxPLZ6Pzludx3K0eoCUpr5nsshFhwR7Vu0V36knUcdocdG+dYAcqk6RAhkdOkMdIAlKxwbQGgxhda4dCISxQHcNFjpScC4sMk1DkfIu1bbqbHgDYuWypWiW1u6ibBG8Sc6Ts9qWN9c23yEaOGfUr+GQiQMFYn69axHD9qynmt29XI3hBZwraedGOYWpE1+gsbT2DhmZm0maRgSCl/ff22lNOq+zC2roc5qQPv X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7d0c4d3-099c-4232-a638-08dcaca14254 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9088.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2024 11:59:38.4092 (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: 9dBH3/qs9LpPbB3tQnKo/RnRYQ+rk4CqM0Gpdp0Gp5sC0tTaYJ72xYPJYwgjGw9ZHMtZKrB3C7YIbUuDZ/Eo5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7661 This changes the flow for transports created on broadcast sink side. Transports are not automatically changed to pending anymore, instead the user must first run transport.select on them which updates the state to 'broadcasting'. This allows for the selection of the desired stream when running the setup with PipeWire, which acquires any transport that is broadcasting. --- profiles/audio/transport.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index bf2215a0f..54d0ca1f7 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -1303,8 +1303,14 @@ static void transport_update_playing(struct media_transport *transport, if (transport->owner != NULL) media_transport_remove_owner(transport); } - } else if (transport->state == TRANSPORT_STATE_IDLE) - transport_set_state(transport, TRANSPORT_STATE_PENDING); + } else if (transport->state == TRANSPORT_STATE_IDLE) { + if (!strcmp(media_endpoint_get_uuid(transport->endpoint), + BCAA_SERVICE_UUID)) + transport_set_state(transport, + TRANSPORT_STATE_BROADCASTING); + else + transport_set_state(transport, TRANSPORT_STATE_PENDING); + } } static DBusMessage *select_transport(DBusConnection *conn, DBusMessage *msg, @@ -1686,10 +1692,7 @@ static void bap_state_changed(struct bt_bap_stream *stream, uint8_t old_state, bap_update_qos(transport); else if (bt_bap_stream_io_dir(stream) != BT_BAP_BCAST_SOURCE) bap_update_bcast_qos(transport); - if (bt_bap_stream_io_dir(stream) == BT_BAP_BCAST_SOURCE) - transport_update_playing(transport, TRUE); - else - transport_update_playing(transport, FALSE); + transport_update_playing(transport, FALSE); return; case BT_BAP_STREAM_STATE_DISABLING: return;