2020-05-28 17:26:28

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH v2 2/2] avrcp: Don't attempt to load settings if on volume changed is supported

From: Luiz Augusto von Dentz <[email protected]>

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);
--
2.25.3


2020-05-28 18:53:55

by Andrey Semashev

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] avrcp: Don't attempt to load settings if on volume changed is supported

On 2020-05-28 20:25, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <[email protected]>
>
> 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);
>

The result is still the same with this patch - MTW2 reboots after
GetPlayStatus.


Attachments:
mtw2.btsnoop (11.91 kB)
mtw2.pcapng (15.00 kB)
Download all attachments

2020-05-28 22:31:43

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] avrcp: Don't attempt to load settings if on volume changed is supported

Hi Andrey,

On Thu, May 28, 2020 at 11:56 AM Andrey Semashev
<[email protected]> wrote:
>
> On 2020-05-28 20:25, Luiz Augusto von Dentz wrote:
> > From: Luiz Augusto von Dentz <[email protected]>
> >
> > 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);
> >
>
> The result is still the same with this patch - MTW2 reboots after
> GetPlayStatus.

Looks like the test was wrong, Ive send a v3 fixing that.

--
Luiz Augusto von Dentz