Re: [PATCH BlueZ] avctp: Remove redundant UUID checks and additions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

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

Hi,

On Fri, Mar 22, 2024 at 2:39 PM Xiao Yao <xiaokeqinhealth@xxxxxxx> wrote:
From: Xiao Yao <xiaoyao@xxxxxxxxxxxxxx>

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








[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux