All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] avrcp: Fix always requesting player settings for category 1
@ 2020-05-27 22:43 Luiz Augusto von Dentz
  2020-05-27 22:46 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2020-05-27 22:43 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] 5+ messages in thread

* Re: [PATCH BlueZ] avrcp: Fix always requesting player settings for category 1
  2020-05-27 22:43 [PATCH BlueZ] avrcp: Fix always requesting player settings for category 1 Luiz Augusto von Dentz
@ 2020-05-27 22:46 ` Luiz Augusto von Dentz
  2020-05-28  0:23   ` Andrey Semashev
  2020-05-28  0:23   ` Andrey Semashev
  0 siblings, 2 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2020-05-27 22:46 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Rinaldo Bergamini, Andrey Semashev

On Wed, May 27, 2020 at 3:43 PM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> 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

Please let me know if you are able to test the above patch, it should
fix the problem with Senheisers headsets if the are not setting the
Player Settings bits this would prevent the command to be send so it
doesn't crash.

-- 
Luiz Augusto von Dentz

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

* Re: [PATCH BlueZ] avrcp: Fix always requesting player settings for category 1
  2020-05-27 22:46 ` Luiz Augusto von Dentz
@ 2020-05-28  0:23   ` Andrey Semashev
  2020-05-28 14:31     ` Andrey Semashev
  2020-05-28  0:23   ` Andrey Semashev
  1 sibling, 1 reply; 5+ messages in thread
From: Andrey Semashev @ 2020-05-28  0:23 UTC (permalink / raw)
  To: linux-bluetooth

On 2020-05-28 01:46, Luiz Augusto von Dentz wrote:
> On Wed, May 27, 2020 at 3:43 PM Luiz Augusto von Dentz
> <luiz.dentz@gmail.com> wrote:
>>
>> 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
> 
> Please let me know if you are able to test the above patch, it should
> fix the problem with Senheisers headsets if the are not setting the
> Player Settings bits this would prevent the command to be send so it
> doesn't crash.
> 

I'll try it with Momentum True Wireless 2 tomorrow.

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

* Re: [PATCH BlueZ] avrcp: Fix always requesting player settings for category 1
  2020-05-27 22:46 ` Luiz Augusto von Dentz
  2020-05-28  0:23   ` Andrey Semashev
@ 2020-05-28  0:23   ` Andrey Semashev
  1 sibling, 0 replies; 5+ messages in thread
From: Andrey Semashev @ 2020-05-28  0:23 UTC (permalink / raw)
  To: linux-bluetooth

On 2020-05-28 01:46, Luiz Augusto von Dentz wrote:
> On Wed, May 27, 2020 at 3:43 PM Luiz Augusto von Dentz
> <luiz.dentz@gmail.com> wrote:
>>
>> 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
> 
> Please let me know if you are able to test the above patch, it should
> fix the problem with Senheisers headsets if the are not setting the
> Player Settings bits this would prevent the command to be send so it
> doesn't crash.
> 

I'll try it with Momentum True Wireless 2 tomorrow.

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

* Re: [PATCH BlueZ] avrcp: Fix always requesting player settings for category 1
  2020-05-28  0:23   ` Andrey Semashev
@ 2020-05-28 14:31     ` Andrey Semashev
  0 siblings, 0 replies; 5+ messages in thread
From: Andrey Semashev @ 2020-05-28 14:31 UTC (permalink / raw)
  To: linux-bluetooth

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

On 2020-05-28 03:23, Andrey Semashev wrote:
> On 2020-05-28 01:46, Luiz Augusto von Dentz wrote:
>> On Wed, May 27, 2020 at 3:43 PM Luiz Augusto von Dentz
>> <luiz.dentz@gmail.com> wrote:
>>>
>>> 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
>>
>> Please let me know if you are able to test the above patch, it should
>> fix the problem with Senheisers headsets if the are not setting the
>> Player Settings bits this would prevent the command to be send so it
>> doesn't crash.
>>
> 
> I'll try it with Momentum True Wireless 2 tomorrow.

The headset still reboots while trying to connect, although now it 
reboots after receiving AVRCP GetPlayStatus.

I'm attaching packet dumps in btsnoop and pcap formats.

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

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

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 22:43 [PATCH BlueZ] avrcp: Fix always requesting player settings for category 1 Luiz Augusto von Dentz
2020-05-27 22:46 ` Luiz Augusto von Dentz
2020-05-28  0:23   ` Andrey Semashev
2020-05-28 14:31     ` Andrey Semashev
2020-05-28  0:23   ` Andrey Semashev

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.