All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marijn Suijten <marijn.suijten@somainline.org>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: "linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>, Pauli Virtanen <pav@iki.fi>,
	Marek Czerski <ma.czerski@gmail.com>, Yu Liu <yudiliu@google.com>
Subject: Re: [PATCH BlueZ v2] audio/avrcp: Determine Absolute Volume support from feature category 2
Date: Mon, 25 Oct 2021 23:02:06 +0200	[thread overview]
Message-ID: <20211025210206.bkt5wovzmkmt6teg@SoMainline.org> (raw)
In-Reply-To: <CABBYNZJcx9tC6vNw38X-9d09k-Pe5-=DARY7qPz=dNpaYJqz1g@mail.gmail.com>

Hi Luiz,

On 2021-10-25 13:32:50, Luiz Augusto von Dentz wrote:
> Hi Marijn,
> 
> On Mon, Oct 25, 2021 at 11:37 AM Marijn Suijten
> <marijn.suijten@somainline.org> wrote:
> >
> > Hi Luiz,
> >
> > On 2021-10-25 10:48:34, Luiz Augusto von Dentz wrote:
> > > Hi Marijn,
> > >
> > > On Mon, Oct 25, 2021 at 6:42 AM Marijn Suijten
> > > <marijn.suijten@somainline.org> wrote:
> > > >
> > > > Hi Luiz,
> > > > [..]
> > > > As far as I'm aware AVRCP 1.3 doesn't define FEATURE_CATEGORY_2 either
> > > > (but I don't have that spec available to check) so IOP would only find
> > > > this if it combines v1.3 with that feature bit and then tries to check
> > > > CAP_EVENTS_SUPPORTED.  But if it does that, it should also find that
> > > > we're not even checking for the controller supporting FEATURE_CATEGORY_2
> > > > in the first place, nor are disallowing the controller to send
> > > > SetAbsoluteVolume.  That's something we should add for sure, even if we
> > > > don't go ahead with decreasing the minimum version for category-2
> > > > features below 1.4.
> > > > I can send a preliminary patch enforcing this if you want.
> > >
> > > So you are saying FEATURE_CATEGORY_2 is not defined in AVRCP 1.3
> > > either? If the is the case we should probably make it clear on the
> > > code with a code comment that we will be going to verify it only
> > > because of Android using it with AVRCP 1.3, but I wonder if there is
> > > anything in the records that you give us the information that it is
> > > indeed Android and we should be fine doing such check since AOSP has
> > > been doing this for a while.
> >
> > I'm not sure since I don't have access to the 1.3 spec and haven't found
> > it online in a quick search.  This however makes the most sense since
> > feature category 2 seems to _only_ concern itself with volume-related
> > functionality, which are merely SetAbsoluteVolume and
> > EVENT_VOLUME_CHANGED and introduced only since 1.4.
> >
> > I wonder if there's anything specific besides the class indicating a
> > phone factor and the appearance of an avrcp controller with v1.3 but
> > this feature bit set.
> >
> > I'll send a followup in two stages: one that introduces a
> > FEATURE_CATEGORY_2 check around all volume handling, and another that
> > bumps the requirement for the peer-controller down to v1.3 with clear
> > comments about AOSP - unless you have better ideas to detect it :)
> >
> > > > [..]
> > > >
> > > > Finally, on the subject of incorrect behaviour and IOP, I found
> > > > 179ccb936 ("avrcp: Set volume if volume changed event is registered")
> > > > which also seems counter-intuitive besides going completely against the
> > > > spec.  It doesn't seem to have gone in through the mailing lists nor
> > > > discusses the affected device and any potential misbehaviour as a
> > > > result.  If you're concerned with this patch, is that something you'd
> > > > like to keep as well?
> >
> > Anything on this commit?  I'd like to improve the FEATURE_CATEGORY_2
> > checks and this is quite alarming and conflicting with that.
> 
> So you want to change that check to check for FEATURE_CATEGORY_2
> instead of checking if AVRCP_EVENT_VOLUME_CHANGED has been registered?
> Note that the reason why this was done like that is because there is
> no record to check the version so I assume there are no features to
> check either, I wonder how these devices are even qualified like that.

Yeah I'd check for the TG version (done before that patch) and
FEATURE_CATEGORY_2 here, but the patch clearly mentions that there's no
target to begin with.  This seems counter-intuitive and more like a
fluke (maybe the SDP cache got of date, or the device dynamically
"un"-publishes this record) and without knowing what device this was
happening on it's very hard to validate if/whether this is still valid.

> Anyway we probably need more code comments when we are doing something
> like that, and perhaps we could have some entry on main.conf, under
> AVRCPO, to make these checks less strict so the system can allow
> things like 1.3 with FEATURE_CATEGORY_2 and target without record.

I totally agree that all these edge-cases should use extra comments to
detail what's going on, and I like the idea of hiding them behind config
flags.  That way we can pass validation without worries and at the same
time give distros and individuals the ability to be less strict, though
we'll have to think about the default value for for example this AOSP
workaround.

Based on your suggestion I'll also move absolute volume control without
target SDP record behind a similar flag, and add Yu Liu to the CC here
to see if we can get some more clarification. Yu, can you detail what
device this was happening on, and if this is still the case?  Thanks!

- Marijn

      reply	other threads:[~2021-10-25 21:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19  9:16 [PATCH BlueZ v2] audio/avrcp: Determine Absolute Volume support from feature category 2 Marijn Suijten
2021-10-19  9:38 ` [BlueZ,v2] " bluez.test.bot
2021-10-19 17:38 ` [PATCH BlueZ v2] " Luiz Augusto von Dentz
2021-10-25 13:42   ` Marijn Suijten
2021-10-25 17:48     ` Luiz Augusto von Dentz
2021-10-25 18:37       ` Marijn Suijten
2021-10-25 20:32         ` Luiz Augusto von Dentz
2021-10-25 21:02           ` Marijn Suijten [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211025210206.bkt5wovzmkmt6teg@SoMainline.org \
    --to=marijn.suijten@somainline.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=ma.czerski@gmail.com \
    --cc=pav@iki.fi \
    --cc=yudiliu@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.