From patchwork Wed Nov 22 19:06:45 2023 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: 13465382 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LOnHzxFf" Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 881D4DD for ; Wed, 22 Nov 2023 11:06:53 -0800 (PST) Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-7788f513872so3570785a.1 for ; Wed, 22 Nov 2023 11:06:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700680012; x=1701284812; 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=S9L3RVtYohgGGbQz/96kvey3bQHCTTJXpo42ThDVUdw=; b=LOnHzxFf65xs65bUmUmi3iCiKYwrOs8boqUM7ueOP6wVMSdI8N9Qo65NyKhuWMG4EZ K7HQXimqkGVcf/MIeCvP4YQjQ0dt0KAZd/jiD2qbZct0aOIdxvBVy417NahLU3Y6YD+Z cKEZWke0U9lkk6cunxtM4kOgN+UkS/t+U4KynOTzfNs/92+Nu9CUDJLybAOouXdrff6J rzQkl+8GiS31Uv6oQfDDY0zpMGtl2LxjSlac0piRIqWS0wfml77gi5Yzoad/zXHlEHRR X1DXk74rBDWj9hpR6v18y3L/JaCZ4whqQZrxGsSJSjv4t6P4KPNFMaYhC65Rrsvd/csL wZ0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700680012; x=1701284812; 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=S9L3RVtYohgGGbQz/96kvey3bQHCTTJXpo42ThDVUdw=; b=hcTHsmPpLiGPUNMlHyz41O5QRDH4P84EJ30rSqgAxjA/b/DPLwIDYxdY1nz1ccTtng EUfHFl7HHBvn1yjoMU+trUwLYSYTC/cksPPIkJUVPuZwfxBY82Kx0n7168ZQNte9GhSk /r7ActTm+AM0kIhk67Cfjnu61BPkRdLChVwjnc3tEvK1PqY6n20MZsEdEqVlNg0aAuIe zUKdEHoHiPa/sGbZUH9NiHMUCoJhHlb1StlHGKBecDFITznod4zaCIoJQv1cZRM4zv70 RoK3duGm9vPaRkj8JCR3fKhFcNhATHu5qrXJ41OhK9tE/vWHtkzczi1mSbHQFADoTTln FVmw== X-Gm-Message-State: AOJu0YynlERfz4qfgu0uA6/3Z0nU/zhpfZL6G2qy/fuHzSf6gbHJNUiB MQsvrTI6jEIMLEdPZu6rI4CHdhra047+PCHs X-Google-Smtp-Source: AGHT+IHDPCJxHl62mV5m93Enz9oKF9fzMiZYIfKB5P/p1aJfi7S3j0CmEPH4TlivtbYdSX/EMqXtOQ== X-Received: by 2002:a05:620a:25c8:b0:76f:14fc:6d2f with SMTP id y8-20020a05620a25c800b0076f14fc6d2fmr3699729qko.1.1700680011832; Wed, 22 Nov 2023 11:06:51 -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.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 11:06:51 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 1/5] shared/util: Add GMAP related UUIDs Date: Wed, 22 Nov 2023 14:06:45 -0500 Message-ID: <20231122190649.879386-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.42.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 This adds GMAP 1.0[1] UUIDs following the assigned numbers[2]. [1] https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=576496 [2] https://www.bluetooth.com/wp-content/uploads/Files/Specification/Assigned_Numbers.pdf?id=3 --- src/shared/util.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/shared/util.c b/src/shared/util.c index bf37fce364ed..47efff750e30 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -773,6 +773,7 @@ static const struct { { 0x1854, "Hearing Aid" }, { 0x1855, "Telephony and Media Audio" }, { 0x1856, "Public Broadcast Announcement" }, + { 0x1858, "Gaming Audio" }, /* 0x1857 to 0x27ff undefined */ { 0x2800, "Primary Service" }, { 0x2801, "Secondary Service" }, @@ -1081,6 +1082,11 @@ static const struct { { 0x2bda, "Hearing Aid Features" }, { 0x2bdb, "Hearing Aid Preset Control Point" }, { 0x2bdc, "Active Preset Index" }, + { 0x2c00, "GMAP Role" }, + { 0x2c01, "UGG Features" }, + { 0x2c02, "UGT Features" }, + { 0x2c03, "BGS Features" }, + { 0x2c03, "BGR Features" }, /* vendor defined */ { 0xfeff, "GN Netcom" }, { 0xfefe, "GN ReSound A/S" }, From patchwork Wed Nov 22 19:06:46 2023 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: 13465383 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aP9jusee" Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3C1383 for ; Wed, 22 Nov 2023 11:06:55 -0800 (PST) Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-77d708e4916so2892685a.3 for ; Wed, 22 Nov 2023 11:06:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700680014; x=1701284814; 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=te9sdhX2UqCHf3FISEMe2Njr7WpzZXYgdE6tsK34ksk=; b=aP9jusee17AgK1Mr64+3PhAfWc9WQup5UfIkMqOTtPnQcW4NogvsoMc9Ri24R3CBIf IwkyypKPYkogsUos5OSnnqlGl6t2Ge2vWLPFommrZ8CKeuii/niA48AHdnbnYa8YFLls U5OBmVIVJUG7OJ9YKdJrtL/O4+YKJuErvrHoAlwYVg7OHPboazkBZdzDo0KOJ1FLADDs /zXwU5N6mJmji3fQJxL+55WCQFtgp7mBrgwasuyPR9BNb4j18XWLumgWqKbvegsxqDc5 enRD5BHQW+adKYTIUvpHRhQxGDlvMakGkS6E9wk9NLdYgNeFw3Z0a+orwGfo4MVHgavy NssQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700680014; x=1701284814; 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=te9sdhX2UqCHf3FISEMe2Njr7WpzZXYgdE6tsK34ksk=; b=mgQHFCOdyY6M5RLGgauYIpJVVhAOlncAzaky7PU4MS+1Z6LCub0G5hMq3RBZxf/AaK nz6iOpFimXkTQit9MtksulmilbqCf4d8cSHcaxZaLxamtiKZU+qZP23Py9zAc9zfhVAP dLRucTXBF9IQgYcN2eQmCNNfj6DujHv14dpRmSHp4sAora0b76D5+0TiTAvAZLtNPLDM UyA+acY0vNcmOf3g+KsLdJoteB+z8GPqIQ6sbBJ+23qPUZsAJHpdRveoekcm5T7YXdlT Fwop076xaxPcZM0tN+094dKcbxPpD+sYvHcgat6Dg6heKnDQXL03BeM4GzbE//4q5OD8 dFzA== X-Gm-Message-State: AOJu0Yw1c95ckb+oPUhSSEPL/DVmFc2zBfqPr1NOP758ySNUqJEm0t8n YBDSk+O09yzsY+37VXN3v9/XRA3H88LW32QQ X-Google-Smtp-Source: AGHT+IFElW4lPUvQcPMZfcX3xMBJFF7/gM9Mla6OBx6TmTb1yBsLmotdPXWGWGBojizUoYyCl3wXPw== X-Received: by 2002:a05:620a:894:b0:76c:e9e1:2b2 with SMTP id b20-20020a05620a089400b0076ce9e102b2mr3099189qka.13.1700680013616; Wed, 22 Nov 2023 11:06:53 -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.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 11:06:52 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 2/5] monitor/att: Add GMAS attribute decoders Date: Wed, 22 Nov 2023 14:06:46 -0500 Message-ID: <20231122190649.879386-2-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 From: Luiz Augusto von Dentz This adds GMAS attribute decoders. --- monitor/att.c | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) diff --git a/monitor/att.c b/monitor/att.c index 39ea5d6dac5a..9db273223352 100644 --- a/monitor/att.c +++ b/monitor/att.c @@ -3195,6 +3195,140 @@ static void bcast_audio_scan_cp_write(const struct l2cap_frame *frame) print_bcast_audio_scan_cp_cmd(frame); } +static const struct bitfield_data gmap_role_table[] = { + { 0, "Unicast Game Gateway (UGG) (0x0001)" }, + { 1, "Unicast Game Terminal (UGT) (0x0002)" }, + { 2, "Broadcast Game Sender (BGS) (0x0004)" }, + { 3, "Broadcast Game Receiver (BGR) (0x0008)" }, + { } +}; + +static void gmap_role_read(const struct l2cap_frame *frame) +{ + uint8_t role; + uint8_t mask; + + if (!l2cap_frame_get_u8((void *)frame, &role)) { + print_text(COLOR_ERROR, " invalid size"); + return; + } + + print_field(" Role: 0x%2.2x", role); + + mask = print_bitfield(6, role, gmap_role_table); + if (mask) + print_text(COLOR_WHITE_BG, " Unknown fields (0x%2.2x)", + mask); +} + +static const struct bitfield_data ugg_features_table[] = { + { 0, "UGG Multiplex (0x0001)" }, + { 1, "UGG 96 kbps Source (0x0002)" }, + { 2, "UGG Multilink (0x0004)" }, + { } +}; + +static void ugg_features_read(const struct l2cap_frame *frame) +{ + uint8_t value; + uint8_t mask; + + if (!l2cap_frame_get_u8((void *)frame, &value)) { + print_text(COLOR_ERROR, " invalid size"); + return; + } + + print_field(" Value: 0x%2.2x", value); + + mask = print_bitfield(6, value, ugg_features_table); + if (mask) + print_text(COLOR_WHITE_BG, " Unknown fields (0x%2.2x)", + mask); +} + +static const struct bitfield_data ugt_features_table[] = { + { 0, "UGT Source (0x0001)" }, + { 1, "UGT 80 kbps Source (0x0002)" }, + { 2, "UGT Sink (0x0004)" }, + { 3, "UGT 64 kbps Sink (0x0008)" }, + { 4, "UGT Multiplex (0x0010)" }, + { 5, "UGT Multisink (0x0020)" }, + { 6, "UGT Multisource (0x0040)" }, + { } +}; + +static void ugt_features_read(const struct l2cap_frame *frame) +{ + uint8_t value; + uint8_t mask; + + if (!l2cap_frame_get_u8((void *)frame, &value)) { + print_text(COLOR_ERROR, " invalid size"); + return; + } + + print_field(" Value: 0x%2.2x", value); + + mask = print_bitfield(6, value, ugt_features_table); + if (mask) + print_text(COLOR_WHITE_BG, " Unknown fields (0x%2.2x)", + mask); +} + +static const struct bitfield_data bgs_features_table[] = { + { 0, "BGS 96 kbps (0x0001)" }, + { } +}; + +static void bgs_features_read(const struct l2cap_frame *frame) +{ + uint8_t value; + uint8_t mask; + + if (!l2cap_frame_get_u8((void *)frame, &value)) { + print_text(COLOR_ERROR, " invalid size"); + return; + } + + print_field(" Value: 0x%2.2x", value); + + mask = print_bitfield(6, value, bgs_features_table); + if (mask) + print_text(COLOR_WHITE_BG, " Unknown fields (0x%2.2x)", + mask); +} + +static const struct bitfield_data bgr_features_table[] = { + { 0, "BGR Multisink (0x0001)" }, + { 1, "BGR Multiplex (0x0002)" }, + { } +}; + +static void bgr_features_read(const struct l2cap_frame *frame) +{ + uint8_t value; + uint8_t mask; + + if (!l2cap_frame_get_u8((void *)frame, &value)) { + print_text(COLOR_ERROR, " invalid size"); + return; + } + + print_field(" Value: 0x%2.2x", value); + + mask = print_bitfield(6, value, bgr_features_table); + if (mask) + print_text(COLOR_WHITE_BG, " Unknown fields (0x%2.2x)", + mask); +} + +#define GMAS \ + GATT_HANDLER(0x2c00, gmap_role_read, NULL, NULL), \ + GATT_HANDLER(0x2c01, ugg_features_read, NULL, NULL), \ + GATT_HANDLER(0x2c02, ugt_features_read, NULL, NULL), \ + GATT_HANDLER(0x2c02, bgs_features_read, NULL, NULL), \ + GATT_HANDLER(0x2c03, bgr_features_read, NULL, NULL) + #define GATT_HANDLER(_uuid, _read, _write, _notify) \ { \ .uuid = { \ @@ -3255,6 +3389,7 @@ struct gatt_handler { GATT_HANDLER(0x2bc7, NULL, bcast_audio_scan_cp_write, NULL), GATT_HANDLER(0x2bc8, bcast_recv_state_read, NULL, bcast_recv_state_notify), + GMAS }; static struct gatt_handler *get_handler_uuid(const bt_uuid_t *uuid) From patchwork Wed Nov 22 19:06:47 2023 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: 13465384 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J447ar/k" Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7165493 for ; Wed, 22 Nov 2023 11:06:57 -0800 (PST) Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-77a453eb01cso4595485a.0 for ; Wed, 22 Nov 2023 11:06:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700680016; x=1701284816; 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=qi3K7VQyUWa0lVFxz42Xy5Na8CHjuAIK7BaAEzLEHTA=; b=J447ar/k61C+dwEYjj/vGXcjbOoDE6jCgYRVpktWC3iJUzvODFHqdvykU2RW2gQ9aT aGsAwaWUNyyn3wgPx+TC2K9bcsee81s3pCkAeLMUue4Vj0yrPsx+HaPQSlu82byQD2jR uqMDV7EFCKmFircJKcBSvz8akAExsGhs5kyzkz6EIRLOYPCdf2wJMHWsEQUTF7dK3yUk KMPsQKxh2wX0a74U4NsbzERNJIWJ8Mwdn56vp8fi6ChzZdkg9IX5c14t0jLJL+x+wtRL ikcAY2u8yBRHnFJMnXEeoSb7wEwMj8vBW87wHRbbsjTG/lkc6N2Bn+DuJ7lfqAobrdBz RLHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700680016; x=1701284816; 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=qi3K7VQyUWa0lVFxz42Xy5Na8CHjuAIK7BaAEzLEHTA=; b=VHnwEGGNFfNw7PoK+m1RxqAAFB9MmS8afIbMjGic0OtQ/5nv0r0galQ3Gl4KExzWu3 0+bdDBxK9fuY/sq1k2cQwlVRYyTFLegTViPSmpnYr/aKbVqdEN5RYTgGHZ33PH1tKzcc 1oDgvzFrhU1egTN/aj2bBz04o798qRThABikEhM5bbwafPKDOa7RAW7tU011fONnoU8q 6fPMIR4Ip/IizFrWOGrtMLrRNRQwoy3JmSLBGbku1n9ktai8O9tV5sEhNN2V9lp2XaUW +yvAEZ0wDAhZoZWfFkhdp/x9JemQW1gRn3+VL5vMG1qbt7OSYyLEkPkZIgJKxTspaEzD lqjQ== X-Gm-Message-State: AOJu0YwBFyxDfA7GrkrF7LPVOdcPQQyIQAQZ6E4h+C4wYoQDG5ZprrZp qkU43uX5Lhu55tM4FlKLgfGrS/BA0GL+OSrI X-Google-Smtp-Source: AGHT+IEgcDwq3GJLAOco0amDPb10U9rhxbo8KA6tR8ec6ahZQOOUtzFnItQElqHOAdxzvxRrJU+tEg== X-Received: by 2002:a37:e10d:0:b0:773:be2d:7cd2 with SMTP id c13-20020a37e10d000000b00773be2d7cd2mr2942634qkm.45.1700680015693; Wed, 22 Nov 2023 11:06:55 -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.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 11:06:54 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 3/5] iso-tester: Add presets from GMAP Date: Wed, 22 Nov 2023 14:06:47 -0500 Message-ID: <20231122190649.879386-3-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 From: Luiz Augusto von Dentz This adds the following presets from GMAP: ISO QoS 48_1_gc - Success Passed ISO QoS 48_2_gc - Success Passed ISO QoS 48_1_gr - Success Passed ISO QoS 48_2_gr - Success Passed ISO QoS 48_3_gr - Success Passed ISO QoS 48_4_gr - Success Passed --- tools/iso-tester.c | 109 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/tools/iso-tester.c b/tools/iso-tester.c index 9fccbaa809e4..4d47373e3290 100644 --- a/tools/iso-tester.c +++ b/tools/iso-tester.c @@ -154,6 +154,19 @@ #define QOS_48_4_2 QOS_OUT(10000, 100, 120, 0x02, 13) #define QOS_48_5_2 QOS_OUT(7500, 75, 117, 0x02, 13) #define QOS_48_6_2 QOS_OUT(10000, 100, 155, 0x02, 13) +/* QoS configuration support setting requirements for the UGG and UGT */ +#define QOS_16_1_gs QOS(7500, 15, 30, 0x02, 1) +#define QOS_16_2_gs QOS(10000, 20, 40, 0x02, 1) +#define QOS_32_1_gs QOS(7500, 15, 60, 0x02, 1) +#define QOS_32_2_gs QOS(10000, 20, 80, 0x02, 1) +#define QOS_48_1_gs QOS(7500, 15, 75, 0x02, 1) +#define QOS_48_2_gs QOS(10000, 20, 100, 0x02, 1) +#define QOS_32_1_gr QOS(7500, 15, 60, 0x02, 1) +#define QOS_32_2_gr QOS(10000, 20, 80, 0x02, 1) +#define QOS_48_1_gr QOS(7500, 15, 75, 0x02, 1) +#define QOS_48_2_gr QOS(10000, 20, 100, 0x02, 1) +#define QOS_48_3_gr QOS(7500, 15, 90, 0x02, 1) +#define QOS_48_4_gr QOS(10000, 20, 120, 0x02, 1) /* One unidirectional CIS. Unicast Server is Audio Sink */ #define AC_1_4 QOS_OUT(10000, 10, 40, 0x02, 2) @@ -810,6 +823,66 @@ static const struct iso_client_data connect_48_6_2 = { .expect_err = 0 }; +static const struct iso_client_data connect_16_1_gs = { + .qos = QOS_16_1_gs, + .expect_err = 0 +}; + +static const struct iso_client_data connect_16_2_gs = { + .qos = QOS_16_2_gs, + .expect_err = 0 +}; + +static const struct iso_client_data connect_32_1_gs = { + .qos = QOS_32_1_gs, + .expect_err = 0 +}; + +static const struct iso_client_data connect_32_2_gs = { + .qos = QOS_32_2_gs, + .expect_err = 0 +}; + +static const struct iso_client_data connect_48_1_gs = { + .qos = QOS_48_1_gs, + .expect_err = 0 +}; + +static const struct iso_client_data connect_48_2_gs = { + .qos = QOS_48_2_gs, + .expect_err = 0 +}; + +static const struct iso_client_data connect_32_1_gr = { + .qos = QOS_32_1_gr, + .expect_err = 0 +}; + +static const struct iso_client_data connect_32_2_gr = { + .qos = QOS_32_2_gr, + .expect_err = 0 +}; + +static const struct iso_client_data connect_48_1_gr = { + .qos = QOS_48_1_gr, + .expect_err = 0 +}; + +static const struct iso_client_data connect_48_2_gr = { + .qos = QOS_48_2_gr, + .expect_err = 0 +}; + +static const struct iso_client_data connect_48_3_gr = { + .qos = QOS_48_3_gr, + .expect_err = 0 +}; + +static const struct iso_client_data connect_48_4_gr = { + .qos = QOS_48_4_gr, + .expect_err = 0 +}; + static const struct iso_client_data connect_invalid = { .qos = QOS(0, 0, 0, 0, 0), .expect_err = -EINVAL @@ -2945,6 +3018,42 @@ int main(int argc, char *argv[]) test_iso("ISO QoS 48_6_2 - Success", &connect_48_6_2, setup_powered, test_connect); + test_iso("ISO QoS 16_1_gs - Success", &connect_16_1_gs, setup_powered, + test_connect); + + test_iso("ISO QoS 16_2_gs - Success", &connect_16_2_gs, setup_powered, + test_connect); + + test_iso("ISO QoS 32_1_gs - Success", &connect_32_1_gs, setup_powered, + test_connect); + + test_iso("ISO QoS 32_2_gs - Success", &connect_32_2_gs, setup_powered, + test_connect); + + test_iso("ISO QoS 48_1_gs - Success", &connect_48_1_gs, setup_powered, + test_connect); + + test_iso("ISO QoS 48_2_gs - Success", &connect_48_2_gs, setup_powered, + test_connect); + + test_iso("ISO QoS 32_1_gr - Success", &connect_32_1_gr, setup_powered, + test_connect); + + test_iso("ISO QoS 32_2_gr - Success", &connect_32_2_gr, setup_powered, + test_connect); + + test_iso("ISO QoS 48_1_gr - Success", &connect_48_1_gr, setup_powered, + test_connect); + + test_iso("ISO QoS 48_2_gr - Success", &connect_48_2_gr, setup_powered, + test_connect); + + test_iso("ISO QoS 48_3_gr - Success", &connect_48_3_gr, setup_powered, + test_connect); + + test_iso("ISO QoS 48_4_gr - Success", &connect_48_4_gr, setup_powered, + test_connect); + test_iso("ISO QoS - Invalid", &connect_invalid, setup_powered, test_connect); From patchwork Wed Nov 22 19:06:48 2023 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: 13465385 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bFHQI3AQ" Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55373C1 for ; Wed, 22 Nov 2023 11:06:59 -0800 (PST) Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-77d60604cebso3251185a.2 for ; Wed, 22 Nov 2023 11:06:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700680017; x=1701284817; 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=jpjHUUmesT38WXvxFqXbZh63His/ipJlPqZEbY6lOS0=; b=bFHQI3AQapodN95qEWTJhA89l98mGs1g6l2iMOi+YhHnC/AU5f/6U/bdBHTSZS8YM8 NXMI6NM2c/QPxsnLidaFmTGRmy4qhTizTGtP2Ga81hc652lSXA10TZ5sA3wPk0LbJdBb NGke0fGG6YSAbn0ea7y3Z+z18gzvt57r7P3HO76aZ1Yb5eqFaWuKgyTAOFz7udN0AmSG /Lf3TTOos/rE5QinfXo2e7b0Vb1TPp+y3LWpMZswfCmdg2NEr6MxHx234usbnv2ZTA0R bdguRw5Xqghw4Oo0QNX0Rp0WPiexi5OgHFRYL/5X0RuwwCOGPoSvj/dfW8/jKI1y9RDg 1NNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700680017; x=1701284817; 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=jpjHUUmesT38WXvxFqXbZh63His/ipJlPqZEbY6lOS0=; b=UB37BxUNYSSNkzH/NZsK+i58LqPojtkWhgwQTSfeDPDSW/UgBSCeKbhDoNhtUTXrTy fbBg1cG4uN00wW4D7k1Spy2m77STPAmlxWVmRYzhU8IfGLe9chnMlOnV37i6Q0O6IdXT C/BLciBmEro2m69kcOeVnFBjbVgDRO64YENw/ecUoEc8Gz/57JphnaoAu0zD//SnMQZC QWtShKBRuaLl0JDxRgsE05y2wABHr0j/oUvv8UcG7g9JxLI+bkFQQ0dK1qQLScfQh+cy GxW+FUrXp8x39Dw4Qrqe+NtkavTZfHxPE8+GGRS822xUX5Wwjg3GKY475znpjWMSAZf4 F2cA== X-Gm-Message-State: AOJu0Yz75AL9lo2XbbgBYYPkwEMJTJiweuUlBXPt7M7XPKBStPzC6U7I EW0XUpEweYdj1BWEEkYsJJEaCdKBh7/eM45A X-Google-Smtp-Source: AGHT+IGIllRBHIEPqxaE9vHmx0wzCgbiax+kFNsIHyvcmmtlBWVL69Wr9fpnEQk4M0OvRgeUv6hQ2Q== X-Received: by 2002:a05:620a:910:b0:77a:2520:2793 with SMTP id v16-20020a05620a091000b0077a25202793mr3371497qkv.2.1700680017444; Wed, 22 Nov 2023 11:06:57 -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.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 11:06:56 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 4/5] isotest: Add presets from GMAP Date: Wed, 22 Nov 2023 14:06:48 -0500 Message-ID: <20231122190649.879386-4-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 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 --- tools/isotest.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/isotest.c b/tools/isotest.c index 234e4f1b0453..2c682bc899fc 100644 --- a/tools/isotest.c +++ b/tools/isotest.c @@ -1089,6 +1089,19 @@ static struct qos_preset { QOS_PRESET("48_4_2", false, 10000, 60, 120, 0x02, 23), QOS_PRESET("48_5_2", false, 7500, 45, 117, 0x02, 23), QOS_PRESET("44_6_2", false, 10000, 60, 155, 0x02, 23), + /* QoS configuration support setting requirements for the UGG and UGT */ + QOS_PRESET("16_1_gs", true, 7500, 15, 30, 0x02, 1), + QOS_PRESET("16_2_gs", true, 10000, 20, 40, 0x02, 1), + QOS_PRESET("32_1_gs", true, 7500, 15, 60, 0x02, 1), + QOS_PRESET("32_2_gs", true, 10000, 20, 80, 0x02, 1), + QOS_PRESET("48_1_gs", true, 7500, 15, 75, 0x02, 1), + QOS_PRESET("48_2_gs", true, 10000, 20, 100, 0x02, 1), + QOS_PRESET("32_1_gr", true, 7500, 15, 60, 0x02, 1), + QOS_PRESET("32_2_gr", true, 10000, 20, 80, 0x02, 1), + QOS_PRESET("48_1_gr", true, 7500, 15, 75, 0x02, 1), + QOS_PRESET("48_2_gr", true, 10000, 20, 100, 0x02, 1), + QOS_PRESET("48_3_gr", true, 7500, 15, 90, 0x02, 1), + QOS_PRESET("48_4_gr", true, 10000, 20, 120, 0x02, 1), }; #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) From patchwork Wed Nov 22 19:06:49 2023 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: 13465386 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XiJcs057" 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-Google-Smtp-Source: AGHT+IE5BZpn/bszqWsEHVztF0er9gwlmedW6iepM2nXhLCWBmJuSIU5T3GImGQ9vAh+tNFPWQqwgg== 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 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)