Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2846864pxb; Tue, 12 Oct 2021 14:53:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxY/H0oRascfTDDBH6/p5GCJZU39G2gsiGJx+32lxSyEeZsLSmJq2ULiRwovQgyOUkYeJJ X-Received: by 2002:a05:6402:19b5:: with SMTP id o21mr3575916edz.214.1634075607799; Tue, 12 Oct 2021 14:53:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634075607; cv=none; d=google.com; s=arc-20160816; b=Ysl+TCjTIgh/kgnz4g1Y4BhzqiwzhJ4YPacfHIaNuUQVVAd1xokrzm3fpvxH+v3MqO EZVM6+jj0nYdXMVySZp9gzGYBz8xrUZeT/MNTkswABFIhlCUHGzMUC24HoHqQ6Rwd/io 9GftQUg+CeZx0sUrkYIaXwGsHc1Apip7cZ37Ud2SV1n7j1nH4EOYVzG1R8xeJn7KkaTh 9ce+pfYfaCHQyPkZoUZUTdjdfJj1ib07WQV4T+8UGKzXdpVz8fDaISmjfCJ8Qy+yuTzO MwJ2zIh8G7KIWkupi/Fq4FLg+h4uIVrg5wj7HbUVt2l+ST7R0g1St8Nbrpnh6/yB77vn Q5YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=oaiQRec8iXp/IWwys5SijYE2hNJwupot798JTgR2Suk=; b=0w9FPmoEBLqx7hAY8Bn6FbTMr4ajRwH+8bZQ1HOtbvUa3K5s4WUiHLcCnF0COVAnWI 6ckQPMVz0fHVXydlzXis1zkmAXmqMsA9O0ZX3r/JjX5K7MP7W+IJNUgbfkfxRw6bjBeS 6qTZ9qRhEk+1rqkM/2VJlNu7W5xB32iXrCQF4eCnxsURar1y/ouXR/bqRECTzmt7WLzA KkgekitI8zOheJbEsdR8jzKveBH2PnpQF92+Z4wY7mmfZ11gLKz3s9zzhfKImr0BuZYL P+OgOjnsMQSMvHf2q8QdDttigezmHSux2MTUW9Khsac/x6DR3WlHg7h6IAhFmf+luNVi mIng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y13si27860356eda.344.2021.10.12.14.52.54; Tue, 12 Oct 2021 14:53:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233650AbhJLVxY (ORCPT + 99 others); Tue, 12 Oct 2021 17:53:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232272AbhJLVxY (ORCPT ); Tue, 12 Oct 2021 17:53:24 -0400 Received: from m-r2.th.seeweb.it (m-r2.th.seeweb.it [IPv6:2001:4b7a:2000:18::171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16B00C061570 for ; Tue, 12 Oct 2021 14:51:21 -0700 (PDT) Received: from SoMainline.org (94-209-165-62.cable.dynamic.v4.ziggo.nl [94.209.165.62]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id 950093F357; Tue, 12 Oct 2021 23:51:16 +0200 (CEST) Date: Tue, 12 Oct 2021 23:51:15 +0200 From: Marijn Suijten To: Pauli Virtanen Cc: linux-bluetooth@vger.kernel.org, Luiz Augusto von Dentz Subject: Re: [PATCH BlueZ] avrcp: keep track of last volume, and use as transport init_volume Message-ID: <20211012215115.ypzc55dd5enwscis@SoMainline.org> References: <097b7a889f73ea9cee42b9a0c99683a1d7ee8069.camel () iki ! fi> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <097b7a889f73ea9cee42b9a0c99683a1d7ee8069.camel () iki ! fi> Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Pauli, On 2021-10-12 20:35:17, Pauli Virtanen wrote: > [..] > There's also something confusing in the code in current master > branch:?why are avrcp_handle_set_volume and avrcp_volume_changed > setting the volume on local?target->player, which I thought is a BlueZ > as TG thing? If I remember correctly you can also have a player with BlueZ as CT which is basically a passthrough representing the "actual player" on the other end of the connection? > I see that df7d3fa50023 ("audio/avrcp: Always update transport volume > regardless of player") moved most of what player->set_volume does to > the callbacks, and the player volumes seem to be currently used only to > provide initial volume for transports. The volume probably should be > stored elsewhere than in local players? Going off of memory without looking at the codebase, it probably makes sense to move volume out of the players and into the device entirely as a single source-of-truth representing the currently known volume value of the peer. That might solve these issues (ie. no player available in the linked commit) and get rid of a bunch of edgecases? That's probably overlooking some major dependencies though, but it'd be great if you could look into that direction. In addition I don't know if AVRCP volume is "local" to an entire device or just a single transport "within" that device. > [..] > Caching in struct avrcp session doesn't have these problems, but > df7d3fa50023 mentions there's some issue with avrcp session appearing > late. I'll need to think a bit how to fix this. I don't remember there being no avrcp session yet, but you're probably referring to 4b6153b0501c ("audio/transport: supply volume on transport init") instead? - Marijn