From 774ad9fdd96a522f944a1d09fe374f6a88e61807 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sat, 9 Nov 2024 20:40:29 +0200 Subject: [PATCH] transport: fix AVRCP volume in reconfigured transports We no longer reconnect AVRCP session on AVDTP transport reconfiguration. This breaks AVRCP volume after reconfiguration, since there's no volume update event incoming. Fix by keeping track of the latest volume in btd_device volume. It was introduced to track volume changes that arrive when there are no transports/players, but we should track all volume changes otherwise the value can be out of date when we want to use it. Fixes: 469a75ae182a ("sink: Fix transitioning to BTD_SERVICE_STATE_DISCONNECTED on idle") --- profiles/audio/transport.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index 8597313d8..dbebb1ea5 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -2598,10 +2598,9 @@ void media_transport_update_device_volume(struct btd_device *dev, /* Volume is A2DP only */ if (media_endpoint_get_sep(transport->endpoint)) { media_transport_update_volume(transport, volume); - return; + break; } } - /* If transport volume doesn't exists add to device_volume */ btd_device_set_volume(dev, volume); } -- 2.47.3