avrcp: Fix always requesting player settings for category 1
Luiz Augusto von Dentz
maintainerPATCH v3 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
@@ -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
Luiz Augusto von Dentz
maintainerPATCH v3 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
@@ -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 == (1 <<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
Re: [PATCH v3 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
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 == (1 <<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);
This patchset works, MTW2 is able to connect and play audio. Many thanks!
Hi,
Quoted 25 lines · Luiz Augusto von Dentz
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_SETTINGSis enabled.--- profiles/audio/avrcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)profiles/audio/avrcp.c +2
-2@@ -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 ))) --
Quoted 2 lines
2.25.3
Applied.
Signature · 1 line
Luiz Augusto von Dentz
Quoted 27 lines · Luiz Augusto von Dentz
Hi,
Quoted 23 lines · Luiz Augusto von Dentz
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_SETTINGSis enabled.--- profiles/audio/avrcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)profiles/audio/avrcp.c +2
-1@@ -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);
Quoted 7 lines
Quoted 4 lines
profiles/audio/avrcp.c +0
-1if (!(events & (1 <<AVRCP_EVENT_STATUS_CHANGED ))) --2.25.3
Applied.
Thanks. You may want to close https://bugzilla.kernel.org/show_bug.cgi?id=207625.