[pulseaudio-discuss] [PATCH] bluetooth: set better priorities for profiles
Tanu Kaskinen
tanuk at iki.fi
Sun Oct 15 10:29:42 UTC 2017
Since HSP had higher priority than A2DP, the default profile when
connecting a new headset was HSP. To me it makes more sense to default
to high-quality output. We already have some automatic policies to
switch to HSP when it's needed.
I also made the A2DP source and HSP/HFP gateway profiles have lower
priority than the A2DP sink and HSP headset profiles. The A2DP source
and HSP/HFP gateway profiles should only be activated if the remote
device initiates audio streaming, so it makes sense to have lower
priority for those profiles.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=103058
---
src/modules/bluetooth/module-bluez5-device.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c
index 8a9063932..fb9914727 100644
--- a/src/modules/bluetooth/module-bluez5-device.c
+++ b/src/modules/bluetooth/module-bluez5-device.c
@@ -1861,7 +1861,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, pa_bluetooth_pro
switch (profile) {
case PA_BLUETOOTH_PROFILE_A2DP_SINK:
cp = pa_card_profile_new(name, _("High Fidelity Playback (A2DP Sink)"), sizeof(pa_bluetooth_profile_t));
- cp->priority = 10;
+ cp->priority = 40;
cp->n_sinks = 1;
cp->n_sources = 0;
cp->max_sink_channels = 2;
@@ -1873,7 +1873,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, pa_bluetooth_pro
case PA_BLUETOOTH_PROFILE_A2DP_SOURCE:
cp = pa_card_profile_new(name, _("High Fidelity Capture (A2DP Source)"), sizeof(pa_bluetooth_profile_t));
- cp->priority = 10;
+ cp->priority = 20;
cp->n_sinks = 0;
cp->n_sources = 1;
cp->max_sink_channels = 0;
@@ -1885,7 +1885,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, pa_bluetooth_pro
case PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT:
cp = pa_card_profile_new(name, _("Headset Head Unit (HSP/HFP)"), sizeof(pa_bluetooth_profile_t));
- cp->priority = 20;
+ cp->priority = 30;
cp->n_sinks = 1;
cp->n_sources = 1;
cp->max_sink_channels = 1;
@@ -1898,7 +1898,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, pa_bluetooth_pro
case PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY:
cp = pa_card_profile_new(name, _("Headset Audio Gateway (HSP/HFP)"), sizeof(pa_bluetooth_profile_t));
- cp->priority = 20;
+ cp->priority = 10;
cp->n_sinks = 1;
cp->n_sources = 1;
cp->max_sink_channels = 1;
--
2.14.2
More information about the pulseaudio-discuss
mailing list