From patchwork Fri Oct 4 12:35: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: 13822246 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2081.outbound.protection.outlook.com [40.107.104.81]) (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 65CD81D417D for ; Fri, 4 Oct 2024 12:35:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728045360; cv=fail; b=onqRoDWka1yYkpTZ5879BrhyCJWN0nYgxgIsz3nU3MTmZsiyhxhlAIChTQb82itZyFPS0P3cNH9zXOWa/oyLISNAVIzgVyOdq694upVnfXioY3MEC9eZy1IxOTqrwG+79wXgU/JbXdXBe+SktfJoErpttvAWLqAKDGHKInLmgDE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728045360; c=relaxed/simple; bh=6wNahkMbVA2UziGnvNJTEsLL6VUUfg/+tluezrQvQKc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=gM7nGYsw6oQ4Vi3FpKEdlRK6g6t1TWIkh7SeNCcPfB6UFjfZ6estcq2f2jYqesSkkZXWypTIxFt+oxOm0D368Jb33M+8DKmxnxIsFRaWT6deEIZO2LWHL6k5DiIF7DQVJ0/hEXmwPa0lKIGgLirfRwc2q+yVPhOR+3KD56sy5f8= 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=CdLKRoCg; arc=fail smtp.client-ip=40.107.104.81 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="CdLKRoCg" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kXsihAMO8SekLX6UpqO+B84uEpRDjO7Z0D0I9/Pt9IFc8IWgipaWkvDnc1I0JvJz0iokXC8wQOM0ZiJo4hOeGFRJ1hBNOJ7NDyYGqX6yfpsdIVjKkZXFdcnaVTnzOIsjv3+odJO46w6R4SjDKpVrtWX1nHCg4SXhjjDQamYDbsMlWCFoKUdj9sI4Kambto/g7Lf7GD3mu835/aAs/R/fHbrtFNya1ySMWVwJoPrFLOoymgIR6U77yP1dHOFPN+JXv5Dd1sFflAuELScvYgcdoFlS+b0BRzXpraNArW3YuEX57/K1SIntmw/ksJT4vo4yTAbX1REwlk2ijPfKTdNqUA== 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=fUHE+BCh71xxaLeIiI/5JbvF1U5vTxWAMD9djvotLEw=; b=iaSTuhvy3WT1v3QzsqJevmD1EUfLzgVo2PDSvDmtiVKjfwC6D+4tz+WUTiXwzOSn0CkcPSvEtIX/ce9INgos2SCip1ZPXikiIw1rPQwQzRGCyWk8DL1SN8cmr/ZkGiLTcV+hYbgnbziTcjv95LU2gc1ukxdbxnM/G/dUg809vIec/47vmOSQxG17xJHAKeSGK4RgOqesPvA8ZP6w8xFR58IxGNRpGAI9AdwKvnJmOdTNcHyOIhOYG1QUIt6zJPT453vCp2vCzeBbXo2rIrNmNFVVKQvi9d/NHtTmd/05AL3CF5f3qppeOBvT77mt/HqHd3UEN9yxRGsMa5p0FH+wdQ== 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=fUHE+BCh71xxaLeIiI/5JbvF1U5vTxWAMD9djvotLEw=; b=CdLKRoCgyXUl9ZEh2IQRWMQgvifTxKlYAMBs8t0F6/pG5ykLazn8GzARZJDff78A6TxMycFlnbJfETmrBKaA8ymXygKvYoooLVzs7HLlaKyNSAauVeq5f6iqdQjIlABd5JsvKqiAmVb5eMY7j5XdQI6VdiSpTxWolOER0+sHrLAVH93aysQlWrpw7DczW0riwH+c4Lblz29vAkB8ZBzEx0fmAYl3X51UsSL+iehDZlnqwVjPZj7oBd4mGDHLGVOnwKUpflvjRa40TW0NE55jEOaqMkhQ2U/BkBeX39Gjgz3N8n2Aqv4yHfv98N6dTI5/f1P8UaI186w2UH76gW0ZxA== 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 VI2PR04MB11075.eurprd04.prod.outlook.com (2603:10a6:800:27a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.16; Fri, 4 Oct 2024 12:35:54 +0000 Received: from GV1PR04MB9088.eurprd04.prod.outlook.com ([fe80::8775:dba3:39ac:3277]) by GV1PR04MB9088.eurprd04.prod.outlook.com ([fe80::8775:dba3:39ac:3277%3]) with mapi id 15.20.8026.017; Fri, 4 Oct 2024 12:35:54 +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, Vlad Pruteanu Subject: [PATCH BlueZ 9/9] transport: Trigger transport reacquire for multiple BISes sync Date: Fri, 4 Oct 2024 15:35:23 +0300 Message-Id: <20241004123523.1012743-10-vlad.pruteanu@nxp.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241004123523.1012743-1-vlad.pruteanu@nxp.com> References: <20241004123523.1012743-1-vlad.pruteanu@nxp.com> X-ClientProxiedBy: ZR0P278CA0056.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::7) 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_|VI2PR04MB11075:EE_ X-MS-Office365-Filtering-Correlation-Id: 677f9396-b07b-47ab-9a07-08dce4711684 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: 2Mt7pX9nXaeDRDFbcaf+sUd3pZaQV7mzRx59TVG1IOMg55HbtvjT/SD1wymJMPybaqTt97/tHTCPJ3CHDrym+FoyfaD4OFbodP+6IHeuOn8bHqFkHkV/WjsODDi77ue17DfU6/GNkw0VkfFwS/x4YKvdooZJFwQVLA0TbSRxSBiCwabfEwhOULZ5rLZ0xKrpnHr7l/SkPdRYtQyoCzmjf4Qfvp3qgkfwl5PeCWKBnvNLt5cu9y3y7B9X/VH+su3IwbxKxNoj/yFiaK2drKBqkkMdOt5GOMT+29VW2IbZFN0g90eE6Aj2MqXvDfAgQVGUy0O3fYG7VpOo0md2qu18oX3AD87fjSXQtuOM3U2pdvbxPHzS/ySvMr8vXeHiXPXm1zD4IxrTAN0wh5s1bKQBHjxCJ1aYd/ul6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kzbP7Qfg5nigPO9B1DT20Pk0JRXcYy42aJukQGmuiR+enZysf8ilUMFZn8ThbrmtXbwnvXZFwVW5MygoxdDqh6uJ02JVM14lWAugLExDU+/ToJCB6IXfJ4tIlhNA5ETR/XB135kFS+nFE03zuqQpthVQ78/hczib8hpoLgj/5UhtVjEmVLO8Odo7QXbPTxe6c1pT5RwniyWGGV++Oato7liPxkXIZMzMm/GipV2HVcUc7iwdfKRcQohT4pwtzM1lBRNuKHYZw/ijsxAMWbZsVtlGEqLDts4kNl+cs5qthqPMRorLY09MBfWHvFzzvlhCElvuWUnkmzNqV2s8HyjMf72bG1lm5h0bxda7HRaXowypgzZzoICB62EjlyOj2YjY9xG4Cn+tWD0j+P4Oj91D/fmTj6l64a26zOPOXbjZ+FAovvqXdIOxhRWGcUiVT0eaYy6O+L242n0UN1taDLLN7fzm16OR1+fGnt4N6gOGwrG0wpKhCIfcnF/49aY9twvZtF3bK7IZ8YsmrKGJyYHuacovTu3r2YxQ/HkMvFeNtNFIpJOl7FejR4EIthzZWc6ywxgwpVeQqpd2udeOKNucbzuCjNNf9FH7fdpcpoJ1r1P0JI0RMRAHDsRw X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 677f9396-b07b-47ab-9a07-08dce4711684 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9088.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2024 12:35:54.1444 (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: lFChdTvEhbsoOkH6dw6ZroyuLo/FR/rzeUNkkcmwXXTMnBM+ooK90pYXsfPXZtqCgiRdvlB9/wyC5WETtqL9Ig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB11075 Once the transport is release, bap_stop_complete is called. If the transport is part of a sync with multiple BISes, it needs to be reacquired. Such a transport will have it's stream in the BT_BAP_STREAM_STATE_PENDING state. Thus, transport_update_playing with playing set to TRUE must be called. This will set the transport state to BROADCASTING, so that the audio server will automatically acquire it. --- profiles/audio/transport.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index e68695c39..4ea793a27 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -705,13 +705,16 @@ static DBusMessage *try_acquire(DBusConnection *conn, DBusMessage *msg, return NULL; } +static void transport_update_playing(struct media_transport *transport, + gboolean playing); + static void bap_stop_complete(struct bt_bap_stream *stream, uint8_t code, uint8_t reason, void *user_data) { - struct media_owner *owner = user_data; struct media_request *req; - struct media_transport *transport; + struct media_transport *transport = user_data; + struct media_owner *owner = transport->owner; if (!owner) return; @@ -731,6 +734,11 @@ static void bap_stop_complete(struct bt_bap_stream *stream, transport_set_state(transport, TRANSPORT_STATE_IDLE); media_transport_remove_owner(transport); } + if (bt_bap_stream_get_state(stream) == BT_BAP_STREAM_STATE_PENDING) + /* Transports with streams in this state should be reaquired as + * part of a multiple BIS sync. + */ + transport_update_playing(transport, TRUE); } static void bap_disable_complete(struct bt_bap_stream *stream, @@ -1707,7 +1715,8 @@ static guint transport_bap_suspend(struct media_transport *transport, if (bt_bap_stream_get_type(bap->stream) == BT_BAP_STREAM_TYPE_BCAST) { if (transport->owner == owner) - bap_disable_complete(bap->stream, 0x00, 0x00, owner); + bap_disable_complete(bap->stream, 0x00, 0x00, + transport); return 0; }