public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH] transport: always show A2DP Delay property as sink if DelayReporting
@ 2025-11-05 18:26 Pauli Virtanen
  2025-11-05 20:01 ` [RESEND] " bluez.test.bot
  2025-11-06 23:10 ` [RESEND PATCH] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Pauli Virtanen @ 2025-11-05 18:26 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

The Delay property is currently not shown to sound server unless remote
side has acked delay reporting.  However, when we are A2DP Sink, we
reply to delay report requests with the current value, so the value
logically exists and is active.  This behavior was apparently changed in
commits 05f8bd489fd1 and 5d4efe960fd.

Show Delay value for local A2DP Sink endpoint if it has DelayReporting.

Fixes: https://github.com/bluez/bluez/issues/1541
---
 profiles/audio/media.c     | 5 +++++
 profiles/audio/media.h     | 1 +
 profiles/audio/transport.c | 5 +++++
 3 files changed, 11 insertions(+)

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index deb321e6c..a7a8575f9 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -3488,6 +3488,11 @@ const char *media_endpoint_get_uuid(struct media_endpoint *endpoint)
 	return endpoint->uuid;
 }
 
+bool media_endpoint_get_delay_reporting(struct media_endpoint *endpoint)
+{
+	return endpoint->delay_reporting;
+}
+
 uint8_t media_endpoint_get_codec(struct media_endpoint *endpoint)
 {
 	return endpoint->codec;
diff --git a/profiles/audio/media.h b/profiles/audio/media.h
index d3954abd6..380951f28 100644
--- a/profiles/audio/media.h
+++ b/profiles/audio/media.h
@@ -19,6 +19,7 @@ void media_unregister(struct btd_adapter *btd_adapter);
 
 struct a2dp_sep *media_endpoint_get_sep(struct media_endpoint *endpoint);
 const char *media_endpoint_get_uuid(struct media_endpoint *endpoint);
+bool media_endpoint_get_delay_reporting(struct media_endpoint *endpoint);
 uint8_t media_endpoint_get_codec(struct media_endpoint *endpoint);
 struct btd_adapter *media_endpoint_get_btd_adapter(
 					struct media_endpoint *endpoint);
diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index 08ed699b2..08ca360f4 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -1011,8 +1011,13 @@ static gboolean delay_reporting_exists(const GDBusPropertyTable *property,
 							void *data)
 {
 	struct media_transport *transport = data;
+	struct media_endpoint *endpoint = transport->endpoint;
 	struct avdtp_stream *stream;
 
+	/* Local A2DP sink decides itself if it has delay reporting */
+	if (!strcmp(media_endpoint_get_uuid(endpoint), A2DP_SINK_UUID))
+		return media_endpoint_get_delay_reporting(endpoint);
+
 	stream = media_transport_get_stream(transport);
 	if (stream == NULL)
 		return FALSE;
-- 
2.51.1


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

end of thread, other threads:[~2025-11-06 23:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-05 18:26 [RESEND PATCH] transport: always show A2DP Delay property as sink if DelayReporting Pauli Virtanen
2025-11-05 20:01 ` [RESEND] " bluez.test.bot
2025-11-06 23:10 ` [RESEND PATCH] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox