From patchwork Thu May 28 21:52:59 2020 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: 11577021 X-Patchwork-Delegate: luiz.dentz@gmail.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5207E1391 for ; Thu, 28 May 2020 21:53:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 322E32072D for ; Thu, 28 May 2020 21:53:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VPb3DhGa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436701AbgE1VxF (ORCPT ); Thu, 28 May 2020 17:53:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436611AbgE1VxD (ORCPT ); Thu, 28 May 2020 17:53:03 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9059C08C5C6 for ; Thu, 28 May 2020 14:53:03 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id bh7so116389plb.11 for ; Thu, 28 May 2020 14:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=CRNf3g0aaybUiuE5w1c4KF1fNLd5dCJGW6FPC9eQZFg=; b=VPb3DhGadUSP1BGeqFQqps+s3nQPPWMANvCC14lri5kn2kIObVSyt8Xf2h0Pdes4EG yhHFcjE6R/BuhZhA4eTbQALi77K6iKRqYjLkK7tguDEBzdfjcES1IlU1GsglKKFKzTwn ubqsn/tQ/RnbiFJOuEe8xbaNX9XOXIQT2aqPS7/IQ6AbynaGTdmeUKTJbasMbkNH2XxR QtWYa2bURi+g4GnBdjJwgK4gbpG5Groie3G6qXpnMtvDp1kZs4uPFS6EPipOJRaMri0l v/2V5pHLp4570iIEYdaYOiDE0cP1GPm3ZGwyIRFnPjcRRZHfUMfAQ+vvSMR9vDym2pPA e+Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=CRNf3g0aaybUiuE5w1c4KF1fNLd5dCJGW6FPC9eQZFg=; b=NpHt16KAVZpDPBDVADZ5aqeFmDx1YcDQLS3g+xm2yD5s+Wir3md1g+8mC2KUr6cGea 4g9BkVBA8GQfI9ro1Pq/VAyeYbwJW3VzQ7pcO+9yMMOlyqFybBf54cC/vHFsWJS56z/c ltOEztJSRBY3jMYHAIybyydxOTgixl6H3fmTtRBOu0l5juaGwbh3h5pTVPCt08qbH6/3 5IUUXKqMMJ3wdxOVZX3ETDvoh+zaGURqfpxtfb/ZZp7crTVPksn9QST5JnA7LvDeq/JX 7wLSvPj5IGUV+xcilyE23LP0r3QE7Xup5z5Rb8VEsTIdZOuF5bIyz3NQ0zAOyBprEqGC MNcg== X-Gm-Message-State: AOAM531g0n/RvJlJ5Hv0mFsz91+Jxg0ue+ZYKAsf72+VrK0GsxOuFu0z E/6oe1xNywlE0P+ETAji6Jgg+RSM X-Google-Smtp-Source: ABdhPJxz6lqcqeqh2b54csFT8FrpzUvimKa0m1pDsbXaW5/XlsqFbl+zdrK0LHs40NOY6HNlKmTIKQ== X-Received: by 2002:a17:90b:1882:: with SMTP id mn2mr5964080pjb.139.1590702782771; Thu, 28 May 2020 14:53:02 -0700 (PDT) Received: from localhost.localdomain (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id l4sm5126170pgo.92.2020.05.28.14.53.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 14:53:01 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v3 1/2] avrcp: Fix always requesting player settings for category 1 Date: Thu, 28 May 2020 14:52:59 -0700 Message-Id: <20200528215300.225894-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.25.3 MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz Player Application settings is not mandatory for category 1 so instead of always listing the settings the code now checks if AVRCP_FEATURE_PLAYER_SETTINGS is enabled. --- profiles/audio/avrcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c index 773ccdb60..75811bf98 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -3814,7 +3814,8 @@ static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code, if (!session->controller || !session->controller->player) return FALSE; - if (!(events & (1 << AVRCP_EVENT_SETTINGS_CHANGED))) + if ((session->controller->features & AVRCP_FEATURE_PLAYER_SETTINGS) && + !(events & (1 << AVRCP_EVENT_SETTINGS_CHANGED))) avrcp_list_player_attributes(session); if (!(events & (1 << AVRCP_EVENT_STATUS_CHANGED))) From patchwork Thu May 28 21:53:00 2020 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: 11577023 X-Patchwork-Delegate: luiz.dentz@gmail.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D9196159A for ; Thu, 28 May 2020 21:53:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C157D208A7 for ; Thu, 28 May 2020 21:53:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PKL1AJxs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436710AbgE1VxG (ORCPT ); Thu, 28 May 2020 17:53:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436703AbgE1VxF (ORCPT ); Thu, 28 May 2020 17:53:05 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED3C9C08C5C6 for ; Thu, 28 May 2020 14:53:04 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id v2so91268pfv.7 for ; Thu, 28 May 2020 14:53:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=iflpTdnrlYYAFeQ7PdOyqCC9+nfFboZmwKA70zJrtMc=; b=PKL1AJxsDXo6MXMh7MiYWujPpYbbx1WToTZHTcsVnJfIENE1Mw/ZtwZRPmATwaHFNq oEWTB8hVplDipNxwL5i+QvHsgfgqZ1TkVm7y96mfVTY4CvEX5d21pvyVwxL17pSrcMwN or/yiSUWWgZZCgTT9pWxVRWui8/qVMSe5f73EvmELKOid7NRDk/MKsS0m2DWeol1I9na XRrjtpBYADVd2c3sng/8y/Lj5rNgZwKpGn1pl+mBuzNEhV+ygrlJAGrLE8DwmgFca4qe KbcOD4WA0NMdvfAFIMddt0pn7PYvQkWpoNmWWi+O5u3uPa66A+4DPrm5lkgqoBfgJkB2 qzCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iflpTdnrlYYAFeQ7PdOyqCC9+nfFboZmwKA70zJrtMc=; b=SYRWRss0bcpW+/wyXHTliH26MUorifAithDwojWuncX0lFYiPHCB/jYlYIfcwftWTy ESesiLvINpm+cd+Jq+Mf3PtMndGS12L1BzwMUbkMeBakmxFETyq5BFRAyLh8cDYadehA NSvCunPw/FC8+bzbigXvJTu5ZxWD9923QOoBd6RujcYkSgRbABa8yaqbMYCz8s/ryHeG dfsvo+lUVrQWqyI6C2teDO1J0+Z4GXTxt/ltIPpoJw6FfqnSWPALEL1AJnziHDZWoQnk lpySS5mxN6LNdKSUZ/47rrRbPWh55YZJ4awltZCE4nj3wc0kaZCako4ojltURgR5fA/c v0tA== X-Gm-Message-State: AOAM532inD4HorIGtHJhlxeATFS0D0KsaN5IG9GnKrCUfspYHi7R/ySa hZjfMGEoJHusvuwrFq1x42MkLhaO X-Google-Smtp-Source: ABdhPJx2spbAWDOsS9iNJRbTN25HNDJrznOdfY4It/Edx+tnvbET2P2/BGZZZOQwYK7NMJ5N3YUUBg== X-Received: by 2002:a63:d547:: with SMTP id v7mr5018726pgi.413.1590702784169; Thu, 28 May 2020 14:53:04 -0700 (PDT) Received: from localhost.localdomain (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id l4sm5126170pgo.92.2020.05.28.14.53.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 14:53:03 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v3 2/2] avrcp: Don't attempt to load settings if on volume changed is supported Date: Thu, 28 May 2020 14:53:00 -0700 Message-Id: <20200528215300.225894-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200528215300.225894-1-luiz.dentz@gmail.com> References: <20200528215300.225894-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz If only volume changed is supported that means the player cannot really indicate track/metadata changes so don't attempt to read them. --- profiles/audio/avrcp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c index 75811bf98..8b3debe46 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -3814,6 +3814,10 @@ static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code, if (!session->controller || !session->controller->player) return FALSE; + /* Skip if player status/metadata if only volume changes is supported */ + if (events == (1 << AVRCP_EVENT_VOLUME_CHANGED)) + return FALSE; + if ((session->controller->features & AVRCP_FEATURE_PLAYER_SETTINGS) && !(events & (1 << AVRCP_EVENT_SETTINGS_CHANGED))) avrcp_list_player_attributes(session);