From patchwork Wed Jul 24 14:34:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Pruteanu X-Patchwork-Id: 814267 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011011.outbound.protection.outlook.com [52.101.65.11]) (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 E1F802D030 for ; Wed, 24 Jul 2024 14:35:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.11 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721831719; cv=fail; b=AWG711qCxlvERXVIEo1Orxq57VzZnAkffCFED3rcVF312ZeVO6d8xzuYk5Uu45RX1xxOgVej+xy+oGKsddhtzIYmGtYOvmpz1RlYnjCcCzNoIoRJMVwvi3HV2p3YCHwXlKoeKJ2f2zavEeo/eH/FBU4vkL/UElnVZ4CEKBvLfEs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721831719; c=relaxed/simple; bh=hwTl/k5FCHD8GY3RQef5b6zrkabjhWZXp7T5+IY+uoI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=UWIPDCFWvWFW8Ir5oh9DPRxA//uQIcuEhGQjJFOQVnnrfNc0M8f5wXPH17BrBBwsmW8HHNY+zsIMyTddciPavQ8lHWSrmfyGLf5WY8z2zYjy+eFiJr94fKQFFNZ7RwoEk6PEC4HxVD05Dv01XlwUHU8Fa290Fi1Pd8Kqamyw1F4= 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=VlBnset1; arc=fail smtp.client-ip=52.101.65.11 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="VlBnset1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GRqT5zaVT8jUPD0/jMGxEx4vTEuuRmWxGJBvQC+T7B4eKrfmLRdzKpWdUG023FH5kjJcnkHhfvnjvj4NHpb+cA/LaW2cbpM7X7SIbZg6Qpt1FBKrO4whANPp5D8A6o5bYHA6LhAmnyvyi5bdP42QFdxfybVDrp0VrRXintNJ6xqUHLPrN4YSICPHzBaH69cZIEmthre8DQn0I4aHaqFt2XDJYNnlQ05nBHSDQC13CJR7N/QJDXCw3Vd+bpxu29ABJxmnxAPF/KqNXYrkAEoOHUFy9Rv6AO9u3hCpSVgWWbFREXeKPHJYEYewmgYSHmfsANlaNAvBD0l/oBR0mDY2Vg== 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=l6RBqQ1diB/5McJByT4aF6OA/d+7zApibgUBVH4lRZw=; b=PzSd+GW+TP4de7KK8E/BH0hsMDI70rUE17fDNO8otRs1JmLEEE6zjwvMderhX+UhfqZhDwAbgzT0ouIo+6l7SX/8oI1UgfWJrqWsxQhAu3paVxLKeYeJzkqLsdPtuMwaiRU8DwNdueVjUDpKqLFmm4gL3dtXdHnZG8APKGeC5c96v5Rw80T2MFAgQtbpXKy+uKlhG8cVavvDrOWy2+XC/dRfk3qaH81DAj2fhEIJVqcx9jv1zMlTMhYHOYRYsZBE3SLKC+EyjRJgZZ0pmCqcC4Zu6eadnsAI1EliI8x4QBa63vHDvuGaBbTd5XxZbhW52VG0MZmYOgFzaPrCPCpy0g== 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=l6RBqQ1diB/5McJByT4aF6OA/d+7zApibgUBVH4lRZw=; b=VlBnset1pMffuyjy/EjUGQajLFzoyiGGkaS/ZUp+gkG7pHAy+TZqP1aFiltWkzQCzQEpIVuh8Oed8k0XuPj6Cdl7/DjRRldb78gCM9F/yPEXEPU1IFKVIqadglvNvnaqv4HFKJKizO6y3GTRQCm0MOyAgD1UtNeMF2cmdyszkFgfvUT7a/P/pxWaEBdrqAM9YGuK2AeCx3ShOk3iEP6Nm3eFtX7tw0+p3s/wZrD10HQtjluQW1SdIc8fF3pO7vbA0IOi90sd1ZZ7bfikebfVoxJEBiQ3k9Ktzy7yTOXVIs9qTGJ9rul7RbaSWE9E8NtlptHrIluWuppsYAu+v3wqDg== 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 AS8PR04MB8024.eurprd04.prod.outlook.com (2603:10a6:20b:2a3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Wed, 24 Jul 2024 14:35:14 +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; Wed, 24 Jul 2024 14:35:14 +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 1/4] transport: Add 'broadcasting' state Date: Wed, 24 Jul 2024 17:34:22 +0300 Message-Id: <20240724143425.165959-2-vlad.pruteanu@nxp.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240724143425.165959-1-vlad.pruteanu@nxp.com> References: <20240724143425.165959-1-vlad.pruteanu@nxp.com> X-ClientProxiedBy: MI2P293CA0010.ITAP293.PROD.OUTLOOK.COM (2603:10a6:290:45::20) 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_|AS8PR04MB8024:EE_ X-MS-Office365-Filtering-Correlation-Id: 858e985c-a592-4d87-3ebd-08dcabedd46c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: f0HgR8aGSqS/xXNDz7GiB5EAjtt/mQjikry4NzazmRvx9KIoFhO/tmq8mgG1oDqOdx5HAhErhrqD76waay9nBPgVK+ahw0deIIh5PlGAikCgTAxm2z9yeXWISpFHRqqASG2NBlhDVOPLnpQWk6w8Q292i8GFUnieeaeL1yoCsLtufELMfqCWOLwFlcANR5Va+qjEsEgXvjNw/wHA4U9sXiLTVAaEjn+11d3E3dzomD2JEbCFWcL6tSHDwPNba3Ew+7bJOtugkunaJ5TeOGkmJ2skP5xTr6GcyyJmSwY63VYmoUhA68MH2LAY5ddbI6uYDtOalRFb9+PmUFkg0UHVph+LMNl6T1aoo6fB9wEe53FBkXKRErVJDCXTW80Eouyd8+0F/ecloLzEUUlxlVeiD1m/KImaHae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SPM; H:GV1PR04MB9088.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Bu6ZK/kxFi+dGFpvv8XKDT8qx0gIit5Wx2XJ9VsdJ5OkVwwivDGZDptQUOduy/6SxxdxrSDxTrtQr3i9zZya4+QC0uc/QMYuBihnLa3GfNvG6yZXnAb6kkj1dpRbBHcJBDrVFFHA/VQwphVryqKUlJfFTAFHBog5/QNG/J/85DBQTrzmLqcG/GxSFp3+eA3v2a++o2nvOFgGrbPtSrDtfkX0h9CzvQ7T50NRD4qSPADB8I82Eav8Gmyx1n8c1t11FDCLlywmnpLXe+Dr5yzYqcL09Hd/k1sup6BaxwF4qac1HQckAibUJ+1ffX1rDLgpnNeN6pEhDgw2KxNui1nLA6BOpGYbond16c1lrc14BmnWgE2/L4A8ff61r4pRDmMp6Jv82Uo/r1ib6KrXWMrLdKE732P9ampfziA8Hb8Sonct1MoeOyQoS1KFFYM1+9nJ+pOXcMWTCNMr1ODf7psW7HgKqqqZKIqU9/dzlja+iAOjI8Aw0PJRjDbOeIEfbnkxxJSXbiWND261ye1PbQ970ERqE4kx+8swGVBmi2rgC0S+ko4KBMoXLHPJjxTM91xmBpwvO8vMz89oHT+7XmO9h9ncFuXDsvaev2Qch7LCpQink2keXyUynt3eRtkoGCp+cKCC0PX9YCsh0qEwce/od0RqyAxVxnlqRpMQIzPFocjN8VeWKg6a2LzC2sl1LNxHH9vie1zaZMklKo4o/Sor19ci652OUpTLZM/nquAWGxUX3xSXy4raZwldOuOddFHv8YrwN8qy6os++fLvEVAkBRuhTnVraq+pEehAs5GTSRMgygQAWfBVbtu8tJlDUKcKNw8Xt9iLAbJz84fxyAD4tHQTXS2Rr4D5Ove3vUrFSue2UwkxoynrJO9VtKpqyLBHUJfsxZRQJqp13Ac5x6q5Txua2xh3bxcN7Nn0GpJqBHbq9QR/h818+22w0tlmOVf/F1/5/VfwnY47TsAheCUax1uV0TCMiaf7RjjIWCa8s+c2QKxvA97IvzjfyrTIJeQdShJPvLwuM8jtWrErqtHbZM1dzs3b3jy5accagWc+uwA5X9sC7Pz+ijA1tqo3VZrENnBoQ6dH2Jsmy/sy85NsaJbd24Oue08JywesDyIWoZNeB5Wtkj2KMy5rXsJaELYKkrLVv6ACF9ewo7xNNvwhXvOwzsiUn4cyeYcejzQTifRikKlAQTaZ3CRFAQVdv7AdlyDDYD7bRUmfi5k9HvBgnG1blzrxMKaFn/93Akk1VFiKhhi/E8oGUKLHKg5hrsPiu+EixSbTuufBGyn0pmBNxOLyxChD5KWc0b1+bC5FTTCW5413LJdJwHXWG35a/3l9i1mcbtnwTwLPZqC7iB8ZtRA28O86bfCl7swUIGxcPwyhaGUGbdAbwjR64Fo+khBZM0cq0Hf5d3JEReMmJVllLRZlahVP9MFWkwfG4bYxBrQOQkvsMgHXCMr51GkY12bVSTbwPYuLkHe6GPeXomIdWPfV+l5VfoV39ttNmMpcRnkiFsOtRosFyTfRdA9TrerGeHJy0DI4BsnyKT07pasFdLkew3hZpt2HaNWoNhM30hOzYvMrIQRqqEkotfWvm0cw X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 858e985c-a592-4d87-3ebd-08dcabedd46c X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9088.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2024 14:35:14.0968 (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: s/2f6v1Bvf002chl2OGEHoBnuJDg96BoyfkWVrNQR85tWM4DbVxuc3e4eVHYsZrjmfhb3Zs5TEIccZSW7l8LEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8024 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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index 922911cf3..017e60fe9 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -51,6 +51,7 @@ typedef enum { TRANSPORT_STATE_IDLE, /* Not acquired and suspended */ TRANSPORT_STATE_PENDING, /* Playing but not acquired */ + TRANSPORT_STATE_BROADCASTING,/* Bcast source waiting to be selected */ TRANSPORT_STATE_REQUESTING, /* Acquire in progress */ TRANSPORT_STATE_ACTIVE, /* Acquired and playing */ TRANSPORT_STATE_SUSPENDING, /* Release in progress */ @@ -59,6 +60,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 +141,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"; @@ -679,7 +683,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 +1286,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 Wed Jul 24 14:34:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Pruteanu X-Patchwork-Id: 814455 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011011.outbound.protection.outlook.com [52.101.65.11]) (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 3B7D915A4B0 for ; Wed, 24 Jul 2024 14:35:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.11 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721831721; cv=fail; b=s/DXBO2TAVOYFGjG0iUtT8q9nLQYM7mdBNge5/KqBQF+3C2Y6do/moG8FGiCFeOWlbiOrNZ3jpB4jJ0jTAzwYyfmTAQnREWtvuhtDMOU56lBAxRDs+FeTw+I9HD/e202YZS5DgU0VYARPu5Sn5LjxWansWg1ZjrcPyFanuN45ag= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721831721; c=relaxed/simple; bh=RMFoeR8JeQh+bbAmGcoASloJYULXAlNy4AYD9iqJ1/o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=GfEX8iuTi3ymZWUAsQMweqRVpoiYgPrA3F6J2kbZLl9Jk54v/H7h9UAUJtRBd5UfD7R0SeG5ZJrlAS2py9BRJBHmJPPSMLqGMl6weaWSJiO1pCaAvx2zDnd+rDuHHDEydk0L4tiLA4DVMDSmlcBquEu6Jw/cbmNEW+zDh+QdEWI= 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=BAzpDczu; arc=fail smtp.client-ip=52.101.65.11 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="BAzpDczu" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TpZ9EaVnryytg+vtqj5SwgqUNvU0f5Vb9oDaPDEufupLPvvd9knZ8rxo2ZW+icKIXeDIDD3IGiv95PWd/pZlCayLo7+p/iQrjZ06KdgM4oXi/1Rtgf0YqqtlQN9MA7au0olEUvuAYb5Gjr9Qto04rRucP+75sCvsJSCtA7ihZoU521ZZEDwQ3cvECEgOF/Q3/mIDdNkyn3kTRQT99m7uv7JPh0CsYsiWymplnTdaR6Dqb9Rg2X13Y4Ugnz9KvoID92eGtXUTFa01fNtgX2FQLEVa6GEOHDK4B11O09z0wjKF8CbxPHFMxgHAYtPOns6wmUoL2Zq3RGKCy+ORLqPWmQ== 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=joLU0J1DSC+cyP+DARdkFe+1sptMD8S/UV8lf/xgTmE=; b=rv/dHjBvFtlP+iYRsztJqc+wIPm2yqPTGRO49wQGDFGFWNpvcG6PYqYfLIfiBW2JtFx9HUjomBmlW1MUQzNyz7EEgyWrLeVaPsDf3JzbSD46/fBS8HjtXtmfOiHerwyBzanyl0ipjmFpKXtLU6POi2HMMVdOTRlGWxpd4lM8QGCq7fuRJ4tWI4mHi7nx1tNOfTBqvZzidnV2FcXelreCQW/heMBp0KtirwvGxSXm7lwuleD+CE+XmBrHvYltAIaFccizwTJwthH6payzO7gtaAnebbZ2qDfO2SYANhnndLrrDHxnklipFuXrxvtFJUeaCn7Qy7lrzyy2MQe8dmYigg== 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=joLU0J1DSC+cyP+DARdkFe+1sptMD8S/UV8lf/xgTmE=; b=BAzpDczuUt4gr+AdV6P50ddYO94klk2FvGLBUo2dn7XbRPqEZ5XyqDAgb9pYEB0oMAyofmzCLku7L6zI1OfLphzYtvhA8M+6E6vaQj1x4TxNM62KCCNWoUyOz7vBS1VgT4R8/SRw1FggItLWAa/vondgv1k0SQdR0Qu0zDqUcxR14cffBdTNohd9d2K1Q8evj8o75DmQKpQY+fOfLb31luK7aJhcg91yOR4LBZ0nR0jXCknTfDCJyHfESt/AZiPhdUEuZ8Ms5ohI4jhyPJe+DZOT8mfFne0st3NROY6MkMLGYLNa6ZnfYAYX0T2FrRDwbZ7G8kIboEhJ823tntjPqA== 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 AS8PR04MB8024.eurprd04.prod.outlook.com (2603:10a6:20b:2a3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Wed, 24 Jul 2024 14:35:17 +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; Wed, 24 Jul 2024 14:35:17 +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 2/4] transport: Add "select" method Date: Wed, 24 Jul 2024 17:34:23 +0300 Message-Id: <20240724143425.165959-3-vlad.pruteanu@nxp.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240724143425.165959-1-vlad.pruteanu@nxp.com> References: <20240724143425.165959-1-vlad.pruteanu@nxp.com> X-ClientProxiedBy: MI2P293CA0010.ITAP293.PROD.OUTLOOK.COM (2603:10a6:290:45::20) 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_|AS8PR04MB8024:EE_ X-MS-Office365-Filtering-Correlation-Id: 75c3b316-56e7-4484-01b0-08dcabedd62f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: kbqQtZfc5wWezhk6HHnBBBSngp1t9LoBUfuMR7cCQr5oF1g+JMhFbzmtYqqcdShJ03O/Q3nHGL0c6EGH8R9wFk8qLgWWq3t1YeLffnkVguzcgdzoN8xNU84yuZzi05mroixh4TXAVN9Q/KWZUH9uCFzRc7hHiqeWk08Zpq/mQ5bt0LDfSzH/Ac5FGNRbyrJTliP3JTqSk2QMDQALBnhrMifnGoWXRWjMobsG2g/Zj2eAyP03T/f6NxayJM8Ebn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O1Cj/1CXjh1r84rSkfAKTdNxTiXm9yA92nW+qtULchjoRKnGsDItbgHs6mRxLOC+Ocw8mLV5PVFQ/rNZ7XOGfF9VYDSZa4Q== 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)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /FlGZLO08ptqDctsv0crDMPP9X6gj0raLY61+2blbRMpyIKINj4LG3aIQewUricXwwnqC3WwP3KH9hcdmxL1B/Aj3XENlxoNIhfu5X7N9Sa/Y8TG8Ox75dFukTbuoy1N7+NKyuGa0yTRXLbY6EEzVKHR7gBldDMCiG0dR8E3Hnz/Rv8DRnVgomxNqi3hstMrReVNRT0V6FcoL4fvHIdvQB/HYHkhYfQ/xZ4iSs0Ha54JoqU2T8z+sRTU10oScFWHWt0w0lFejKVIzSAO2URjWG+Eb6k4feZ+rXglY0vRLHNfar1n5r7ejk6sTw3cKOJPeto4ppOG3nfVhVQTLfElyE5K7TDGkd+qdU1Fju5TAO/QIqBUlem1/y3f2Os5+wGr2ZeijOwB8Taa7JTwxyp2tDE1v1Yj9pE5TrFLKCRYQQheJDDMrs68e8Oienp0lBJXpmQVoIUhI2s3OPYutFOy3+mipWLo2XRTX/PcA11eEi1lwtzqid8j23/499w0DMjVCoEVoNDtbi6OBQcQxxtiyXCzH3PvEb67cJAaxm/0tsBzvlJK9atQssVpZLYTKN7qHH+bMMKmsdu6Hpx8+ljszDxmbERe1mCy5Nu/5sWA48m28l2GOZGOGMbJsLmVu0Pu/Z9Nyo4YRFxFN/Z8u6aK2on8SxLpwhMDTJdqRdyXR38L0wNakS5kivGgZ9ljSM1wi5iwuBARZQqET+e+IguCNJf4gw1uXVbMePRco8gKcFGYSG6T4H8oY421RcSNwVmkWrKFeMrB68PmHGv+tE9GDLu7ndZ4b+heZRrvTEn5/WAHNqXa9047BWJ90JBGy16Tdc7CURopAMYy3BoaFD6AJkZGZb0gDlysDd3EZyTXVDegrjktwwLMpebV0jmRpmRBY/bQYVt4W+hxQGGOQSJCTqPoQBk6Wt1SrSYCZxXB9uOPZHsfw2Oj8vStnEOdX85wRzespx/pTAQwFqklHIC7m8tw+Ch1icxkJs2+bRZkNVzUwS7hhaggmyzyTV25BtsZR+5Zj/VhCD/RE50HMIW9ALuGeRGV58GN17q2dhFxzaX3B6LWjYCW1wsU1YyDlqf6mcDT5mm9J+wB2Zbprrwfwm1dghNI9ryZEYmb1Mtj/8Vgrqu7Pg8pDQKYaLfOH6+NNeLezQ+By7nSj2W39ZvJW1rIMWpapiAZTGto6+692ss61Kn/R4fhwimHckUGebjWRZwQhS2KC+Ava4IRmrM7rUIJkU1o5u+jFLA+NS970w1fYvk3sjCLhPw9O2KbVAp4fagFDbPsEfUP0gelNxTZ+W4/DBBS+5ERzpccJDhq3B54Y33PJGpJG876m3e/x+nl3lQDYo2/v96rWA5YplaBINlglXYpuryiQKX6nl0zlph2JGPnLRiPnY1b/KyPMI4yWUFLY76heg3kHO+JVYZBmUPhjOwHbFWMp1SWE/Q+nNWWF/0ZajUEaUJPvCMhXuE3g6TAvMjaGzzQ6T6kRUhRAd2/gmKF4AJgNGHbWe/SWPUQrOlpGsJXXfv6QFpUD8sUNw2khfDVZX3/eI9IHMhqGTe+Yjj/Ruaxqb/5Z7zeYftcsqjadm0mGymbJw1cbcNi X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 75c3b316-56e7-4484-01b0-08dcabedd62f X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9088.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2024 14:35:17.0741 (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: bvhXvyM+ZXPOcGdKd81lSFai2tyZp/qcuURxjnhPHD1GNDOhRQvHMiqELmC+ulu86UENcxNSU4fRbjR1G3TrFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8024 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 017e60fe9..ce1edbf46 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -968,6 +968,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, @@ -980,6 +983,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) }, { }, }; @@ -1298,6 +1303,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 Wed Jul 24 14:34:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Pruteanu X-Patchwork-Id: 814266 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011011.outbound.protection.outlook.com [52.101.65.11]) (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 76BCD15A853 for ; Wed, 24 Jul 2024 14:35:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.11 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721831723; cv=fail; b=sMaju4YOvAItrxl4JbJORNnUQnJYzAwdggzCEVkww4a1NdpZrQF2iwwYvkYrBWyMZy9LQEbkeeoT1uXRc+PB6ZRcSo25xM/dZuZnwavhrclzF8oyW2gpGQivAb22vMXDcXKGxKkbIrGIcPnWIqkPWvr8TPFPQl5ki6pfCxNsb94= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721831723; c=relaxed/simple; bh=CmmC6iFRScey7GGcg8bk+zTx0yNf3xCzVlu0pe4Gbgc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=dgCOee/JDPCxmayYxPxp/uDO7QP6bDnOXxrvUAHbW9pxd2p4pDN5l0QIQx2i5Hza7H8PiEq/llE7NndaOE++zoJL5yLz9gU8cw/J+koaVJJgNGXsJ4iEJkuQaghJlYW4Pd5mQDzbgI/l/n+ca9EBfRY3h+sDv7oQnxjcWeDAFzI= 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=EfcJI0Q+; arc=fail smtp.client-ip=52.101.65.11 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="EfcJI0Q+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=w9zqxVe/VJpU8HfUaOyRwr2v1CfvV54fSAymld0fAP+CKntbI6d1J59ueQhdIdKzzg3nqY8Aq4aR2lhIWoXYQ39xqNVGiVRbheNBJDssEo5SKWPT305TLgO7AyyCpn5C4DbfBBOOFT01MdVga/4bLTvtxbCGwVJSfwYc9f7YxtCDyis98Bi0WpxJr+5oXMfH7IIe8KoO5Pd2xDHBeV3wtV3xlx5epo+sbK892++7u2WETim1sA/RnRRtrzHzzuTZ+Aa8/6TA4uB6rHqflKWJtMt5+q4SP3zAaq0piG7oH6drBvvU/oOIfcqSb5wIjKcP2xlVo4LCogoQ+fvSbiHykQ== 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=gY+lEWUtd+X1hO86OtQDB/by0jgUluoSpy4CjJu1hCVX87BS8M8cviUzDoXnMvuVpQ3T6zr4cACIiTsUmzLAUDHB9BLqPbW8II0ixNTr9JCX+nOA9X8uIX3VzkMZCI215eVD0vU6Rwi3C4l6nYqIur1sTg9Ohu82tuYw7f70QkbSpu5rcmARDb/fsgOiYsWPtAKYpruONhr2lWYmVdOjpUJtFCaQl8/Zj9Cz7aEKe0qPXfELOVBTwISQl4pUoIYfE9GnN+MSTFD3bFq7Arj9hGlsmE1kHLrr46AWtaDj59M+iy4BP9kEZ6/BROXaO1QqT3mFdmU8rpzmi65+JUWjUw== 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=EfcJI0Q+5QT2mczJjxYim1nFS3ryjqrskxhKefqUdx1ajgR3oJHVEg3+qcdjG/YNpffW6E8BOMWMii9sbruINfayjpOD+1604eayFzvcxE2bhZ0BA8Y1itPJTT5ZMsNrsmJ8SWHoXEvv2Wke8NeHMnRXO502Kpl3TMJKTujFa2UZEvmPXzgTDch8C5guK3jUbnAvR4DRrooAm29xRDhFs5fC3Jqe6c9b9R7pG4QhTXXij0pz01zPbC8Bcots2Q3TbhfksC2FnAvWMNtaC2TgZWOJryrd/AsLK9OlekBWntJP6FtJFYRjZ+mD7rZon5Exg1SOV/ru9tCwl3QfLhbwDg== 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 AS8PR04MB8024.eurprd04.prod.outlook.com (2603:10a6:20b:2a3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Wed, 24 Jul 2024 14:35:20 +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; Wed, 24 Jul 2024 14:35:20 +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 3/4] client/player: Expose transport "select" method to the user Date: Wed, 24 Jul 2024 17:34:24 +0300 Message-Id: <20240724143425.165959-4-vlad.pruteanu@nxp.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240724143425.165959-1-vlad.pruteanu@nxp.com> References: <20240724143425.165959-1-vlad.pruteanu@nxp.com> X-ClientProxiedBy: MI2P293CA0010.ITAP293.PROD.OUTLOOK.COM (2603:10a6:290:45::20) 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_|AS8PR04MB8024:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d62e851-8feb-4ab7-6fc4-08dcabedd806 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: OFVNrzMcdLPT4ttoKL7ooNb3brYWpJY+/s/EghffHHZnhtj0wNmv0jxxSYSLkG/caoSIJ8GC6MZfbsSlkaQk9Y2dAiK503We6BSGupORzeQRDKGyk3hRpyWZX087yIcfmI4RWVcfOy90EAUlmpMyz4j+mOeIGKHVTxKYyF+s9B8JVXUmViAQWHH7kYwVR98jaN72lbI2eDPw7VpIo0gQ31N4f7Oru1KJ6s9dHbUE2X9gAtIO7S22YvY31r5550x6PSHaSw95Ublv379eKpEGldeXH56nT7TfaYtYcXeypxC0/bNTVG1WgsF6aHPA4dva/zGKB8kHne2ZpXWiACMkJVxWwffcnUBM0mhgpY4y/BEdUzas3u+dpZobgFw5DrOI/zrG04CkSuEkQAvVenLYehCLa9HYOAz1iY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:NLI; SFV:NSPM; H:GV1PR04MB9088.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MoWTI5dyMEYDo5sR1rLs/xXgRYpkp83zPtn/TYX2bhr+WGuvrG5/EKBhup7nR1xJo6PQJXTglUq+nXw/ZKqY7OURCR+uCnshbbiD3hgPNN2qT2+KzseNWSnRY7NeJ3wMkbKB3GZJKLDKP6qM4qLePVSB8gIg72NsX4le3JFpOodaNrVc1SNw9owLeN0/BkzxGi7ABfOdx4KwCVQ9x4V0BnSwUeBl3rdLVvaey4fYfvlPfdzy7W4CLAhWPsUNS8+9gQiJzoAlJnuAlr8gMiz9MDI84rOIpkel+PHZTx9yv+12jJNdkRoBbyo8jM0f7AK9kPUztZLKnIy7ggPVr5WQyUszXkznYaR1bVoWPfAJCMOIcoCJyTiXyjPmAXPVTCx6GNnzcR7brLjiARSKr7C35XCTwfgWKTQuIB0QUoGOcVvj3Qz9Jioc99zAmXY5hjEACR4Cx5dVFDG7Ttb4ejyxZ0tLoFhhBM+lrSQ5SMooLZdP4irP1/TI9Th5XXZqNAmUbGQeaHrsH7UY73BDB+SfDF/rzG20nlL234zeHNpw+xV65Rs2gCoBxaiPbaTgNCejIsQcTQQcLLsO+eTmOuLgx+jzwO0O570eE7fBewcjvJuMiNRJTlgLIFiJ22Y7GlCTX7B0OzwNtCZORU7UrYGdrYOevUlNEQ274eKI0dZtfm5zg8HPAS/5fZEATUXiMMJgOtkEoQalsBfpl5Uxlk2BlsU3dfeS9FuFiXWJyGMZDWEl2/8RkRTpheG/R/2eVLML5QPOqOPhFE7yCW63euj54GMADSFtqXU6hRYAYhR9jVRmJFSun4psOKr5kqgjc98G5Qkq8z8TjyjaNJfEranIYNNd8Z4fwahF7gK9ytcymheWqW2Kic0WniIIXw9/qN9/Yf17JeQNwnAzVK7uMe6xZv//WTne6sJ5pR3LrE+dvq/JRanFzwznw5KAgdbOaWqS9coyVhvUddGGN45o/GKw15/Pq6+QbefEYk2CYFVgtmD5Dg5dnNFaxOszJzIioi/xEfhG+fu/nq0RAJRspvELRyqKvgGvd5tU84kZ5TSY2Rl4lp17QI/K0i31Md8sbcH51o32u9eyy5uyWc5batBShIT48YE+QS+bA14vGDRJWj5hHK2Njg5xoEPfalreGNP+2Pvog1Qu/pi2MykfzaaPhSokwbzM0dNkzOm+qc8SzwmlakalI4jO8k7K2o4y2mYse0P3HEv2yvqVgNSe/O1oSwj1mVb8ZNzP8o3TgA5z7QSa6tZdH1MuaQbZyaTv5NWqb8un8JmOpAchgnF8sevC59vEny5rS/QhlWN3SbgrVJCVyA7HxPTjl/Bptf0ILKbZ657M4Kgny/ImBbIRXYnHrWzuVAlg9cXsPHL3c1DWe9CVr7TdL6OsnJJyMXc9LkhwCCJMmiunIDeBEb6w/Q5x1KaiLn6kWwhwuPXh8gXbTUlWVpyGogTXcbZ0XANXz6PodugzXjcyIwRBHIdzbYcaVbbtRFPxFdaencc6cjwMtojsUtae1PLRhIMQ/6mHf7HhZph5owJ2HmlOSUd5sT9FAapz4avqvGcbZS7airaydB/kOrjn7R4Wdtz0kGKKQ6RG X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d62e851-8feb-4ab7-6fc4-08dcabedd806 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9088.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2024 14:35:20.1974 (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: SG1sb8OC1lqgoWHOVDRfLzhxIHN4IQPIkP/mRfdD66HgUGYW69Y/26dw2bi3UOs/RKHb1UoSCYzOnowDe1oPbQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8024 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 Wed Jul 24 14:34:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Pruteanu X-Patchwork-Id: 814454 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012059.outbound.protection.outlook.com [52.101.66.59]) (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 0AADB158871 for ; Wed, 24 Jul 2024 14:35:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721831728; cv=fail; b=ayAHSaCslJvMARufK8nKOeaIcBzJMMUddxa+x/RtFzc3l+lv67iftt1V2K6FR+ohwx0WeNWBDbSrX2+gS41b4vISXZivz09Qo5KvNdFO6ggly0cdXMJ/T28+gJHiBlkpooUwR/NjoMHoZxTD0pagVtmvjMtG4L0DLJIN37bpDCs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721831728; c=relaxed/simple; bh=ou4SbUO7uilT77h4/IoXh+cpb6rbJKfId4Jtc3XM8GE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=iVpIwXm/9Yxsiv4CD6AY+byqIvYitY6ZYSkclrge/YWmtdEW2Av4RBrLrety55WsAUrtcsokZFg1BDkAle3AMOnbSuqyqwQnJy+WLn8vSi3iACiFTE/09bYHek1EAmNirqyPz6dQV1ik3hRQFI9sv3T4QQ6airY6PObtiktgnMA= 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=cAV/MRNz; arc=fail smtp.client-ip=52.101.66.59 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="cAV/MRNz" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WafRvpA4oCQE8TlvmGXdaa1iz3HTv02j98XV19DfLEzFbKOlNmJwTD7oEoGmb9fK2baiVJTZlo/+p4LZyve2CPshj5dmaa+hwt72P7B2FRa8tjV1ZixPzyRqtnFWI2lB1aZK2JEUKv//a9kkM/15TF7HUUw6KgskdcGGldjoceTPx8foSt+UpY3qTDQQzVTW0+FTCd5ThxFsOp+NkRQY5F72aPL4shUaHn0Pa+VDmGCx4VpsFHelBBuG7FTJagVN/5Z9RRShrRj8pZnrskT7MQRsHHGuTP9zwA2O5ksmlmxVz/EPBEH1aWbTMMeaNM06IEUWc/GyQF2iZlgl3fRO6w== 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=BlJ0q9PzlOav6z8uhds3C5JZ7xWggjdHo3Dh0S9swtw=; b=YJDLD/ruS/M2qNtlugGcgkXr1v3m4oO68hCR0raOIJsFgmoeQ+hSxSaNrn07RSCcth+UfEYaV9QU/JcHCwLwBvA6pTR+Yw7p18dNNixy26CaO369iR/qszeI6HOZYSx0CH96Bm1PCyxtj9/M5ulP54pYnTVrGC6+KJ6zLSPXcfkr3mkAVrNrpHj34SPA4OT6BP1GyM8/zVK0tvEDWYGceZEdCWxHPwRsUdtv7532v1f/204JOem2sGrhBFRs4AvXWXS4UIXUBymp2IydoVLk+D/S71YRvNxnFFdDycocZdzFyNzy9YuxdrC9fXCVcLLD0zjuxOP8y7RKnmi0YBxE6A== 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=BlJ0q9PzlOav6z8uhds3C5JZ7xWggjdHo3Dh0S9swtw=; b=cAV/MRNz6pS0X7anhQys0ICYNGkqVzpQ5Q+X0WbiwiWn9b8HEzXLg5wnO1lQtotlXvcbmYjfVexBRrX47ieA66XibBccvB/0cpHj9FY4zU84ie48eQHQb0nKeScjuCoADNisoEgPemCoKYQeuKdzSaxC+JxA/n4pprFDKOiaF8CfqI2Mif42nAvDUbIMyrbEChe9SVjZxGZuTCrLnRbdDJ+YjxK/ICHFRR1QyidJOSlkJR+7d3jbK/EoQIm8PrtCvx78qcQr7+eCCRV4HfDnxlgvOBJMuxczubplF0m4ZdxzRJ49rDjimo+PbZ3JLL8/pPQ1PKlktfaJK1cR3z59mA== 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 GVXPR04MB9994.eurprd04.prod.outlook.com (2603:10a6:150:11a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Wed, 24 Jul 2024 14:35:23 +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; Wed, 24 Jul 2024 14:35:23 +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 4/4] transport: Broadcast sink: wait for user to select transport Date: Wed, 24 Jul 2024 17:34:25 +0300 Message-Id: <20240724143425.165959-5-vlad.pruteanu@nxp.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240724143425.165959-1-vlad.pruteanu@nxp.com> References: <20240724143425.165959-1-vlad.pruteanu@nxp.com> X-ClientProxiedBy: MI2P293CA0010.ITAP293.PROD.OUTLOOK.COM (2603:10a6:290:45::20) 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_|GVXPR04MB9994:EE_ X-MS-Office365-Filtering-Correlation-Id: 63bd304e-7fdb-4c62-71ca-08dcabedd9aa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|366016|52116014|38350700014; X-Microsoft-Antispam-Message-Info: Pgin73Ht8+QK5iEtWV6CMym96tPtV6ankmWhFtdf3Sc5lfffP3wOfLXPmTgW6ifOkscxqVGJAaLDeHnzVDh9SuOOjpi91s7fnYjhDmVxl6fdjnk3yEy4sBI2NS7e2Cm/SIDiw8YMgYKnClX+aK2kUsPkA/FgozrRzhyr3US/IS9jTh1OLyfVIXDEb1ow+uZ1IOY0V8g+PffRTfmraobYPga+v9t2tcQcSWC4Sb9EaHc7+GXXOHAnUDftJs3M2iLeLayOfP9sN87hduYkk8HeuWv6Tca5p5xK/FO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sGRwphynR4wp67esZt9DB2veo42xnWExXFWnS53L0prkCGgMcQzORSGlE4w== 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)(376014)(1800799024)(366016)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: r/zJmJMj6g18k9QZihSl/a4SRD5fSr5XVI/tBcwZOLDUTmMZzxYiwi0G8w/Vttvy8RH8V7lzAA8Mn3GCv43e6ZwStkVUcVhsTv5zsN2wI3fsh/v+GXAzycqLxdC3en8Y6Nc41Ur3gSJ8UVirKam+63jgt3OBRraP6YpMb8TF5uJxMfWdWU/lelCwisyvNPpCrAYWVs7iOP0cMN1MHFu2tgEmtGO3wxWfDGiDdNq97UhY5VaHVjexWQKLrFt3ZRrjRTUMzPBf17UkcB7UJvFpWQJ+9VBSXvmdZUjdhkqV8KYnUuIAylvUHfv1LdMG30RvhpC7MXFfSdhj8hSZuITqc8QsChS7Eo4fFHtunFJWX+Bzf2IZBYvCQkcEls6BC3eYK+/9oWwmBfzZWO2WJhbLePFwqAOjLHc+9nRAM0kRDOgHm4MAt0nyP3KYsxOC/y6aB8rLqVWBYedNhUBW0p51dql7PnPmgErcGNELyWMzMd/ua+mm1MbJXZxeK/LJhFRJoBhnMlex1pTV2Skg56B3m99S7RXkgtj2A1s0+X++W81/brAusENBU+v7HRTtxWhY0U1wqITuYCYlKCO1NYj30gzaAdIjjZ8BEdwNqaVPbcrJFLLk6QGYUQVpmHDAEl7JjKnAMcy/aQVJVFIUB0Q0j/t/L+YIt8XHxlk6q6qg99vO3NBy8yYWOlwIHBYG4JXFTVsxc8AhrjbAEIU0ZGUXNJ9VQyOFTLnum3hbvm8SfDKjoe3tIgxqjjeGZk/ThlgkwnCc90ysXSDcEVSMXtstFD3FQ8zRaD/PTf/5bOzDCJCnef90PlhqqKm5hHXQ9FflLY+sKc0B+1Ed318OgzpmNNulDAreNrjJ5owv8D+oOCxtANtA5M9X4u9ifWDJil7KXLitFCCIvpYWGNqAgorzw3ryqOxxml1SQDK89i75y1mW5WGDXBUejY4/qf2nIvlmFO2E3PsSrOFQCeeVrY0HY2SY9rfMiyt1ASdDrnlPJhchu3nujxMI6fdDumcN6Qq1KM39jWIHgqpiORQkxSeG/vEE77yXOVxAFK3awhmjbf4Gv6j7wDd2N8gOs9ThmvXlKS/4JTyy+8JutxWMLO3yy4F68IY9TiIUUgMQYba2kcMMYh/WgeIBr/ebDVqE7XKXzXGtvILw6oF7uFx4zyByLEk9mH39JLkI6QhCqIEDaZaMd7xlqpDo47HKSg2OL5S3zDxTg4R5Sc4HRVrMyvLMOJODZZsOW3LMrj8Fp4TTS7DZGocnDi8B7jFwTvOCEzEhMckjjFW5C2Vfl+DCZLAd3tQTyKZvsqxZKZbmSrv2DhIUSuoTLJDUdAc7ZFjDJSXFHnxhuZcUbFOS1++szyOSmQ/SE6ySt40orasWsMb+rnqt/ePRrhFvSrBT562//8v07c+j9WR7xIGEkp/NXj0Ag2CWay1SUVoiPRL1DtIqBcORZ+7FA66NaGB/7ktIeRXDJqYIPNSV8hv9HVyyBqo3rHkkP9qYEEbAl6ey44eMtRuHmgjoELL2cffKwK47e8CpJB8jqJL5E+2P/downbEiA7qiHf/qPyEZICVqsilFrizd4KGbsq6PYgkZC+JcMl/E X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63bd304e-7fdb-4c62-71ca-08dcabedd9aa X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9088.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2024 14:35:22.9277 (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: hwtHxAXxHip4D2al8KYJg0PeODJwdjyeDxP3W8iNluvWb1RIbqc7D1cNT1LWvAg2TUf0rR+ZpCWm0Q8UVZ9tEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9994 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 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index ce1edbf46..44e82da38 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -156,6 +156,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: @@ -1299,8 +1300,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, @@ -1682,10 +1689,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;