* [PATCH BlueZ] audio/transport: Emit Volume changed if endpoint is source
@ 2021-03-31 11:38 Feryllt Pryderi
2021-03-31 18:33 ` Luiz Augusto von Dentz
0 siblings, 1 reply; 4+ messages in thread
From: Feryllt Pryderi @ 2021-03-31 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: feryllt
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(+)
diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index 8248014ae..26aa237a3 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -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,
--
2.31.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH BlueZ] audio/transport: Emit Volume changed if endpoint is source
2021-03-31 11:38 [PATCH BlueZ] audio/transport: Emit Volume changed if endpoint is source Feryllt Pryderi
@ 2021-03-31 18:33 ` Luiz Augusto von Dentz
2021-03-31 20:03 ` Feryllt Pryderi
0 siblings, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2021-03-31 18:33 UTC (permalink / raw)
To: Feryllt Pryderi; +Cc: linux-bluetooth@vger.kernel.org
Hi Feryllt,
On Wed, Mar 31, 2021 at 4:40 AM Feryllt Pryderi <feryllt@gmail.com> wrote:
>
> 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(+)
>
> diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
> index 8248014ae..26aa237a3 100644
> --- a/profiles/audio/transport.c
> +++ b/profiles/audio/transport.c
> @@ -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)
> if (notify)
> g_dbus_emit_property_changed(btd_get_dbus_connection(),
> transport->path,
> --
> 2.31.0
>
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH BlueZ] audio/transport: Emit Volume changed if endpoint is source
2021-03-31 18:33 ` Luiz Augusto von Dentz
@ 2021-03-31 20:03 ` Feryllt Pryderi
2021-03-31 20:14 ` Luiz Augusto von Dentz
0 siblings, 1 reply; 4+ messages in thread
From: Feryllt Pryderi @ 2021-03-31 20:03 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth@vger.kernel.org
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?
On 3/31/21 8:33 PM, Luiz Augusto von Dentz wrote:
> Hi Feryllt,
>
> On Wed, Mar 31, 2021 at 4:40 AM Feryllt Pryderi <feryllt@gmail.com> wrote:
>> 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(+)
>>
>> diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
>> index 8248014ae..26aa237a3 100644
>> --- a/profiles/audio/transport.c
>> +++ b/profiles/audio/transport.c
>> @@ -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)
>
>> if (notify)
>> g_dbus_emit_property_changed(btd_get_dbus_connection(),
>> transport->path,
>> --
>> 2.31.0
>>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH BlueZ] audio/transport: Emit Volume changed if endpoint is source
2021-03-31 20:03 ` Feryllt Pryderi
@ 2021-03-31 20:14 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2021-03-31 20:14 UTC (permalink / raw)
To: Feryllt Pryderi; +Cc: linux-bluetooth@vger.kernel.org
Hi Feryllt,
On Wed, Mar 31, 2021 at 1:01 PM Feryllt Pryderi <feryllt@gmail.com> wrote:
>
> 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?
> On 3/31/21 8:33 PM, Luiz Augusto von Dentz wrote:
> > Hi Feryllt,
> >
> > On Wed, Mar 31, 2021 at 4:40 AM Feryllt Pryderi <feryllt@gmail.com> wrote:
> >> 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(+)
> >>
> >> diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
> >> index 8248014ae..26aa237a3 100644
> >> --- a/profiles/audio/transport.c
> >> +++ b/profiles/audio/transport.c
> >> @@ -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)
> >
> >> if (notify)
> >> g_dbus_emit_property_changed(btd_get_dbus_connection(),
> >> transport->path,
> >> --
> >> 2.31.0
> >>
> >
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-03-31 20:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-31 11:38 [PATCH BlueZ] audio/transport: Emit Volume changed if endpoint is source Feryllt Pryderi
2021-03-31 18:33 ` Luiz Augusto von Dentz
2021-03-31 20:03 ` Feryllt Pryderi
2021-03-31 20:14 ` Luiz Augusto von Dentz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox