From patchwork Thu May 28 17:25:24 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: 11576399 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 311C992A for ; Thu, 28 May 2020 17:25:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B05D2073B for ; Thu, 28 May 2020 17:25:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W7joYmME" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405557AbgE1RZb (ORCPT ); Thu, 28 May 2020 13:25:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405539AbgE1RZ2 (ORCPT ); Thu, 28 May 2020 13:25:28 -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 4AD48C08C5C6 for ; Thu, 28 May 2020 10:25:28 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id e11so12949138pfn.3 for ; Thu, 28 May 2020 10:25:28 -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=W7joYmMEO++1j0WhcTRWOYcDCHKShEk/g8aVbuj75hqb0mkkkgd2L4XzmMdDBe4wAP BfsaHdJhod7kz0S+2nIfOCpMuroKhDQR+WZNYyqGnldET+vg92RNmmfPPE9aiFWhJDh0 KmGkt+NDA/AbjzhRPgnMmHN7WCw4sjao319BI3qb0Bo20HwfmFFMM1ZUeoDUvrD1KcdL 31l8Epz9Nmin/iZEe9tOgxS73VrlEQPx1qu3+CSeWTL7q+lmfAzV1JDtlbqVJ3FZ2eAO GjWG1JM6O1adzIBzQ/4dy8v5IcG+TwjJk7mmD43y3EzpB0iruYjnZ0whvgHizqco4DsF 1ODw== 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=mGqSTzrC5wX0wyRvwnzKl49OPyhISO9kalR6uYPoWTqHUT9O4Lq4LCPCO/k7O5nWW5 GnUYEFwGIuF+X9zG6iEiu8vlDbnn9Xe9EyhzxUMmtUzCZtMvjUfSBgOeoqt0sMkf4e66 ZbBeWsWm+hB1H1SHLNLUVX4RWHT/JORuARIWNETNeQBG53EOMHifVK6Jx374J/edqhVi 46nDJMYqrRvhQFFq065iWg/oa/jlMf4S8yTHxkVNjxBhh3j+TyMjZcqoG7uKYEbRxiqX DE/OTbWffpSXuYggDAH8MpmIHOO4e2Wa1AX+FJzlCX6oDti1SEkxkf6aXG+N2Og7KDtl jNtA== X-Gm-Message-State: AOAM530R0Ti1wl1tO75HKFR5333X1D2FGFJg9Eo+m85xNBDg5TUy7Wpp vwuOlUGq10P1zI/WGFiRCGvBZz83 X-Google-Smtp-Source: ABdhPJxrB5LHLTmoWvB+fZuR3IBvlkM/7b9JAk/oz4S4EJeBFsK2ZRdpeLhQRZoXogHuMSd7G4LiXQ== X-Received: by 2002:a63:a84d:: with SMTP id i13mr3886249pgp.342.1590686727402; Thu, 28 May 2020 10:25:27 -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 n5sm4481503pfa.168.2020.05.28.10.25.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 10:25:26 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v2 1/2] avrcp: Fix always requesting player settings for category 1 Date: Thu, 28 May 2020 10:25:24 -0700 Message-Id: <20200528172525.216354-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 17:25:25 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: 11576401 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 2ECDB159A for ; Thu, 28 May 2020 17:25:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 175DC208E4 for ; Thu, 28 May 2020 17:25:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="px9pL7Rq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405558AbgE1RZb (ORCPT ); Thu, 28 May 2020 13:25:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405540AbgE1RZ3 (ORCPT ); Thu, 28 May 2020 13:25:29 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 829D2C08C5C7 for ; Thu, 28 May 2020 10:25:29 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id n18so13918523pfa.2 for ; Thu, 28 May 2020 10:25:29 -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=8rzfdUrlc7E6TiIkd8wKl+Q/Lnr2dT152h0Jn7EafjI=; b=px9pL7RqOohNMUTQg9f/XPQesRK7f5KacRP3kF2z5urKa6v1nhzGvfVjGblqQhQDh0 wlEWgkagN/EI5WsiWWh4LjIefEipKMmG5kbVXnYLEro6tYwQj4iJv3NR0CkEGSUWD1hQ QhRSh1gAFO6ZeCMN8SBD4Pybj/eqStQQZ6hM8C/9DQ+D52OXX5GiLS08qb0ZJPOWDS// 4lzNpN2cnyF8vlkt4XRI3VgT4ZbRgRV3oGnk4QPePSIl4QbgJ/wEOMe1h+RhnDTeX8MD fnBaiCsQkprWgLUJbts17+zaSNnGbBpKLB4q2fgor73glzKRnp9zNONz5FNVPS2bIlEb HCUg== 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=8rzfdUrlc7E6TiIkd8wKl+Q/Lnr2dT152h0Jn7EafjI=; b=rg4iCo1qVPu3tYqPdgJy50jznCtw5NQo3bm/0t1/rh8bVSB7QfZA3qGSQ5wqGU7gtr XkZ6hUd/zcpbq6d66LCWhZLiw/Rmf0QMqqGBjVBYiPaHeFyCyyFyyoN+6yIxKmzsSjGX lqJg7O2uKy7zCikl4H8lXpQkQl32cFQgvHWZpylOn2GV+b8Vkqr4NA+UJYAQ1cHaJE1M kV5dKchWYESocP2Mmpcx7LiYwWN6iyOOttCghUazhSQNRtjNRHb5lgcFs8AKK3AhY8BF mkJ427X/MJAbvCVidX85B7r12FY1j7kacFPh2PMnTORzQL982/DiizppBURYOaTYroOA Lq9w== X-Gm-Message-State: AOAM531EAeAlQSKWwuKtuGUKFH9Mj/hCNdxKRIQrCHc/8Le5t6+Sz34b Ib/1moGzE8yk76lKPR8/6lshNz0o X-Google-Smtp-Source: ABdhPJwT/m0YmvQ9MJKZjZxfOtPDhV44BmRjy40ioTONvImiBRN/IU67BxHrY0XWHSxfaMC0gx6V6g== X-Received: by 2002:a65:4107:: with SMTP id w7mr3980997pgp.226.1590686728742; Thu, 28 May 2020 10:25:28 -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 n5sm4481503pfa.168.2020.05.28.10.25.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 10:25:27 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v2 2/2] avrcp: Don't attempt to load settings if on volume changed is supported Date: Thu, 28 May 2020 10:25:25 -0700 Message-Id: <20200528172525.216354-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200528172525.216354-1-luiz.dentz@gmail.com> References: <20200528172525.216354-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..d46ac0ab7 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 == 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);