Skip to contentSkip to conversation

avrcp: Fix always requesting player settings for category 1

PATCH Superseded Luiz Augusto von Dentz 2 participants 4 messages May 28, 2020 Bluetooth drivers

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH v2 1/2 avrcp: Fix always requesting player settings for category 1

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

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(-)
profiles/audio/avrcp.c +2 -1
index 773ccdb60..75811bf98 100644
@@ -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)))
Signature · 1 line
2.25.3
author maintainer
#1 lore raw

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(+)
profiles/audio/avrcp.c +4 -0
index 75811bf98..d46ac0ab7 100644
@@ -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);
Signature · 1 line
2.25.3
#2 lore raw

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

Quoted 14 lines · Luiz Augusto von Dentz

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(+)
profiles/audio/avrcp.c +0 -0
index 75811bf98..d46ac0ab7 100644

profiles/audio/avrcp.c static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code, · line 3823

Quoted 10 lines
profiles/audio/avrcp.c +4 -0
@@ -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.

author maintainer
#3 lore raw

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

Hi Andrey,

Quoted 18 lines · Andrey Semashev
Quoted 16 lines · Luiz Augusto von Dentz

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(+)
profiles/audio/avrcp.c +0 -0
index 75811bf98..d46ac0ab7 100644
@@ -3814,6 +3814,10 @@ static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code,
      if (!session->controller || !session->controller->player)
              return FALSE;
 
Quoted 11 lines

profiles/audio/avrcp.c static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code, · line 3823

Quoted 8 lines
profiles/audio/avrcp.c +4 -0
+     /* 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.

Signature · 1 line
Luiz Augusto von Dentz