From patchwork Wed Mar 13 19:43:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 780596 Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E93846426 for ; Wed, 13 Mar 2024 19:44:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710359046; cv=none; b=QnmrKvF85V7t57xsCgQ/WHAGu3wdJHZ+z88hQA4FzkC4OGRs/nWu3wtpcDPJM5D4jpdKObI+Xu11acrJuh018gJWwn1eRvqSA5xlyDN4pVfLyp986j6nXE4l1ld40a4DfY/Ln2iYc8qCmhzHubbGWHcJ1tRR9e8zvbsg9EJ+oRE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710359046; c=relaxed/simple; bh=e4+PHqDauya9n2dspmku/9IFy3579jWCY4iOuSZnHjA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=WLKvy+1jY3aSaLu1Mvhd1HSVVUn/4sa9Ie6FnemY0uesgEAtKiSufN/wrPpvNWmMA3361Yf976pj68hglwg13xHPEkbvv5peYBhwVyylDEzo/HscHZFcc5qwEPwL3t6PiovX28cXd9S/eX3jucAOY+l4Mq7zWVSSkkDrzH1ucU8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CwCRHC3p; arc=none smtp.client-ip=209.85.222.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CwCRHC3p" Received: by mail-ua1-f43.google.com with SMTP id a1e0cc1a2514c-7de0f584da9so80002241.3 for ; Wed, 13 Mar 2024 12:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710359042; x=1710963842; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=lCfHqTTsLIjf6PahHwoSB6au2rlpK/wHDjPqDhpqcc4=; b=CwCRHC3p3xqD+sxS80XqWZhVPLydXoCxP6RdCaG2f9iRj+bjBDH+PjsLXnmYZwQs/Q b0NE1iJPa/KuDAL2iYSWBVJVUUD7tcesCu4pqhMecn8OcYZ3G5G4ZXTQ2xTgrwxdoE3S w1+hC7jkU5f08DZZa1F8uWWslVgLZyox+KUodRUT7xg6nGeM/TN6tWa6ubrYAbWEzNcd lloLod8C+nmFttZcACFiVaS31qBziG57FsIyfNq8fRQO+ckCaMaD9fnnpzanIKTJx5Qu nDEoi6cieEVRw2pvelnSwBIuXrA6Jq/lQ0Vo30HwhePJBGovrniSu8/+lY3mPoFvKeMx Sqbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710359042; x=1710963842; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lCfHqTTsLIjf6PahHwoSB6au2rlpK/wHDjPqDhpqcc4=; b=sALRZjNTaUpKNr8+OA+Qcurq6EJZgvE2A3Frjlt+PtzGJfDwdMIiMZLrj9eurgbnmY 2tSeVP16lifVadYiFwq/7MpVvM8nqL8A8ezRitZdJet0KU6VYt2b+sT5b/1sjA9wGMcD BytzAkihiOyDO3j5JaFUzxPUdas77DJNkmW8k604vKnHuevRUAHBskvcSqf/LGatSgYa EqsGQUrpoM9i1wBkFQwc9qobNemfKNNroML6OsXG5C8L0OWWccV7W6ZG0Fm1TX1uGXTw ISg4nMmCnTXDwOVkvn5LV4tuwFdoPMxnrO/CbR9tCe80vQXzPFDtH8KTTs4GZO4sxovS A68g== X-Gm-Message-State: AOJu0Yx98Yt9ncIrgZXCLC+AxRYhbQZrM4lUXd0hl+VKORJo/jlOLWc+ Tcdw2G3+6ZFOp9ZGrnfZ2vJjRVWjxrPunUoVIB3QOXtr+/f3IWhqPxR6BsWJ X-Google-Smtp-Source: AGHT+IHvorvA3rwf+gSE15zDGGIiDN06JW/S9WbtgGZF1eKZDfMYx9RVZRcPzx75eWpujHmzMVJfeA== X-Received: by 2002:a05:6102:408:b0:475:fd25:3c6 with SMTP id d8-20020a056102040800b00475fd2503c6mr799678vsq.35.1710359042005; Wed, 13 Mar 2024 12:44:02 -0700 (PDT) Received: from lvondent-mobl4.. (107-146-107-067.biz.spectrum.com. [107.146.107.67]) by smtp.gmail.com with ESMTPSA id gd6-20020a056102624600b004730db4e873sm1800259vsb.10.2024.03.13.12.44.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 12:44:01 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v4 1/6] client/player: Split unicast and broadcast presets Date: Wed, 13 Mar 2024 15:43:55 -0400 Message-ID: <20240313194400.1397477-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz Although their name matches unicast and broadcast are not actually the same when it comes to RTN and Max Latency, so this splits their settings into 2 presets tables and fix the values for broadcast. --- client/player.c | 115 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 110 insertions(+), 5 deletions(-) diff --git a/client/player.c b/client/player.c index a40bf66e3967..cb771447bf4b 100644 --- a/client/player.c +++ b/client/player.c @@ -1403,7 +1403,7 @@ static struct codec_preset sbc_presets[] = { .target_latency = 0x03, \ } -static struct codec_preset lc3_presets[] = { +static struct codec_preset lc3_ucast_presets[] = { /* Table 4.43: QoS configuration support setting requirements */ LC3_PRESET("8_1_1", LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_7_5, 26u), @@ -1565,6 +1565,111 @@ static struct codec_preset lc3_presets[] = { LC3_10_UNFRAMED(2 * 120u, 1u, 20u, 10000u)), }; +static struct codec_preset lc3_bcast_presets[] = { + /* Table 6.4: Broadcast Audio Stream configuration support requirements + * for the Broadcast Source and Broadcast Sink + */ + LC3_PRESET("8_1_1", + LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_7_5, 26u), + LC3_7_5_UNFRAMED(26u, 2u, 8u, 40000u)), + LC3_PRESET("8_2_1", + LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_10, 30u), + LC3_10_UNFRAMED(30u, 2u, 10u, 40000u)), + LC3_PRESET("16_1_1", + LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_7_5, 30u), + LC3_7_5_UNFRAMED(30u, 2u, 8u, 40000u)), + LC3_PRESET("16_2_1", + LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_10, 40u), + LC3_10_UNFRAMED(40u, 2u, 10u, 40000u)), + LC3_PRESET("24_1_1", + LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_7_5, 45u), + LC3_7_5_UNFRAMED(45u, 2u, 8u, 40000u)), + LC3_PRESET("24_2_1", + LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_10, 60u), + LC3_10_UNFRAMED(60u, 2u, 10u, 40000u)), + LC3_PRESET("32_1_1", + LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_7_5, 60u), + LC3_7_5_UNFRAMED(60u, 2u, 8u, 40000u)), + LC3_PRESET("32_2_1", + LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_10, 80u), + LC3_10_UNFRAMED(80u, 2u, 10u, 40000u)), + LC3_PRESET("44_1_1", + LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_7_5, 98u), + QOS_FRAMED_2M(8163u, 98u, 4u, 24u, 40000u)), + LC3_PRESET("44_2_1", + LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_10, 130u), + QOS_FRAMED_2M(10884u, 130u, 4u, 31u, 40000u)), + LC3_PRESET("48_1_1", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 75u), + LC3_7_5_UNFRAMED(75u, 4u, 15u, 40000u)), + LC3_PRESET("48_2_1", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 100u), + LC3_10_UNFRAMED(100u, 4u, 20u, 40000u)), + LC3_PRESET("48_3_1", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 90u), + LC3_7_5_UNFRAMED(90u, 4u, 15u, 40000u)), + LC3_PRESET("48_4_1", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 120u), + LC3_10_UNFRAMED(120u, 4u, 20u, 40000u)), + LC3_PRESET("48_5_1", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 117u), + LC3_7_5_UNFRAMED(117u, 4u, 15u, 40000u)), + LC3_PRESET("48_6_1", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 155u), + LC3_10_UNFRAMED(155u, 4u, 20u, 40000u)), + /* Broadcast Audio Stream configuration settings for high-reliability + * audio data. + */ + LC3_PRESET_HR("8_1_2", + LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_7_5, 26u), + LC3_7_5_UNFRAMED(26u, 4u, 45u, 40000u)), + LC3_PRESET_HR("8_2_2", + LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_10, 30u), + LC3_10_UNFRAMED(30u, 4u, 60u, 40000u)), + LC3_PRESET_HR("16_1_2", + LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_7_5, 30u), + LC3_7_5_UNFRAMED(30u, 4u, 45u, 40000u)), + LC3_PRESET_HR("16_2_2", + LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_10, 40u), + LC3_10_UNFRAMED(40u, 4u, 60u, 40000u)), + LC3_PRESET_HR("24_1_2", + LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_7_5, 45u), + LC3_7_5_UNFRAMED(45u, 4u, 45u, 40000u)), + LC3_PRESET_HR("24_2_2", + LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_10, 60u), + LC3_10_UNFRAMED(60u, 4u, 60u, 40000u)), + LC3_PRESET_HR("32_1_2", + LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_7_5, 60u), + LC3_7_5_UNFRAMED(60u, 4u, 45u, 40000u)), + LC3_PRESET_HR("32_2_2", + LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_10, 80u), + LC3_10_UNFRAMED(80u, 4u, 60u, 40000u)), + LC3_PRESET_HR("44_1_2", + LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_7_5, 98u), + QOS_FRAMED_2M(8163u, 4u, 13u, 54u, 40000u)), + LC3_PRESET_HR("44_2_2", + LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_10, 130u), + QOS_FRAMED_2M(10884u, 130u, 4u, 60u, 40000u)), + LC3_PRESET_HR("48_1_2", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 75u), + LC3_7_5_UNFRAMED(75u, 4u, 50u, 40000u)), + LC3_PRESET_HR("48_2_2", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 100u), + LC3_10_UNFRAMED(100u, 4u, 65u, 40000u)), + LC3_PRESET_HR("48_3_2", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 90u), + LC3_7_5_UNFRAMED(90u, 4u, 50u, 40000u)), + LC3_PRESET_HR("48_4_2", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 120u), + LC3_10_UNFRAMED(120u, 4u, 65u, 40000u)), + LC3_PRESET_HR("48_5_2", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 117u), + LC3_7_5_UNFRAMED(117u, 4u, 50u, 40000u)), + LC3_PRESET_HR("48_6_2", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 155u), + LC3_10_UNFRAMED(155u, 4u, 65u, 40000u)), +}; + static void print_ltv(const char *str, void *user_data) { const char *label = user_data; @@ -1615,10 +1720,10 @@ static struct preset { } presets[] = { PRESET(A2DP_SOURCE_UUID, A2DP_CODEC_SBC, sbc_presets, 6), PRESET(A2DP_SINK_UUID, A2DP_CODEC_SBC, sbc_presets, 6), - PRESET(PAC_SINK_UUID, LC3_ID, lc3_presets, 3), - PRESET(PAC_SOURCE_UUID, LC3_ID, lc3_presets, 3), - PRESET(BCAA_SERVICE_UUID, LC3_ID, lc3_presets, 3), - PRESET(BAA_SERVICE_UUID, LC3_ID, lc3_presets, 3), + PRESET(PAC_SINK_UUID, LC3_ID, lc3_ucast_presets, 3), + PRESET(PAC_SOURCE_UUID, LC3_ID, lc3_ucast_presets, 3), + PRESET(BCAA_SERVICE_UUID, LC3_ID, lc3_bcast_presets, 3), + PRESET(BAA_SERVICE_UUID, LC3_ID, lc3_bcast_presets, 3), }; static void parse_vendor_codec(const char *codec, uint16_t *vid, uint16_t *cid) From patchwork Wed Mar 13 19:43:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 780132 Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 27C2E46426 for ; Wed, 13 Mar 2024 19:44:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710359049; cv=none; b=QYqtVCLakH8idDV/9bVjQTAEh/jUxgVWeqIutZ0PWVQS3Vbj6W2IoC3MjUODY+iP3/j0mbSkaZ3AZ/aaXiinA6k3QzLcX3PvqfTuPEBQ3K5jjbjLuykGOD+0QzdRvPTZk47PnvIhD7XvcTX8PNnali1sVHDJWB3QgtZ61hCF4bE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710359049; c=relaxed/simple; bh=cfNY3BBkfwla0T7BeuhyZ1NNOs+VAaGvidP52JFYiQw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HTp04e1NM31gfHMYvOAB31q0q4gV3myXFvM06ADUfAcNGk05x6fGFusT8zbPCJPojRtYNXIqt3S8V8YQR/ejBe0OEFUeDiqF8IaKjrQsszNu/jDk2xcU85eORrmwETw3oqX54nn07d3x7CC0aBZE6jlyYr6RN+rB//XQO7SSCDY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kgGGUTBO; arc=none smtp.client-ip=209.85.217.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kgGGUTBO" Received: by mail-vs1-f47.google.com with SMTP id ada2fe7eead31-475ffc62cbaso49360137.1 for ; Wed, 13 Mar 2024 12:44:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710359045; x=1710963845; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=9MZuY6HijLPSzb+nauMJkoEggmbfDWPgO2STK/0p2VQ=; b=kgGGUTBOJBK4Go9W+y7RLEvN3kIVB3jCKsJmBrPdQDkm44ndYjprGlQZ92cEj6iJo6 TD6WT6d4M70LJalrDX5cxteXCKUMUzc5YMcI/91d016gsBjOoH29tfDj2+Mo9/SJX2KT a/MReJ5qTmrj4m6gpwUK1+biY5zUITHcj2FEwUokOef6vhvcamPU0r6lUdWMRmEGiZrJ U9TxNsn4xo47eLFJ4JkwSmxeboI61HfEAQwvN172ToTs3ngIczQIvJUh0r5HFYK1qJeT ZROfChEOfp8TDW4Fu3jmU8xBbAZU9W1acLTL7EBXUdWOwIhHEsn2jKluI/sBHr4jgpcl a1eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710359045; x=1710963845; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9MZuY6HijLPSzb+nauMJkoEggmbfDWPgO2STK/0p2VQ=; b=jc3sNRI4308eBoq13jW7vLRGPTP+o2ja44o/ggFVkR+QOfTkK2zu9mGojHtQhiU+Zp td359zuLD8dhXKC8pKTmGuQ+Fxhb62+NXGaqoHz61ZrIbkcs2LFCHnzCzZMHdDwsOmcZ 7mTWgelqg2mQYWtsv4IiKquzhYN+vmZCETidKkhAmzxsLK+444UGH7Y2/a8zCXJ1XFAR FM7qN0xSLiYhvkwfbsU482VUcHESZ2ZRd9gCzjvv7Q4IWQb0WHIp+3NGOrnAqdHuZYTn Wxi113Ho3XokgK7TuxfDj0ZNLmme2cL221q40Qd1PvC80hAM70205vNRgEptaN1ojAJK eW9A== X-Gm-Message-State: AOJu0YzJ+sxEtPPPLRIzPpfTyaooHfYvx0yqTfTuCDuseEIcEjPbAUUD xjXnd09ynQ3mZ6dXQeAi8WQtMxZdqY9Nsch31s4aWhAmBc34RbPBdDQN4V2v X-Google-Smtp-Source: AGHT+IGqh/K52qqbLkfgrk2aPe1AvZXL+j4+OxBffQo3JE8XoOVEzC8ongYpGF6N+AfO94zJFXYhqw== X-Received: by 2002:a67:f88f:0:b0:474:cef2:e638 with SMTP id h15-20020a67f88f000000b00474cef2e638mr957082vso.26.1710359044546; Wed, 13 Mar 2024 12:44:04 -0700 (PDT) Received: from lvondent-mobl4.. (107-146-107-067.biz.spectrum.com. [107.146.107.67]) by smtp.gmail.com with ESMTPSA id gd6-20020a056102624600b004730db4e873sm1800259vsb.10.2024.03.13.12.44.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 12:44:02 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v4 2/6] client/player: Use macros from lc3.h to define presets Date: Wed, 13 Mar 2024 15:43:56 -0400 Message-ID: <20240313194400.1397477-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313194400.1397477-1-luiz.dentz@gmail.com> References: <20240313194400.1397477-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz This makes use of macros for for lc3.h to define preset configuration and remove existing macros since they were just duplicates. --- client/player.c | 294 ++++++++++++++---------------------------------- 1 file changed, 82 insertions(+), 212 deletions(-) diff --git a/client/player.c b/client/player.c index cb771447bf4b..ab8cb7434cdc 100644 --- a/client/player.c +++ b/client/player.c @@ -1337,48 +1337,6 @@ static struct codec_preset sbc_presets[] = { #define LC3_10_FRAMED(_sdu, _rtn, _latency, _delay) \ QOS_FRAMED_2M(10000u, _sdu, _rtn, _latency, _delay) -#define LC3_PRESET_DATA(_freq, _duration, _len) \ - UTIL_IOV_INIT(0x02, LC3_CONFIG_FREQ, _freq, \ - 0x02, LC3_CONFIG_DURATION, _duration, \ - 0x03, LC3_CONFIG_FRAME_LEN, _len, _len >> 8) - -#define LC3_PRESET_DATA_ALL(_freq, _duration, _alloc, _len) \ - UTIL_IOV_INIT(0x02, LC3_CONFIG_FREQ, _freq, \ - 0x02, LC3_CONFIG_DURATION, _duration, \ - 0x05, LC3_CONFIG_CHAN_ALLOC, _alloc, _alloc >> 8, \ - _alloc >> 16, _alloc >> 24, \ - 0x03, LC3_CONFIG_FRAME_LEN, _len, _len >> 8) - -#define LC3_PRESET_8KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_8KHZ, _duration, _len) - -#define LC3_PRESET_11KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_11KHZ, _duration, _len) - -#define LC3_PRESET_16KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_16KHZ, _duration, _len) - -#define LC3_PRESET_22KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_22KHZ, _duration, _len) - -#define LC3_PRESET_24KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_24KHZ, _duration, _len) - -#define LC3_PRESET_32KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_32KHZ, _duration, _len) - -#define LC3_PRESET_32KHZ_ALL(_duration, _len, _alloc) \ - LC3_PRESET_DATA_ALL(LC3_CONFIG_FREQ_48KHZ, _duration, _alloc, _len) - -#define LC3_PRESET_44KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_44KHZ, _duration, _len) - -#define LC3_PRESET_48KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_48KHZ, _duration, _len) - -#define LC3_PRESET_48KHZ_ALL(_duration, _len, _alloc) \ - LC3_PRESET_DATA_ALL(LC3_CONFIG_FREQ_48KHZ, _duration, _alloc, _len) - #define LC3_PRESET_LL(_name, _data, _qos) \ { \ .name = _name, \ @@ -1405,163 +1363,107 @@ static struct codec_preset sbc_presets[] = { static struct codec_preset lc3_ucast_presets[] = { /* Table 4.43: QoS configuration support setting requirements */ - LC3_PRESET("8_1_1", - LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_7_5, 26u), + LC3_PRESET("8_1_1", LC3_CONFIG_8_1, LC3_7_5_UNFRAMED(26u, 2u, 8u, 40000u)), - LC3_PRESET("8_2_1", - LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_10, 30u), + LC3_PRESET("8_2_1", LC3_CONFIG_8_2, LC3_10_UNFRAMED(30u, 2u, 10u, 40000u)), - LC3_PRESET("16_1_1", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_7_5, 30u), + LC3_PRESET("16_1_1", LC3_CONFIG_16_1, LC3_7_5_UNFRAMED(30u, 2u, 8u, 40000u)), - LC3_PRESET("16_2_1", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_10, 40u), + LC3_PRESET("16_2_1", LC3_CONFIG_16_2, LC3_10_UNFRAMED(40u, 2u, 10u, 40000u)), - LC3_PRESET("24_1_1", - LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_7_5, 45u), + LC3_PRESET("24_1_1", LC3_CONFIG_24_1, LC3_7_5_UNFRAMED(45u, 2u, 8u, 40000u)), - LC3_PRESET("24_2_1", - LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_10, 60u), + LC3_PRESET("24_2_1", LC3_CONFIG_24_2, LC3_10_UNFRAMED(60u, 2u, 10u, 40000u)), - LC3_PRESET("32_1_1", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_7_5, 60u), + LC3_PRESET("32_1_1", LC3_CONFIG_32_1, LC3_7_5_UNFRAMED(60u, 2u, 8u, 40000u)), - LC3_PRESET("32_2_1", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_10, 80u), + LC3_PRESET("32_2_1", LC3_CONFIG_32_2, LC3_10_UNFRAMED(80u, 2u, 10u, 40000u)), - LC3_PRESET("44_1_1", - LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_7_5, 98u), + LC3_PRESET("44_1_1", LC3_CONFIG_44_1, QOS_FRAMED_2M(8163u, 98u, 5u, 24u, 40000u)), - LC3_PRESET("44_2_1", - LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_10, 130u), + LC3_PRESET("44_2_1", LC3_CONFIG_44_2, QOS_FRAMED_2M(10884u, 130u, 5u, 31u, 40000u)), - LC3_PRESET("48_1_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 75u), + LC3_PRESET("48_1_1", LC3_CONFIG_48_1, LC3_7_5_UNFRAMED(75u, 5u, 15u, 40000u)), - LC3_PRESET("48_2_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 100u), + LC3_PRESET("48_2_1", LC3_CONFIG_48_2, LC3_10_UNFRAMED(100u, 5u, 20u, 40000u)), - LC3_PRESET("48_3_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 90u), + LC3_PRESET("48_3_1", LC3_CONFIG_48_3, LC3_7_5_UNFRAMED(90u, 5u, 15u, 40000u)), - LC3_PRESET("48_4_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 120u), + LC3_PRESET("48_4_1", LC3_CONFIG_48_4, LC3_10_UNFRAMED(120u, 5u, 20u, 40000u)), - LC3_PRESET("48_5_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 117u), + LC3_PRESET("48_5_1", LC3_CONFIG_48_5, LC3_7_5_UNFRAMED(117u, 5u, 15u, 40000u)), - LC3_PRESET("48_6_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 155u), + LC3_PRESET("48_6_1", LC3_CONFIG_48_6, LC3_10_UNFRAMED(155u, 5u, 20u, 40000u)), /* QoS Configuration settings for high reliability audio data */ - LC3_PRESET_HR("8_1_2", - LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_7_5, 26u), + LC3_PRESET_HR("8_1_2", LC3_CONFIG_8_1, LC3_7_5_UNFRAMED(26u, 13u, 75u, 40000u)), - LC3_PRESET_HR("8_2_2", - LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_10, 30u), + LC3_PRESET_HR("8_2_2", LC3_CONFIG_8_2, LC3_10_UNFRAMED(30u, 13u, 95u, 40000u)), - LC3_PRESET_HR("16_1_2", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_7_5, 30u), + LC3_PRESET_HR("16_1_2", LC3_CONFIG_16_1, LC3_7_5_UNFRAMED(30u, 13u, 75u, 40000u)), - LC3_PRESET_HR("16_2_2", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_10, 40u), + LC3_PRESET_HR("16_2_2", LC3_CONFIG_16_2, LC3_10_UNFRAMED(40u, 13u, 95u, 40000u)), - LC3_PRESET_HR("24_1_2", - LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_7_5, 45u), + LC3_PRESET_HR("24_1_2", LC3_CONFIG_24_1, LC3_7_5_UNFRAMED(45u, 13u, 75u, 40000u)), - LC3_PRESET_HR("24_2_2", - LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_10, 60u), + LC3_PRESET_HR("24_2_2", LC3_CONFIG_24_2, LC3_10_UNFRAMED(60u, 13u, 95u, 40000u)), - LC3_PRESET_HR("32_1_2", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_7_5, 60u), + LC3_PRESET_HR("32_1_2", LC3_CONFIG_32_1, LC3_7_5_UNFRAMED(60u, 13u, 75u, 40000u)), - LC3_PRESET_HR("32_2_2", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_10, 80u), + LC3_PRESET_HR("32_2_2", LC3_CONFIG_32_2, LC3_10_UNFRAMED(80u, 13u, 95u, 40000u)), - LC3_PRESET_HR("44_1_2", - LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_7_5, 98u), + LC3_PRESET_HR("44_1_2", LC3_CONFIG_44_1, QOS_FRAMED_2M(8163u, 98u, 13u, 80u, 40000u)), - LC3_PRESET_HR("44_2_2", - LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_10, 130u), + LC3_PRESET_HR("44_2_2", LC3_CONFIG_44_2, QOS_FRAMED_2M(10884u, 130u, 13u, 85u, 40000u)), - LC3_PRESET_HR("48_1_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 75u), + LC3_PRESET_HR("48_1_2", LC3_CONFIG_48_1, LC3_7_5_UNFRAMED(75u, 13u, 75u, 40000u)), - LC3_PRESET_HR("48_2_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 100u), + LC3_PRESET_HR("48_2_2", LC3_CONFIG_48_2, LC3_10_UNFRAMED(100u, 13u, 95u, 40000u)), - LC3_PRESET_HR("48_3_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 90u), + LC3_PRESET_HR("48_3_2", LC3_CONFIG_48_3, LC3_7_5_UNFRAMED(90u, 13u, 75u, 40000u)), - LC3_PRESET_HR("48_4_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 120u), + LC3_PRESET_HR("48_4_2", LC3_CONFIG_48_4, LC3_10_UNFRAMED(120u, 13u, 100u, 40000u)), - LC3_PRESET_HR("48_5_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 117u), + LC3_PRESET_HR("48_5_2", LC3_CONFIG_48_5, LC3_7_5_UNFRAMED(117u, 13u, 75u, 40000u)), - LC3_PRESET_HR("48_6_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 155u), + LC3_PRESET_HR("48_6_2", LC3_CONFIG_48_6, LC3_10_UNFRAMED(155u, 13u, 100u, 40000u)), /* QoS configuration support setting requirements for the UGG and UGT */ - LC3_PRESET_LL("16_1_gs", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_7_5, 30u), + LC3_PRESET_LL("16_1_gs", LC3_CONFIG_16_1, LC3_7_5_UNFRAMED(30u, 1u, 15u, 60000u)), - LC3_PRESET_LL("16_2_gs", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_10, 40u), + LC3_PRESET_LL("16_2_gs", LC3_CONFIG_16_2, LC3_10_UNFRAMED(40u, 1u, 20u, 60000u)), - LC3_PRESET_LL("32_1_gs", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_7_5, 60u), + LC3_PRESET_LL("32_1_gs", LC3_CONFIG_32_1, LC3_7_5_UNFRAMED(60u, 1u, 15u, 60000u)), - LC3_PRESET_LL("32_2_gs", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_10, 80u), + LC3_PRESET_LL("32_2_gs", LC3_CONFIG_32_2, LC3_10_UNFRAMED(80u, 1u, 20u, 60000u)), - LC3_PRESET_LL("48_1_gs", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 75u), + LC3_PRESET_LL("48_1_gs", LC3_CONFIG_48_1, LC3_7_5_UNFRAMED(75u, 1u, 15u, 60000u)), - LC3_PRESET_LL("48_2_gs", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 100u), + LC3_PRESET_LL("48_2_gs", LC3_CONFIG_48_2, LC3_10_UNFRAMED(100u, 1u, 20u, 60000u)), - LC3_PRESET_LL("32_1_gr", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_7_5, 60u), + LC3_PRESET_LL("32_1_gr", LC3_CONFIG_32_1, LC3_7_5_UNFRAMED(60u, 1u, 15u, 10000u)), - LC3_PRESET_LL("32_2_gr", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_10, 80u), + LC3_PRESET_LL("32_2_gr", LC3_CONFIG_32_2, LC3_10_UNFRAMED(80u, 1u, 20u, 10000u)), - LC3_PRESET_LL("48_1_gr", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 75u), + LC3_PRESET_LL("48_1_gr", LC3_CONFIG_48_1, LC3_7_5_UNFRAMED(75u, 1u, 15u, 10000u)), - LC3_PRESET_LL("48_2_gr", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 100u), + LC3_PRESET_LL("48_2_gr", LC3_CONFIG_48_2, LC3_10_UNFRAMED(100u, 1u, 20u, 10000u)), - LC3_PRESET_LL("48_3_gr", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 90u), + LC3_PRESET_LL("48_3_gr", LC3_CONFIG_48_3, LC3_7_5_UNFRAMED(90u, 1u, 15u, 10000u)), - LC3_PRESET_LL("48_4_gr", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 120u), + LC3_PRESET_LL("48_4_gr", LC3_CONFIG_48_4, LC3_10_UNFRAMED(120u, 1u, 20u, 10000u)), - LC3_PRESET_LL("32_1_gr_l+r", - LC3_PRESET_32KHZ_ALL(LC3_CONFIG_DURATION_7_5, 60u, - 0x00000003), + LC3_PRESET_LL("32_1_gr_l+r", LC3_CONFIG_32_1_AC(2), LC3_7_5_UNFRAMED(2 * 60u, 1u, 15u, 10000u)), - LC3_PRESET_LL("32_2_gr_l+r", - LC3_PRESET_32KHZ_ALL(LC3_CONFIG_DURATION_10, 80u, - 0x00000003), + LC3_PRESET_LL("32_2_gr_l+r", LC3_CONFIG_32_2_AC(2), LC3_10_UNFRAMED(2 * 80u, 1u, 20u, 10000u)), - LC3_PRESET_LL("48_1_gr_l+r", - LC3_PRESET_48KHZ_ALL(LC3_CONFIG_DURATION_7_5, 75u, - 0x00000003), + LC3_PRESET_LL("48_1_gr_l+r", LC3_CONFIG_48_1_AC(2), LC3_7_5_UNFRAMED(2 * 75u, 1u, 15u, 10000u)), - LC3_PRESET_LL("48_2_gr_l+r", - LC3_PRESET_48KHZ_ALL(LC3_CONFIG_DURATION_10, 100u, - 0x00000003), + LC3_PRESET_LL("48_2_gr_l+r", LC3_CONFIG_48_2_AC(2), LC3_10_UNFRAMED(2 * 100u, 1u, 20u, 10000u)), - LC3_PRESET_LL("48_3_gr_l+r", - LC3_PRESET_48KHZ_ALL(LC3_CONFIG_DURATION_7_5, 90u, - 0x00000003), + LC3_PRESET_LL("48_3_gr_l+r", LC3_CONFIG_48_3_AC(2), LC3_7_5_UNFRAMED(2 * 90u, 1u, 15u, 10000u)), - LC3_PRESET_LL("48_4_gr_l+r", - LC3_PRESET_48KHZ_ALL(LC3_CONFIG_DURATION_10, 120u, - 0x00000003), + LC3_PRESET_LL("48_4_gr_l+r", LC3_CONFIG_48_4_AC(2), LC3_10_UNFRAMED(2 * 120u, 1u, 20u, 10000u)), }; @@ -1569,104 +1471,72 @@ static struct codec_preset lc3_bcast_presets[] = { /* Table 6.4: Broadcast Audio Stream configuration support requirements * for the Broadcast Source and Broadcast Sink */ - LC3_PRESET("8_1_1", - LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_7_5, 26u), + LC3_PRESET("8_1_1", LC3_CONFIG_8_1, LC3_7_5_UNFRAMED(26u, 2u, 8u, 40000u)), - LC3_PRESET("8_2_1", - LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_10, 30u), + LC3_PRESET("8_2_1", LC3_CONFIG_8_2, LC3_10_UNFRAMED(30u, 2u, 10u, 40000u)), - LC3_PRESET("16_1_1", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_7_5, 30u), + LC3_PRESET("16_1_1", LC3_CONFIG_16_1, LC3_7_5_UNFRAMED(30u, 2u, 8u, 40000u)), - LC3_PRESET("16_2_1", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_10, 40u), + LC3_PRESET("16_2_1", LC3_CONFIG_16_2, LC3_10_UNFRAMED(40u, 2u, 10u, 40000u)), - LC3_PRESET("24_1_1", - LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_7_5, 45u), + LC3_PRESET("24_1_1", LC3_CONFIG_24_1, LC3_7_5_UNFRAMED(45u, 2u, 8u, 40000u)), - LC3_PRESET("24_2_1", - LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_10, 60u), + LC3_PRESET("24_2_1", LC3_CONFIG_24_2, LC3_10_UNFRAMED(60u, 2u, 10u, 40000u)), - LC3_PRESET("32_1_1", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_7_5, 60u), + LC3_PRESET("32_1_1", LC3_CONFIG_32_1, LC3_7_5_UNFRAMED(60u, 2u, 8u, 40000u)), - LC3_PRESET("32_2_1", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_10, 80u), + LC3_PRESET("32_2_1", LC3_CONFIG_32_2, LC3_10_UNFRAMED(80u, 2u, 10u, 40000u)), - LC3_PRESET("44_1_1", - LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_7_5, 98u), + LC3_PRESET("44_1_1", LC3_CONFIG_44_1, QOS_FRAMED_2M(8163u, 98u, 4u, 24u, 40000u)), - LC3_PRESET("44_2_1", - LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_10, 130u), + LC3_PRESET("44_2_1", LC3_CONFIG_44_2, QOS_FRAMED_2M(10884u, 130u, 4u, 31u, 40000u)), - LC3_PRESET("48_1_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 75u), + LC3_PRESET("48_1_1", LC3_CONFIG_48_1, LC3_7_5_UNFRAMED(75u, 4u, 15u, 40000u)), - LC3_PRESET("48_2_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 100u), + LC3_PRESET("48_2_1", LC3_CONFIG_48_2, LC3_10_UNFRAMED(100u, 4u, 20u, 40000u)), - LC3_PRESET("48_3_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 90u), + LC3_PRESET("48_3_1", LC3_CONFIG_48_3, LC3_7_5_UNFRAMED(90u, 4u, 15u, 40000u)), - LC3_PRESET("48_4_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 120u), + LC3_PRESET("48_4_1", LC3_CONFIG_48_4, LC3_10_UNFRAMED(120u, 4u, 20u, 40000u)), - LC3_PRESET("48_5_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 117u), + LC3_PRESET("48_5_1", LC3_CONFIG_48_5, LC3_7_5_UNFRAMED(117u, 4u, 15u, 40000u)), - LC3_PRESET("48_6_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 155u), + LC3_PRESET("48_6_1", LC3_CONFIG_48_6, LC3_10_UNFRAMED(155u, 4u, 20u, 40000u)), /* Broadcast Audio Stream configuration settings for high-reliability * audio data. */ - LC3_PRESET_HR("8_1_2", - LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_7_5, 26u), + LC3_PRESET_HR("8_1_2", LC3_CONFIG_8_1, LC3_7_5_UNFRAMED(26u, 4u, 45u, 40000u)), - LC3_PRESET_HR("8_2_2", - LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_10, 30u), + LC3_PRESET_HR("8_2_2", LC3_CONFIG_8_2, LC3_10_UNFRAMED(30u, 4u, 60u, 40000u)), - LC3_PRESET_HR("16_1_2", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_7_5, 30u), + LC3_PRESET_HR("16_1_2", LC3_CONFIG_16_1, LC3_7_5_UNFRAMED(30u, 4u, 45u, 40000u)), - LC3_PRESET_HR("16_2_2", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_10, 40u), + LC3_PRESET_HR("16_2_2", LC3_CONFIG_16_2, LC3_10_UNFRAMED(40u, 4u, 60u, 40000u)), - LC3_PRESET_HR("24_1_2", - LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_7_5, 45u), + LC3_PRESET_HR("24_1_2", LC3_CONFIG_24_1, LC3_7_5_UNFRAMED(45u, 4u, 45u, 40000u)), - LC3_PRESET_HR("24_2_2", - LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_10, 60u), + LC3_PRESET_HR("24_2_2", LC3_CONFIG_24_2, LC3_10_UNFRAMED(60u, 4u, 60u, 40000u)), - LC3_PRESET_HR("32_1_2", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_7_5, 60u), + LC3_PRESET_HR("32_1_2", LC3_CONFIG_32_1, LC3_7_5_UNFRAMED(60u, 4u, 45u, 40000u)), - LC3_PRESET_HR("32_2_2", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_10, 80u), + LC3_PRESET_HR("32_2_2", LC3_CONFIG_32_2, LC3_10_UNFRAMED(80u, 4u, 60u, 40000u)), - LC3_PRESET_HR("44_1_2", - LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_7_5, 98u), + LC3_PRESET_HR("44_1_2", LC3_CONFIG_44_1, QOS_FRAMED_2M(8163u, 4u, 13u, 54u, 40000u)), - LC3_PRESET_HR("44_2_2", - LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_10, 130u), + LC3_PRESET_HR("44_2_2", LC3_CONFIG_44_2, QOS_FRAMED_2M(10884u, 130u, 4u, 60u, 40000u)), - LC3_PRESET_HR("48_1_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 75u), + LC3_PRESET_HR("48_1_2", LC3_CONFIG_48_1, LC3_7_5_UNFRAMED(75u, 4u, 50u, 40000u)), - LC3_PRESET_HR("48_2_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 100u), + LC3_PRESET_HR("48_2_2", LC3_CONFIG_48_2, LC3_10_UNFRAMED(100u, 4u, 65u, 40000u)), - LC3_PRESET_HR("48_3_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 90u), + LC3_PRESET_HR("48_3_2", LC3_CONFIG_48_3, LC3_7_5_UNFRAMED(90u, 4u, 50u, 40000u)), - LC3_PRESET_HR("48_4_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 120u), + LC3_PRESET_HR("48_4_2", LC3_CONFIG_48_4, LC3_10_UNFRAMED(120u, 4u, 65u, 40000u)), - LC3_PRESET_HR("48_5_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 117u), + LC3_PRESET_HR("48_5_2", LC3_CONFIG_48_5, LC3_7_5_UNFRAMED(117u, 4u, 50u, 40000u)), - LC3_PRESET_HR("48_6_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 155u), + LC3_PRESET_HR("48_6_2", LC3_CONFIG_48_6, LC3_10_UNFRAMED(155u, 4u, 65u, 40000u)), }; From patchwork Wed Mar 13 19:43:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 780595 Received: from mail-vs1-f52.google.com (mail-vs1-f52.google.com [209.85.217.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5480546426 for ; Wed, 13 Mar 2024 19:44:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710359053; cv=none; b=rvdSX9FD7zmxmqw+g38ED/fEHKLCRd4emIhhP+OR6/XG5NJuatUglCgw7KhJnAJ1jpKnm7jxzx013aWrOorIR2ptAfPBHqI996r2lUgRDIUnCbHtr8/TCnirECUbskDrW2jxrLXJ1CFOCZJF2tbgVAcvTHKDS2xe0WHvFhK9Zu4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710359053; c=relaxed/simple; bh=n5ZRuxq+mrHO2vZrIkAFHnhCP9PXZ4om0K1L6v3SJrM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HNh+6cpdqrqSYt7K0GsToI50CtfhOnPIoyHQHCp6klLQWECpmRApx7RauyLBsL1pSmeD2/yMGeao1yr27tLKh5CUTT+v6nG0gcEIsvSXDor+30Z6SwgRAdT37+mgtap0lu7Gem0Ki/KUXDxTk9LLJabicPu1OHuuctoLNa4YkBo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BzXuJmDe; arc=none smtp.client-ip=209.85.217.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BzXuJmDe" Received: by mail-vs1-f52.google.com with SMTP id ada2fe7eead31-4727e38ec10so56633137.1 for ; Wed, 13 Mar 2024 12:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710359049; x=1710963849; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=25OGvpsp6THQWKK3GYGhEVbIQHg3IxpvYP6eWlw3O94=; b=BzXuJmDeIBZe6l8rwIteNZHcN+kWJCC9Hao/K9YzKSfXUvYi7D1uXa8S+QGkV7rk3B zvXBlRj8RY9T3gyUZIvVR0upybCyHgT3mRpqlxVFV5flj6nvNFfpGCm0pAgrz4dt0YNi 1aTR7etBmmqObcS+8kagwF7wKuib7Y2GMqzRGHYo6Ntm8TGPt6LWzTv4s+8lE70ij8K2 HV5vynxp42ILQoH3nRj4KrE31tiMOGVsDanEtOKpTzbToMlRqLONQ6cQBrkjMjTnLuLu PXqN1QwLsqUkNVCgIMEikH473WS8Tv0V5mViE+ajEX/pPd37zCGEq6J2qyc07xJAvVpM FvPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710359049; x=1710963849; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=25OGvpsp6THQWKK3GYGhEVbIQHg3IxpvYP6eWlw3O94=; b=AiLL5od0obK4TzkPHAWyKuGOzUh5Bce/wsXkdli97dsgPLNbgGmh3ry9+XQwemLlDX bX4VJ69JB6+FqLi6x16KxswUpodG0d5AansY7OkN4iP0rOsYGiXxopYOHEUSeJTEyC1L YK83hh6evGBghvx7sgDB8MfLPDFPyrO1EbTisJN8woJQljj3GyyehMkQmDbzXGcJ/rVC cIk4lf8MU+LQ6/hvrGxPfoGurDEQ/JOdL+NTaLKlSxyYfObJZ46zAWUf54vtzYtHtBhq +BuwROPOG0/38gNnv5kUAQ2ozqcSso+ijyRGvQM16HPUoKp5XrtcV0M9NRYbmEojHut0 Jtyg== X-Gm-Message-State: AOJu0YxkEUtgfX/DE1p/ZpAZkc4TUSzAXBwP6iNb/Qa551bHFHHYgoAA vLN9/R5jWJMXkdhiHgvcq2ZU4sI9n4apkxBvx7PcUYDNQym/3qbcu0Hdx3Ue X-Google-Smtp-Source: AGHT+IGIVU9kEfpXmmOE2HS25z0KcAhFs6e6tgvSCzx7YxXcWRFCMPNIa4QLRCHNaMNe2vBpTzNuBQ== X-Received: by 2002:a05:6102:2405:b0:475:d24b:91b9 with SMTP id j5-20020a056102240500b00475d24b91b9mr728234vsi.35.1710359048807; Wed, 13 Mar 2024 12:44:08 -0700 (PDT) Received: from lvondent-mobl4.. (107-146-107-067.biz.spectrum.com. [107.146.107.67]) by smtp.gmail.com with ESMTPSA id gd6-20020a056102624600b004730db4e873sm1800259vsb.10.2024.03.13.12.44.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 12:44:05 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v4 3/6] shared/lc3: Add definition for broadcast configurations Date: Wed, 13 Mar 2024 15:43:57 -0400 Message-ID: <20240313194400.1397477-3-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313194400.1397477-1-luiz.dentz@gmail.com> References: <20240313194400.1397477-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz This adds defines for broadcast settings as they don't really match unicast when it comes to RTN and Latency. --- src/shared/bap-defs.h | 97 ++++++++++ src/shared/bap.h | 84 +------- src/shared/lc3.h | 434 ++++++++++++++++++++++++++++++++++++++---- 3 files changed, 500 insertions(+), 115 deletions(-) create mode 100644 src/shared/bap-defs.h diff --git a/src/shared/bap-defs.h b/src/shared/bap-defs.h new file mode 100644 index 000000000000..2467e816ffa9 --- /dev/null +++ b/src/shared/bap-defs.h @@ -0,0 +1,97 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2022 Intel Corporation. All rights reserved. + * Copyright 2023-2024 NXP + * + */ + +#ifndef SRC_SHARED_BAP_DEFS_H_ +#define SRC_SHARED_BAP_DEFS_H_ + +#ifndef __packed +#define __packed __attribute__((packed)) +#endif + +#define BT_BAP_SINK 0x01 +#define BT_BAP_SOURCE 0x02 +#define BT_BAP_BCAST_SOURCE 0x03 +#define BT_BAP_BCAST_SINK 0x04 + +#define BT_BAP_STREAM_TYPE_UCAST 0x01 +#define BT_BAP_STREAM_TYPE_BCAST 0x02 + +#define BT_BAP_STREAM_STATE_IDLE 0x00 +#define BT_BAP_STREAM_STATE_CONFIG 0x01 +#define BT_BAP_STREAM_STATE_QOS 0x02 +#define BT_BAP_STREAM_STATE_ENABLING 0x03 +#define BT_BAP_STREAM_STATE_STREAMING 0x04 +#define BT_BAP_STREAM_STATE_DISABLING 0x05 +#define BT_BAP_STREAM_STATE_RELEASING 0x06 + +#define BT_BAP_CONFIG_LATENCY_LOW 0x01 +#define BT_BAP_CONFIG_LATENCY_BALANCED 0x02 +#define BT_BAP_CONFIG_LATENCY_HIGH 0x03 + +#define BT_BAP_CONFIG_PHY_1M 0x01 +#define BT_BAP_CONFIG_PHY_2M 0x02 +#define BT_BAP_CONFIG_PHY_CODEC 0x03 + +struct bt_bap_codec { + uint8_t id; + uint16_t cid; + uint16_t vid; +} __packed; + +struct bt_ltv { + uint8_t len; + uint8_t type; + uint8_t value[]; +} __packed; + +struct bt_bap_io_qos { + uint32_t interval; /* Frame interval */ + uint16_t latency; /* Transport Latency */ + uint16_t sdu; /* Maximum SDU Size */ + uint8_t phy; /* PHY */ + uint8_t rtn; /* Retransmission Effort */ +}; + +struct bt_bap_ucast_qos { + uint8_t cig_id; + uint8_t cis_id; + uint8_t framing; /* Frame framing */ + uint32_t delay; /* Presentation Delay */ + uint8_t target_latency; /* Target Latency */ + struct bt_bap_io_qos io_qos; +}; + +struct bt_bap_bcast_qos { + uint8_t big; + uint8_t bis; + uint8_t sync_factor; + uint8_t packing; + uint8_t framing; + uint8_t encryption; + struct iovec *bcode; + uint8_t options; + uint16_t skip; + uint16_t sync_timeout; + uint8_t sync_cte_type; + uint8_t mse; + uint16_t timeout; + uint8_t pa_sync; + struct bt_bap_io_qos io_qos; + uint32_t delay; /* Presentation Delay */ +}; + +struct bt_bap_qos { + union { + struct bt_bap_ucast_qos ucast; + struct bt_bap_bcast_qos bcast; + }; +}; + +#endif /* SRC_SHARED_BAP_DEFS_H_ */ diff --git a/src/shared/bap.h b/src/shared/bap.h index b2826719f84f..9839e324905a 100644 --- a/src/shared/bap.h +++ b/src/shared/bap.h @@ -10,94 +10,12 @@ #include #include - -#ifndef __packed -#define __packed __attribute__((packed)) -#endif - -#define BT_BAP_SINK 0x01 -#define BT_BAP_SOURCE 0x02 -#define BT_BAP_BCAST_SOURCE 0x03 -#define BT_BAP_BCAST_SINK 0x04 - -#define BT_BAP_STREAM_TYPE_UCAST 0x01 -#define BT_BAP_STREAM_TYPE_BCAST 0x02 - -#define BT_BAP_STREAM_STATE_IDLE 0x00 -#define BT_BAP_STREAM_STATE_CONFIG 0x01 -#define BT_BAP_STREAM_STATE_QOS 0x02 -#define BT_BAP_STREAM_STATE_ENABLING 0x03 -#define BT_BAP_STREAM_STATE_STREAMING 0x04 -#define BT_BAP_STREAM_STATE_DISABLING 0x05 -#define BT_BAP_STREAM_STATE_RELEASING 0x06 - -#define BT_BAP_CONFIG_LATENCY_LOW 0x01 -#define BT_BAP_CONFIG_LATENCY_BALANCED 0x02 -#define BT_BAP_CONFIG_LATENCY_HIGH 0x03 - -#define BT_BAP_CONFIG_PHY_1M 0x01 -#define BT_BAP_CONFIG_PHY_2M 0x02 -#define BT_BAP_CONFIG_PHY_CODEC 0x03 +#include "src/shared/bap-defs.h" struct bt_bap; struct bt_bap_pac; struct bt_bap_stream; -struct bt_bap_codec { - uint8_t id; - uint16_t cid; - uint16_t vid; -} __packed; - -struct bt_ltv { - uint8_t len; - uint8_t type; - uint8_t value[0]; -} __packed; - -struct bt_bap_io_qos { - uint32_t interval; /* Frame interval */ - uint16_t latency; /* Transport Latency */ - uint16_t sdu; /* Maximum SDU Size */ - uint8_t phy; /* PHY */ - uint8_t rtn; /* Retransmission Effort */ -}; - -struct bt_bap_ucast_qos { - uint8_t cig_id; - uint8_t cis_id; - uint8_t framing; /* Frame framing */ - uint32_t delay; /* Presentation Delay */ - uint8_t target_latency; /* Target Latency */ - struct bt_bap_io_qos io_qos; -}; - -struct bt_bap_bcast_qos { - uint8_t big; - uint8_t bis; - uint8_t sync_factor; - uint8_t packing; - uint8_t framing; - uint8_t encryption; - struct iovec *bcode; - uint8_t options; - uint16_t skip; - uint16_t sync_timeout; - uint8_t sync_cte_type; - uint8_t mse; - uint16_t timeout; - uint8_t pa_sync; - struct bt_bap_io_qos io_qos; - uint32_t delay; /* Presentation Delay */ -}; - -struct bt_bap_qos { - union { - struct bt_bap_ucast_qos ucast; - struct bt_bap_bcast_qos bcast; - }; -}; - typedef void (*bt_bap_ready_func_t)(struct bt_bap *bap, void *user_data); typedef void (*bt_bap_destroy_func_t)(void *user_data); typedef void (*bt_bap_debug_func_t)(const char *str, void *user_data); diff --git a/src/shared/lc3.h b/src/shared/lc3.h index 1db46217b76e..d74412719306 100644 --- a/src/shared/lc3.h +++ b/src/shared/lc3.h @@ -8,6 +8,8 @@ * */ +#include "src/shared/bap-defs.h" + #define LC3_ID 0x06 #define LC3_BASE 0x01 @@ -280,6 +282,7 @@ { \ .ucast.cig_id = 0x00, \ .ucast.cis_id = 0x00, \ + .ucast.framing = _frame, \ .ucast.delay = _pd, \ .ucast.target_latency = _t_lat, \ .ucast.io_qos.interval = _interval, \ @@ -304,7 +307,7 @@ #define LC3_QOS_8_1_1_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_8_1_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_8_1, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_1, \ LC3_QOS_8_1_1_RTN) #define LC3_QOS_8_1_1 LC3_QOS_8_1_1_AC(1) @@ -314,7 +317,7 @@ #define LC3_QOS_8_1_2_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_8_1_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_8_1, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_1, \ LC3_QOS_8_1_2_RTN) #define LC3_QOS_8_1_2 LC3_QOS_8_1_2_AC(1) @@ -324,7 +327,7 @@ #define LC3_QOS_8_2_1_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_8_2_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_8_2, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_2, \ LC3_QOS_8_2_1_RTN) #define LC3_QOS_8_2_1 LC3_QOS_8_2_1_AC(1) @@ -334,7 +337,7 @@ #define LC3_QOS_8_2_2_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_8_2_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_8_2, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_2, \ LC3_QOS_8_2_2_RTN) #define LC3_QOS_8_2_2 LC3_QOS_8_2_2_AC(1) @@ -344,7 +347,7 @@ #define LC3_QOS_16_1_1_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_16_1_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_16_1, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_1, \ LC3_QOS_16_1_1_RTN) #define LC3_QOS_16_1_1 LC3_QOS_16_1_1_AC(1) @@ -354,17 +357,25 @@ #define LC3_QOS_16_1_2_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_16_1_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_16_1, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_1, \ LC3_QOS_16_1_2_RTN) #define LC3_QOS_16_1_2 LC3_QOS_16_1_2_AC(1) +#define LC3_QOS_16_1_GS_LATENCY 15u +#define LC3_QOS_16_1_GS_RTN 1u +#define LC3_QOS_16_1_GS \ + LC3_QOS_UCAST_7_5_UNFRAMED(60000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_16_1_GS_LATENCY, \ + LC3_CONFIG_FRAME_LEN_16_1, \ + LC3_QOS_16_1_GS_RTN) + #define LC3_QOS_16_2_1_LATENCY 10u #define LC3_QOS_16_2_1_RTN 2u #define LC3_QOS_16_2_1_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_16_2_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_16_2, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_2, \ LC3_QOS_16_2_1_RTN) #define LC3_QOS_16_2_1 LC3_QOS_16_2_1_AC(1) @@ -374,17 +385,26 @@ #define LC3_QOS_16_2_2_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_16_2_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_16_2, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_2, \ LC3_QOS_16_2_2_RTN) #define LC3_QOS_16_2_2 LC3_QOS_16_2_2_AC(1) +#define LC3_QOS_16_2_GS_LATENCY 20u +#define LC3_QOS_16_2_GS_RTN 1u +#define LC3_QOS_16_2_GS \ + LC3_QOS_UCAST_10_UNFRAMED(60000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_16_2_GS_LATENCY, \ + LC3_CONFIG_FRAME_LEN_16_2, \ + LC3_QOS_16_2_GS_RTN) + #define LC3_QOS_24_1_1_LATENCY 8u #define LC3_QOS_24_1_1_RTN 2u #define LC3_QOS_24_1_1_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_24_1_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_24_1, 2u) + (_ac) * LC3_CONFIG_FRAME_LEN_24_1, \ + LC3_QOS_24_1_1_RTN) #define LC3_QOS_24_1_1 LC3_QOS_24_1_1_AC(1) #define LC3_QOS_24_1_2_LATENCY 75u @@ -393,7 +413,7 @@ #define LC3_QOS_24_1_2_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_24_1_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_24_1, \ + (_ac) * LC3_CONFIG_FRAME_LEN_24_1, \ LC3_QOS_24_1_2_RTN) #define LC3_QOS_24_1_2 LC3_QOS_24_1_2_AC(1) @@ -403,7 +423,7 @@ #define LC3_QOS_24_2_1_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_24_2_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_24_2, \ + (_ac) * LC3_CONFIG_FRAME_LEN_24_2, \ LC3_QOS_24_2_1_RTN) #define LC3_QOS_24_2_1 LC3_QOS_24_2_1_AC(1) @@ -413,7 +433,7 @@ #define LC3_QOS_24_2_2_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_24_2_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_24_2, \ + (_ac) * LC3_CONFIG_FRAME_LEN_24_2, \ LC3_QOS_24_2_2_RTN) #define LC3_QOS_24_2_2 LC3_QOS_24_2_2_AC(1) @@ -423,7 +443,7 @@ #define LC3_QOS_32_1_1_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_32_1_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_32_1, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_1, \ LC3_QOS_32_1_1_RTN) #define LC3_QOS_32_1_1 LC3_QOS_32_1_1_AC(1) @@ -433,17 +453,34 @@ #define LC3_QOS_32_1_2_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_32_1_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_32_1, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_1, \ LC3_QOS_32_1_2_RTN) #define LC3_QOS_32_1_2 LC3_QOS_32_1_2_AC(1) +#define LC3_QOS_32_1_GS_LATENCY 15u +#define LC3_QOS_32_1_GS_RTN 1u +#define LC3_QOS_32_1_GS \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_32_1_GS_LATENCY, \ + LC3_CONFIG_FRAME_LEN_32_1, \ + LC3_QOS_32_1_GS_RTN) + +#define LC3_QOS_32_1_GR_LATENCY 15u +#define LC3_QOS_32_1_GR_RTN 1u +#define LC3_QOS_32_1_GR_AC(_ac) \ + LC3_QOS_UCAST_7_5_UNFRAMED(10000u, BT_BAP_CONFIG_LATENCY_LOW, \ + LC3_QOS_32_1_GS_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_1, \ + LC3_QOS_32_1_GS_RTN) +#define LC3_QOS_32_1_GR LC3_QOS_32_1_GR_AC(1) + #define LC3_QOS_32_2_1_LATENCY 10u #define LC3_QOS_32_2_1_RTN 2u #define LC3_QOS_32_2_1_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_32_2_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_32_2, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_2, \ LC3_QOS_32_2_1_RTN) #define LC3_QOS_32_2_1 LC3_QOS_32_2_1_AC(1) @@ -453,10 +490,27 @@ #define LC3_QOS_32_2_2_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_32_2_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_32_2, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_2, \ LC3_QOS_32_2_2_RTN) #define LC3_QOS_32_2_2 LC3_QOS_32_2_2_AC(1) +#define LC3_QOS_32_2_GS_LATENCY 20u +#define LC3_QOS_32_2_GS_RTN 1u +#define LC3_QOS_32_2_GS \ + LC3_QOS_UCAST_10_UNFRAMED(60000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_32_2_GS_LATENCY, \ + LC3_CONFIG_FRAME_LEN_32_2, \ + LC3_QOS_32_2_GS_RTN) + +#define LC3_QOS_32_2_GR_LATENCY 20u +#define LC3_QOS_32_2_GR_RTN 1u +#define LC3_QOS_32_2_GR_AC(_ac) \ + LC3_QOS_UCAST_10_UNFRAMED(10000u, BT_BAP_CONFIG_LATENCY_LOW, \ + LC3_QOS_32_2_GR_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_2, \ + LC3_QOS_32_2_GR_RTN) +#define LC3_QOS_32_2_GR LC3_QOS_32_2_GR_AC(1) + #define LC3_QOS_44_1_INTERVAL 8163u #define LC3_QOS_44_1_1_LATENCY 24u #define LC3_QOS_44_1_1_RTN 5u @@ -465,7 +519,7 @@ LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_44_1_INTERVAL, \ LC3_QOS_44_1_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_44_1, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_1, \ LC3_QOS_44_1_1_RTN) #define LC3_QOS_44_1_1 LC3_QOS_44_1_1_AC(1) @@ -476,7 +530,7 @@ LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_44_1_INTERVAL, \ LC3_QOS_44_1_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_44_1, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_1, \ LC3_QOS_44_1_2_RTN) #define LC3_QOS_44_1_2 LC3_QOS_44_1_2_AC(1) @@ -488,7 +542,7 @@ LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_44_2_INTERVAL, \ LC3_QOS_44_2_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_44_2, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_2, \ LC3_QOS_44_2_1_RTN) #define LC3_QOS_44_2_1 LC3_QOS_44_2_1_AC(1) @@ -499,7 +553,7 @@ LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_44_2_INTERVAL, \ LC3_QOS_44_2_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_44_2, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_2, \ LC3_QOS_44_2_2_RTN) #define LC3_QOS_44_2_2 LC3_QOS_44_2_2_AC(1) @@ -509,7 +563,7 @@ #define LC3_QOS_48_1_1_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_48_1_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_48_1,\ + (_ac) * LC3_CONFIG_FRAME_LEN_48_1,\ LC3_QOS_48_1_1_RTN) #define LC3_QOS_48_1_1 LC3_QOS_48_1_1_AC(1) @@ -519,17 +573,36 @@ #define LC3_QOS_48_1_2_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_48_1_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_48_1, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_1, \ LC3_QOS_48_1_2_RTN) #define LC3_QOS_48_1_2 LC3_QOS_48_1_2_AC(1) +#define LC3_QOS_48_1_GS_LATENCY 15u +#define LC3_QOS_48_1_GS_RTN 1u + +#define LC3_QOS_48_1_GS \ + LC3_QOS_UCAST_7_5_UNFRAMED(60000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_48_1_GS_LATENCY, \ + LC3_CONFIG_FRAME_LEN_48_1, \ + LC3_QOS_48_1_GS_RTN) + +#define LC3_QOS_48_1_GR_LATENCY 15u +#define LC3_QOS_48_1_GR_RTN 1u + +#define LC3_QOS_48_1_GR_AC(_ac) \ + LC3_QOS_UCAST_7_5_UNFRAMED(10000u, BT_BAP_CONFIG_LATENCY_LOW, \ + LC3_QOS_48_1_GR_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_1, \ + LC3_QOS_48_1_GR_RTN) +#define LC3_QOS_48_1_GR LC3_QOS_48_1_GR_AC(1) + #define LC3_QOS_48_2_1_LATENCY 20u #define LC3_QOS_48_2_1_RTN 5u #define LC3_QOS_48_2_1_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_48_2_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_48_2, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_2, \ LC3_QOS_48_2_1_RTN) #define LC3_QOS_48_2_1 LC3_QOS_48_2_1_AC(1) @@ -539,17 +612,36 @@ #define LC3_QOS_48_2_2_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_48_2_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_48_2, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_2, \ LC3_QOS_48_2_2_RTN) #define LC3_QOS_48_2_2 LC3_QOS_48_2_2_AC(1) +#define LC3_QOS_48_2_GS_LATENCY 20u +#define LC3_QOS_48_2_GS_RTN 1u + +#define LC3_QOS_48_2_GS \ + LC3_QOS_UCAST_10_UNFRAMED(60000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_48_2_GS_LATENCY, \ + LC3_CONFIG_FRAME_LEN_48_2, \ + LC3_QOS_48_2_GS_RTN) + +#define LC3_QOS_48_2_GR_LATENCY 20u +#define LC3_QOS_48_2_GR_RTN 1u + +#define LC3_QOS_48_2_GR_AC(_ac) \ + LC3_QOS_UCAST_10_UNFRAMED(10000u, BT_BAP_CONFIG_LATENCY_LOW, \ + LC3_QOS_48_2_GR_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_2, \ + LC3_QOS_48_2_GR_RTN) +#define LC3_QOS_48_2_GR LC3_QOS_48_2_GR_AC(1) + #define LC3_QOS_48_3_1_LATENCY 15u #define LC3_QOS_48_3_1_RTN 5u #define LC3_QOS_48_3_1_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_48_3_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_48_3, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_3, \ LC3_QOS_48_3_1_RTN) #define LC3_QOS_48_3_1 LC3_QOS_48_3_1_AC(1) @@ -559,17 +651,27 @@ #define LC3_QOS_48_3_2_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_48_3_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_48_3, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_3, \ LC3_QOS_48_3_2_RTN) #define LC3_QOS_48_3_2 LC3_QOS_48_3_2_AC(1) +#define LC3_QOS_48_3_GR_LATENCY 15u +#define LC3_QOS_48_3_GR_RTN 1u + +#define LC3_QOS_48_3_GR_AC(_ac) \ + LC3_QOS_UCAST_7_5_UNFRAMED(10000u, BT_BAP_CONFIG_LATENCY_LOW, \ + LC3_QOS_48_3_GR_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_3, \ + LC3_QOS_48_3_GR_RTN) +#define LC3_QOS_48_3_GR LC3_QOS_48_3_GR_AC(1) + #define LC3_QOS_48_4_1_LATENCY 20u #define LC3_QOS_48_4_1_RTN 5u #define LC3_QOS_48_4_1_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_48_4_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_48_4, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_4, \ LC3_QOS_48_4_1_RTN) #define LC3_QOS_48_4_1 LC3_QOS_48_4_1_AC(1) @@ -579,17 +681,27 @@ #define LC3_QOS_48_4_2_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_48_4_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_48_4, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_4, \ LC3_QOS_48_4_2_RTN) #define LC3_QOS_48_4_2 LC3_QOS_48_4_2_AC(1) +#define LC3_QOS_48_4_GR_LATENCY 20u +#define LC3_QOS_48_4_GR_RTN 1u + +#define LC3_QOS_48_4_GR_AC(_ac) \ + LC3_QOS_UCAST_10_UNFRAMED(10000u, BT_BAP_CONFIG_LATENCY_LOW, \ + LC3_QOS_48_4_GR_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_4, \ + LC3_QOS_48_4_GR_RTN) +#define LC3_QOS_48_4_GR LC3_QOS_48_4_GR_AC(1) + #define LC3_QOS_48_5_1_LATENCY 15u #define LC3_QOS_48_5_1_RTN 5u #define LC3_QOS_48_5_1_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_48_5_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_48_5, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_5, \ LC3_QOS_48_5_1_RTN) #define LC3_QOS_48_5_1 LC3_QOS_48_5_1_AC(1) @@ -599,7 +711,7 @@ #define LC3_QOS_48_5_2_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_48_5_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_48_5, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_5, \ LC3_QOS_48_5_2_RTN) #define LC3_QOS_48_5_2 LC3_QOS_48_5_2_AC(1) @@ -609,7 +721,7 @@ #define LC3_QOS_48_6_1_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_48_6_1_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_48_6, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_6, \ LC3_QOS_48_6_1_RTN) #define LC3_QOS_48_6_1 LC3_QOS_48_6_1_AC(1) @@ -619,6 +731,264 @@ #define LC3_QOS_48_6_2_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ LC3_QOS_48_6_2_LATENCY, \ - _ac * LC3_CONFIG_FRAME_LEN_48_6, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_6, \ LC3_QOS_48_6_2_RTN) #define LC3_QOS_48_6_2 LC3_QOS_48_6_2_AC(1) + +#define LC3_QOS_BCAST(_frame, _pd, _interval, _lat, _sdu, _rtn) \ +{ \ + .bcast.big = 0x00, \ + .bcast.bis = 0x00, \ + .bcast.framing = _frame, \ + .bcast.delay = _pd, \ + .bcast.io_qos.interval = _interval, \ + .bcast.io_qos.latency = _lat, \ + .bcast.io_qos.sdu = _sdu, \ + .bcast.io_qos.phy = BT_BAP_CONFIG_PHY_2M, \ + .bcast.io_qos.rtn = _rtn, \ +} + +#define LC3_QOS_BCAST_7_5_UNFRAMED(_pd, _lat, _sdu, _rtn) \ + LC3_QOS_BCAST(LC3_QOS_UNFRAMED, _pd, 7500u, _lat, _sdu, _rtn) + +#define LC3_QOS_BCAST_10_UNFRAMED(_pd, _lat, _sdu, _rtn) \ + LC3_QOS_BCAST(LC3_QOS_UNFRAMED, _pd, 10000u, _lat, _sdu, _rtn) + +#define LC3_QOS_BCAST_FRAMED(_pd, _interval, _lat, _sdu, _rtn) \ + LC3_QOS_BCAST(LC3_QOS_FRAMED, _pd, _interval, _lat, _sdu, _rtn) + +#define LC3_QOS_8_1_1_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_8_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_1, \ + LC3_QOS_8_1_1_RTN) +#define LC3_QOS_8_1_1_B LC3_QOS_8_1_1_B_AC(1) + +#define LC3_QOS_8_1_2_B_LATENCY 75u +#define LC3_QOS_8_1_2_B_RTN 4u +#define LC3_QOS_8_1_2_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_8_1_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_1, \ + LC3_QOS_8_1_2_B_RTN) +#define LC3_QOS_48_1_2_B LC3_QOS_48_1_2_B_AC(1) + +#define LC3_QOS_8_2_1_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_8_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_2, \ + LC3_QOS_8_2_1_RTN) +#define LC3_QOS_8_2_1_B LC3_QOS_8_2_1_B_AC(1) + +#define LC3_QOS_8_2_2_B_LATENCY 60u +#define LC3_QOS_8_2_2_B_RTN 4u +#define LC3_QOS_8_2_2_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_8_2_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_2, \ + LC3_QOS_8_2_2_B_RTN) +#define LC3_QOS_8_2_2_B LC3_QOS_8_2_2_B_AC(1) + +#define LC3_QOS_16_1_1_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_16_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_1, \ + LC3_QOS_16_1_1_RTN) +#define LC3_QOS_16_1_1_B LC3_QOS_16_1_1_B_AC(1) + +#define LC3_QOS_16_1_2_B_LATENCY 45u +#define LC3_QOS_16_1_2_B_RTN 4u +#define LC3_QOS_16_1_2_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_16_1_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_1, \ + LC3_QOS_16_1_2_B_RTN) +#define LC3_QOS_16_1_2_B LC3_QOS_16_1_2_B_AC(1) + +#define LC3_QOS_16_2_1_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_16_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_2, \ + LC3_QOS_16_2_1_RTN) +#define LC3_QOS_16_2_1_B LC3_QOS_16_2_1_B_AC(1) + +#define LC3_QOS_16_2_2_B_LATENCY 60u +#define LC3_QOS_16_2_2_B_RTN 4u +#define LC3_QOS_16_2_2_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_16_2_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_2, \ + LC3_QOS_16_2_2_B_RTN) +#define LC3_QOS_16_2_2_B LC3_QOS_16_2_2_B_AC(1) + +#define LC3_QOS_24_1_1_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_24_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_24_1, \ + LC3_QOS_24_1_1_RTN) +#define LC3_QOS_24_1_1_B LC3_QOS_24_1_1_B_AC(1) + +#define LC3_QOS_24_1_2_B_LATENCY 45u +#define LC3_QOS_24_1_2_B_RTN 4u +#define LC3_QOS_24_1_2_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_24_1_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_24_1, \ + LC3_QOS_24_1_2_B_RTN) +#define LC3_QOS_24_1_2_B LC3_QOS_24_1_2_B_AC(1) + +#define LC3_QOS_24_2_1_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_24_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_24_2, \ + LC3_QOS_24_2_1_RTN) +#define LC3_QOS_24_2_1_B LC3_QOS_24_2_1_B_AC(1) + +#define LC3_QOS_24_2_2_B_LATENCY 60u +#define LC3_QOS_24_2_2_B_RTN 4u +#define LC3_QOS_24_2_2_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_24_2_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_24_2, \ + LC3_QOS_24_2_2_B_RTN) +#define LC3_QOS_24_2_2_B LC3_QOS_24_2_2_B_AC(1) + +#define LC3_QOS_32_1_1_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_32_1_1_LATENCY, \ + LC3_CONFIG_FRAME_LEN_32_1, \ + LC3_QOS_32_1_1_RTN) +#define LC3_QOS_32_1_1_B LC3_QOS_32_1_1_B_AC(1) + +#define LC3_QOS_32_1_2_B_LATENCY 45u +#define LC3_QOS_32_1_2_B_RTN 4u +#define LC3_QOS_32_1_2_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_32_1_2_B_LATENCY, \ + LC3_CONFIG_FRAME_LEN_32_1, \ + LC3_QOS_32_1_2_B_RTN) +#define LC3_QOS_32_1_2_B LC3_QOS_32_1_2_B_AC(1) + +#define LC3_QOS_32_2_1_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_32_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_2, \ + LC3_QOS_32_2_1_RTN) +#define LC3_QOS_32_2_1_B LC3_QOS_32_2_1_B_AC(1) + +#define LC3_QOS_32_2_2_B_LATENCY 60u +#define LC3_QOS_32_2_2_B_RTN 4u +#define LC3_QOS_32_2_2_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_32_2_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_2, \ + LC3_QOS_32_2_2_B_RTN) +#define LC3_QOS_32_2_2_B LC3_QOS_32_2_2_B_AC(1) + +#define LC3_QOS_44_1_1_B_RTN 4u +#define LC3_QOS_44_1_1_B_AC(_ac) \ + LC3_QOS_BCAST_FRAMED(40000u, LC3_QOS_44_1_INTERVAL, \ + LC3_QOS_44_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_1, \ + LC3_QOS_44_1_1_B_RTN) +#define LC3_QOS_44_1_1_B LC3_QOS_44_1_1_B_AC(1) + +#define LC3_QOS_44_1_2_B_LATENCY 54u +#define LC3_QOS_44_1_2_B_RTN 4u +#define LC3_QOS_44_1_2_B_AC(_ac) \ + LC3_QOS_BCAST_FRAMED(40000u, LC3_QOS_44_1_INTERVAL, \ + LC3_QOS_44_1_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_1, \ + LC3_QOS_44_1_2_B_RTN) +#define LC3_QOS_44_1_2_B LC3_QOS_44_1_2_B_AC(1) + +#define LC3_QOS_44_2_1_B_RTN 4u +#define LC3_QOS_44_2_1_B_AC(_ac) \ + LC3_QOS_BCAST_FRAMED(40000u, LC3_QOS_44_2_INTERVAL, \ + LC3_QOS_44_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_2, \ + LC3_QOS_44_2_1_B_RTN) +#define LC3_QOS_44_2_1_B LC3_QOS_44_2_1_B_AC(1) + +#define LC3_QOS_44_2_2_B_LATENCY 60u +#define LC3_QOS_44_2_2_B_RTN 4u +#define LC3_QOS_44_2_2_B_AC(_ac) \ + LC3_QOS_BCAST_FRAMED(40000u, LC3_QOS_44_2_INTERVAL, \ + LC3_QOS_44_2_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_2, \ + LC3_QOS_44_2_2_RTN) +#define LC3_QOS_44_2_2_B LC3_QOS_44_2_2_B_AC(1) + +#define LC3_QOS_48_1_1_B_RTN 4u +#define LC3_QOS_48_1_1_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_48_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_1,\ + LC3_QOS_48_1_1_B_RTN) +#define LC3_QOS_48_1_1_B LC3_QOS_48_1_1_B_AC(1) + +#define LC3_QOS_48_1_2_B_LATENCY 50u +#define LC3_QOS_48_1_2_B_RTN 4u +#define LC3_QOS_48_1_2_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_48_1_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_1, \ + LC3_QOS_48_1_2_B_RTN) +#define LC3_QOS_48_1_2_B LC3_QOS_48_1_2_B_AC(1) + +#define LC3_QOS_48_2_1_B_RTN 4u +#define LC3_QOS_48_2_1_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_48_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_2, \ + LC3_QOS_48_2_1_B_RTN) +#define LC3_QOS_48_2_1_B LC3_QOS_48_2_1_B_AC(1) + +#define LC3_QOS_48_2_2_B_LATENCY 65u +#define LC3_QOS_48_2_2_B_RTN 4u +#define LC3_QOS_48_2_2_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_48_2_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_2, \ + LC3_QOS_48_2_2_B_RTN) +#define LC3_QOS_48_2_2_B LC3_QOS_48_2_2_B_AC(1) + +#define LC3_QOS_48_3_1_B_RTN 4u +#define LC3_QOS_48_3_1_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_48_3_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_3, \ + LC3_QOS_48_3_1_B_RTN) +#define LC3_QOS_48_3_1_B LC3_QOS_48_3_1_B_AC(1) + +#define LC3_QOS_48_3_2_B_LATENCY 50u +#define LC3_QOS_48_3_2_B_RTN 4u +#define LC3_QOS_48_3_2_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_48_3_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_3, \ + LC3_QOS_48_3_2_RTN) +#define LC3_QOS_48_3_2_B LC3_QOS_48_3_2_B_AC(1) + +#define LC3_QOS_48_4_1_B_RTN 4u +#define LC3_QOS_48_4_1_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_48_4_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_4, \ + LC3_QOS_48_4_1_B_RTN) +#define LC3_QOS_48_4_1_B LC3_QOS_48_4_1_B_AC(1) + +#define LC3_QOS_48_4_2_B_LATENCY 65u +#define LC3_QOS_48_4_2_B_RTN 4u +#define LC3_QOS_48_4_2_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_48_4_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_4, \ + LC3_QOS_48_4_2_B_RTN) +#define LC3_QOS_48_4_2_B LC3_QOS_48_4_2_B_AC(1) + +#define LC3_QOS_48_5_1_B_RTN 4u +#define LC3_QOS_48_5_1_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_48_5_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_5, \ + LC3_QOS_48_5_1_B_RTN) +#define LC3_QOS_48_5_1_B LC3_QOS_48_5_1_B_AC(1) + +#define LC3_QOS_48_5_2_B_LATENCY 50u +#define LC3_QOS_48_5_2_B_RTN 4u +#define LC3_QOS_48_5_2_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_48_5_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_5, \ + LC3_QOS_48_5_2_B_RTN) +#define LC3_QOS_48_5_2_B LC3_QOS_48_5_2_B_AC(1) + +#define LC3_QOS_48_6_1_B_RTN 5u +#define LC3_QOS_48_6_1_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_48_6_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_6, \ + LC3_QOS_48_6_1_B_RTN) +#define LC3_QOS_48_6_1_B LC3_QOS_48_6_1_B_AC(1) + +#define LC3_QOS_48_6_2_B_LATENCY 65u +#define LC3_QOS_48_6_2_B_RTN 4u +#define LC3_QOS_48_6_2_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_48_6_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_6, \ + LC3_QOS_48_6_2_B_RTN) +#define LC3_QOS_48_6_2_B LC3_QOS_48_6_2_B_AC(1) From patchwork Wed Mar 13 19:43:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 780594 Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9335C210E9 for ; Wed, 13 Mar 2024 19:44:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710359054; cv=none; b=pTflF4tCjn3Ee7gw5EuMaKGan+9cNHElp7yuIs6fRIu8kRXDAgadjG1OKkq11ejmd+/EPGufwEoULcUbqNFQgY6nqJW7F2pRNE8aOuZay7m1yZAA3VMTt00CyfM6+LEYKi1ynv0hqiU29XTX2n4CLPDIhZi/wXQg4eV3RfXCf/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710359054; c=relaxed/simple; bh=j710wOZNf7KTzExFslKWSqoTk4lqWboYfZoTrcgyVgI=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M23Wg2kZO2xluG2YDaWjHqO5NCp2W0EWIES3P7KsxaFwwOzpoAu7ZAA9CEe6wTmkI+8DTZt7AnbV21bevQnQ1faT5nHXxdrS7g0wXDUBF0U1sWdppk7oxcB9H2CM0fszKqCeGmwqMC6EZzatokQVkmOMiYGpMBcy8R9NJ213rO0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=d0J7RUr+; arc=none smtp.client-ip=209.85.217.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d0J7RUr+" Received: by mail-vs1-f54.google.com with SMTP id ada2fe7eead31-474c802022fso160834137.0 for ; Wed, 13 Mar 2024 12:44:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710359050; x=1710963850; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=wWt7gHL/JGzoqW2iuwH4qx4vSGfHkpJ9BsKj6XmOeRk=; b=d0J7RUr+DxmlVrkbcRFEtKwyaTOc02U4YZYitJGFyZt4Ly91lhZQYmw7wvy1VTxWZH XXmLGsScrFSUFi1lIQlTENwksRQFmUFRyOK/74X94aMsylBdxF2z/5Ycy3pJwFn2Rl9c VxEQkY4DsQHQ81R25R2/4ZF+q1Spu/POGwz+YPTlgtLak903Zynr7jAOSq6dtXI3dmV8 TRm4XB0/a+W+/GWOlqZi1b8P2rziyzg5Yt4Ad9WAqi2SqoUdZb6QjNhGFyiSPdLsUkG/ fjYPanP8Z4WmkHGRZxuvvgAvAJLQBTHFxZp9jE6PEI4cXMn6+QoD70kija7n5Qx3v83d HhOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710359050; x=1710963850; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wWt7gHL/JGzoqW2iuwH4qx4vSGfHkpJ9BsKj6XmOeRk=; b=Ym0zT+vNIqkN52LBBHTr/HC2x4wcEm/rnqa+PMMmVz71uMiRchkEKxTnUzJ8FJaJk5 jwWlTevTN0k94ArK67MUfXmxTp4PDK2I8bLFApMTtaDTfx5q1/Rts0gT1hQdx60FDs71 MqMnX/ZTfZe+6xLoODrLdyt0sEx397N/0IwuITxLIlcmgB5cmxwsmqcrwhajlCivGSgm CaMYgFJjKJY+PG0HINWP5pV3W489TkZTdJU6C40V1A/25cRMtXAvhteI16nfr4GSevUc UQmx8zN5KQBmRNZXG6AtIAeDL3cOcVxcvhYqTBBSPT1pRdLJqIs9laBz5OWOenQT/H+J V3DQ== X-Gm-Message-State: AOJu0YwcTOBOkGwgqT4e3DhT/8+MmTI67/KzN2siQi+8jLqMLhFXxfh0 2wCKMkuH8Bny0ejCj09q6edJGSpBWoqVjPhucsEj5DUJN0sxvRpRfifLhe1o X-Google-Smtp-Source: AGHT+IG79ODzDiOmSeUF6XD61iJJos694LPbghShX/XmzigHpWErYw8mbTS8KsPhfLITlA1e1r83KQ== X-Received: by 2002:a67:ea14:0:b0:473:799:9764 with SMTP id g20-20020a67ea14000000b0047307999764mr918091vso.14.1710359049989; Wed, 13 Mar 2024 12:44:09 -0700 (PDT) Received: from lvondent-mobl4.. (107-146-107-067.biz.spectrum.com. [107.146.107.67]) by smtp.gmail.com with ESMTPSA id gd6-20020a056102624600b004730db4e873sm1800259vsb.10.2024.03.13.12.44.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 12:44:09 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v4 4/6] client/player: Use QOS macros from lc3.h to define presets Date: Wed, 13 Mar 2024 15:43:58 -0400 Message-ID: <20240313194400.1397477-4-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313194400.1397477-1-luiz.dentz@gmail.com> References: <20240313194400.1397477-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz This makes use of QOS macros for for lc3.h to define preset configuration and remove existing macros since they were just duplicates. --- client/player.c | 424 +++++++++++++++++++----------------------------- 1 file changed, 169 insertions(+), 255 deletions(-) diff --git a/client/player.c b/client/player.c index ab8cb7434cdc..381c5d568103 100644 --- a/client/player.c +++ b/client/player.c @@ -1232,20 +1232,10 @@ static const struct capabilities { UTIL_IOV_INIT()), }; -struct codec_qos { - uint32_t interval; - uint8_t framing; - uint8_t phy; - uint16_t sdu; - uint8_t rtn; - uint16_t latency; - uint32_t delay; -}; - struct codec_preset { char *name; const struct iovec data; - const struct codec_qos qos; + struct bt_bap_qos qos; uint8_t target_latency; }; @@ -1296,47 +1286,6 @@ static struct codec_preset sbc_presets[] = { SBC_PRESET("UQ_STEREO_48", UTIL_IOV_INIT(0x11, 0x15, 2, 58)), }; -#define QOS_CONFIG(_interval, _framing, _phy, _sdu, _rtn, _latency, _delay) \ - { \ - .interval = _interval, \ - .framing = _framing, \ - .phy = _phy, \ - .sdu = _sdu, \ - .rtn = _rtn, \ - .latency = _latency, \ - .delay = _delay, \ - } - -#define QOS_UNFRAMED(_interval, _phy, _sdu, _rtn, _latency, _delay) \ - QOS_CONFIG(_interval, 0x00, _phy, _sdu, _rtn, _latency, _delay) - -#define QOS_FRAMED(_interval, _phy, _sdu, _rtn, _latency, _delay) \ - QOS_CONFIG(_interval, 0x01, _phy, _sdu, _rtn, _latency, _delay) - -#define QOS_UNFRAMED_1M(_interval, _sdu, _rtn, _latency, _delay) \ - QOS_UNFRAMED(_interval, 0x01, _sdu, _rtn, _latency, _delay) \ - -#define QOS_FRAMED_1M(_interval, _sdu, _rtn, _latency, _delay) \ - QOS_FRAMED(_interval, 0x01, _sdu, _rtn, _latency, _delay) \ - -#define QOS_UNFRAMED_2M(_interval, _sdu, _rtn, _latency, _delay) \ - QOS_UNFRAMED(_interval, 0x02, _sdu, _rtn, _latency, _delay) \ - -#define QOS_FRAMED_2M(_interval, _sdu, _rtn, _latency, _delay) \ - QOS_FRAMED(_interval, 0x02, _sdu, _rtn, _latency, _delay) \ - -#define LC3_7_5_UNFRAMED(_sdu, _rtn, _latency, _delay) \ - QOS_UNFRAMED(7500u, 0x02, _sdu, _rtn, _latency, _delay) - -#define LC3_7_5_FRAMED(_sdu, _rtn, _latency, _delay) \ - QOS_FRAMED(7500u, 0x02, _sdu, _rtn, _latency, _delay) - -#define LC3_10_UNFRAMED(_sdu, _rtn, _latency, _delay) \ - QOS_UNFRAMED_2M(10000u, _sdu, _rtn, _latency, _delay) - -#define LC3_10_FRAMED(_sdu, _rtn, _latency, _delay) \ - QOS_FRAMED_2M(10000u, _sdu, _rtn, _latency, _delay) - #define LC3_PRESET_LL(_name, _data, _qos) \ { \ .name = _name, \ @@ -1361,183 +1310,115 @@ static struct codec_preset sbc_presets[] = { .target_latency = 0x03, \ } +#define LC3_PRESET_B(_name, _data, _qos) \ + { \ + .name = _name, \ + .data = _data, \ + .qos = _qos, \ + .target_latency = 0x00, \ + } + static struct codec_preset lc3_ucast_presets[] = { /* Table 4.43: QoS configuration support setting requirements */ - LC3_PRESET("8_1_1", LC3_CONFIG_8_1, - LC3_7_5_UNFRAMED(26u, 2u, 8u, 40000u)), - LC3_PRESET("8_2_1", LC3_CONFIG_8_2, - LC3_10_UNFRAMED(30u, 2u, 10u, 40000u)), - LC3_PRESET("16_1_1", LC3_CONFIG_16_1, - LC3_7_5_UNFRAMED(30u, 2u, 8u, 40000u)), - LC3_PRESET("16_2_1", LC3_CONFIG_16_2, - LC3_10_UNFRAMED(40u, 2u, 10u, 40000u)), - LC3_PRESET("24_1_1", LC3_CONFIG_24_1, - LC3_7_5_UNFRAMED(45u, 2u, 8u, 40000u)), - LC3_PRESET("24_2_1", LC3_CONFIG_24_2, - LC3_10_UNFRAMED(60u, 2u, 10u, 40000u)), - LC3_PRESET("32_1_1", LC3_CONFIG_32_1, - LC3_7_5_UNFRAMED(60u, 2u, 8u, 40000u)), - LC3_PRESET("32_2_1", LC3_CONFIG_32_2, - LC3_10_UNFRAMED(80u, 2u, 10u, 40000u)), - LC3_PRESET("44_1_1", LC3_CONFIG_44_1, - QOS_FRAMED_2M(8163u, 98u, 5u, 24u, 40000u)), - LC3_PRESET("44_2_1", LC3_CONFIG_44_2, - QOS_FRAMED_2M(10884u, 130u, 5u, 31u, 40000u)), - LC3_PRESET("48_1_1", LC3_CONFIG_48_1, - LC3_7_5_UNFRAMED(75u, 5u, 15u, 40000u)), - LC3_PRESET("48_2_1", LC3_CONFIG_48_2, - LC3_10_UNFRAMED(100u, 5u, 20u, 40000u)), - LC3_PRESET("48_3_1", LC3_CONFIG_48_3, - LC3_7_5_UNFRAMED(90u, 5u, 15u, 40000u)), - LC3_PRESET("48_4_1", LC3_CONFIG_48_4, - LC3_10_UNFRAMED(120u, 5u, 20u, 40000u)), - LC3_PRESET("48_5_1", LC3_CONFIG_48_5, - LC3_7_5_UNFRAMED(117u, 5u, 15u, 40000u)), - LC3_PRESET("48_6_1", LC3_CONFIG_48_6, - LC3_10_UNFRAMED(155u, 5u, 20u, 40000u)), + LC3_PRESET("8_1_1", LC3_CONFIG_8_1, LC3_QOS_8_1_1), + LC3_PRESET("8_2_1", LC3_CONFIG_8_2, LC3_QOS_8_2_1), + LC3_PRESET("16_1_1", LC3_CONFIG_16_1, LC3_QOS_16_1_1), + LC3_PRESET("16_2_1", LC3_CONFIG_16_2, LC3_QOS_16_2_1), + LC3_PRESET("24_1_1", LC3_CONFIG_24_1, LC3_QOS_24_1_1), + LC3_PRESET("24_2_1", LC3_CONFIG_24_2, LC3_QOS_24_2_1), + LC3_PRESET("32_1_1", LC3_CONFIG_32_1, LC3_QOS_32_1_1), + LC3_PRESET("32_2_1", LC3_CONFIG_32_2, LC3_QOS_32_1_1), + LC3_PRESET("44_1_1", LC3_CONFIG_44_1, LC3_QOS_44_1_1), + LC3_PRESET("44_2_1", LC3_CONFIG_44_2, LC3_QOS_44_2_1), + LC3_PRESET("48_1_1", LC3_CONFIG_48_1, LC3_QOS_48_1_1), + LC3_PRESET("48_2_1", LC3_CONFIG_48_2, LC3_QOS_48_2_1), + LC3_PRESET("48_3_1", LC3_CONFIG_48_3, LC3_QOS_48_3_1), + LC3_PRESET("48_4_1", LC3_CONFIG_48_4, LC3_QOS_48_4_1), + LC3_PRESET("48_5_1", LC3_CONFIG_48_5, LC3_QOS_48_5_1), + LC3_PRESET("48_6_1", LC3_CONFIG_48_6, LC3_QOS_48_6_1), /* QoS Configuration settings for high reliability audio data */ - LC3_PRESET_HR("8_1_2", LC3_CONFIG_8_1, - LC3_7_5_UNFRAMED(26u, 13u, 75u, 40000u)), - LC3_PRESET_HR("8_2_2", LC3_CONFIG_8_2, - LC3_10_UNFRAMED(30u, 13u, 95u, 40000u)), - LC3_PRESET_HR("16_1_2", LC3_CONFIG_16_1, - LC3_7_5_UNFRAMED(30u, 13u, 75u, 40000u)), - LC3_PRESET_HR("16_2_2", LC3_CONFIG_16_2, - LC3_10_UNFRAMED(40u, 13u, 95u, 40000u)), - LC3_PRESET_HR("24_1_2", LC3_CONFIG_24_1, - LC3_7_5_UNFRAMED(45u, 13u, 75u, 40000u)), - LC3_PRESET_HR("24_2_2", LC3_CONFIG_24_2, - LC3_10_UNFRAMED(60u, 13u, 95u, 40000u)), - LC3_PRESET_HR("32_1_2", LC3_CONFIG_32_1, - LC3_7_5_UNFRAMED(60u, 13u, 75u, 40000u)), - LC3_PRESET_HR("32_2_2", LC3_CONFIG_32_2, - LC3_10_UNFRAMED(80u, 13u, 95u, 40000u)), - LC3_PRESET_HR("44_1_2", LC3_CONFIG_44_1, - QOS_FRAMED_2M(8163u, 98u, 13u, 80u, 40000u)), - LC3_PRESET_HR("44_2_2", LC3_CONFIG_44_2, - QOS_FRAMED_2M(10884u, 130u, 13u, 85u, 40000u)), - LC3_PRESET_HR("48_1_2", LC3_CONFIG_48_1, - LC3_7_5_UNFRAMED(75u, 13u, 75u, 40000u)), - LC3_PRESET_HR("48_2_2", LC3_CONFIG_48_2, - LC3_10_UNFRAMED(100u, 13u, 95u, 40000u)), - LC3_PRESET_HR("48_3_2", LC3_CONFIG_48_3, - LC3_7_5_UNFRAMED(90u, 13u, 75u, 40000u)), - LC3_PRESET_HR("48_4_2", LC3_CONFIG_48_4, - LC3_10_UNFRAMED(120u, 13u, 100u, 40000u)), - LC3_PRESET_HR("48_5_2", LC3_CONFIG_48_5, - LC3_7_5_UNFRAMED(117u, 13u, 75u, 40000u)), - LC3_PRESET_HR("48_6_2", LC3_CONFIG_48_6, - LC3_10_UNFRAMED(155u, 13u, 100u, 40000u)), + LC3_PRESET_HR("8_1_2", LC3_CONFIG_8_1, LC3_QOS_8_1_2), + LC3_PRESET_HR("8_2_2", LC3_CONFIG_8_2, LC3_QOS_8_2_2), + LC3_PRESET_HR("16_1_2", LC3_CONFIG_16_1, LC3_QOS_16_1_2), + LC3_PRESET_HR("16_2_2", LC3_CONFIG_16_2, LC3_QOS_16_2_2), + LC3_PRESET_HR("24_1_2", LC3_CONFIG_24_1, LC3_QOS_24_1_2), + LC3_PRESET_HR("24_2_2", LC3_CONFIG_24_2, LC3_QOS_24_2_2), + LC3_PRESET_HR("32_1_2", LC3_CONFIG_32_1, LC3_QOS_32_1_2), + LC3_PRESET_HR("32_2_2", LC3_CONFIG_32_2, LC3_QOS_32_2_2), + LC3_PRESET_HR("44_1_2", LC3_CONFIG_44_1, LC3_QOS_44_1_2), + LC3_PRESET_HR("44_2_2", LC3_CONFIG_44_2, LC3_QOS_44_2_2), + LC3_PRESET_HR("48_1_2", LC3_CONFIG_48_1, LC3_QOS_48_1_2), + LC3_PRESET_HR("48_2_2", LC3_CONFIG_48_2, LC3_QOS_48_2_2), + LC3_PRESET_HR("48_3_2", LC3_CONFIG_48_3, LC3_QOS_48_3_2), + LC3_PRESET_HR("48_4_2", LC3_CONFIG_48_4, LC3_QOS_48_4_2), + LC3_PRESET_HR("48_5_2", LC3_CONFIG_48_5, LC3_QOS_48_5_2), + LC3_PRESET_HR("48_6_2", LC3_CONFIG_48_6, LC3_QOS_48_6_2), /* QoS configuration support setting requirements for the UGG and UGT */ - LC3_PRESET_LL("16_1_gs", LC3_CONFIG_16_1, - LC3_7_5_UNFRAMED(30u, 1u, 15u, 60000u)), - LC3_PRESET_LL("16_2_gs", LC3_CONFIG_16_2, - LC3_10_UNFRAMED(40u, 1u, 20u, 60000u)), - LC3_PRESET_LL("32_1_gs", LC3_CONFIG_32_1, - LC3_7_5_UNFRAMED(60u, 1u, 15u, 60000u)), - LC3_PRESET_LL("32_2_gs", LC3_CONFIG_32_2, - LC3_10_UNFRAMED(80u, 1u, 20u, 60000u)), - LC3_PRESET_LL("48_1_gs", LC3_CONFIG_48_1, - LC3_7_5_UNFRAMED(75u, 1u, 15u, 60000u)), - LC3_PRESET_LL("48_2_gs", LC3_CONFIG_48_2, - LC3_10_UNFRAMED(100u, 1u, 20u, 60000u)), - LC3_PRESET_LL("32_1_gr", LC3_CONFIG_32_1, - LC3_7_5_UNFRAMED(60u, 1u, 15u, 10000u)), - LC3_PRESET_LL("32_2_gr", LC3_CONFIG_32_2, - LC3_10_UNFRAMED(80u, 1u, 20u, 10000u)), - LC3_PRESET_LL("48_1_gr", LC3_CONFIG_48_1, - LC3_7_5_UNFRAMED(75u, 1u, 15u, 10000u)), - LC3_PRESET_LL("48_2_gr", LC3_CONFIG_48_2, - LC3_10_UNFRAMED(100u, 1u, 20u, 10000u)), - LC3_PRESET_LL("48_3_gr", LC3_CONFIG_48_3, - LC3_7_5_UNFRAMED(90u, 1u, 15u, 10000u)), - LC3_PRESET_LL("48_4_gr", LC3_CONFIG_48_4, - LC3_10_UNFRAMED(120u, 1u, 20u, 10000u)), + LC3_PRESET_LL("16_1_gs", LC3_CONFIG_16_1, LC3_QOS_16_1_GS), + LC3_PRESET_LL("16_2_gs", LC3_CONFIG_16_2, LC3_QOS_16_2_GS), + LC3_PRESET_LL("32_1_gs", LC3_CONFIG_32_1, LC3_QOS_32_1_GS), + LC3_PRESET_LL("32_2_gs", LC3_CONFIG_32_2, LC3_QOS_32_2_GS), + LC3_PRESET_LL("48_1_gs", LC3_CONFIG_48_1, LC3_QOS_48_1_GS), + LC3_PRESET_LL("48_2_gs", LC3_CONFIG_48_2, LC3_QOS_48_2_GS), + LC3_PRESET_LL("32_1_gr", LC3_CONFIG_32_1, LC3_QOS_32_1_GR), + LC3_PRESET_LL("32_2_gr", LC3_CONFIG_32_2, LC3_QOS_32_2_GR), + LC3_PRESET_LL("48_1_gr", LC3_CONFIG_48_1, LC3_QOS_48_1_GR), + LC3_PRESET_LL("48_2_gr", LC3_CONFIG_48_2, LC3_QOS_48_2_GR), + LC3_PRESET_LL("48_3_gr", LC3_CONFIG_48_3, LC3_QOS_48_3_GR), + LC3_PRESET_LL("48_4_gr", LC3_CONFIG_48_4, LC3_QOS_48_4_GR), LC3_PRESET_LL("32_1_gr_l+r", LC3_CONFIG_32_1_AC(2), - LC3_7_5_UNFRAMED(2 * 60u, 1u, 15u, 10000u)), + LC3_QOS_32_1_GR_AC(2)), LC3_PRESET_LL("32_2_gr_l+r", LC3_CONFIG_32_2_AC(2), - LC3_10_UNFRAMED(2 * 80u, 1u, 20u, 10000u)), + LC3_QOS_32_2_GR_AC(2)), LC3_PRESET_LL("48_1_gr_l+r", LC3_CONFIG_48_1_AC(2), - LC3_7_5_UNFRAMED(2 * 75u, 1u, 15u, 10000u)), + LC3_QOS_48_1_GR_AC(2)), LC3_PRESET_LL("48_2_gr_l+r", LC3_CONFIG_48_2_AC(2), - LC3_10_UNFRAMED(2 * 100u, 1u, 20u, 10000u)), + LC3_QOS_48_2_GR_AC(2)), LC3_PRESET_LL("48_3_gr_l+r", LC3_CONFIG_48_3_AC(2), - LC3_7_5_UNFRAMED(2 * 90u, 1u, 15u, 10000u)), + LC3_QOS_48_3_GR_AC(2)), LC3_PRESET_LL("48_4_gr_l+r", LC3_CONFIG_48_4_AC(2), - LC3_10_UNFRAMED(2 * 120u, 1u, 20u, 10000u)), + LC3_QOS_48_4_GR_AC(2)), }; static struct codec_preset lc3_bcast_presets[] = { /* Table 6.4: Broadcast Audio Stream configuration support requirements * for the Broadcast Source and Broadcast Sink */ - LC3_PRESET("8_1_1", LC3_CONFIG_8_1, - LC3_7_5_UNFRAMED(26u, 2u, 8u, 40000u)), - LC3_PRESET("8_2_1", LC3_CONFIG_8_2, - LC3_10_UNFRAMED(30u, 2u, 10u, 40000u)), - LC3_PRESET("16_1_1", LC3_CONFIG_16_1, - LC3_7_5_UNFRAMED(30u, 2u, 8u, 40000u)), - LC3_PRESET("16_2_1", LC3_CONFIG_16_2, - LC3_10_UNFRAMED(40u, 2u, 10u, 40000u)), - LC3_PRESET("24_1_1", LC3_CONFIG_24_1, - LC3_7_5_UNFRAMED(45u, 2u, 8u, 40000u)), - LC3_PRESET("24_2_1", LC3_CONFIG_24_2, - LC3_10_UNFRAMED(60u, 2u, 10u, 40000u)), - LC3_PRESET("32_1_1", LC3_CONFIG_32_1, - LC3_7_5_UNFRAMED(60u, 2u, 8u, 40000u)), - LC3_PRESET("32_2_1", LC3_CONFIG_32_2, - LC3_10_UNFRAMED(80u, 2u, 10u, 40000u)), - LC3_PRESET("44_1_1", LC3_CONFIG_44_1, - QOS_FRAMED_2M(8163u, 98u, 4u, 24u, 40000u)), - LC3_PRESET("44_2_1", LC3_CONFIG_44_2, - QOS_FRAMED_2M(10884u, 130u, 4u, 31u, 40000u)), - LC3_PRESET("48_1_1", LC3_CONFIG_48_1, - LC3_7_5_UNFRAMED(75u, 4u, 15u, 40000u)), - LC3_PRESET("48_2_1", LC3_CONFIG_48_2, - LC3_10_UNFRAMED(100u, 4u, 20u, 40000u)), - LC3_PRESET("48_3_1", LC3_CONFIG_48_3, - LC3_7_5_UNFRAMED(90u, 4u, 15u, 40000u)), - LC3_PRESET("48_4_1", LC3_CONFIG_48_4, - LC3_10_UNFRAMED(120u, 4u, 20u, 40000u)), - LC3_PRESET("48_5_1", LC3_CONFIG_48_5, - LC3_7_5_UNFRAMED(117u, 4u, 15u, 40000u)), - LC3_PRESET("48_6_1", LC3_CONFIG_48_6, - LC3_10_UNFRAMED(155u, 4u, 20u, 40000u)), + LC3_PRESET_B("8_1_1", LC3_CONFIG_8_1, LC3_QOS_8_1_1_B), + LC3_PRESET_B("8_2_1", LC3_CONFIG_8_2, LC3_QOS_8_2_1_B), + LC3_PRESET_B("16_1_1", LC3_CONFIG_16_1, LC3_QOS_16_1_1_B), + LC3_PRESET_B("16_2_1", LC3_CONFIG_16_2, LC3_QOS_16_2_1_B), + LC3_PRESET_B("24_1_1", LC3_CONFIG_24_1, LC3_QOS_24_1_1_B), + LC3_PRESET_B("24_2_1", LC3_CONFIG_24_2, LC3_QOS_24_2_1_B), + LC3_PRESET_B("32_1_1", LC3_CONFIG_32_1, LC3_QOS_32_1_1_B), + LC3_PRESET_B("32_2_1", LC3_CONFIG_32_2, LC3_QOS_32_2_1_B), + LC3_PRESET_B("44_1_1", LC3_CONFIG_44_1, LC3_QOS_44_1_1_B), + LC3_PRESET_B("44_2_1", LC3_CONFIG_44_2, LC3_QOS_44_2_1_B), + LC3_PRESET_B("48_1_1", LC3_CONFIG_48_1, LC3_QOS_48_1_1_B), + LC3_PRESET_B("48_2_1", LC3_CONFIG_48_2, LC3_QOS_48_2_1_B), + LC3_PRESET_B("48_3_1", LC3_CONFIG_48_3, LC3_QOS_48_3_1_B), + LC3_PRESET_B("48_4_1", LC3_CONFIG_48_4, LC3_QOS_48_4_1_B), + LC3_PRESET_B("48_5_1", LC3_CONFIG_48_5, LC3_QOS_48_5_1_B), + LC3_PRESET_B("48_6_1", LC3_CONFIG_48_6, LC3_QOS_48_6_1_B), /* Broadcast Audio Stream configuration settings for high-reliability * audio data. */ - LC3_PRESET_HR("8_1_2", LC3_CONFIG_8_1, - LC3_7_5_UNFRAMED(26u, 4u, 45u, 40000u)), - LC3_PRESET_HR("8_2_2", LC3_CONFIG_8_2, - LC3_10_UNFRAMED(30u, 4u, 60u, 40000u)), - LC3_PRESET_HR("16_1_2", LC3_CONFIG_16_1, - LC3_7_5_UNFRAMED(30u, 4u, 45u, 40000u)), - LC3_PRESET_HR("16_2_2", LC3_CONFIG_16_2, - LC3_10_UNFRAMED(40u, 4u, 60u, 40000u)), - LC3_PRESET_HR("24_1_2", LC3_CONFIG_24_1, - LC3_7_5_UNFRAMED(45u, 4u, 45u, 40000u)), - LC3_PRESET_HR("24_2_2", LC3_CONFIG_24_2, - LC3_10_UNFRAMED(60u, 4u, 60u, 40000u)), - LC3_PRESET_HR("32_1_2", LC3_CONFIG_32_1, - LC3_7_5_UNFRAMED(60u, 4u, 45u, 40000u)), - LC3_PRESET_HR("32_2_2", LC3_CONFIG_32_2, - LC3_10_UNFRAMED(80u, 4u, 60u, 40000u)), - LC3_PRESET_HR("44_1_2", LC3_CONFIG_44_1, - QOS_FRAMED_2M(8163u, 4u, 13u, 54u, 40000u)), - LC3_PRESET_HR("44_2_2", LC3_CONFIG_44_2, - QOS_FRAMED_2M(10884u, 130u, 4u, 60u, 40000u)), - LC3_PRESET_HR("48_1_2", LC3_CONFIG_48_1, - LC3_7_5_UNFRAMED(75u, 4u, 50u, 40000u)), - LC3_PRESET_HR("48_2_2", LC3_CONFIG_48_2, - LC3_10_UNFRAMED(100u, 4u, 65u, 40000u)), - LC3_PRESET_HR("48_3_2", LC3_CONFIG_48_3, - LC3_7_5_UNFRAMED(90u, 4u, 50u, 40000u)), - LC3_PRESET_HR("48_4_2", LC3_CONFIG_48_4, - LC3_10_UNFRAMED(120u, 4u, 65u, 40000u)), - LC3_PRESET_HR("48_5_2", LC3_CONFIG_48_5, - LC3_7_5_UNFRAMED(117u, 4u, 50u, 40000u)), - LC3_PRESET_HR("48_6_2", LC3_CONFIG_48_6, - LC3_10_UNFRAMED(155u, 4u, 65u, 40000u)), + LC3_PRESET_B("8_1_2", LC3_CONFIG_8_1, LC3_QOS_8_1_1_B), + LC3_PRESET_B("8_2_2", LC3_CONFIG_8_2, LC3_QOS_8_2_2_B), + LC3_PRESET_B("16_1_2", LC3_CONFIG_16_1, LC3_QOS_16_1_2_B), + LC3_PRESET_B("16_2_2", LC3_CONFIG_16_2, LC3_QOS_16_2_2_B), + LC3_PRESET_B("24_1_2", LC3_CONFIG_24_1, LC3_QOS_24_1_2_B), + LC3_PRESET_B("24_2_2", LC3_CONFIG_24_2, LC3_QOS_24_2_2_B), + LC3_PRESET_B("32_1_2", LC3_CONFIG_32_1, LC3_QOS_32_1_2_B), + LC3_PRESET_B("32_2_2", LC3_CONFIG_32_2, LC3_QOS_32_2_2_B), + LC3_PRESET_B("44_1_2", LC3_CONFIG_44_1, LC3_QOS_44_1_2_B), + LC3_PRESET_B("44_2_2", LC3_CONFIG_44_2, LC3_QOS_44_2_2_B), + LC3_PRESET_B("48_1_2", LC3_CONFIG_48_1, LC3_QOS_48_1_2_B), + LC3_PRESET_B("48_2_2", LC3_CONFIG_48_2, LC3_QOS_48_2_2_B), + LC3_PRESET_B("48_3_2", LC3_CONFIG_48_3, LC3_QOS_48_3_2_B), + LC3_PRESET_B("48_4_2", LC3_CONFIG_48_4, LC3_QOS_48_4_2_B), + LC3_PRESET_B("48_5_2", LC3_CONFIG_48_5, LC3_QOS_48_5_2_B), + LC3_PRESET_B("48_6_2", LC3_CONFIG_48_6, LC3_QOS_48_6_2_B), }; static void print_ltv(const char *str, void *user_data) @@ -1863,7 +1744,7 @@ struct endpoint_config { struct iovec *caps; /* Codec Specific Configuration LTVs */ struct iovec *meta; /* Metadata LTVs*/ uint8_t target_latency; - struct codec_qos qos; /* BAP QOS configuration parameters */ + struct bt_bap_qos qos; /* BAP QOS configuration parameters */ uint8_t sync_factor; /* PA parameter */ uint8_t options; /* PA create sync parameter */ uint16_t skip; /* PA create sync parameter */ @@ -1873,20 +1754,8 @@ struct endpoint_config { uint16_t timeout; /* BIG create sync parameter */ }; -static void append_io_qos(DBusMessageIter *iter, struct endpoint_config *cfg) +static void append_io_qos(DBusMessageIter *iter, struct bt_bap_io_qos *qos) { - struct codec_qos *qos = &cfg->qos; - - bt_shell_printf("Framing 0x%02x\n", qos->framing); - - g_dbus_dict_append_entry(iter, "Framing", DBUS_TYPE_BYTE, - &qos->framing); - - bt_shell_printf("PresentationDelay %u\n", qos->delay); - - g_dbus_dict_append_entry(iter, "PresentationDelay", - DBUS_TYPE_UINT32, &qos->delay); - bt_shell_printf("Interval %u\n", qos->interval); g_dbus_dict_append_entry(iter, "Interval", DBUS_TYPE_UINT32, @@ -1902,18 +1771,18 @@ static void append_io_qos(DBusMessageIter *iter, struct endpoint_config *cfg) bt_shell_printf("Retransmissions %u\n", qos->rtn); - g_dbus_dict_append_entry(iter, "Retransmissions", - DBUS_TYPE_BYTE, &qos->rtn); + g_dbus_dict_append_entry(iter, "Retransmissions", DBUS_TYPE_BYTE, + &qos->rtn); bt_shell_printf("Latency %u\n", qos->latency); - g_dbus_dict_append_entry(iter, "Latency", - DBUS_TYPE_UINT16, &qos->latency); + g_dbus_dict_append_entry(iter, "Latency", DBUS_TYPE_UINT16, + &qos->latency); } static void append_ucast_qos(DBusMessageIter *iter, struct endpoint_config *cfg) { - struct codec_qos *qos = &cfg->qos; + struct bt_bap_ucast_qos *qos = &cfg->qos.ucast; if (cfg->ep->iso_group != BT_ISO_QOS_GROUP_UNSET) { bt_shell_printf("CIG 0x%2.2x\n", cfg->ep->iso_group); @@ -1930,7 +1799,7 @@ static void append_ucast_qos(DBusMessageIter *iter, struct endpoint_config *cfg) bt_shell_printf("Framing 0x%02x\n", qos->framing); g_dbus_dict_append_entry(iter, "Framing", DBUS_TYPE_BYTE, - &qos->framing); + &qos->framing); bt_shell_printf("PresentationDelay %u\n", qos->delay); @@ -1938,16 +1807,18 @@ static void append_ucast_qos(DBusMessageIter *iter, struct endpoint_config *cfg) DBUS_TYPE_UINT32, &qos->delay); if (cfg->target_latency) { - bt_shell_printf("TargetLatency 0x%02x\n", cfg->target_latency); - g_dbus_dict_append_entry(iter, "TargetLatency", - DBUS_TYPE_BYTE, &cfg->target_latency); + bt_shell_printf("TargetLatency 0x%02x\n", qos->target_latency); + g_dbus_dict_append_entry(iter, "TargetLatency", DBUS_TYPE_BYTE, + &qos->target_latency); } - append_io_qos(iter, cfg); + append_io_qos(iter, &qos->io_qos); } static void append_bcast_qos(DBusMessageIter *iter, struct endpoint_config *cfg) { + struct bt_bap_bcast_qos *qos = &cfg->qos.bcast; + if (cfg->ep->iso_group != BT_ISO_QOS_BIG_UNSET) { bt_shell_printf("BIG 0x%2.2x\n", cfg->ep->iso_group); g_dbus_dict_append_entry(iter, "BIG", DBUS_TYPE_BYTE, @@ -2008,19 +1879,25 @@ static void append_bcast_qos(DBusMessageIter *iter, struct endpoint_config *cfg) cfg->ep->bcode->iov_len); } + bt_shell_printf("Framing 0x%02x\n", qos->framing); + + g_dbus_dict_append_entry(iter, "Framing", DBUS_TYPE_BYTE, + &qos->framing); + + bt_shell_printf("PresentationDelay %u\n", qos->delay); + + g_dbus_dict_append_entry(iter, "PresentationDelay", + DBUS_TYPE_UINT32, &qos->delay); + /* Add BAP codec QOS configuration */ - append_io_qos(iter, cfg); + append_io_qos(iter, &qos->io_qos); } static void append_qos(DBusMessageIter *iter, struct endpoint_config *cfg) { DBusMessageIter entry, var, dict; - struct codec_qos *qos = &cfg->qos; const char *key = "QoS"; - if (!qos) - return; - dbus_message_iter_open_container(iter, DBUS_TYPE_DICT_ENTRY, NULL, &entry); @@ -2137,6 +2014,7 @@ static DBusMessage *endpoint_select_properties_reply(struct endpoint *ep, DBusMessage *reply; DBusMessageIter iter, props; struct endpoint_config *cfg; + struct bt_bap_io_qos *qos; uint32_t location = 0; uint8_t channels = 1; @@ -2169,14 +2047,19 @@ static DBusMessage *endpoint_select_properties_reply(struct endpoint *ep, /* Copy metadata */ cfg->meta = util_iov_dup(ep->meta, 1); - if (preset->qos.phy) { + if (ep->broadcast) + qos = &preset->qos.bcast.io_qos; + else + qos = &preset->qos.ucast.io_qos; + + if (qos->phy) { /* Set QoS parameters */ cfg->qos = preset->qos; /* Adjust the SDU size based on the number of * locations/channels that is being requested. */ if (channels > 1) - cfg->qos.sdu *= channels; + qos->sdu *= channels; } dbus_message_iter_init_append(reply, &iter); @@ -3871,10 +3754,14 @@ fail: static void custom_delay(const char *input, void *user_data) { struct codec_preset *p = user_data; - struct codec_qos *qos = (void *)&p->qos; + struct bt_bap_qos *qos = (void *)&p->qos; char *endptr = NULL; - qos->delay = strtol(input, &endptr, 0); + if (!p->target_latency) + qos->bcast.delay = strtol(input, &endptr, 0); + else + qos->ucast.delay = strtol(input, &endptr, 0); + if (!endptr || *endptr != '\0') { bt_shell_printf("Invalid argument: %s\n", input); return bt_shell_noninteractive_quit(EXIT_FAILURE); @@ -3886,10 +3773,14 @@ static void custom_delay(const char *input, void *user_data) static void custom_latency(const char *input, void *user_data) { struct codec_preset *p = user_data; - struct codec_qos *qos = (void *)&p->qos; + struct bt_bap_qos *qos = (void *)&p->qos; char *endptr = NULL; - qos->latency = strtol(input, &endptr, 0); + if (!p->target_latency) + qos->bcast.io_qos.latency = strtol(input, &endptr, 0); + else + qos->ucast.io_qos.latency = strtol(input, &endptr, 0); + if (!endptr || *endptr != '\0') { bt_shell_printf("Invalid argument: %s\n", input); return bt_shell_noninteractive_quit(EXIT_FAILURE); @@ -3902,10 +3793,14 @@ static void custom_latency(const char *input, void *user_data) static void custom_rtn(const char *input, void *user_data) { struct codec_preset *p = user_data; - struct codec_qos *qos = (void *)&p->qos; + struct bt_bap_qos *qos = (void *)&p->qos; char *endptr = NULL; - qos->rtn = strtol(input, &endptr, 0); + if (!p->target_latency) + qos->bcast.io_qos.rtn = strtol(input, &endptr, 0); + else + qos->ucast.io_qos.rtn = strtol(input, &endptr, 0); + if (!endptr || *endptr != '\0') { bt_shell_printf("Invalid argument: %s\n", input); return bt_shell_noninteractive_quit(EXIT_FAILURE); @@ -3918,10 +3813,14 @@ static void custom_rtn(const char *input, void *user_data) static void custom_sdu(const char *input, void *user_data) { struct codec_preset *p = user_data; - struct codec_qos *qos = (void *)&p->qos; + struct bt_bap_qos *qos = (void *)&p->qos; char *endptr = NULL; - qos->sdu = strtol(input, &endptr, 0); + if (!p->target_latency) + qos->bcast.io_qos.sdu = strtol(input, &endptr, 0); + else + qos->ucast.io_qos.sdu = strtol(input, &endptr, 0); + if (!endptr || *endptr != '\0') { bt_shell_printf("Invalid argument: %s\n", input); return bt_shell_noninteractive_quit(EXIT_FAILURE); @@ -3933,7 +3832,12 @@ static void custom_sdu(const char *input, void *user_data) static void custom_phy(const char *input, void *user_data) { struct codec_preset *p = user_data; - struct codec_qos *qos = (void *)&p->qos; + struct bt_bap_io_qos *qos; + + if (!p->target_latency) + qos = &p->qos.bcast.io_qos; + else + qos = &p->qos.ucast.io_qos; if (!strcmp(input, "1M")) qos->phy = 0x01; @@ -3965,16 +3869,21 @@ static void custom_phy(const char *input, void *user_data) static void custom_framing(const char *input, void *user_data) { struct codec_preset *p = user_data; - struct codec_qos *qos = (void *)&p->qos; + uint8_t *framing; + + if (!p->target_latency) + framing = &p->qos.bcast.framing; + else + framing = &p->qos.ucast.framing; if (!strcasecmp(input, "Unframed")) - qos->framing = 0x00; + *framing = 0x00; else if (!strcasecmp(input, "Framed")) - qos->framing = 0x01; + *framing = 0x01; else { char *endptr = NULL; - qos->framing = strtol(input, &endptr, 0); + *framing = strtol(input, &endptr, 0); if (!endptr || *endptr != '\0') { bt_shell_printf("Invalid argument: %s\n", input); return bt_shell_noninteractive_quit(EXIT_FAILURE); @@ -3988,8 +3897,13 @@ static void custom_framing(const char *input, void *user_data) static void custom_interval(const char *input, void *user_data) { struct codec_preset *p = user_data; - struct codec_qos *qos = (void *)&p->qos; char *endptr = NULL; + struct bt_bap_io_qos *qos; + + if (!p->target_latency) + qos = &p->qos.bcast.io_qos; + else + qos = &p->qos.ucast.io_qos; qos->interval = strtol(input, &endptr, 0); if (!endptr || *endptr != '\0') { From patchwork Wed Mar 13 19:43:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 780131 Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2007746537 for ; Wed, 13 Mar 2024 19:44:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710359054; cv=none; b=bkXzeYVudF4hywJuVLyossOp5nizKplTqcsN/oR8S1GtNZRaF1CykblsuoWZztrG62uc/fggyY8yrWckSzEh7MrArtZH5ziD6nhLMZggADiT/O+HHVYulwhTH8go1GggsCAu+fdZT0YFLGI9mPjzyDDeqUTCr/eqZu/mFkPYYmM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710359054; c=relaxed/simple; bh=KkkYgXSYcPx3PZFYQwyFf1flBkRiAj4QvwNf7IT6Utw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LKWm87PLKX+GJByfkSOiIxFBX29W1hZiAPoKvWOJEF+ESA4il+h+nD7PXRHQDqnBKNvbIo8LU+oBQw5xRhjL2uSXkVMLH/H//JVn53K0XjKZFUOAmPyg1V5ZLUO1JPalPoI2Dw5NTfu4JxAi9ZEKdQXuBWHk6cryHadAyfCCu2M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BPzIQftW; arc=none smtp.client-ip=209.85.222.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BPzIQftW" Received: by mail-ua1-f43.google.com with SMTP id a1e0cc1a2514c-7dae66def19so116917241.0 for ; Wed, 13 Mar 2024 12:44:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710359051; x=1710963851; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=zND5AGdO5FgvrcyAaXZw/th9OCUgQhoWphEUq6dFV0Q=; b=BPzIQftWEat0IC7Gci6IQRxzRA3j3ssbgL+z7aye6v1DIQzcul1vaikc679W5mp5a4 UR8wi39iQdi9PDKIHrFDeCjtkG4XEWcJwRJmnWH2cWG0+q9rK21Gxo1DRNBIgC22LWLX cOd4rfsgUoInIRcs1E2sXnsxnhH+cG7xqFAxiF8Y94SmbXhQNeMJfPyW7eXNruQrd++J ElATvRNnQIHAcEKYhJ5L/YuSsulBTBp/G+xtIytKY0EZoDFoZRGkUwkV6D8EUPaIaCxv 6dPiA6qFbbOsvpIQElWSUdVvYIulsdPk/HEylyqy9dhsSwc/sslrVV1xJVYFfxamCZSh 1xyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710359051; x=1710963851; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zND5AGdO5FgvrcyAaXZw/th9OCUgQhoWphEUq6dFV0Q=; b=XcWckVmJNeh5DL2Zrqaxxzgzo2inU0KFWtqLtG5kCDZROhTtZl2thXaKKrVk/MAGrG uyahHb9GgR6y92Me6+RPRrd29yj3NXEF73ei/twDXCQsN3VMxhJW/TXDoFtqBFKgpk4w nN3QHxL5O7e46qvtJ6f3LuRKJ6CB6Vd7LyVD3oGkavUCuHSJr/896tlS9bVsO8BO3pFE a0DtKPFtoilwaOJh6/hcdZHdlgDypdnuZVqVWc0g1ZuDSVr6D+L4k9tvVjINa1hi+QhY +7+c+QcpAfWxeXhlBYRhPa620vVcaE/KmqWCu+j2ZI1vP2cayexrIxfig8ZMgkysQsxv o8/A== X-Gm-Message-State: AOJu0YxzxgF6u9gCxkeQU0AwFeZUnjMZ8x+qhgFWox6SK5/5UKn9+jz6 T6B4ev8RfLvBSpuT35H5FHenEt0qtVtMp7iMUgmmgJlCLc+eNX9QC1JMV5Ah X-Google-Smtp-Source: AGHT+IGi/3LLuzPaZ2yX6x4ypOMfPW5AoXQElY2gI2SiPjh3ziIRR+TLFY62Jlr0zc1KxWkf0A3j0g== X-Received: by 2002:a67:b60b:0:b0:472:6673:f8ce with SMTP id d11-20020a67b60b000000b004726673f8cemr932667vsm.34.1710359051138; Wed, 13 Mar 2024 12:44:11 -0700 (PDT) Received: from lvondent-mobl4.. (107-146-107-067.biz.spectrum.com. [107.146.107.67]) by smtp.gmail.com with ESMTPSA id gd6-20020a056102624600b004730db4e873sm1800259vsb.10.2024.03.13.12.44.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 12:44:10 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v4 5/6] client/player: Cleanup broadcast QoS Date: Wed, 13 Mar 2024 15:43:59 -0400 Message-ID: <20240313194400.1397477-5-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313194400.1397477-1-luiz.dentz@gmail.com> References: <20240313194400.1397477-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz There is no need to setup broadcast QoS related to PA/BIG as the kernel already sets these settings. --- client/player.c | 89 +++++++++++++++++++------------------------------ 1 file changed, 35 insertions(+), 54 deletions(-) diff --git a/client/player.c b/client/player.c index 381c5d568103..d26ff9d3a9df 100644 --- a/client/player.c +++ b/client/player.c @@ -94,14 +94,6 @@ struct avdtp_media_codec_capability { #error "Unknown byte order" #endif -/* BAP Broadcast parameters */ -#define BCAST_SYNC_FACTOR 24 /* PA params */ -#define BCAST_OPTIONS 0x00 /* PA Create Sync */ -#define BCAST_SKIP 0x0000 /* PA Create Sync */ -#define BCAST_SYNC_TIMEOUT 0x4000 /* PA Create Sync */ -#define BCAST_SYNC_CTE_TYPE 0x00 /* PA Create Sync */ -#define BCAST_MSE 0x00 /* BIG Create Sync */ -#define BCAST_TIMEOUT 0x4000 /* BIG Create Sync */ #define BCAST_CODE {0x01, 0x02, 0x68, 0x05, 0x53, 0xf1, 0x41, 0x5a, \ 0xa2, 0x65, 0xbb, 0xaf, 0xc6, 0xea, 0x03, 0xb8} @@ -1745,13 +1737,6 @@ struct endpoint_config { struct iovec *meta; /* Metadata LTVs*/ uint8_t target_latency; struct bt_bap_qos qos; /* BAP QOS configuration parameters */ - uint8_t sync_factor; /* PA parameter */ - uint8_t options; /* PA create sync parameter */ - uint16_t skip; /* PA create sync parameter */ - uint16_t sync_timeout; /* PA create sync parameter */ - uint8_t sync_cte_type; /* PA create sync parameter */ - uint8_t mse; /* BIG create sync parameter */ - uint16_t timeout; /* BIG create sync parameter */ }; static void append_io_qos(DBusMessageIter *iter, struct bt_bap_io_qos *qos) @@ -1831,40 +1816,47 @@ static void append_bcast_qos(DBusMessageIter *iter, struct endpoint_config *cfg) &cfg->ep->iso_stream); } - bt_shell_printf("SyncFactor %u\n", cfg->sync_factor); + if (qos->sync_factor) { + bt_shell_printf("SyncFactor %u\n", qos->sync_factor); + g_dbus_dict_append_entry(iter, "SyncFactor", DBUS_TYPE_BYTE, + &qos->sync_factor); + } - g_dbus_dict_append_entry(iter, "SyncFactor", DBUS_TYPE_BYTE, - &cfg->sync_factor); + if (qos->options) { + bt_shell_printf("Options %u\n", qos->options); + g_dbus_dict_append_entry(iter, "Options", DBUS_TYPE_BYTE, + &qos->options); + } - bt_shell_printf("Options %u\n", cfg->options); + if (qos->skip) { + bt_shell_printf("Skip %u\n", qos->skip); + g_dbus_dict_append_entry(iter, "Skip", DBUS_TYPE_UINT16, + &qos->skip); + } - g_dbus_dict_append_entry(iter, "Options", DBUS_TYPE_BYTE, - &cfg->options); + if (qos->sync_timeout) { + bt_shell_printf("SyncTimeout %u\n", qos->sync_timeout); + g_dbus_dict_append_entry(iter, "SyncTimeout", DBUS_TYPE_UINT16, + &qos->sync_timeout); + } - bt_shell_printf("Skip %u\n", cfg->skip); + if (qos->sync_cte_type) { + bt_shell_printf("SyncCteType %u\n", qos->sync_cte_type); + g_dbus_dict_append_entry(iter, "SyncCteType", DBUS_TYPE_BYTE, + &qos->sync_cte_type); + } - g_dbus_dict_append_entry(iter, "Skip", DBUS_TYPE_UINT16, - &cfg->skip); + if (qos->sync_cte_type) { + bt_shell_printf("MSE %u\n", qos->mse); + g_dbus_dict_append_entry(iter, "MSE", DBUS_TYPE_BYTE, + &qos->mse); + } - bt_shell_printf("SyncTimeout %u\n", cfg->sync_timeout); - - g_dbus_dict_append_entry(iter, "SyncTimeout", DBUS_TYPE_UINT16, - &cfg->sync_timeout); - - bt_shell_printf("SyncCteType %u\n", cfg->sync_cte_type); - - g_dbus_dict_append_entry(iter, "SyncType", DBUS_TYPE_BYTE, - &cfg->sync_cte_type); - - bt_shell_printf("MSE %u\n", cfg->mse); - - g_dbus_dict_append_entry(iter, "MSE", DBUS_TYPE_BYTE, - &cfg->mse); - - bt_shell_printf("Timeout %u\n", cfg->timeout); - - g_dbus_dict_append_entry(iter, "Timeout", DBUS_TYPE_UINT16, - &cfg->timeout); + if (qos->timeout) { + bt_shell_printf("Timeout %u\n", qos->timeout); + g_dbus_dict_append_entry(iter, "Timeout", DBUS_TYPE_UINT16, + &qos->timeout); + } if (cfg->ep->bcode->iov_len != 0) { const char *key = "BCode"; @@ -3673,17 +3665,6 @@ static void endpoint_set_config_bcast(struct endpoint_config *cfg) iov_append(&cfg->ep->bcode, bcast_code, sizeof(bcast_code)); - /* Add periodic advertisement parameters */ - cfg->sync_factor = BCAST_SYNC_FACTOR; - cfg->options = BCAST_OPTIONS; - cfg->skip = BCAST_SKIP; - cfg->sync_timeout = BCAST_SYNC_TIMEOUT; - cfg->sync_cte_type = BCAST_SYNC_CTE_TYPE; - - /* Add BIG create sync parameters */ - cfg->mse = BCAST_MSE; - cfg->timeout = BCAST_TIMEOUT; - if ((strcmp(cfg->ep->uuid, BAA_SERVICE_UUID) == 0)) { /* A broadcast sink endpoint config does not need * user input. From patchwork Wed Mar 13 19:44:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 780130 Received: from mail-vs1-f49.google.com (mail-vs1-f49.google.com [209.85.217.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B358246426 for ; Wed, 13 Mar 2024 19:44:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710359056; cv=none; b=Mf+iKZcqIMUP/0/DzSFk8LX5nBktMJqf9BUAOo+2N99fBnScXcC9dNky94IGvmchtdYGtcMAdtfx/5cHUuhkqmn+YJuL1w8NTLBRjiGXQ8lWz7QyX90jvJt/7VKv1YRXnlHWAAAuGLlcFqRVErDDjxdWE2kc12y3bKa6NtyOEfY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710359056; c=relaxed/simple; bh=PXp1Zb1Khcx0KWI5SNDwipwCmZytXIDt+kHpshxKR7E=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HHr1q9VVQXOI9bNLCOfL/elTpUXo2J1jvhzGwxisjqFEPCfRrlHE3spKOZVMfFGUYvLi6i0GuLjqJe5GGPczwjFan5Ts+k7Ostn3fAypDhmke/igY9tDi/Z8TD9uvouzDPvu9xMiEPnlBzdezUz+zjbfszlizKLYrZoOiuEC7fQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VuD0f18S; arc=none smtp.client-ip=209.85.217.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VuD0f18S" Received: by mail-vs1-f49.google.com with SMTP id ada2fe7eead31-47348b64b56so38677137.1 for ; Wed, 13 Mar 2024 12:44:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710359053; x=1710963853; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=VGuMbCSblXuMbRdp+cVXJVrBpElJQ+MdlDXtWzUF73w=; b=VuD0f18SMkRqocxNSqql0MWc5s+Qz76RY4X8A03gagCr7zdEuy5OnDWI6whzZ1BTLY Ch51WTq3uNiX03GM1nR/IA1VCY63cME/SehgCIczkSBV1ruPKLrRIwz56E3u55dHa2y4 KUmWPACDPUZWTeCNdJg4vNtW1pZkQsCUbn9CCRZt1QArV/g6l4PrC6o6GTPLIVCUf/YT pvsC87IY0nayuOt2Lf+ggWeH+CgfvoQkf8BPU49yxT3FEEkhAlvAZdNh2uynWu4GcB71 k8KbGphMapYp7ZzjysEsAZmU8mUlxrPaw2jwdLChXZnU01kQjR3u8aBI9eOhYlVovK3C TzHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710359053; x=1710963853; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VGuMbCSblXuMbRdp+cVXJVrBpElJQ+MdlDXtWzUF73w=; b=hlJGuyrK8uwdJPXY+ZFUqL3WJBhuSMTA/nm2zhYZeQFuxY86rl5NG8WFdl/KlrRS2F 14hmbU+uIZJxi3dXN8HE9C9x3TImpL36z6oNKYJFV3+2FZUnpESqCHw4nVPe0J6oqidz gEUb0OXRWPfo5bJUNAWz1VMCz2MDIWjB35hvwSGuKVVIj1maoz+t3iWCJ8UeI80co7nc EKMk4BLeamcqBqoghtIylU1IbW0TiukCU9f7Fr+4HHhjpt/ZEHgXkVnsExSJMLNCtWcT hdOqUp1o5x/uPUZ7G82hgETYqAa20ywRrv/gK0qydBAdt2iHJxaDQGjk75pVw6geGhQQ +d5g== X-Gm-Message-State: AOJu0YyOO8nmKRy8B4bHvJAxMsWl/2+9Uhor0/wsyktS6aV3Q1Mqps5z j8e+yZqb/Ms0oYyEJHLmK3bxkwphBYpOVAMzmkRyzFynSHoZgo3c9HpyDJgg X-Google-Smtp-Source: AGHT+IGE130eQXNzR3G85kEkU+BEd5gq4xX/LTiFZ/5+5DqZn5EU7F9Lxr7zf3lXcINy7cPThi/AMg== X-Received: by 2002:a67:f3d5:0:b0:473:c49:283d with SMTP id j21-20020a67f3d5000000b004730c49283dmr1023485vsn.2.1710359053130; Wed, 13 Mar 2024 12:44:13 -0700 (PDT) Received: from lvondent-mobl4.. (107-146-107-067.biz.spectrum.com. [107.146.107.67]) by smtp.gmail.com with ESMTPSA id gd6-20020a056102624600b004730db4e873sm1800259vsb.10.2024.03.13.12.44.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 12:44:11 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v4 6/6] bap: Add proper default for broadcast setup Date: Wed, 13 Mar 2024 15:44:00 -0400 Message-ID: <20240313194400.1397477-6-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313194400.1397477-1-luiz.dentz@gmail.com> References: <20240313194400.1397477-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz This adds proper default for broadcast setup so it doesn't fail to create the socket due to users not setting them. --- profiles/audio/bap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 1034202cb8a0..964ba9c212e8 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -841,6 +841,9 @@ static struct bap_setup *setup_new(struct bap_ep *ep) /* Mark BIG and BIS to be auto assigned */ setup->qos.bcast.big = BT_ISO_QOS_BIG_UNSET; setup->qos.bcast.bis = BT_ISO_QOS_BIS_UNSET; + setup->qos.bcast.sync_factor = 0x01; + setup->qos.bcast.sync_timeout = BT_ISO_SYNC_TIMEOUT; + setup->qos.bcast.timeout = BT_ISO_SYNC_TIMEOUT; setup->qos_parser = setup_parse_bcast_qos; setup->destroy = setup_bcast_destroy; } else {