Linux-Bluetooth Archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] avctp: Remove redundant UUID checks and additions
@ 2024-03-22 14:38 Xiao Yao
  2024-03-22 15:28 ` Luiz Augusto von Dentz
  2024-03-22 16:40 ` [BlueZ] " bluez.test.bot
  0 siblings, 2 replies; 4+ messages in thread
From: Xiao Yao @ 2024-03-22 14:38 UTC (permalink / raw
  To: linux-bluetooth, luiz.dentz; +Cc: Xiao Yao

From: Xiao Yao <xiaoyao@rock-chips.com>

---
 profiles/audio/avctp.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c
index 8ad146df1..6199ee951 100644
--- a/profiles/audio/avctp.c
+++ b/profiles/audio/avctp.c
@@ -1597,12 +1597,6 @@ static void avctp_confirm_cb(GIOChannel *chan, gpointer data)
 	if (session == NULL)
 		return;
 
-	if (btd_device_get_service(device, AVRCP_REMOTE_UUID) == NULL)
-		btd_device_add_uuid(device, AVRCP_REMOTE_UUID);
-
-	if (btd_device_get_service(device, AVRCP_TARGET_UUID) == NULL)
-		btd_device_add_uuid(device, AVRCP_TARGET_UUID);
-
 	switch (psm) {
 	case AVCTP_CONTROL_PSM:
 		avctp_control_confirm(session, chan, device);
-- 
2.34.1


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

* Re: [PATCH BlueZ] avctp: Remove redundant UUID checks and additions
  2024-03-22 14:38 [PATCH BlueZ] avctp: Remove redundant UUID checks and additions Xiao Yao
@ 2024-03-22 15:28 ` Luiz Augusto von Dentz
  2024-03-22 18:06   ` Yao Xiao
  2024-03-22 16:40 ` [BlueZ] " bluez.test.bot
  1 sibling, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2024-03-22 15:28 UTC (permalink / raw
  To: Xiao Yao; +Cc: linux-bluetooth, Xiao Yao

Hi,

On Fri, Mar 22, 2024 at 2:39 PM Xiao Yao <xiaokeqinhealth@126.com> wrote:
>
> From: Xiao Yao <xiaoyao@rock-chips.com>
>
> ---
>  profiles/audio/avctp.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c
> index 8ad146df1..6199ee951 100644
> --- a/profiles/audio/avctp.c
> +++ b/profiles/audio/avctp.c
> @@ -1597,12 +1597,6 @@ static void avctp_confirm_cb(GIOChannel *chan, gpointer data)
>         if (session == NULL)
>                 return;
>
> -       if (btd_device_get_service(device, AVRCP_REMOTE_UUID) == NULL)
> -               btd_device_add_uuid(device, AVRCP_REMOTE_UUID);
> -
> -       if (btd_device_get_service(device, AVRCP_TARGET_UUID) == NULL)
> -               btd_device_add_uuid(device, AVRCP_TARGET_UUID);

Patch description makes no sense to me, this code is adding the UUIDs
of AVCTP if the device over its PSM because at this point perhaps SDP
discovery is not complete.

>         switch (psm) {
>         case AVCTP_CONTROL_PSM:
>                 avctp_control_confirm(session, chan, device);
> --
> 2.34.1
>
>


-- 
Luiz Augusto von Dentz

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

* RE: [BlueZ] avctp: Remove redundant UUID checks and additions
  2024-03-22 14:38 [PATCH BlueZ] avctp: Remove redundant UUID checks and additions Xiao Yao
  2024-03-22 15:28 ` Luiz Augusto von Dentz
@ 2024-03-22 16:40 ` bluez.test.bot
  1 sibling, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2024-03-22 16:40 UTC (permalink / raw
  To: linux-bluetooth, xiaokeqinhealth

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

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=837396

---Test result---

Test Summary:
CheckPatch                    PASS      0.45 seconds
GitLint                       PASS      0.34 seconds
BuildEll                      PASS      26.81 seconds
BluezMake                     PASS      1770.17 seconds
MakeCheck                     PASS      13.18 seconds
MakeDistcheck                 PASS      176.25 seconds
CheckValgrind                 PASS      244.12 seconds
CheckSmatch                   PASS      349.27 seconds
bluezmakeextell               PASS      120.00 seconds
IncrementalBuild              PASS      1522.33 seconds
ScanBuild                     PASS      999.12 seconds



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ] avctp: Remove redundant UUID checks and additions
  2024-03-22 15:28 ` Luiz Augusto von Dentz
@ 2024-03-22 18:06   ` Yao Xiao
  0 siblings, 0 replies; 4+ messages in thread
From: Yao Xiao @ 2024-03-22 18:06 UTC (permalink / raw
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth, Xiao Yao

Hi,

在 2024/3/22 23:28, Luiz Augusto von Dentz 写道:

> Hi,
>
> On Fri, Mar 22, 2024 at 2:39 PM Xiao Yao <xiaokeqinhealth@126.com> wrote:
>> From: Xiao Yao <xiaoyao@rock-chips.com>
>>
>> ---
>>   profiles/audio/avctp.c | 6 ------
>>   1 file changed, 6 deletions(-)
>>
>> diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c
>> index 8ad146df1..6199ee951 100644
>> --- a/profiles/audio/avctp.c
>> +++ b/profiles/audio/avctp.c
>> @@ -1597,12 +1597,6 @@ static void avctp_confirm_cb(GIOChannel *chan, gpointer data)
>>          if (session == NULL)
>>                  return;
>>
>> -       if (btd_device_get_service(device, AVRCP_REMOTE_UUID) == NULL)
>> -               btd_device_add_uuid(device, AVRCP_REMOTE_UUID);
>> -
>> -       if (btd_device_get_service(device, AVRCP_TARGET_UUID) == NULL)
>> -               btd_device_add_uuid(device, AVRCP_TARGET_UUID);
> Patch description makes no sense to me, this code is adding the UUIDs
> of AVCTP if the device over its PSM because at this point perhaps SDP
> discovery is not complete.
In the scenario encountered, the SDP service discovery has already
been completed, with the SDP record only containing AVRCP_REMOTE_UUID.
At this point, the device is added support for AVRCP_TARGET_UUID,
which leads to the following code being executed:
   controller_init(session);
     //avrcp.c:controller_init() 0x55bcdbd690 version 0x0000
     session->controller = controller;
However, avrcp_set_volume relies on session->controller, erroneously
issuing the AVRCP_SET_ABSOLUTE_VOLUME command.

Perhaps add a check to verify that SDP discovery has completed before
adding the UUID?

Additionally, there is another concern: is it appropriate to add support
for both AVRCP_REMOTE_UUID and AVRCP_TARGET_UUID before the completion
of SDP? if one of the UUIDs is not supported,how should it be handled?

>
>>          switch (psm) {
>>          case AVCTP_CONTROL_PSM:
>>                  avctp_control_confirm(session, chan, device);
>> --
>> 2.34.1
>>
>>
>


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

end of thread, other threads:[~2024-03-22 18:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-22 14:38 [PATCH BlueZ] avctp: Remove redundant UUID checks and additions Xiao Yao
2024-03-22 15:28 ` Luiz Augusto von Dentz
2024-03-22 18:06   ` Yao Xiao
2024-03-22 16:40 ` [BlueZ] " bluez.test.bot

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 read-only IMAP folder(s) and NNTP newsgroup(s).