linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] avrcp: Fix always requesting player settings for category 1
@ 2020-05-28 17:25 Luiz Augusto von Dentz
  2020-05-28 17:25 ` [PATCH v2 2/2] avrcp: Don't attempt to load settings if on volume changed is supported Luiz Augusto von Dentz
  0 siblings, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2020-05-28 17:25 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] avrcp: Don't attempt to load settings if on volume changed is supported
  2020-05-28 17:25 [PATCH v2 1/2] avrcp: Fix always requesting player settings for category 1 Luiz Augusto von Dentz
@ 2020-05-28 17:25 ` Luiz Augusto von Dentz
  2020-05-28 18:53   ` Andrey Semashev
  0 siblings, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2020-05-28 17:25 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] avrcp: Don't attempt to load settings if on volume changed is supported
  2020-05-28 17:25 ` [PATCH v2 2/2] avrcp: Don't attempt to load settings if on volume changed is supported Luiz Augusto von Dentz
@ 2020-05-28 18:53   ` Andrey Semashev
  2020-05-28 22:31     ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Semashev @ 2020-05-28 18:53 UTC (permalink / raw)
  To: linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]

On 2020-05-28 20:25, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> 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.

[-- Attachment #2: mtw2.btsnoop --]
[-- Type: application/octet-stream, Size: 12198 bytes --]

[-- Attachment #3: mtw2.pcapng --]
[-- Type: application/x-pcapng, Size: 15360 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] avrcp: Don't attempt to load settings if on volume changed is supported
  2020-05-28 18:53   ` Andrey Semashev
@ 2020-05-28 22:31     ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2020-05-28 22:31 UTC (permalink / raw)
  To: Andrey Semashev; +Cc: linux-bluetooth

Hi Andrey,

On Thu, May 28, 2020 at 11:56 AM Andrey Semashev
<andrey.semashev@gmail.com> wrote:
>
> On 2020-05-28 20:25, Luiz Augusto von Dentz wrote:
> > From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> >
> > 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-28 22:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28 17:25 [PATCH v2 1/2] avrcp: Fix always requesting player settings for category 1 Luiz Augusto von Dentz
2020-05-28 17:25 ` [PATCH v2 2/2] avrcp: Don't attempt to load settings if on volume changed is supported Luiz Augusto von Dentz
2020-05-28 18:53   ` Andrey Semashev
2020-05-28 22:31     ` Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).