public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] transport: fix A2DP Delay values missing from DBus
@ 2025-08-16  8:56 Pauli Virtanen
  2025-08-16 10:27 ` [BlueZ] " bluez.test.bot
  2025-08-18 21:40 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Pauli Virtanen @ 2025-08-16  8:56 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

With headsets, a2dp_transport::session == NULL usually until stream
resumes. During this time, delay_reporting_exists() incorrectly returns
FALSE, because streams corresponding to NULL session cannot be found.
As no further "Delay" property updates will usually arrive, the property
remains missing even though delay reports have been received.

Fix by setting a2dp->session when processing a delay report, if missing.

Log (bluetoothctl):
[NEW] Transport /org/bluez/hci1/dev_XX_XX_XX_XX_XX_XX/sep2/fd1
[CHG] Transport /org/bluez/hci1/dev_XX_XX_XX_XX_XX_XX/sep2/fd1 Delay is nil
---
 profiles/audio/transport.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index 2b9832a76..ab149bcd7 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -2649,6 +2649,9 @@ void media_transport_update_delay(struct media_transport *transport,
 	if (a2dp->delay == delay)
 		return;
 
+	if (a2dp->session == NULL)
+		a2dp->session = a2dp_avdtp_get(transport->device);
+
 	a2dp->delay = delay;
 
 	g_dbus_emit_property_changed(btd_get_dbus_connection(),
-- 
2.50.1


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

end of thread, other threads:[~2025-08-18 21:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-16  8:56 [PATCH BlueZ] transport: fix A2DP Delay values missing from DBus Pauli Virtanen
2025-08-16 10:27 ` [BlueZ] " bluez.test.bot
2025-08-18 21:40 ` [PATCH BlueZ] " 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