* [PATCH v1] device: Initialize device volume with a valid value
@ 2026-01-22 6:36 Jinwang Li
2026-01-22 7:50 ` [v1] " bluez.test.bot
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Jinwang Li @ 2026-01-22 6:36 UTC (permalink / raw)
To: linux-bluetooth
Cc: cheng.jiang, quic_chezhou, wei.deng, shuai.zhang, mengshi.wu,
jinwang.li
When AVRCP is connected earlier than AVDTP, this invalid device volume
causes the A2DP sink to reject the peer's registration for the
EVENT_VOLUME_CHANGED notification. As a result, subsequent attempts to
set the volume fail.
Fixes: fa7828bddd21 ("transport: Fix not being able to initialize volume properly")
Signed-off-by: Jinwang Li <jinwang.li@oss.qualcomm.com>
---
src/device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/device.c b/src/device.c
index af8df5f29..cd0b8802e 100644
--- a/src/device.c
+++ b/src/device.c
@@ -4948,7 +4948,7 @@ static struct btd_device *device_new(struct btd_adapter *adapter,
return NULL;
device->tx_power = 127;
- device->volume = -1;
+ device->volume = 127;
device->wake_id = -1U;
device->db = gatt_db_new();
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* RE: [v1] device: Initialize device volume with a valid value
2026-01-22 6:36 [PATCH v1] device: Initialize device volume with a valid value Jinwang Li
@ 2026-01-22 7:50 ` bluez.test.bot
2026-02-25 9:10 ` [PATCH v1] " Jinwang Li
2026-02-25 14:52 ` Luiz Augusto von Dentz
2 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2026-01-22 7:50 UTC (permalink / raw)
To: linux-bluetooth, jinwang.li
[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1045489
---Test result---
Test Summary:
CheckPatch PENDING 0.37 seconds
GitLint PENDING 0.38 seconds
BuildEll PASS 20.13 seconds
BluezMake PASS 650.70 seconds
MakeCheck PASS 18.79 seconds
MakeDistcheck PASS 244.71 seconds
CheckValgrind PASS 296.47 seconds
CheckSmatch PASS 355.04 seconds
bluezmakeextell PASS 184.47 seconds
IncrementalBuild PENDING 0.33 seconds
ScanBuild PASS 1040.61 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] device: Initialize device volume with a valid value
2026-01-22 6:36 [PATCH v1] device: Initialize device volume with a valid value Jinwang Li
2026-01-22 7:50 ` [v1] " bluez.test.bot
@ 2026-02-25 9:10 ` Jinwang Li
2026-02-25 14:52 ` Luiz Augusto von Dentz
2 siblings, 0 replies; 5+ messages in thread
From: Jinwang Li @ 2026-02-25 9:10 UTC (permalink / raw)
To: linux-bluetooth
Cc: cheng.jiang, quic_chezhou, wei.deng, shuai.zhang, mengshi.wu
On 1/22/2026 2:36 PM, Jinwang Li wrote:
> When AVRCP is connected earlier than AVDTP, this invalid device volume
> causes the A2DP sink to reject the peer's registration for the
> EVENT_VOLUME_CHANGED notification. As a result, subsequent attempts to
> set the volume fail.
>
> Fixes: fa7828bddd21 ("transport: Fix not being able to initialize volume properly")
> Signed-off-by: Jinwang Li <jinwang.li@oss.qualcomm.com>
> ---
> src/device.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/device.c b/src/device.c
> index af8df5f29..cd0b8802e 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -4948,7 +4948,7 @@ static struct btd_device *device_new(struct btd_adapter *adapter,
> return NULL;
>
> device->tx_power = 127;
> - device->volume = -1;
> + device->volume = 127;
> device->wake_id = -1U;
>
> device->db = gatt_db_new();
Hi maintainers,
Do you have any comments on this change?
--
with best wishes
Jinwang
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v1] device: Initialize device volume with a valid value
2026-01-22 6:36 [PATCH v1] device: Initialize device volume with a valid value Jinwang Li
2026-01-22 7:50 ` [v1] " bluez.test.bot
2026-02-25 9:10 ` [PATCH v1] " Jinwang Li
@ 2026-02-25 14:52 ` Luiz Augusto von Dentz
2026-03-05 8:41 ` Jinwang Li
2 siblings, 1 reply; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2026-02-25 14:52 UTC (permalink / raw)
To: Jinwang Li
Cc: linux-bluetooth, cheng.jiang, quic_chezhou, wei.deng, shuai.zhang,
mengshi.wu
Hi Jinwang,
On Thu, Jan 22, 2026 at 1:44 AM Jinwang Li <jinwang.li@oss.qualcomm.com> wrote:
>
> When AVRCP is connected earlier than AVDTP, this invalid device volume
> causes the A2DP sink to reject the peer's registration for the
> EVENT_VOLUME_CHANGED notification. As a result, subsequent attempts to
> set the volume fail.
>
> Fixes: fa7828bddd21 ("transport: Fix not being able to initialize volume properly")
> Signed-off-by: Jinwang Li <jinwang.li@oss.qualcomm.com>
> ---
> src/device.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/device.c b/src/device.c
> index af8df5f29..cd0b8802e 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -4948,7 +4948,7 @@ static struct btd_device *device_new(struct btd_adapter *adapter,
> return NULL;
>
> device->tx_power = 127;
> - device->volume = -1;
> + device->volume = 127;
This represents the volume of the remote end. Why would we initialize
with max volume if we don't know its volume? I guess this depends on
the role though since transport_a2dp_src_init and
transport_a2dp_snk_init do initialize the volume with -1 and 127
respectively, so as a sink perhaps it would be correct to initialize
with max volume so we may need to replicate the same behavior.
> device->wake_id = -1U;
>
> device->db = gatt_db_new();
> --
> 2.34.1
>
>
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v1] device: Initialize device volume with a valid value
2026-02-25 14:52 ` Luiz Augusto von Dentz
@ 2026-03-05 8:41 ` Jinwang Li
0 siblings, 0 replies; 5+ messages in thread
From: Jinwang Li @ 2026-03-05 8:41 UTC (permalink / raw)
To: Luiz Augusto von Dentz
Cc: linux-bluetooth, cheng.jiang, quic_chezhou, wei.deng, shuai.zhang,
mengshi.wu
Hi Luiz,
On 2/25/2026 10:52 PM, Luiz Augusto von Dentz wrote:
> Hi Jinwang,
>
> On Thu, Jan 22, 2026 at 1:44 AM Jinwang Li <jinwang.li@oss.qualcomm.com> wrote:
>>
>> When AVRCP is connected earlier than AVDTP, this invalid device volume
>> causes the A2DP sink to reject the peer's registration for the
>> EVENT_VOLUME_CHANGED notification. As a result, subsequent attempts to
>> set the volume fail.
>>
>> Fixes: fa7828bddd21 ("transport: Fix not being able to initialize volume properly")
>> Signed-off-by: Jinwang Li <jinwang.li@oss.qualcomm.com>
>> ---
>> src/device.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/device.c b/src/device.c
>> index af8df5f29..cd0b8802e 100644
>> --- a/src/device.c
>> +++ b/src/device.c
>> @@ -4948,7 +4948,7 @@ static struct btd_device *device_new(struct btd_adapter *adapter,
>> return NULL;
>>
>> device->tx_power = 127;
>> - device->volume = -1;
>> + device->volume = 127;
>
> This represents the volume of the remote end. Why would we initialize
> with max volume if we don't know its volume? I guess this depends on
> the role though since transport_a2dp_src_init and
> transport_a2dp_snk_init do initialize the volume with -1 and 127
> respectively, so as a sink perhaps it would be correct to initialize
> with max volume so we may need to replicate the same behavior.
>
>> device->wake_id = -1U;
>>
>> device->db = gatt_db_new();
>> --
>> 2.34.1
>>
>>
>
>
When AVRCP is established before A2DP, the role is not yet known, so it
is unclear which volume should be used. However, rejecting the Volume
Changed RegisterNotification prevents any later volume synchronization.
Returning a valid volume from media_transport_get_a2dp_volume() when
there is no A2DP transport and the device volume is -1 seems reasonable.
Would using the maximum volume make sense?
I have updated the change to
"[PATCH v2] transport: Fix set volume failure with invalid device volume".
Thanks,
Jinwang
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-03-05 8:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-22 6:36 [PATCH v1] device: Initialize device volume with a valid value Jinwang Li
2026-01-22 7:50 ` [v1] " bluez.test.bot
2026-02-25 9:10 ` [PATCH v1] " Jinwang Li
2026-02-25 14:52 ` Luiz Augusto von Dentz
2026-03-05 8:41 ` Jinwang Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox