Received: by 2002:a05:7412:e79e:b0:f3:1519:9f41 with SMTP id o30csp128079rdd; Wed, 22 Nov 2023 11:07:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZ312hLO8nhrgDB5H3C/AJYUtkX01q5zYxeV1INv2if0sP4M4pF+nt1QnjodahcBaxi0Xf X-Received: by 2002:a05:6a00:1484:b0:68f:f38d:f76c with SMTP id v4-20020a056a00148400b0068ff38df76cmr3698364pfu.6.1700680036644; Wed, 22 Nov 2023 11:07:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700680036; cv=none; d=google.com; s=arc-20160816; b=V+zZyU0cVK5vLn0cDfcaUCkFnWt9Ywq3Jk4CWeYaQq7L8NOwhDwILrPRS9gltZlnaV byrgzPx2y5G0DAhQ86y2maSbH7BK+q3c6y1n2AV3YTQBcsXFdbHIVIjasPvsA6bOh4Xh 6CZvj+s6zWwiey4n37+aFXYts6y9pr6/P/OAguGGnH7m5qGktxpw0L212VImogDHTSlq lemQalXS9LwMHaoHvuEUCyC/5avuloRDTQjnhMGN9IuKVdVuS4VAcMtruVzrceuTWe51 IYoaJ/OVEHmYlgRho39xg9zUM6hV476fxnuflqBmn0sudexcq3jLwjmkNDgDfZNLOt0B Q2aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=ori42QOJjHOoXAlPFmHbnz7X2hMN0jo6XBrSbRRzThg=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=mK00cL9wx7fKJw4hTHo6FhhEJqHOqHZfrGrmJyiyXoda7/9Des4V0bElNZsLhidKar 2gv1/jlv1ENBzH0Xs4lusHIbfAjRqfe852U4X9d+xV/qILQ6Ul6boRZRYYXdiHgLaKrU 23A8sUlEf+5pXL4xCVf5v8gb9kXaJ06Yh60+S3kqufGsMUOK3PurmgKvZabBAU7Yt2eT KONXnaOTiLpt1VQ3Jef+M0/A1Z22VIy7EClrL/OIPKgh2rOGReJT8jloJenZFMgXWzYf hRgMM0b9wTygxOHL0ZgNqWuo+ZL7Am5N0px0EYgbX7n+4aE1XxFExqy+fYbXC9KRsjXS zKEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XiJcs057; spf=pass (google.com: domain of linux-bluetooth+bounces-174-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-174-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o16-20020a656150000000b005b4c93baa41si58447pgv.391.2023.11.22.11.07.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 11:07:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-174-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XiJcs057; spf=pass (google.com: domain of linux-bluetooth+bounces-174-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-174-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 57CAB2816C6 for ; Wed, 22 Nov 2023 19:07:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B06825C90F; Wed, 22 Nov 2023 19:07:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XiJcs057" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C19193 for ; Wed, 22 Nov 2023 11:07:01 -0800 (PST) Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-778999c5ecfso3049385a.2 for ; Wed, 22 Nov 2023 11:07:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700680019; x=1701284819; 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=ori42QOJjHOoXAlPFmHbnz7X2hMN0jo6XBrSbRRzThg=; b=XiJcs057JsCfLo6dBuQZ2RI7Kc58nCDYGEeuGYJV6IYeESdcTih1eKve0EIZu8CHuz WpKDLUns19uHQGVxRgR3HT8BFkJTMXu1p1GjrFiRUifHesfR41pE2cCRLcLoFpBeXRkm kkJCIWgampTTiO9jyyj8wR54cPgEC+OISlWYLhvDHlM12nrwxVyDSdNVRvMPo3zOlWfO OmaZgTf/ZA6Vgz+Hfwn5UGKYlQwUBmMVCEUsFpJaKoZr4EUVU/LEbceri4RbGA73wqWo qm13kM5doMdMyHOHHqJvLeMfw8jQIdcHioUoK0Tnb6AvW0VDrQ1kcvBDkqXmBmkQkCa6 hLjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700680019; x=1701284819; 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=ori42QOJjHOoXAlPFmHbnz7X2hMN0jo6XBrSbRRzThg=; b=EuAmoRR6Hg64ZEWBUMHNxpzb/VWBfVHpz3v3a6BWUB81toYMKaxIGs44kXMZHgeCxB 0nfX4BL5te///NjZdUO70749pyp1TwVn5gY3uxwyLQD1euG6cHWpQMqPYPQZyQpXMlJS 7Q60zUMrnIj3yfafujyCbiTA+DHO7hWzgbde9Clue1Ztzt1QUpdoBnNMkC62NbFzYP/2 jtBdjHJQCtITpmZJ9Gx4Bdr5koX30nQS9NMBkV8m28Vx6F7tZf/LQrP5dPvtFrg2vJ95 fvN7QR3Hc1nVYwhTpqh+gCFxr4fZvKjffIiFZqi3KBRgv3DXU9yeA+DrYeneAl9jIIc4 xdNg== X-Gm-Message-State: AOJu0YwZydxlAzdXblqbFG1bZzeHz3DABb3PYMxrNzBUV+hghaxqTcoA 9DNXmIKqYn+3O+CWscJWi2/X+TnfjDH3xq8b X-Received: by 2002:a05:620a:268e:b0:77d:6860:c628 with SMTP id c14-20020a05620a268e00b0077d6860c628mr2541273qkp.46.1700680019376; Wed, 22 Nov 2023 11:06:59 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id b32-20020a05620a272000b0076d25b11b62sm97885qkp.38.2023.11.22.11.06.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 11:06:58 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 5/5] client/player: Add presets from GMAP Date: Wed, 22 Nov 2023 14:06:49 -0500 Message-ID: <20231122190649.879386-5-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231122190649.879386-1-luiz.dentz@gmail.com> References: <20231122190649.879386-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 Content-Transfer-Encoding: 8bit From: Luiz Augusto von Dentz This adds the following presets from GMAP: 16_1_gs 16_2_gs 32_1_gs 32_2_gs 48_1_gs 48_2_gs 32_1_gr 32_2_gr 48_1_gr 48_2_gr 48_3_gr 48_4_gr 32_1_gr_l+r 32_2_gr_l+r 48_1_gr_l+r 48_2_gr_l+r 48_3_gr_l+r 48_4_gr_l+r --- client/player.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/client/player.c b/client/player.c index 715598aa9405..4a7042412248 100644 --- a/client/player.c +++ b/client/player.c @@ -1314,6 +1314,13 @@ static struct codec_preset sbc_presets[] = { 0x02, LC3_CONFIG_DURATION, _duration, \ 0x03, LC3_CONFIG_FRAME_LEN, _len, _len >> 8) +#define LC3_PRESET_DATA_ALL(_freq, _duration, _alloc, _len) \ + CODEC_DATA(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) @@ -1332,18 +1339,24 @@ static struct codec_preset sbc_presets[] = { #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, \ .data = _data, \ .qos = _qos, \ - .latency = 0x01, \ + .target_latency = 0x01, \ } #define LC3_PRESET(_name, _data, _qos) \ @@ -1461,6 +1474,67 @@ static struct codec_preset lc3_presets[] = { LC3_PRESET_HR("48_6_2", LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 155u), 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_7_5_UNFRAMED(30u, 1u, 15u, 60000u)), + LC3_PRESET_LL("16_2_gs", + LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_10, 40u), + LC3_10_UNFRAMED(40u, 1u, 20u, 60000u)), + LC3_PRESET_LL("32_1_gs", + LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_7_5, 60u), + LC3_7_5_UNFRAMED(60u, 1u, 15u, 60000u)), + LC3_PRESET_LL("32_2_gs", + LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_10, 80u), + LC3_10_UNFRAMED(80u, 1u, 20u, 60000u)), + LC3_PRESET_LL("48_1_gs", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 75u), + LC3_7_5_UNFRAMED(75u, 1u, 15u, 60000u)), + LC3_PRESET_LL("48_2_gs", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 100u), + LC3_10_UNFRAMED(100u, 1u, 20u, 60000u)), + LC3_PRESET_LL("32_1_gr", + LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_7_5, 60u), + LC3_7_5_UNFRAMED(60u, 1u, 15u, 10000u)), + LC3_PRESET_LL("32_2_gr", + LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_10, 80u), + LC3_10_UNFRAMED(80u, 1u, 20u, 10000u)), + LC3_PRESET_LL("48_1_gr", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 75u), + LC3_7_5_UNFRAMED(75u, 1u, 15u, 10000u)), + LC3_PRESET_LL("48_2_gr", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 100u), + LC3_10_UNFRAMED(100u, 1u, 20u, 10000u)), + LC3_PRESET_LL("48_3_gr", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 90u), + LC3_7_5_UNFRAMED(90u, 1u, 15u, 10000u)), + LC3_PRESET_LL("48_4_gr", + LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 120u), + 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_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_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_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_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_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_10_UNFRAMED(2 * 120u, 1u, 20u, 10000u)), }; static void print_ltv(const char *str, void *user_data) -- 2.42.0