From patchwork Wed Nov 22 21:07:23 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: 746864 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JC7m2nTB" Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDAEB1A4 for ; Wed, 22 Nov 2023 13:07:31 -0800 (PST) Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-6d7e67c169cso138746a34.1 for ; Wed, 22 Nov 2023 13:07:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700687250; x=1701292050; 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=JC7m2nTBiOSflfQpHjHts4svDA66MqFvcx7llMBa+xt1uFhNC1ZLIQmHL0f+cTwp1k xB8T7wF8Dss+M36U30yA16ZEI452W4oKp+ZGRcu6/6d9n1T3CrEUMgGSabzkHAi5gzRx 5tAgFI+g3lbECCLyoeBSQu/pDMF+TL6I5OyerkkRCkKeIcjoSPjMxvafSeocoWhZC3Jm 4Fgh+dM2UIPpxvLfloSyD/ndGhz1Bv0oKoR5Z2RFj9P2mKjK01BD0SiFeXxrD+nwEnMu Xy41MXlbkoQv0ZPfdu2GG61r+5ctlKdWevhtY5sQZU22EFLzrofhdntpg2R/43ESc4FU TLkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700687250; x=1701292050; 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=ryVGfZc5yNrc4leqOS8RsX2yEUMfXu+e2Ccui+fURERywDMDDCwiG7RZZrLtpfXGGJ G1IR7Cxn/CzCL0Wk3/weFDABZDsmN0Ilh5U2BI0PMYGNE+Hvb4axDk7e3nHZDrQfYchf IcuNIIN/fdl5iNTmwIN7xeAHo/Fh4z5k0jRpePTRWaaaJmf7HUzr3FT0LgdVHOdny1Lf qLg+qCnScBllyUCclrtSatG2/ep2PJHcO4UzQumHEEoHkT0ovmGA+CojnN2PgcYJW1eq 8a4BHkezA4knOMdnq8ah/gBRfiHWEmK4eA0GMQZJ2RDTCkFZxRYlC94RYi6v/RuoLrWq vzlQ== X-Gm-Message-State: AOJu0YxXpqwx0/ZlWQu0o4/AImS5xWwuI8niUv/RJzBTB7OC8vhjNJEk 1F4ZCwtWfzQLVEnSni/S0pgca8UyP94487IM X-Google-Smtp-Source: AGHT+IF/3pCNTuaqh5gWtza5ciCvev2e1XTtz9HtEVsRp2drFx1hsYy1SFSCOV9fL/8wEDUv0Nu7JA== X-Received: by 2002:a9d:7855:0:b0:6d6:567a:c83d with SMTP id c21-20020a9d7855000000b006d6567ac83dmr4001922otm.9.1700687249923; Wed, 22 Nov 2023 13:07:29 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id w2-20020a0ca802000000b006781b67abaasm94384qva.109.2023.11.22.13.07.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 13:07:29 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v3 1/5] shared/util: Add GMAP related UUIDs Date: Wed, 22 Nov 2023 16:07:23 -0500 Message-ID: <20231122210727.893872-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 21:07:24 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: 746118 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="h9zqJzls" Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CB28112 for ; Wed, 22 Nov 2023 13:07:34 -0800 (PST) Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-66d76904928so1440756d6.2 for ; Wed, 22 Nov 2023 13:07:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700687252; x=1701292052; 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=h9zqJzlsB2IdMrXajDleCM/hhD8KdHUlXgzdultnlz16zVO1+x9kmw6ef0dybKJt9y 8bzbM68CbOW+jVMH9SuJTNrqB1l9vN4N2ZMa9aI0caB5PQObelPxYQDUOkiLAzdxxMVh TnV3diLMokpJutrvLsgyiPT92EhYePT1raHW2dcpvo0SIBBs9MLtlLq1SC3uc0pBFO3v pEk5c7kAUkmW9+PCAem/Hdqhaw3lf5Hbtiy6QYNAwCimyewBZKdnp/V+WdyRTIzlejFZ hako+GA5ms3mhMaTokXTgG0Vmd607vMb0iosFQP2YteIMgyG0+fFBotljpRxTFM81xcz l6PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700687252; x=1701292052; 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=uftndZ11Hjqv+kr+zt5un66PCVwpBlro2sVfn9JjnO/Atb0XVjro9vZ06VSBYsA9b0 YJH4K3GLFyzD/Q4o9d1SQjQZdsARAgscbWk89DTWr9XjkZ3Y8jqN+N0HMuXTPDHIXmyK mQU4wFrQO4CyJoGd88DpAe4NQ9u1f0AttvNCSQUz/no0CmdyeMFJDZAfEgYRjHpNzgCM hB0X2roUsL+FtgGU8mUZLMwsxaO8R+7FSWfJvMARbE9g6YtneEGJVaXtNBVJiOj2GaET c+15ScnpFbVUoETUEp0jIgXBs56C8XecKNT8DPKw9E0d3gaJmrYJS7oAiciULd0TvPTo /uCA== X-Gm-Message-State: AOJu0YwYcOD5LIbvFJxILYTNsj3pWHtPCamCUIjk+6O2GfEXMbVJr6p1 WhvWHjdX5ZCexkGHSMgZ8SGUFWZ0d9DaJ1kB X-Google-Smtp-Source: AGHT+IE9UVKGPm1FdT+JLpkPweOpxIpcqF5lsgiKQcICf5zktWHhAAVyengiofMoDkGFt4gEltT/2g== X-Received: by 2002:ad4:5763:0:b0:677:f803:8183 with SMTP id r3-20020ad45763000000b00677f8038183mr3950965qvx.64.1700687252247; Wed, 22 Nov 2023 13:07:32 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id w2-20020a0ca802000000b006781b67abaasm94384qva.109.2023.11.22.13.07.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 13:07:30 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v3 2/5] monitor/att: Add GMAS attribute decoders Date: Wed, 22 Nov 2023 16:07:24 -0500 Message-ID: <20231122210727.893872-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231122210727.893872-1-luiz.dentz@gmail.com> References: <20231122210727.893872-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 21:07:25 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: 746863 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dvkvfh+m" Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EF161B9 for ; Wed, 22 Nov 2023 13:07:36 -0800 (PST) Received: by mail-qv1-xf36.google.com with SMTP id 6a1803df08f44-6705379b835so1513216d6.1 for ; Wed, 22 Nov 2023 13:07:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700687254; x=1701292054; 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=dvkvfh+mODAExfyI2UNn6Bhqi98tMWL/58pohg1jqj/jejVWkJOQFfnT0lhzT4Ak27 tByw50OnRfMmbJ6wMhyVeDEZMrLqjY/wnrsAkhGgK+7Xh/T8QlZuFhSvY8KiyUP3HMRG gagdO3nRTBEOah5cxBTt3rnCUiUtmg6ymq7LZ0sUJJ/QPO/AmJg0sujfBMXxxH1cZxEy 5aT8D3LzkGNVwxKxvySY/CuMTJopwM6KDQnweu4cEDaXXhoqzJwrNFDHUfrCHstJm/ke 9/TqDvkE5OIjdfE7SHD8mX9Uj8QHYCgcq0y4YOEniwho0oaRKEnUk5L16SorT1SOr1QH mebg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700687254; x=1701292054; 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=Rqogd/Wj8ZSaDTy5HvDSojb3SqXGEfJaAe4WpWcKLNd+katcSCGRqGBLc4g24JYoJ7 Zl0ArBIaTN4pEZxpccVNQgFjNS9fK2BIOF7dFDO9szsW3KwRqpqOCQ6U4XCfL/gmLd4s ZMOBAV0SxAsDRN0ADADxNRJVqJ6/O2/1EannE79tKNJAZmsPnZ8LmQb2MwK0rJuLR9wN M6Ay4DfzNeTnjTXOTfv0MdHvHQhQ3AE1EkS23A7W9h0zHWJotHFunW9jqM1wsanBbCvG 0zyPiIxVUYCoLTFusBTMFUIbZc4TygWVkDXWrN3XjizP1Qrjh6ISsulYV1HpSd0JIjiu mSpA== X-Gm-Message-State: AOJu0YzEpi0wNxOXufOvnJcFHc0d/HUQd9Zh+i4jBy0rzA7V9oVHzBxA 2HT3WWG+KTPf9TLqo9US9KotxAjuVBUUoHCd X-Google-Smtp-Source: AGHT+IHL2YeouxuvMfcLNpDUqVRHWgeBmqabZwYQGAqPNIaqt9iYui6DRHBZfFHT1LwFyRDByV2scQ== X-Received: by 2002:a05:6214:628:b0:66d:36fb:474d with SMTP id a8-20020a056214062800b0066d36fb474dmr4488758qvx.1.1700687254522; Wed, 22 Nov 2023 13:07:34 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id w2-20020a0ca802000000b006781b67abaasm94384qva.109.2023.11.22.13.07.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 13:07:33 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v3 3/5] iso-tester: Add presets from GMAP Date: Wed, 22 Nov 2023 16:07:25 -0500 Message-ID: <20231122210727.893872-3-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231122210727.893872-1-luiz.dentz@gmail.com> References: <20231122210727.893872-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 21:07:26 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: 746117 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bo6IUW0B" Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6708A98 for ; Wed, 22 Nov 2023 13:07:38 -0800 (PST) Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-677fe97ddf8so1464636d6.3 for ; Wed, 22 Nov 2023 13:07:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700687257; x=1701292057; 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=bo6IUW0BGPVx3JoxqbgxwJjqv11BION5o3+d8Q1T0n2314zrSDzr0UDpaYXMEWKGEq dZr28IysZobUGLXTPIru2XXIL9uCmd0TE0iK58tteGf+ogJa3XSeZ4MJwfKnPqZX5pda JopT+Vgxwg25Qi4cXSyu1ENhe+Hql15VNPje9Py0pdx3srOI1VT35j8xh5umJnQzZq6R ggX4DIUvOpH52HRGjH6CjlKixK/ry79gsKY8BUCHPeCyG00XLkIDt+L/1Em1Rz5Ui/o4 d+L1nPqmuzEmUnGSyDUcGOsRAK03v5aBrLrrRkJmSSuKGwRxykYEKgJvpXEzCcBGXYI3 cddQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700687257; x=1701292057; 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=ZHUBLDNOXQuAbo/RrIBG/GCgPwM7E12eI80Aq5A7Bm038VYRdod6cC1tm3Nx+RU/tn B4j6AA7ENUA7RrTDv/a9erEp6Tiw2J5kCIHdnzdFz5EH3nBcUADOKlErVxjLcIbNO5WJ K2PrMR4s8XfgQoY3PXAlL5ZtsGal5HT92cPwf0/ihDj1HaUiluwQzXAPrgC5PXWjmvAU uBzXzboxmU4KO1lxNTL8djuriRjeBox9dsWddy8ZNBOtwrwio5Iv5hONyhYbIAZbF6He U874ENBXRS2E5xICNMjkzQdRZQLVkVMwTSLJTmcjqaO+2hyhiPG2iJAWc05ao9haXXr1 mTZg== X-Gm-Message-State: AOJu0YwQI7DeRVVGCUovGA6uZzHRAg1JA6gvkIxAyYwKXKZAsTtBetpf 5OLa3uLQmWduwpz+pe10d3gpmLRNZ7mew+u2 X-Google-Smtp-Source: AGHT+IEF8yhBRzez1XKXgjZHKd0FDroSXaeTP7gIotaElNu63UwAV10hv9z58yBb+vzuYzqL+lb9VA== X-Received: by 2002:a05:6214:ace:b0:657:a0cc:635c with SMTP id g14-20020a0562140ace00b00657a0cc635cmr3778401qvi.22.1700687256816; Wed, 22 Nov 2023 13:07:36 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id w2-20020a0ca802000000b006781b67abaasm94384qva.109.2023.11.22.13.07.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 13:07:35 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v3 4/5] isotest: Add presets from GMAP Date: Wed, 22 Nov 2023 16:07:26 -0500 Message-ID: <20231122210727.893872-4-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231122210727.893872-1-luiz.dentz@gmail.com> References: <20231122210727.893872-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 21:07:27 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: 746862 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DK2L7CmI" Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10DF4112 for ; Wed, 22 Nov 2023 13:07:40 -0800 (PST) Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-6d7f3a4bbc6so136695a34.2 for ; Wed, 22 Nov 2023 13:07:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700687258; x=1701292058; 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=OJpMXcJ+bEj94AivcUzi8VIL523XrGD7Y0BZ3tLkHLo=; b=DK2L7CmIYIM80fzRFOV+dlZLL/YUqU4/KMvu9P1mu/CxoMafksXgrcHEnz/tV3Gka5 67Qn/Vu+5SFckpzs2naeJpuhx2Z2N83CRg5Ul9eNCRV62LHVrKXetx1KsTLz0y0FEDdf RNi+fUhyNDKacpLH9zVTRVusGpegUnZbkdIux15hkBXNxHu7cKd6eGllla44/LpcAwQS mdovh2aZYHvRysHT/zVwimwwekOSGQa8srd9xplBIZnOYypVsFkSKY8MbtSAFX+dF932 4izPloeHCR1iuaBbShfTFQ6jq/mPr23WC3pIvoP8io//akl5qND09uV6Kj6Jx2Las7+X wl0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700687258; x=1701292058; 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=OJpMXcJ+bEj94AivcUzi8VIL523XrGD7Y0BZ3tLkHLo=; b=PDY18y27Jny5JPcsH2LavpTRImLPsXE91O5yiCp2CkEgejVyot4Z4PLdSrE3SFEn3D PHIfOKRi/XWAZagmqercJ5VxeYPY1SdPSacKrYei6pV4XSa11teyWrDBCzpTfdIPDe9p 2GCGZmIgn+qopPOtM38onL4tvXMqE3WYpydGfzIC0rpjwD+zdsECNWX4hpvnlbrsN4KA u6l4vlK7fFrLFhFnYVLd0F0oEEXXg03elDE6XMiuuGt/XT/Yu26iP9Efhg0gJ8BacCu1 G4qfbwo0IgIUElHWSzVMFJRadMamWzGdMQr9SIPxnTK3JcZQyXAvfg4ssoFHryEFwfbg dkEA== X-Gm-Message-State: AOJu0Ywc2nqGTDheyZOLGKAQx8upv8UA+R1m/p9LHilqfplCKRaBnMpE RBIcMbBt7Kw388831Aujg54sRO5aHkcyT+e+ X-Google-Smtp-Source: AGHT+IEytcieuLmjcUfVGY53a0fOfkU6L+5OmHZgTY6IGI6vc80rWWzKo2dneZxhmH3ilw8zcYZHcQ== X-Received: by 2002:a9d:75d6:0:b0:6d7:ed0f:87d4 with SMTP id c22-20020a9d75d6000000b006d7ed0f87d4mr3584469otl.33.1700687258629; Wed, 22 Nov 2023 13:07:38 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id w2-20020a0ca802000000b006781b67abaasm94384qva.109.2023.11.22.13.07.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 13:07:37 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v3 5/5] client/player: Add presets from GMAP Date: Wed, 22 Nov 2023 16:07:27 -0500 Message-ID: <20231122210727.893872-5-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231122210727.893872-1-luiz.dentz@gmail.com> References: <20231122210727.893872-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..4673d2efece8 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)