From patchwork Wed Mar 13 15:07:03 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: 13591503 Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (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 232AA43AC8 for ; Wed, 13 Mar 2024 15:07:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710342431; cv=none; b=LewG4u3OIHCqcm7IliA2llkE7wN0y7tziO9gqvzrOU875lx19DfVf69OxSeCpnI27EC5kF0WnrZUgFSOEr/O2FOtpA6hTHbVPIy3bBViATaAvyaWEzVtVNPcnCNiTUQ4AfiMxj3XZoMsMsQE/K0ebLKhAZ40TA+uDduoRXPTTdA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710342431; c=relaxed/simple; bh=e4+PHqDauya9n2dspmku/9IFy3579jWCY4iOuSZnHjA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=DgkGwLk8REDc8TdycrTpZl+OOJtsg3G6o+EEqdE2+6xFaAzgHlGc3OWTjV1JCYx95Q9vjA64jE5HkWdX4rQxzeHUZJFFwnXdplEaBWxneNMJwHcvBxgkv+zoo3oLtbpTrjQ9rVfnnVa6tF/7OtY7DM7z2vQJ2H71dwPbUWtcuQQ= 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=grLc/znx; arc=none smtp.client-ip=209.85.160.169 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="grLc/znx" Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-42f2009e559so8745721cf.0 for ; Wed, 13 Mar 2024 08:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710342428; x=1710947228; 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=grLc/znxAi/g0/pw+36vNdvEFn2DGU7kv7hXS0XZ/ugNKp279FyXMgPwYNGEbSE0X1 5ZvOq4oRuUprJLBxj8cxPjWXiZogEX0fIHve0Ppvjt0ZoqTS1aLR+/hXrRc30ey86Eos yHfK7dXVu7/BMPM8x/nOOQEX9iZC950OjjtyoSgdNtyVziwkC1SxSMmmtOBPx0Xo9zKi +Iyub0vzV0KliefZUNkucsF9r1v9/vv4RxqAAFvvlmyZTxcUHEmeCSEQezqTtVWlmhfa Uv0JV8I3PQd/8DuczjGAGnuhxSu7L2l5OnXBWF7noK5vB8GP16QfdZqwEVdMZ46XeVo7 SOTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710342428; x=1710947228; 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=jB3NAoIPs3/UPCv7YkUhOCdUrgrIJhZXA81aXJ1OY1Nzx32y5x8X1fYtaAUTFzVc4W wI3oAXsYBOfMM2w/PBw+6eoIx1YD15mUI+aLDo15FoCgn8mgjqLMmWKi6jaMpexJMoX0 uCDWzxguDDQqGQ1gNBI5ZNiPs7OzEK1ImeIj5/oor60Os4BABLde2bHbZIdz95AAmjj0 6k+Eo58DnK35nP5SVIE1bGKWEiVS6rOfL+Wv8rxpzj/jxOF0OxKDFCnClxXBNWEXkaIH Xb2RB2+ojdkgjEvFQL3HocQpl4AGy4LdtcimGfWhSlITY/qKuoMYA6D8Y/GT3ji4JTyy dV0w== X-Gm-Message-State: AOJu0YwnzGXWsZott1R3/VC/iGFNpPXI7aeKRe3QCo16Z/9v6xoGv1jY cIgGyV2WD2WOqVF7JHzRv24JRdGtUQaEintqc1Lp3YNxCru3iR9Rw1v6+g5k X-Google-Smtp-Source: AGHT+IGh2d7MdnJYdxNLeVMl8E4WCd45z7Qrb5JaEpcHtYJNKE/M84WzOv2fq0vC2gicAFafd9nPhg== X-Received: by 2002:a05:6214:2b0a:b0:68f:f859:ee06 with SMTP id jx10-20020a0562142b0a00b0068ff859ee06mr175651qvb.12.1710342428432; Wed, 13 Mar 2024 08:07: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 bi47-20020a05612218af00b004cd29aaccd6sm1205610vkb.2.2024.03.13.08.07.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 08:07:07 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 1/4] client/player: Split unicast and broadcast presets Date: Wed, 13 Mar 2024 11:07:03 -0400 Message-ID: <20240313150706.1279036-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 15:07:04 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: 13591504 Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.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 B5C6943AC8 for ; Wed, 13 Mar 2024 15:07:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710342434; cv=none; b=e+8wHrH1qUdWWJ8yS2FHJxyDbGh8aQKxzfS4GTmjHcuhBh/jRYE0x3G8tL1Da5OZOo9WpaNu2wdHJ0Cp+WmlitWdC8clhvnAj5dnKQxfV+MbNjs6Z5Rms+AjuejsU9dsA25UmY5ykKSKYCecc07rHF0wQVCTH8dVbicjLaiUHn4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710342434; c=relaxed/simple; bh=cfNY3BBkfwla0T7BeuhyZ1NNOs+VAaGvidP52JFYiQw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K5i3NkfJZpTj+HVaOw72SJMAth/6e1s/qNZQMKd1Exo6GMFz/jgIzehnTgKzAJuclKpEr0XR8ECNSuxKKqNmXRMY8x40Q0Qs93sGONZZJLeG+kUw5qb09zXH47biC+RfSn32BZG8DKZ/L1gi5uEA3gJ1GDy/uh7XM9CnQL+ne2M= 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=BJANZ2Qq; arc=none smtp.client-ip=209.85.210.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="BJANZ2Qq" Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-6e4f7975121so1619417a34.1 for ; Wed, 13 Mar 2024 08:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710342430; x=1710947230; 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=BJANZ2QqQadLPpjgTr7hPssgFV+aQdhj51d+8IcnHbdJAY4Rc95tHNsQsOk68YBFlz rehsf7f4lu5Jgqds3Nnh/AEIFcd2B4Mz1nVM3lhF9aGVRi6hIhJ7w1JL/nvULH8ww9+R 5Xl0MVfY2E/f4Kcqp45p6L8p2D6VcQRPXG5J78q7+jmkdlr9FcDoSktgBnTaLllgudhO hnyBGGJtUnvGjl6ER8c+fbWhWbjzPzujvn8DZFFt+NmCmlpY+q3m6HcokoE2Ha/40WTO W0eeb5eNrqwi9PaLfLRhA3fsDh+fWzKexthAtCOy8uboaoFrioAZ73nDztn6I+/SIhTG URug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710342430; x=1710947230; 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=DG+pVZhpIG5YWCiWsuoTBMDDLLthJXqvkfnKt8KmfySPxjtIfIodTA7B3jkP3l7qhw uKDl5/LSzCVTvdsGykdDJunM2p+SFYC0hC2UmLkh1szdKcC4DX7HTnpdno5OdCJd9eLp lGTUOULvPTTh5oOTwxuas9MQNi5mYYrExHSU2IMxnqMEHY6YWlZJ0is1c2OSgxNS2KpV v3whMRaKinmTNOSo4SVnwKQCHKE47MIfa4NfeKGhwXRx33L+ncbj1YL227p9XH07jluT MTR9bZUq6XnV4yv9psJHib/Jpsrt//WRrxriPnSH4mAdZ8qMOXCDWHBPAumfMaZ171Mb n2Vg== X-Gm-Message-State: AOJu0Ywz8A8giVLxB9OCfbRa4u/t1n+WUzzxxGWwP+rdKMGrsHWmGarR gB8XEEbA54UUrFYxOQS251oZrVxoS1ChnxjJGn0+lYDAZpYyNlhfxf1yp45w X-Google-Smtp-Source: AGHT+IHkD4lyBgI9tsQxAzgRu/9k7xFhCQT7ClUjhejIgM4gGWbt3oADrE6KXUTNw2uHFJWEemFy/g== X-Received: by 2002:a05:6830:1549:b0:6e5:3103:a948 with SMTP id l9-20020a056830154900b006e53103a948mr137126otp.27.1710342430157; Wed, 13 Mar 2024 08:07:10 -0700 (PDT) Received: from lvondent-mobl4.. (107-146-107-067.biz.spectrum.com. [107.146.107.67]) by smtp.gmail.com with ESMTPSA id bi47-20020a05612218af00b004cd29aaccd6sm1205610vkb.2.2024.03.13.08.07.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 08:07:09 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 2/4] client/player: Use macros from lc3.h to define presets Date: Wed, 13 Mar 2024 11:07:04 -0400 Message-ID: <20240313150706.1279036-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313150706.1279036-1-luiz.dentz@gmail.com> References: <20240313150706.1279036-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 15:07:05 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: 13591505 Received: from mail-vk1-f177.google.com (mail-vk1-f177.google.com [209.85.221.177]) (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 7F1BB45BF3 for ; Wed, 13 Mar 2024 15:07:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710342437; cv=none; b=GhpHENlrn8z9MB6L2p6DAD2yA6EmhcdrjrvTffujHAH5+ULGr7PkI7YGtH5hYKJskxMkh4nq66vVHknusDCxVhCHsgeow4a5HO3IDJ6AHykP+hDtSMVMLojg6ocymnNOn+1uZMpJvuL+Qzy1z/GWMybgVbhbO1PLT2KW/8bOk8I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710342437; c=relaxed/simple; bh=5YFf7okjs2u0/6jnyzg/Fczgw9WsIIgUxrcV9ADawPw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CPpm1hT8gFGLAOdh9OlOGcl2yQJa6R4BihviwqGsFesbwkFSffKdnf0iwkAxQ9w8Ukqz7BGEW20U8KPhbLWAD0wDMifqPJ5+tjpd1t9R5TQDrfWXqM8si8Rr+AePcxOrIOdPGUyp4d0yF5VqlX0aEpjpC0418WF6USOyI6KlcrM= 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=FPrXZRfj; arc=none smtp.client-ip=209.85.221.177 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="FPrXZRfj" Received: by mail-vk1-f177.google.com with SMTP id 71dfb90a1353d-4d37e76a3dfso530909e0c.1 for ; Wed, 13 Mar 2024 08:07:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710342433; x=1710947233; 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=nFqkOlrlD9l8od2nf4iVUx9e4lpYZkfntREwQL72MVM=; b=FPrXZRfjAtQsqO5tYz6iw6cl/8nfq/PgzTHWYuHrPLsMfFi6krAVdu3lta+PcRas60 WEv85qO0k4SJNtJgqNgJ4t4gk2O8QnAvN7iNJmtf9XsfCcynBT1/OBDUB4wttymdZEc1 K0elSn27ocyhYBQMOrPbS9fr6Gm4a78Hy/9kMGtscfvHV2u/Ss57xvhqI04QnqA1miuh 7lsaHZjSPSOi/PtdRWw+3vFUFAAQKA4PY9CbrGG/bKvcFW1+qkrTG7SPfMTDL+TcporM A6HRF3qTq0hHLOvTpG1xFJs7g6KLmOvzk7q6Ht0McjM6SytuaZRNUViycpQLCZTSVdNZ 5DsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710342433; x=1710947233; 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=nFqkOlrlD9l8od2nf4iVUx9e4lpYZkfntREwQL72MVM=; b=vceMoAinK3WitKa58eyEiahzuWz9YT0E1i3j/m/eNFplGqUf4g4DsHIOb3RizTmKwt eBYKDGKKDrJRcAqpRp0B+ijAn9etuLGlQw1lHPIw7AUEZy9B/1R4egIGjk+aPd0pRcT+ BTY2TmQvnVlMl1XUnrqjh5N8kM5km90WEontn02xIXK/NhNwMlfLnJrzxpfrRJfV9KhQ qR8bsOHZCYsoOyqO3OSa9Jkg0vMiOsuUp1vER9FzufZqn5Z/B1feUr8Lhu2nfpmT9pGa XDQIE6tvfVrWcL/OfgYKG6lhxmfoxy36IQrcB3eRn32Sx3EcPzyHuhdv37/6FIegJlOk x9Gw== X-Gm-Message-State: AOJu0YyDXeP0JlABLo5QruT9b/RfpJRsYZAiFRp+RjczlI4z/hPlB2y/ 7mJbQu/0gXPgbI7e/TIAKRQV6pTZnIkt4oI0ILjPfhifbaug6DMHpaOmEzqO X-Google-Smtp-Source: AGHT+IEyKwrd4gpjIevqbflf57jtsumWoI9M9tgN1DUWQWNJIEp3MA94+xlI0sVeQhCyXkSfw0PGYQ== X-Received: by 2002:a05:6122:1685:b0:4c9:b45:7e74 with SMTP id 5-20020a056122168500b004c90b457e74mr83461vkl.6.1710342433037; Wed, 13 Mar 2024 08:07: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 bi47-20020a05612218af00b004cd29aaccd6sm1205610vkb.2.2024.03.13.08.07.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 08:07:10 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 3/4] shared/lc3: Add definition for broadcast configurations Date: Wed, 13 Mar 2024 11:07:05 -0400 Message-ID: <20240313150706.1279036-3-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313150706.1279036-1-luiz.dentz@gmail.com> References: <20240313150706.1279036-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 | 372 +++++++++++++++++++++++++++++++++++++++++- 3 files changed, 469 insertions(+), 84 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..dcaa50ad531f 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, \ @@ -358,6 +361,14 @@ 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 @@ -378,13 +389,22 @@ 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 @@ -437,6 +457,23 @@ 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 @@ -457,6 +494,23 @@ 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 @@ -523,6 +577,25 @@ 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 @@ -543,6 +616,25 @@ 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 @@ -563,6 +655,16 @@ 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 @@ -583,6 +685,16 @@ 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 @@ -622,3 +734,261 @@ _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 15:07:06 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: 13591506 Received: from mail-oa1-f49.google.com (mail-oa1-f49.google.com [209.85.160.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 E4A474595B for ; Wed, 13 Mar 2024 15:07:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710342440; cv=none; b=MDZ30rQ+oL0xKbbl1UNK4/dvyIhKhYQqkAUrb+60eiXB3R53B/Pv1mtV3vJzievL1gTbH99TIwo5XJ5Y8pKZ5eNilEOqkQn+A7jepgbFSv5+q9Lc9L4Nx+2cWYbxnxJWyfxew6wvYM3iifun8zEFa7VBNMXPgHqQYSVpARoM24A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710342440; c=relaxed/simple; bh=j710wOZNf7KTzExFslKWSqoTk4lqWboYfZoTrcgyVgI=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fcLn/o/dN3vRtCe0JyjhadupYzfHHVIwaXoGzcikx0lnn222FRzgcSqDqU/wl368XeSUZSxTI934adQR2PYQ8KfnR28MD6+5LCWePe3OaKopZ85urNiCOdqj50cDNwp9vm8l5P1QaRpQ0Wmi67VrhdM0NsiedZzDHnvD3YNd0Bg= 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=flydXdgQ; arc=none smtp.client-ip=209.85.160.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="flydXdgQ" Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-22181888b88so5465607fac.1 for ; Wed, 13 Mar 2024 08:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710342436; x=1710947236; 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=flydXdgQBQ0RzgjMylPdYUF5C3fz0RW4y561XrPyr+VqI7SIiNDjl5F9ZJNBaQwLKG HAhssSO7lsioOenguCcAxD0sDPXNDPBqv+o1bmABaXPOB4p2ILzIE62RVuXDZrOfpJTv 6Xn5r6/sNWygcZaiDYB/0OFGNPbZD/qnUS801fOYCRv4dAO5fT91b4qn8sX2NA2mnDx3 24UoIIsvTBhw1RH0eJBjGO/XMzpTlsu4F+v9/pZTyJBt/RkSrRjjWWol/5Bsxx3V6wmJ EaKqnnDiOai6qqlf9+Y04kRNjk0j5NBzmcjfiHq1e/LkleOekPaARL/HUzT1r5H+xhsr B2vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710342436; x=1710947236; 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=dUgyc9tNnTIuqRAM8cJS2woJI8/2thC07RNo5jCadPkPJmf//xT9MuLogur4w7jEFM TMPYqbIEbVsLiooUuxoVWrTxFodBGxcVjzAVMQ2OJgl0KP0PTWI2b0yZI9+V+2DPhWHS kAf7XSH288N4wdODtdPDaMszXCccbZeGdcYZu9EWCMjpWVP2/fpQk9/pm5tvtWLezIz1 R3Cphb1+dYghh0YNfSxHK8TCMIkOwZ8xgZHVzjYtfr9c0pLXZmU6Yw6h1yIQHk9Ec1G2 W9Xtj4/ANFzXkMkZ+qsLGN26Pu9veAZgWDYc3OK/cUYVTkZfpPfwjukds3rjFqLCv7he qqjA== X-Gm-Message-State: AOJu0Yy2/gryWLcgcXtViSJbNb8+xM3UBTikOK+kQxgIwR7owHVoL0n3 7Uo69WYLvoZRexXWbLNbYbGS7dZ482DZQDh8cl6kFtLSCRmnZltm7ESpPuaZ X-Google-Smtp-Source: AGHT+IEC08RbKwf9eczVuxAnkNH5QdEzNTIawehVFvCNir2azHrlQidaHJSzpYV6zgj1s8YARe0e+A== X-Received: by 2002:a05:6870:1590:b0:21f:a11a:e251 with SMTP id j16-20020a056870159000b0021fa11ae251mr5665311oab.5.1710342435913; Wed, 13 Mar 2024 08:07:15 -0700 (PDT) Received: from lvondent-mobl4.. (107-146-107-067.biz.spectrum.com. [107.146.107.67]) by smtp.gmail.com with ESMTPSA id bi47-20020a05612218af00b004cd29aaccd6sm1205610vkb.2.2024.03.13.08.07.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 08:07:13 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 4/4] client/player: Use QOS macros from lc3.h to define presets Date: Wed, 13 Mar 2024 11:07:06 -0400 Message-ID: <20240313150706.1279036-4-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313150706.1279036-1-luiz.dentz@gmail.com> References: <20240313150706.1279036-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') {