All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/1] avrcp: Add strict checks for supported events
@ 2024-02-29 16:09 Xiao Yao
  2024-02-29 18:06 ` [BlueZ,1/1] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Xiao Yao @ 2024-02-29 16:09 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Xiao Yao

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

In some resource-limited embedded systems, if the player is not
registered, but the supported event contains the status/track/
settings events that need player support, it will return some
unreasonable values to the peer, which will cause confusion on
the peer device and cause some unknown problems.

In my test scenario, bluez was the role of the source to connect
the bose speaker. bluez could send absolute volume to the bose
speaker, but it could not adjust the volume of bluez. By checking
the btsnoop, we could see that bluez had registered volume change
notification. When I removed the events above, everything worked
fine. I also tested on iPhone/Android and everything worked fine.
---
 profiles/audio/avrcp.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 36ce01a14..34fc23306 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -4152,21 +4152,26 @@ static void target_init(struct avrcp *session)
 
 		init_volume = media_player_get_device_volume(session->dev);
 		media_transport_update_device_volume(session->dev, init_volume);
-	}
 
-	session->supported_events |= (1 << AVRCP_EVENT_STATUS_CHANGED) |
-				(1 << AVRCP_EVENT_TRACK_CHANGED) |
-				(1 << AVRCP_EVENT_TRACK_REACHED_START) |
-				(1 << AVRCP_EVENT_TRACK_REACHED_END) |
-				(1 << AVRCP_EVENT_SETTINGS_CHANGED);
+		/* These events below requires a player */
+		session->supported_events |= (1 << AVRCP_EVENT_STATUS_CHANGED) |
+					(1 << AVRCP_EVENT_TRACK_CHANGED) |
+					(1 << AVRCP_EVENT_TRACK_REACHED_START) |
+					(1 << AVRCP_EVENT_TRACK_REACHED_END) |
+					(1 << AVRCP_EVENT_SETTINGS_CHANGED);
 
-	if (target->version < 0x0104)
-		return;
+		if (target->version < 0x0104)
+			return;
 
-	session->supported_events |=
+		session->supported_events |=
 				(1 << AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED) |
 				(1 << AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED) |
 				(1 << AVRCP_EVENT_VOLUME_CHANGED);
+	} else {
+		if (target->version > 0x0103)
+			session->supported_events =
+					(1 << AVRCP_EVENT_VOLUME_CHANGED);
+	}
 
 	/* Only check capabilities if controller is not supported */
 	if (session->controller == NULL)
-- 
2.34.1


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

* RE: [BlueZ,1/1] avrcp: Add strict checks for supported events
  2024-02-29 16:09 [PATCH BlueZ 1/1] avrcp: Add strict checks for supported events Xiao Yao
@ 2024-02-29 18:06 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2024-02-29 18:06 UTC (permalink / raw)
  To: linux-bluetooth, xiaokeqinhealth

[-- Attachment #1: Type: text/plain, Size: 946 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=831186

---Test result---

Test Summary:
CheckPatch                    PASS      0.45 seconds
GitLint                       PASS      0.31 seconds
BuildEll                      PASS      23.86 seconds
BluezMake                     PASS      714.52 seconds
MakeCheck                     PASS      11.47 seconds
MakeDistcheck                 PASS      162.63 seconds
CheckValgrind                 PASS      227.31 seconds
CheckSmatch                   PASS      329.91 seconds
bluezmakeextell               PASS      106.94 seconds
IncrementalBuild              PASS      671.86 seconds
ScanBuild                     PASS      945.34 seconds



---
Regards,
Linux Bluetooth


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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-29 16:09 [PATCH BlueZ 1/1] avrcp: Add strict checks for supported events Xiao Yao
2024-02-29 18:06 ` [BlueZ,1/1] " bluez.test.bot

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.