From 47bb2ac98f1fbabb64f89d5250528c8289a3cb43 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 14 Mar 2021 19:04:04 +0000 Subject: [PATCH] Fix for avdtp audio disconnexts --- ...ing-all-seps-when-loading-from-cache.patch | 41 +++++++++++++++++++ bluez.spec | 6 ++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 bluez-avdtp-fix-removing-all-seps-when-loading-from-cache.patch diff --git a/bluez-avdtp-fix-removing-all-seps-when-loading-from-cache.patch b/bluez-avdtp-fix-removing-all-seps-when-loading-from-cache.patch new file mode 100644 index 0000000..c2e3415 --- /dev/null +++ b/bluez-avdtp-fix-removing-all-seps-when-loading-from-cache.patch @@ -0,0 +1,41 @@ +From 28ddec8d6b829e002fa268c07b71e4c564ba9e16 Mon Sep 17 00:00:00 2001 +From: Luiz Augusto von Dentz +Date: Thu, 11 Mar 2021 07:36:07 -0800 +Subject: [PATCH] avdtp: Fix removing all remote SEPs when loading from cache + +If avdtp_discover is called after cache has been loaded it end up +removing all remote SEPs as they have not been discovered yet. + +Fixes: https://github.com/bluez/bluez/issues/102 +--- + profiles/audio/avdtp.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c +index 088ca58b3..1d5871c62 100644 +--- a/profiles/audio/avdtp.c ++++ b/profiles/audio/avdtp.c +@@ -3381,10 +3381,18 @@ int avdtp_discover(struct avdtp *session, avdtp_discover_cb_t cb, + session->discover = g_new0(struct discover_callback, 1); + + if (session->seps) { +- session->discover->cb = cb; +- session->discover->user_data = user_data; +- session->discover->id = g_idle_add(process_discover, session); +- return 0; ++ struct avdtp_remote_sep *sep = session->seps->data; ++ ++ /* Check that SEP have been discovered as it may be loaded from ++ * cache. ++ */ ++ if (sep->discovered) { ++ session->discover->cb = cb; ++ session->discover->user_data = user_data; ++ session->discover->id = g_idle_add(process_discover, ++ session); ++ return 0; ++ } + } + + err = send_request(session, FALSE, NULL, AVDTP_DISCOVER, NULL, 0); + diff --git a/bluez.spec b/bluez.spec index d056c39..2592283 100644 --- a/bluez.spec +++ b/bluez.spec @@ -6,7 +6,7 @@ Name: bluez Version: 5.56 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Bluetooth utilities License: GPLv2+ URL: http://www.bluez.org/ @@ -22,6 +22,7 @@ Patch11: 0002-systemd-Add-PrivateTmp-and-NoNewPrivileges-options.patch Patch12: 0003-systemd-Add-more-filesystem-lockdown.patch Patch13: 0004-systemd-More-lockdown.patch Patch14: 0005-media-rename-local-function-conflicting-with-pause-2.patch +Patch15: bluez-avdtp-fix-removing-all-seps-when-loading-from-cache.patch BuildRequires: dbus-devel >= 1.6 BuildRequires: glib2-devel @@ -314,6 +315,9 @@ install emulator/btvirt ${RPM_BUILD_ROOT}/%{_libexecdir}/bluetooth/ %{_userunitdir}/obex.service %changelog +* Sun Mar 14 2021 Peter Robinson - 5.56-4 +- Fix for avdtp audio disconnexts + * Sun Mar 14 2021 Hans de Goede - 5.56-3 - Drop obsolete udev rule + systemd service to call btattach on BT-HCIs connected via UART from userspace, this is all handled in the kernel now