Skip to contentSkip to conversation

audio/transport: Emit Volume changed if endpoint is source

PATCH New Feryllt Pryderi 1 participant 1 message Mar 31, 2021 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 audio/transport: Emit Volume changed if endpoint is source

Change set_volume to send a Volume PropertyChanged signal also if transport->sink_watch is set (and not only if source_watch is set).

This fixes volume changes signals not being sent for devices like speakers and headphone adapters with volume control (like Bose Soundlink Revolve or Fiio BTR5).
---
 profiles/audio/transport.c | 4 +---

 1 file changed, 1 insertion(+), 3 deletions(-)
profiles/audio/transport.c +0 -0
index 8248014ae..2d6c0201b 100644
@@ -644,7 +644,6 @@ static void set_volume(const GDBusPropertyTable *property,

        struct a2dp_transport *a2dp = transport->data; uint16_t arg;
        int8_t volume;
-       bool notify;

        if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_UINT16) goto error;
@@ -661,8 +660,7 @@ static void set_volume(const GDBusPropertyTable *property,

        a2dp->volume = volume;

-       notify = transport->source_watch ? true : false;
-       if (notify)
+       if (transport->source_watch || transport->sink_watch) g_dbus_emit_property_changed(btd_get_dbus_connection(), transport->path, MEDIA_TRANSPORT_INTERFACE, --
2.31.0