From patchwork Wed Jul 31 13:57:15 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: 815750 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2190F1AED53 for ; Wed, 31 Jul 2024 13:57:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722434244; cv=none; b=Hylz8oIcsHcu7z1Tit5qUVMKyyaWSNZ/c7HbjCPCnyRSxiseKdRLXb1up1lNCpNVfxS8VDFazkRBG4pJWoyxAN21LRXL6z451f12nWS4YPuVxzQjVeB42GLV4h40UNCWT2il6l5OBjwG1IoN2u+sEVHhB5KQKXofCk1lzoOlLK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722434244; c=relaxed/simple; bh=TI+F+qXlPAM/QGcPTDx/AZKdzjIJK9XwpYc/em4RiVk=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=M1e2URvn7Y8Ugv1BT+PelqpQheA7thwfA4OQ2J5Ahy8ZEGQImvUZtIWrIBSBh1VjFllxxcj0HX8WAVCsworYhTU34VQASTZdYyEfSqu7ogiQmzvoORKTDgkS3RR+s4A7GLQjbfsEhEZnzqATWM9rczNeuAWKVyuYaqBlfKT//Xc= 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=OQLUCPfv; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OQLUCPfv" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a7ab76558a9so174851066b.1 for ; Wed, 31 Jul 2024 06:57:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722434240; x=1723039040; 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=GCnNDQkoFp9WDf4NMCU/dI6dSk0E8ysiqRP+ZDf/gd8=; b=OQLUCPfvb18psWu15GFzW4GGH2XLmoC4Ve5mLKXc9K8k+Whn4WzHj5fq0uGa2x3VZ4 G3bjurSspAnpQ5tKcj7nR33Sg46YcOe3JvAoAzQ87kpl5qYeOyMMQsV39bacI3SLXBrg SA1QCJwHKB4f2xFXHnY2WFgMiPGWVLx6JTmVz5BiswS/ZIrW0V2T0wphsfYMse4iSQp7 blKhZEvbi3aMoj7UUiT9WVBSztsxQH194dl3Xu4gPzjucvCg8h2AMKIVESZ5ak1nc/h5 j/TRgmc2QoWZ/Nq5SoIYzZU95RI3ndkDGlGsrcNdBrAgehcsnkokqra2JrkHV7wB+Qq2 h5kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722434240; x=1723039040; 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=GCnNDQkoFp9WDf4NMCU/dI6dSk0E8ysiqRP+ZDf/gd8=; b=ZpxoNIVROjHmLRX42d8kYVg08cHc/SlCHmz6myM03AmBudBfjA8d5HWMnvE7BpyGsq g1egJmQDh7UueZFk/pl5R4lPyX2o0ltAvt2HmjFwF0cCimqL45C48YuI4UFQ6Qh2GoN8 /k9LwnQV4PgTU4SHFQRYVkZMsRgIjKD/2AYftWyn8kzbyRvfswBxf/VRJ5zcjrmSZm2m NMKqOXVU1Ut440n0Ty1KMrsvTIsQOAsBQ8doToqG6PYdUFZSDVbwFYNpHksuohFF8wSx HwBCnKx7/psJG4fnHLAKuM0DFL4TWxVemcCSlGjXgls72ElmlSQ5ixyLJHNnV54UFX99 fxyw== X-Gm-Message-State: AOJu0YwSMuGp/UxPkRLCqJQTsMG++iwwNkfSZVDNCZ9huVyYDcB+y69w NFPKPC6viyM9WON5JF4KJ2Y19kuFPnFKhBM/Qj725yPvmYPMULu+3zCqaw6T X-Google-Smtp-Source: AGHT+IG/yNyjFPgJPg87cbAuSzMdubsW2qbSG+YS33vcKrFbOArcgamYNVV/ubw1/OXqlEhi24WKRw== X-Received: by 2002:a17:907:7244:b0:a7a:afe8:1015 with SMTP id a640c23a62f3a-a7d85aa7ef2mr543603666b.29.1722434240276; Wed, 31 Jul 2024 06:57:20 -0700 (PDT) Received: from lvondent-mobl3.wlan.qualcomm.com ([212.136.9.4]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7acad91041sm779143666b.174.2024.07.31.06.57.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 06:57:19 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 1/4] client/player: Fix not setting config target_latency with edpoint.config Date: Wed, 31 Jul 2024 14:57:15 +0100 Message-ID: <20240731135718.429604-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.45.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 fixes not setting target_latency with endpoint.config command. --- client/player.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/player.c b/client/player.c index 3c3587f2c..93d6b62e2 100644 --- a/client/player.c +++ b/client/player.c @@ -1790,9 +1790,9 @@ 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", qos->target_latency); + bt_shell_printf("TargetLatency 0x%02x\n", cfg->target_latency); g_dbus_dict_append_entry(iter, "TargetLatency", DBUS_TYPE_BYTE, - &qos->target_latency); + &cfg->target_latency); } append_io_qos(iter, &qos->io_qos); @@ -3765,6 +3765,7 @@ static void cmd_config_endpoint(int argc, char *argv[]) /* Copy capabilities */ util_iov_append(cfg->caps, preset->data.iov_base, preset->data.iov_len); + cfg->target_latency = preset->target_latency; /* Set QoS parameters */ cfg->qos = preset->qos; @@ -3960,7 +3961,7 @@ static void custom_target_latency(const char *input, void *user_data) else if (!strcasecmp(input, "Balance")) p->target_latency = 0x02; else if (!strcasecmp(input, "High")) - p->target_latency = 0x02; + p->target_latency = 0x03; else { char *endptr = NULL; From patchwork Wed Jul 31 13:57:16 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: 816130 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 B17F01AED53 for ; Wed, 31 Jul 2024 13:57:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722434247; cv=none; b=O1W4F+ZwqG39/rXKZGuWmFj52+ZJl477tab73JuyNxLC7h//whU4avBq7ozQVShrc1sys0fz6BvC1c4ZPihEg1DnPW3mNt7Nd+rw2JH0ydj0sqZA6AYGxsZaOHtDxjkDTixGUhDFP7+ss43TQ4hDa4HelIm9Lrt2tTeui2uP3qw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722434247; c=relaxed/simple; bh=o9h6rsB6ftlMwOh3AU0PLDUXJw3KUnf8i+QIUM3JGPk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d3NeHLDF8ReMoPh/FU9hzn3u/IRwPu+Ex0EbvFqtu0yCqELFtwUMcEyJNYMUNW5Ti5J+j9m4Oq06sm02EAzOSCATHKTV/07fgERY1eZRFkQurF7dGvYD0VQGN2LvpYfxmNYfhS3+YqKL9OguF0jLuVzRuGeHN1v4J2c4zhaeS+8= 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=EL6c/7WF; arc=none smtp.client-ip=209.85.218.44 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="EL6c/7WF" Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a7ac449a0e6so468459066b.1 for ; Wed, 31 Jul 2024 06:57:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722434243; x=1723039043; 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=f0ifOWpXPDm976yezlya2rMJUdCbb/i5qM7P0W7RaAQ=; b=EL6c/7WFYORXTParNVRAhyWmaSoWPUQidB39+KpFPq8mjQ++cV5pQS6S2vCcdbexsV As7/FHYkOlnlSdlAfEnxedPuX7GrfcHbCG/Bbd2rO5Srm1ccyNcm6d4qWTtUj2/fSOO7 1Vgh/8kLVeNCN+BfXW37vVX0JZG79B4/1Z0A2E3eN8OSa/sLBwFJo+lAl/E9qh12w+Wj bVFo4grkfh7EuPkTkcP+6UC2C7l05aDEsyRHEEOhSnKggGj/4L7Dow1ucCaVu3dmaDyT QkhoVnot+bAfqWy1A8k3yeDIEk3P2sgxXu7pqbDb2VZzBLe3uahuA1SQGCgQx/k6XAlu 9A9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722434243; x=1723039043; 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=f0ifOWpXPDm976yezlya2rMJUdCbb/i5qM7P0W7RaAQ=; b=PcinfnyI4HxXlN5r610crko3hDG0Kqi+upWeroA6u5k65pJRJzSduwAekiHGZ4tBdV j1bmLSKXoAHd580NO2N2GpS6ZybkM+xAs5I5g5WyqgGO8RljLhWuWO1zrZH/LRlIieaD qMrRl7OqiPNF/JTS/UpRKOHUTiI3QIA/793++FkmPV6VEL036xWtigySsbJsx8abQGgr ql3j78LHJl9nw5+owNBkgDwBkskSTivAh9ghFva0L8oBKDYsTLRfe5418cvGLTfu9WfC ftjTcNojCw+jYmzThAnvKcn8UOWr9MlsZgHF7+YL6xX/VZHhSxzEmTpe/wMGh38lfoQh YomA== X-Gm-Message-State: AOJu0YxP2CbXkkjyzkirimCqLhJh9jvBeCgfwRYBR0H9/0evuFSimmsv GZVXKeZbRgOx1vSjV+GsOCb12r90ZSda3aXhNjk2WMR6bs4P7ak4ckODeFaa X-Google-Smtp-Source: AGHT+IHvL+tr30XPCHAjidjtWbrNnOuOMAKVkdYukfXGbQaCPSyariodtx/U8WYdDU2gY8gbvhxFIg== X-Received: by 2002:a17:907:2cc6:b0:a7d:4dc4:3d8 with SMTP id a640c23a62f3a-a7d4dc40564mr914847966b.54.1722434242842; Wed, 31 Jul 2024 06:57:22 -0700 (PDT) Received: from lvondent-mobl3.wlan.qualcomm.com ([212.136.9.4]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7acad91041sm779143666b.174.2024.07.31.06.57.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 06:57:20 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 2/4] monitor: Fix crash parsing notification Date: Wed, 31 Jul 2024 14:57:16 +0100 Message-ID: <20240731135718.429604-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240731135718.429604-1-luiz.dentz@gmail.com> References: <20240731135718.429604-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 fixes the following crash caused by notify callback being NULL: Jump to the invalid address stated on the next line at 0x0: ??? by 0x1E8375: print_notify (att.c:5420) by 0x1E9464: att_multiple_vl_rsp (att.c:5463) by 0x20D39E: att_packet (att.c:5637) by 0x1B2054: l2cap_frame (l2cap.c:2567) by 0x1B4A4D: l2cap_packet (l2cap.c:2708) by 0x19AD43: packet_hci_acldata (packet.c:12522) by 0x19CF07: packet_monitor (packet.c:4249) by 0x152405: data_callback (control.c:973) by 0x2204F6: mainloop_run (mainloop.c:106) by 0x221017: mainloop_run_with_signal (mainloop-notify.c:189) by 0x14F387: main (main.c:298) Address 0x0 is not stack'd, malloc'd or (recently) free'd --- monitor/att.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monitor/att.c b/monitor/att.c index a23347ef7..73a616584 100644 --- a/monitor/att.c +++ b/monitor/att.c @@ -4646,7 +4646,8 @@ static void print_notify(const struct l2cap_frame *frame, uint16_t handle, frame = &clone; } - handler->notify(frame); + if (handler->notify) + handler->notify(frame); } static void att_handle_value_notify(const struct l2cap_frame *frame) From patchwork Wed Jul 31 13:57:17 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: 815749 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.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 594C11B29D7 for ; Wed, 31 Jul 2024 13:57:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722434247; cv=none; b=ep2F+GzVCS5nSyTOIV84qWlMbnwfWLex68HFiL7h5EplVm1ASCY/plTRtSQvacty9BSFv9MSKZjS+3RT5ZF8lBS1MebWoLwRW/aNvSr8jfXDPn1MKAppqdL1IBNJ1MLI8hzAuhIYmfhIezgqizwjAm4zZmvt81dojhQs7PWlGN0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722434247; c=relaxed/simple; bh=NhSwMsjZg89Aw5OlQmXm7xwkq9viY2RnmqKDqkAKR9c=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Oeq5Vp1/Wp9zNE3AAVl8Tg9jlIApcvru/Id/MhDqiK8a6f+yNn6OiQkZkUWgIZ1LJ4JP5pS2NqZx8w6xGDYlX/HIWyQB0lh5L8YHl96z7ecyOZxS2BDLn1uYr3JtFyQ7s8X5EdXpVkZ97xfS0dvD7eUXN/Rd7vZRgL3Fui/9+Q0= 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=IcDXLvfk; arc=none smtp.client-ip=209.85.218.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="IcDXLvfk" Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a6265d3ba8fso541001666b.0 for ; Wed, 31 Jul 2024 06:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722434244; x=1723039044; 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=/0o7wK6f7my5NzT3+kEHNbYAQwaybfRVmaM0eb2Q2Zo=; b=IcDXLvfkGsakiCnmKuRZo4JL0MiDYzuXhoF1xmGpARvNWTmaemGQuBkh7GsKAY4xHT sKRR2aLSjZSHP1h8hX9XtvC2tpliXiROZp9CDPq7V0Wxp4EH+c2QtQZLywVcO0nHt7ZJ sq2w/lqWYMlCFF6Duh5eWoPr9ee/Zaf8QMbkVAtr3LPWqpefJ/z7CJ5UvlhCB8YO6b1g 3pAyXWCyhGJdLMsPNFwZPK483emxikeAZA+DxUciPJ5qEvmGxChWpGRxTEkod9QiR6sT C6a78Z/B7BKvpPtk1o75Mb6TVDHpnqO0fMV3fyiYgz6D8mTz0A3NwJPIhlW5zJRjrgM2 6AWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722434244; x=1723039044; 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=/0o7wK6f7my5NzT3+kEHNbYAQwaybfRVmaM0eb2Q2Zo=; b=bk1i+cT9l0zgTi+un2SrZsGrTZLpqZQXq+niEheQDllCkkR4ciW3Eyp+DH8F+KMp6+ OQt/F5zjwrQiyoYTgwd4lEenBXzP8MI7ZnU7WqMnjg8nUWU2rntEK0VIQzX68c0vusG1 +9HMDZGeHsEVORZeye1Cist9JCwNFwyw98h7ObDQIHEcT0jMPoSWlfJfqXY4uMrGDa1J RspnMg15QJe4hJzWhI79iu5g4i4C/9w2AjS6CoEW4rNewQuW4b/zdoYxGWTvlVXYRpUr eKq5ISt+JfTtIOgKeFbQ+IRQyK6iv8PyY2DXgm4TCgiNQPIQ+jl/Xx9DlyKqntb4cylh xXQA== X-Gm-Message-State: AOJu0YzvgXWJI6RWBmpHU9EX+Rk3lUTslPJvMMewUr79DFMLU3vqeG+B PaFQtDvZ4EZRBJ7KUhckzKYPEshX9692tsrDrvZSkhHWn+oqLHX3BHjmXQ6r X-Google-Smtp-Source: AGHT+IEqrNwTSvBP2CCQhzcAkAiHCvuxddiKWxDitxxj4ibl/SkMo1VMblBBmpHdAXJxOg34swrrmw== X-Received: by 2002:a17:907:96a0:b0:a72:7da4:267c with SMTP id a640c23a62f3a-a7d3ffa612bmr1165489966b.12.1722434243900; Wed, 31 Jul 2024 06:57:23 -0700 (PDT) Received: from lvondent-mobl3.wlan.qualcomm.com ([212.136.9.4]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7acad91041sm779143666b.174.2024.07.31.06.57.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 06:57:23 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 3/4] shared/bap: Fix not setting metadata Date: Wed, 31 Jul 2024 14:57:17 +0100 Message-ID: <20240731135718.429604-3-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240731135718.429604-1-luiz.dentz@gmail.com> References: <20240731135718.429604-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 bt_bap_stream_metatada shall not send Update Metadata if the states don't allow it, instead it shall store it so it can be send later when enabling the stream. --- src/shared/bap.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 499e740c9..a7217b417 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -1971,8 +1971,17 @@ static unsigned int bap_ucast_metadata(struct bt_bap_stream *stream, return 0; } - return bap_stream_metadata(stream, BT_ASCS_METADATA, data, func, - user_data); + switch (bt_bap_stream_get_state(stream)) { + /* Valid only if ASE_State field = 0x03 (Enabling) */ + case BT_BAP_STREAM_STATE_ENABLING: + /* or 0x04 (Streaming) */ + case BT_BAP_STREAM_STATE_STREAMING: + return bap_stream_metadata(stream, BT_ASCS_METADATA, data, func, + user_data); + } + + stream_metadata(stream, data, NULL); + return 0; } static uint8_t stream_release(struct bt_bap_stream *stream, struct iovec *rsp) From patchwork Wed Jul 31 13:57:18 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: 816129 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 396F91B3731 for ; Wed, 31 Jul 2024 13:57:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722434249; cv=none; b=r43HBVkNK8c34nH4WF7g1UsJULR6GmrUhHTtqAanHsUp40fgvuB5TciiOwSaxf0rdjxr/ZgPpCzmV0UPLHWbHtcAaOxGTtNIdmb2XRMhGGDuVAn6a6K0fUlPqoOrbV1KTBVqFqaJxfTDbSAIbudt23E7HQCTMe0R2FXjDN3d+RI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722434249; c=relaxed/simple; bh=0jHhr9gvP75BtOdY1Q0O74hGBxxDcZ+CuAQl2X1+IkA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=vEw2qlpzcCS5PuE87/aPdThtatUdWwlFckVbk6uryrvIcfNlv6L//VG/nw52ZxFXGQkzCYFQh995HT/mWIz9A11b5sEzWH6nZA63asZvvWx1af20Yh1KVUIWh2PkYDlfxbak8iCsxccowhE0HntjSW1gIvBNwcp+htz7Lti6Nns= 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=INtJlZl3; arc=none smtp.client-ip=209.85.208.46 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="INtJlZl3" Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5af6a1afa7bso6145253a12.1 for ; Wed, 31 Jul 2024 06:57:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722434246; x=1723039046; 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=Oaq2svp4XIVCK+k0SdX+3g8mv7npMWryUIo1poDIm5E=; b=INtJlZl3RiDj+sgchI0M1y9otnIs1LqON14d7aEueeWrLX0XqmVqUif/gqrZ6KyeHt /R92vcEFLnD5rZZFYjAcRWopsF3AK+UYJk8AsFRzIxf4dSb9bEVT9U7EzRZvEWoUhxzk +LFnhLo2QeWoZPM1Q8uFWvfzhgAb5pTcWNUnLBKbm80iCX4gzskhXLdsLQ68r40Xx9mT mbo0/roBgVV3ERS38WfQzv5AJ6kejLtfgEw0zQb9a0ONIwgaG+v86se1ysUPHB0yB5It u4Lhj2lZG2uVjlew6cVk7EAXWzFJ2PeVevoJhjeM3dnHIocxtOYHg7nM6RHPA/iQZOf2 KVUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722434246; x=1723039046; 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=Oaq2svp4XIVCK+k0SdX+3g8mv7npMWryUIo1poDIm5E=; b=Qn86fR7pbEB5Pue+2YHfHomEdgxoD1TK5B8b1gWoFhr26/Dm0WXZPwLBG9J8dtIndv gooa2CvP7wSZ/QWu12O9fQas2WcnjPu3l38t4r+kYiZIY+3EF5kyCzYbMboMsAphcQzd FrWlHaGPcuCLr5v2sLm0vhjUcYt1eNzJKIomMKDaGYHBddGynWyI/aLpK+6F8KRnDI8v YzlqLdTpuw5T0t5cndWSXrMmQbLtejB4Xjwzzwa+PtVmq6BCgaAUtxjqcREGiJ0AYT38 atHrzk5g1HMpQrnTytBYab8RkcZWy6JBIeyjwIkWbw7N175m3nBfzOfy5VqxYYQl9L5i HI4Q== X-Gm-Message-State: AOJu0YzJDzVB8PW3ACsTwORAZp+eNVCJJKfpOxOM0bd0FuXt/3sqDCWC PRCyyvf8Ldcu75XvkXPGNReU6/YkABWTTGUS2bLsh7Q2f6IykKtjgMTqWnIZ X-Google-Smtp-Source: AGHT+IFXBqNRqhEx9/isbBzzJl7FJ77/BlkMF2Ek39lSKk4Rrunq3zXxWGzScp5MkPiVMeN7P20oIQ== X-Received: by 2002:a17:907:9483:b0:a7a:83f8:cfd5 with SMTP id a640c23a62f3a-a7d3ff9f2f8mr985266066b.18.1722434245950; Wed, 31 Jul 2024 06:57:25 -0700 (PDT) Received: from lvondent-mobl3.wlan.qualcomm.com ([212.136.9.4]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7acad91041sm779143666b.174.2024.07.31.06.57.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 06:57:24 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 4/4] bap: Fix not setting metatada Date: Wed, 31 Jul 2024 14:57:18 +0100 Message-ID: <20240731135718.429604-4-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240731135718.429604-1-luiz.dentz@gmail.com> References: <20240731135718.429604-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 Fix not using bt_bap_stream_metadata when configuring a new stream as the endpoint/client may have set it. --- profiles/audio/bap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 53f430d66..a2c5a546d 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -1523,6 +1523,10 @@ static void setup_config(void *data, void *user_data) return; } + if (setup->metadata && setup->metadata->iov_len) + bt_bap_stream_metadata(setup->stream, setup->metadata, NULL, + NULL); + bt_bap_stream_set_user_data(setup->stream, ep->path); }