mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
bluez5: deprioritize audio-gateway if remote is HFP HF + A2DP sink
If remote supports both HFP HF and AG, both may get connected, which occurs with Pipewire<->Pipewire connection. In this case, Pipewire on both sides may pick the audio-gateway profile. To avoid both sides being audio-gateway, if remote is both A2DP sink and HF, use lower priority for the audio-gateway profile. Generally, BlueZ won't connect both A2DP Source and Sink between same devices at the same time, so we use that to determine which side should be the receiver.
This commit is contained in:
parent
5f7afe588c
commit
a9cc3f2813
1 changed files with 11 additions and 1 deletions
|
|
@ -1608,6 +1608,16 @@ static struct spa_pod *build_profile(struct impl *this, struct spa_pod_builder *
|
|||
name = "audio-gateway";
|
||||
desc = _("Audio Gateway (A2DP Source & HSP/HFP AG)");
|
||||
}
|
||||
|
||||
/*
|
||||
* If the remote is A2DP sink and HF, we likely should prioritize being
|
||||
* A2DP sender, not gateway. This can occur in PW<->PW if RFCOMM gets
|
||||
* connected both as AG and HF.
|
||||
*/
|
||||
if ((device->connected_profiles & SPA_BT_PROFILE_A2DP_SINK) &&
|
||||
(device->connected_profiles & SPA_BT_PROFILE_HEADSET_HEAD_UNIT))
|
||||
priority = 15;
|
||||
else
|
||||
priority = 256;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue