Skip to contentSkip to conversation

audio/transport: Emit Volume changed if endpoint is source

PATCH Superseded Feryllt Pryderi 2 participants 4 messages Mar 31, 2021 Bluetooth drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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 | 1 +

 1 file changed, 1 insertion(+)
profiles/audio/transport.c +0 -0
index 8248014ae..26aa237a3 100644
@@ -662,6 +662,7 @@ static void set_volume(const GDBusPropertyTable *property,

     a2dp->volume = volume;

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

Signature · 1 line
2.31.0
#1 lore raw

Hi Feryllt,

Quoted 15 lines · Feryllt Pryderi

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 | 1 +
 1 file changed, 1 insertion(+)
profiles/audio/transport.c +0 -0
index 8248014ae..26aa237a3 100644

profiles/audio/transport.c static void set_volume(const GDBusPropertyTable *property, · line 665

Quoted 4 lines
profiles/audio/transport.c +1 -0
@@ -662,6 +662,7 @@ static void set_volume(const GDBusPropertyTable *property,
     a2dp->volume = volume;
 
     notify = transport->source_watch ? true : false;
+    notify = notify || (transport->sink_watch ? true : false);

Id replace the following like with:

  if (transport->source_watch || transport->sink_watch)
Quoted 6 lines
profiles/audio/transport.c +0 -1
     if (notify)
         g_dbus_emit_property_changed(btd_get_dbus_connection(),
                         transport->path,
--

2.31.0

Signature · 1 line
Luiz Augusto von Dentz
#2 lore raw

Hi Luiz,

sure I can update the patch, but is the if at all needed? Can we have transports without any of source_watch and sink_watch?

Quoted 32 lines · Luiz Augusto von Dentz

Hi Feryllt,

Quoted 14 lines · Feryllt Pryderi

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 | 1 +
 1 file changed, 1 insertion(+)
profiles/audio/transport.c +0 -0
index 8248014ae..26aa237a3 100644

profiles/audio/transport.c static void set_volume(const GDBusPropertyTable *property, · line 665

Quoted 4 lines
profiles/audio/transport.c +1 -0
@@ -662,6 +662,7 @@ static void set_volume(const GDBusPropertyTable *property,
     a2dp->volume = volume;
 
     notify = transport->source_watch ? true : false;
+    notify = notify || (transport->sink_watch ? true : false);

Id replace the following like with:

  if (transport->source_watch || transport->sink_watch)
Quoted 6 lines
profiles/audio/transport.c +0 -1
     if (notify)
         g_dbus_emit_property_changed(btd_get_dbus_connection(),
                         transport->path,
--

2.31.0

#3 lore raw

Hi Feryllt,

Quoted 4 lines · Feryllt Pryderi

Hi Luiz,

sure I can update the patch, but is the if at all needed? Can we have transports without any of source_watch and sink_watch?

Right, I was about to do the change myself but you have a good point, if we will be emitting for both then we should just signal regardless. That said when acting as a source (notify=false) we would be sense the command AVRCP_SET_ABSOLUTE_VOLUME which the remote shall generate an event AVRCP_EVENT_VOLUME_CHANGED which will then generate the signal at media_transport_update_volume, so something is off here, are you really not getting any signal?

Quoted 33 lines · Luiz Augusto von Dentz
Quoted 32 lines

Hi Feryllt,

Quoted 14 lines · Feryllt Pryderi

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 | 1 +
 1 file changed, 1 insertion(+)
profiles/audio/transport.c +0 -0
index 8248014ae..26aa237a3 100644

profiles/audio/transport.c static void set_volume(const GDBusPropertyTable *property, · line 665

Quoted 4 lines
profiles/audio/transport.c +1 -0
@@ -662,6 +662,7 @@ static void set_volume(const GDBusPropertyTable *property,
     a2dp->volume = volume;
 
     notify = transport->source_watch ? true : false;
+    notify = notify || (transport->sink_watch ? true : false);

Id replace the following like with:

  if (transport->source_watch || transport->sink_watch)
Quoted 6 lines
profiles/audio/transport.c +0 -1
     if (notify)
         g_dbus_emit_property_changed(btd_get_dbus_connection(),
                         transport->path,
--

2.31.0

Signature · 1 line
Luiz Augusto von Dentz