diff --git a/SOURCES/0001-bluez5-do-NameHasOwner-before-using-org.bluez.patch b/SOURCES/0001-bluez5-do-NameHasOwner-before-using-org.bluez.patch new file mode 100644 index 0000000..b57733f --- /dev/null +++ b/SOURCES/0001-bluez5-do-NameHasOwner-before-using-org.bluez.patch @@ -0,0 +1,94 @@ +From e50ec0deb7c20d1daa26cc7eab5a1ff75b9f7bf8 Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Wed, 17 Nov 2021 12:28:23 +0100 +Subject: [PATCH] bluez5: do NameHasOwner before using org.bluez + +We should not be using org.bluez when the bluetooth service is not +running or else we might try to activate it. The activation of the +bluetooth service should be done at boot time. +--- + src/modules/bluetooth/bluez5-util.c | 61 ++++++++++++++++++++++++++++- + 1 file changed, 60 insertions(+), 1 deletion(-) + +diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c +index a21896ede..282886e45 100644 +--- a/src/modules/bluetooth/bluez5-util.c ++++ b/src/modules/bluetooth/bluez5-util.c +@@ -1095,6 +1095,65 @@ static void get_managed_objects(pa_bluetooth_discovery *y) { + send_and_add_to_pending(y, m, get_managed_objects_reply, NULL); + } + ++static void check_name_owner_reply(DBusPendingCall *pending, void *userdata) { ++ pa_dbus_pending *p; ++ pa_bluetooth_discovery *y; ++ DBusMessage *r; ++ DBusError err; ++ bool running; ++ ++ pa_assert_se(p = userdata); ++ pa_assert_se(y = p->context_data); ++ pa_assert_se(r = dbus_pending_call_steal_reply(pending)); ++ ++ if (dbus_message_is_error(r, DBUS_ERROR_UNKNOWN_METHOD)) { ++ pa_log_warn("BlueZ D-Bus ObjectManager not available"); ++ goto finish; ++ } ++ ++ if (dbus_message_get_type(r) == DBUS_MESSAGE_TYPE_ERROR) { ++ pa_log_error("NameHasOwner() failed: %s: %s", dbus_message_get_error_name(r), pa_dbus_get_error_message(r)); ++ goto finish; ++ } ++ ++ if (!pa_streq(dbus_message_get_signature(r), "b")) { ++ pa_log_error("Invalid reply signature for NameHasOwner()"); ++ goto finish; ++ } ++ ++ dbus_error_init(&err); ++ if (!dbus_message_get_args(r, &err, DBUS_TYPE_BOOLEAN, &running, DBUS_TYPE_INVALID)) { ++ pa_log_error("Could not check bluetooth service: %s", err.message); ++ dbus_error_free(&err); ++ goto finish; ++ } ++ ++ pa_log_info("bluetooth service running: %s", running ? "yes" : "no"); ++ if (running) ++ get_managed_objects(y); ++ ++finish: ++ dbus_message_unref(r); ++ ++ PA_LLIST_REMOVE(pa_dbus_pending, y->pending, p); ++ pa_dbus_pending_free(p); ++} ++ ++static void check_name_owner(pa_bluetooth_discovery *y) { ++ DBusMessage *m; ++ const char *service = BLUEZ_SERVICE; ++ ++ pa_assert(y); ++ ++ pa_assert_se(m = dbus_message_new_method_call("org.freedesktop.DBus", ++ "/org/freedesktop/DBus", ++ "org.freedesktop.DBus", ++ "NameHasOwner")); ++ dbus_message_append_args(m, DBUS_TYPE_STRING, &service, DBUS_TYPE_INVALID); ++ ++ send_and_add_to_pending(y, m, check_name_owner_reply, NULL); ++} ++ + pa_hook* pa_bluetooth_discovery_hook(pa_bluetooth_discovery *y, pa_bluetooth_hook_t hook) { + pa_assert(y); + pa_assert(PA_REFCNT_VALUE(y) > 0); +@@ -1653,7 +1712,7 @@ pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *c, int headset_backe + pa_xfree(endpoint); + } + +- get_managed_objects(y); ++ check_name_owner(y); + + return y; + +-- +2.36.1 + diff --git a/SPECS/pulseaudio.spec b/SPECS/pulseaudio.spec index eb2ad19..358deb0 100644 --- a/SPECS/pulseaudio.spec +++ b/SPECS/pulseaudio.spec @@ -26,7 +26,7 @@ Name: pulseaudio Summary: Improved Linux Sound Server Version: %{pa_major}%{?pa_minor:.%{pa_minor}} -Release: 3%{?snap:.%{snap}git%{shortcommit}}%{?dist} +Release: 4%{?snap:.%{snap}git%{shortcommit}}%{?dist} License: LGPLv2+ URL: http://www.freedesktop.org/wiki/Software/PulseAudio %if 0%{?gitrel} @@ -51,6 +51,7 @@ Patch206: pulseaudio-11.1-autospawn_disable.patch ## upstream patches Patch301: 0001-alsa-card-add-dynamic-priority-bonus-base-for-alsa-p.patch +Patch302: 0001-bluez5-do-NameHasOwner-before-using-org.bluez.patch BuildRequires: automake libtool BuildRequires: gcc-c++ @@ -242,6 +243,7 @@ This package contains command line utilities for the PulseAudio sound server. %patch206 -p1 -b .autospawn_disable %endif %patch301 -p1 -b .301 +%patch302 -p1 -b .302 sed -i.no_consolekit -e \ 's/^load-module module-console-kit/#load-module module-console-kit/' \ @@ -617,6 +619,10 @@ systemctl --no-reload preset --global pulseaudio.socket >/dev/null 2>&1 || : %{_mandir}/man1/pax11publish.1* %changelog +* Fri Jun 17 2022 Wim Taymans - 14.0-4 +- Add patch to avoid bluez warning. +- Resolves: rhbz#1969944 + * Thu May 12 2022 Wim Taymans - 14.0-3 - Add patch for profile switching - Resolves: rhbz#2052011. rhbz#2073877