bluez5: handle BAP volume change events

Handle volume changes initiated by remote also for the BAP profiles.
This commit is contained in:
Pauli Virtanen 2025-12-31 13:39:48 +02:00 committed by Wim Taymans
parent 8a7c71694d
commit f754741d58
2 changed files with 8 additions and 9 deletions

View file

@ -3552,6 +3552,12 @@ static void spa_bt_transport_volume_changed(struct spa_bt_transport *transport)
volume_id = SPA_BT_VOLUME_ID_RX;
else if (transport->profile & SPA_BT_PROFILE_ASHA_SINK)
volume_id = SPA_BT_VOLUME_ID_TX;
else if (transport->profile & SPA_BT_PROFILE_BAP_SINK)
volume_id = SPA_BT_VOLUME_ID_TX;
else if (transport->profile & SPA_BT_PROFILE_BAP_SOURCE)
volume_id = SPA_BT_VOLUME_ID_RX;
else if (transport->profile & SPA_BT_PROFILE_BAP_BROADCAST_SOURCE)
volume_id = SPA_BT_VOLUME_ID_RX;
else
return;

View file

@ -809,17 +809,10 @@ static void dynamic_node_volume_changed(void *data)
SPA_FLAG_CLEAR(id, DYNAMIC_NODE_ID_FLAG);
/* Remote device is the controller */
if (!node->transport || impl->profile != DEVICE_PROFILE_AG
|| !spa_bt_transport_volume_enabled(node->transport))
return;
if (id == 0 || id == 2)
volume_id = SPA_BT_VOLUME_ID_RX;
else if (id == 1)
volume_id = SPA_BT_VOLUME_ID_TX;
else
if (!node->transport || !spa_bt_transport_volume_enabled(node->transport))
return;
volume_id = get_volume_id(id);
t_volume = &node->transport->volumes[volume_id];
if (!t_volume->active)
return;