[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] bluetooth: Demote "No such property 'Volume'" error to warning

PulseAudio Marge Bot (@pulseaudio-merge-bot) gitlab at gitlab.freedesktop.org
Mon May 23 15:22:09 UTC 2022



PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio


Commits:
0adb12e0 by Marijn Suijten at 2022-05-23T15:19:44+00:00
bluetooth: Demote "No such property 'Volume'" error to warning

The AVRCP service is known to not be connected before the A2DP transport
is, resulting in PulseAudio asking BlueZ for an initial 'Volume' value
but not getting it because the property doesn't exist.

To prevent end-users from conjecturing this to be the source of whatever
issue they're observing, demote it to a warning.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/707>

- - - - -


1 changed file:

- src/modules/bluetooth/bluez5-util.c


Changes:

=====================================
src/modules/bluetooth/bluez5-util.c
=====================================
@@ -788,6 +788,7 @@ static void get_volume_reply(DBusPendingCall *pending, void *userdata) {
     pa_bluetooth_transport *t;
     uint16_t gain;
     pa_volume_t volume;
+    const char *error_name, *error_message;
 
     pa_assert(pending);
     pa_assert_se(p = userdata);
@@ -796,10 +797,18 @@ static void get_volume_reply(DBusPendingCall *pending, void *userdata) {
     pa_assert_se(r = dbus_pending_call_steal_reply(pending));
 
     if (dbus_message_get_type(r) == DBUS_MESSAGE_TYPE_ERROR) {
-        pa_log_error(DBUS_INTERFACE_PROPERTIES ".Get %s Volume failed: %s: %s",
-                     dbus_message_get_path(p->message),
-                     dbus_message_get_error_name(r),
-                     pa_dbus_get_error_message(r));
+        error_name = dbus_message_get_error_name(r);
+        error_message = pa_dbus_get_error_message(r);
+
+        if (pa_streq(error_name, DBUS_ERROR_INVALID_ARGS) && pa_streq(error_message, "No such property 'Volume'")) {
+            pa_log_warn(DBUS_INTERFACE_PROPERTIES ".Get %s Volume property not (yet) available",
+                        dbus_message_get_path(p->message));
+        } else {
+            pa_log_error(DBUS_INTERFACE_PROPERTIES ".Get %s Volume failed: %s: %s",
+                         dbus_message_get_path(p->message),
+                         error_name,
+                         error_message);
+        }
         goto finish;
     }
     dbus_message_iter_init(r, &iter);



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/0adb12e099fa2fdf4a1753f2c8d729cbb26e928b

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/0adb12e099fa2fdf4a1753f2c8d729cbb26e928b
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20220523/7520ca3d/attachment-0001.htm>


More information about the pulseaudio-commits mailing list