transport: Fix set volume failure with invalid device volume
PATCH v3 1/1 transport: Fix set volume failure with invalid device volume
When AVRCP is connected before AVDTP, an invalid device volume causes the target to reject registration for the EVENT_VOLUME_CHANGED notification, which breaks subsequent volume updates.
Fix this by initializing the volume to the maximum value in the AVRCP target init path when it is invalid, allowing the controller to subscribe to AVRCP_EVENT_VOLUME_CHANGED.
--- profiles/audio/avrcp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
Changes from v2:
- Initialize the volume in the AVRCP target init path instead of returning a fallback value from media_transport_get_a2dp_volume().
- Set the volume to the maximum value only when it is still invalid, avoiding role-dependent behavior issues.
- Link to v1
https://lore.kernel.org/all/[email protected]/
Changes from v1:
- Return the max volume from media_transport_get_a2dp_volume() when there is no A2DP transport and the device volume is invalid.
- Restore the default device volume in device_new().
- Update the commit subject name.
- Link to v1
https://lore.kernel.org/all/[email protected]/
profiles/audio/avrcp.c +8 -1
@@ -4296,9 +4296,16 @@ static void target_init(struct avrcp *session)if (target->version <0x0104 )return ; -if (avrcp_volume_supported (target)) +if (avrcp_volume_supported (target)) { session->supported_events |= (1 <<AVRCP_EVENT_VOLUME_CHANGED ); +/* Check if transport volume hasn't been initialized then set it +* to max so it works properly if the controller attempts to +* subscribe to AVRCP_EVENT_VOLUME_CHANGED. +*/ +if (media_transport_get_a2dp_volume (session->dev) <0 ) +media_transport_set_a2dp_volume (session->dev,127 ); + } session->supported_events |= (1 << AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED) |
Signature · 1 line
2.34.1
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=1063601
---Test result---
Test Summary:
CheckPatch PENDING 0.31 seconds GitLint PENDING 0.35 seconds BuildEll PASS 18.10 seconds BluezMake PASS 647.42 seconds MakeCheck PASS 17.80 seconds MakeDistcheck PASS 224.06 seconds CheckValgrind PASS 282.15 seconds CheckSmatch PASS 320.31 seconds bluezmakeextell PASS 170.43 seconds IncrementalBuild PENDING 0.87 seconds ScanBuild PASS 950.75 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
This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Hello:
This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Quoted 9 lines · On Mon, 9 Mar 2026 19:18:26 +0800 you wrote:
When AVRCP is connected before AVDTP, an invalid device volume causes the target to reject registration for the
EVENT_VOLUME_CHANGEDnotification, which breaks subsequent volume updates.Fix this by initializing the volume to the maximum value in the AVRCP target init path when it is invalid, allowing the controller to subscribe to
AVRCP_EVENT_VOLUME_CHANGED.[...]
Here is the summary with links:
- [v3] transport: Fix set volume failure with invalid device volume
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=121e5ca79be5
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html