mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
bluez5: if Acquire results to NoReply, try to clean up with Release
If BlueZ doesn't reply, it may consider the operation still active. Try to Release the transport to get to a known state. This can happen if device doesn't respond to operations in reasonable time and BlueZ doesn't have its own timeout which is the case for BAP currently (which is a bug there).
This commit is contained in:
parent
126d61db1b
commit
8bf8600e59
1 changed files with 15 additions and 0 deletions
|
|
@ -3868,6 +3868,21 @@ static void transport_acquire_reply(DBusPendingCall *pending, void *user_data)
|
|||
spa_log_error(monitor->log, "Acquire %s returned error: %s",
|
||||
transport->path,
|
||||
dbus_message_get_error_name(r));
|
||||
|
||||
/* If no reply, BlueZ may consider operation still active, so release to
|
||||
* try to get to a known state.
|
||||
*/
|
||||
if (spa_streq(dbus_message_get_error_name(r), DBUS_ERROR_NO_REPLY)) {
|
||||
spa_autoptr(DBusMessage) m = NULL;
|
||||
|
||||
spa_log_info(monitor->log, "Releasing transport %s (clean up NoReply)",
|
||||
transport->path);
|
||||
m = dbus_message_new_method_call(BLUEZ_SERVICE, transport->path,
|
||||
BLUEZ_MEDIA_TRANSPORT_INTERFACE, "Release");
|
||||
if (m)
|
||||
dbus_connection_send(monitor->conn, m, NULL);
|
||||
}
|
||||
|
||||
ret = -EIO;
|
||||
goto finish;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue