diff mbox series

[BlueZ,v1,2/2] transport: Print owner information when it exit or release

Message ID 20240117212811.1784326-2-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,v1,1/2] client/player: Add support for printing A2DP codec details | expand

Commit Message

Luiz Augusto von Dentz Jan. 17, 2024, 9:28 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This prints the owner name when it exits/quits/crash or releases a
transport.
---
- Looks like there is a bug/race on codec switch it appears the likes of
  pipewire attempts to call Release in the process which stops the
  acquire/resume:

  bluetoothd[1774429]: profiles/audio/transport.c:transport_set_state() State
  changed /org/bluez/hci0/dev_94_DB_56_F7_F2_88/sep1/fd8: TRANSPORT_G
  bluetoothd[1774429]: profiles/audio/transport.c:media_request_create()
  Request created: method=Acquire id=50
  bluetoothd[1774429]: profiles/audio/transport.c:media_owner_add() Owner
  :1.133105 Request Acquire
  bluetoothd[1774429]: profiles/audio/transport.c:media_transport_set_owner()
  Transport /org/bluez/hci0/dev_94_DB_56_F7_F2_88/sep1/fd8 Owner :1.5
  bluetoothd[1774429]: profiles/audio/transport.c:release() Owner :1.133105
  bluetoothd[1774429]: profiles/audio/transport.c:media_owner_remove() Owner
  :1.133105 Request Acquire

 profiles/audio/transport.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index a4696154aba5..5395985b990f 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -531,6 +531,8 @@  static void media_owner_exit(DBusConnection *connection, void *user_data)
 {
 	struct media_owner *owner = user_data;
 
+	DBG("Owner %s", owner->name);
+
 	owner->watch = 0;
 
 	media_owner_remove(owner);
@@ -742,6 +744,8 @@  static DBusMessage *release(DBusConnection *conn, DBusMessage *msg,
 	if (owner == NULL || g_strcmp0(owner->name, sender) != 0)
 		return btd_error_not_authorized(msg);
 
+	DBG("Owner %s", owner->name);
+
 	if (owner->pending) {
 		const char *member;