linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bluez PATCH v1] audio/media - Fix volume sync between media and transport
@ 2020-07-09 16:06 Yu Liu
  2020-07-10 20:35 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 3+ messages in thread
From: Yu Liu @ 2020-07-09 16:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Hsin-Yu Chao, sonnysasaka

From: Hsin-Yu Chao <hychao@chromium.org>

A volume value is cached on the global media player object. And a
check was used to NOT update volume to each transport if this
value doesn't change. That is causing problem at disconnect then
reconnect when the new constructed transport never receive update
about the last used volume value.

Reviewed-by: sonnysasaka@chromium.org
Reviewed-by: hychao@chromium.org

---

Changes in v1:
- Initial change

 profiles/audio/media.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index 993ecb3b3..92e363de9 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -1204,9 +1204,6 @@ static void set_volume(uint8_t volume, struct btd_device *dev, void *user_data)
 	struct media_player *mp = user_data;
 	GSList *l;
 
-	if (mp->volume == volume)
-		return;
-
 	mp->volume = volume;
 
 	for (l = mp->adapter->endpoints; l; l = l->next) {
-- 
2.27.0.383.g050319c2ae-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Bluez PATCH v1] audio/media - Fix volume sync between media and transport
  2020-07-09 16:06 [Bluez PATCH v1] audio/media - Fix volume sync between media and transport Yu Liu
@ 2020-07-10 20:35 ` Luiz Augusto von Dentz
       [not found]   ` <CAHC-ybywfMDxm84GVTxUC3fbC0R2VW=k5sjmN_vo9bXZYNu7hQ@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2020-07-10 20:35 UTC (permalink / raw)
  To: Yu Liu; +Cc: linux-bluetooth, Hsin-Yu Chao, Sonny Sasaka

Hi,

On Thu, Jul 9, 2020 at 9:10 AM Yu Liu <yudiliu@google.com> wrote:
>
> From: Hsin-Yu Chao <hychao@chromium.org>
>
> A volume value is cached on the global media player object. And a
> check was used to NOT update volume to each transport if this
> value doesn't change. That is causing problem at disconnect then
> reconnect when the new constructed transport never receive update
> about the last used volume value.

I think this might be related to the other bug we have where the
transport is created after the fetch of the volume so the volume we
have stored in mp->volume is never updated in the transport, see my
comments on the other patch.

> Reviewed-by: sonnysasaka@chromium.org
> Reviewed-by: hychao@chromium.org
>
> ---
>
> Changes in v1:
> - Initial change
>
>  profiles/audio/media.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/profiles/audio/media.c b/profiles/audio/media.c
> index 993ecb3b3..92e363de9 100644
> --- a/profiles/audio/media.c
> +++ b/profiles/audio/media.c
> @@ -1204,9 +1204,6 @@ static void set_volume(uint8_t volume, struct btd_device *dev, void *user_data)
>         struct media_player *mp = user_data;
>         GSList *l;
>
> -       if (mp->volume == volume)
> -               return;
> -
>         mp->volume = volume;
>
>         for (l = mp->adapter->endpoints; l; l = l->next) {
> --
> 2.27.0.383.g050319c2ae-goog
>


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bluez PATCH v1] audio/media - Fix volume sync between media and transport
       [not found]   ` <CAHC-ybywfMDxm84GVTxUC3fbC0R2VW=k5sjmN_vo9bXZYNu7hQ@mail.gmail.com>
@ 2020-07-10 20:58     ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2020-07-10 20:58 UTC (permalink / raw)
  To: Yu Liu; +Cc: linux-bluetooth, Hsin-Yu Chao, Sonny Sasaka

On Fri, Jul 10, 2020 at 1:48 PM Yu Liu <yudiliu@google.com> wrote:
>
> Sorry, which patch?

From Archie, subject: [Bluez PATCH v1 2/2] audio/transport: store
volume for initialization

> On Fri, Jul 10, 2020 at 1:35 PM Luiz Augusto von Dentz <luiz.dentz@gmail.com> wrote:
>>
>> Hi,
>>
>> On Thu, Jul 9, 2020 at 9:10 AM Yu Liu <yudiliu@google.com> wrote:
>> >
>> > From: Hsin-Yu Chao <hychao@chromium.org>
>> >
>> > A volume value is cached on the global media player object. And a
>> > check was used to NOT update volume to each transport if this
>> > value doesn't change. That is causing problem at disconnect then
>> > reconnect when the new constructed transport never receive update
>> > about the last used volume value.
>>
>> I think this might be related to the other bug we have where the
>> transport is created after the fetch of the volume so the volume we
>> have stored in mp->volume is never updated in the transport, see my
>> comments on the other patch.
>>
>> > Reviewed-by: sonnysasaka@chromium.org
>> > Reviewed-by: hychao@chromium.org
>> >
>> > ---
>> >
>> > Changes in v1:
>> > - Initial change
>> >
>> >  profiles/audio/media.c | 3 ---
>> >  1 file changed, 3 deletions(-)
>> >
>> > diff --git a/profiles/audio/media.c b/profiles/audio/media.c
>> > index 993ecb3b3..92e363de9 100644
>> > --- a/profiles/audio/media.c
>> > +++ b/profiles/audio/media.c
>> > @@ -1204,9 +1204,6 @@ static void set_volume(uint8_t volume, struct btd_device *dev, void *user_data)
>> >         struct media_player *mp = user_data;
>> >         GSList *l;
>> >
>> > -       if (mp->volume == volume)
>> > -               return;
>> > -
>> >         mp->volume = volume;
>> >
>> >         for (l = mp->adapter->endpoints; l; l = l->next) {
>> > --
>> > 2.27.0.383.g050319c2ae-goog
>> >
>>
>>
>> --
>> Luiz Augusto von Dentz



-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-10 20:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09 16:06 [Bluez PATCH v1] audio/media - Fix volume sync between media and transport Yu Liu
2020-07-10 20:35 ` Luiz Augusto von Dentz
     [not found]   ` <CAHC-ybywfMDxm84GVTxUC3fbC0R2VW=k5sjmN_vo9bXZYNu7hQ@mail.gmail.com>
2020-07-10 20:58     ` 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;
as well as URLs for NNTP newsgroup(s).