summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2018-06-29 14:33:44 +0300
committerTanu Kaskinen <tanuk@iki.fi>2018-07-14 14:57:55 +0300
commitacae6df6514bfded4e3b996e189d0255b746f5a4 (patch)
treec435378f8468b407b4a13c01b7df72886e51db12
parent43e6ef5c7b05d1013a1eb0c05db34a40c367b892 (diff)
downloadpulseaudio-acae6df6514bfded4e3b996e189d0255b746f5a4.tar.gz
switch-on-port-available: ignore bluetooth cards
When the user manually switches the profile of a bluetooth headset from "off" to "a2dp_sink", the port availability changes from "unknown" to "yes", which triggered a recursive profile change in module-switch-on-port-available. Such recursivity isn't (and possibly can't) be handled well (that is, PulseAudio crashed), so let's avoid doing bluetooth profile changes from module-switch-on-port-available (they're useless anyway). Bug link: https://bugs.freedesktop.org/show_bug.cgi?id=107044
-rw-r--r--src/modules/module-switch-on-port-available.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/modules/module-switch-on-port-available.c b/src/modules/module-switch-on-port-available.c
index 8fd3c9e5f..321db361f 100644
--- a/src/modules/module-switch-on-port-available.c
+++ b/src/modules/module-switch-on-port-available.c
@@ -281,6 +281,14 @@ static pa_hook_result_t port_available_hook_callback(pa_core *c, pa_device_port
return PA_HOOK_OK;
}
+ /* Our profile switching logic caused trouble with bluetooth headsets (see
+ * https://bugs.freedesktop.org/show_bug.cgi?id=107044) and
+ * module-bluetooth-policy takes care of automatic profile switching
+ * anyway, so we ignore bluetooth cards in
+ * module-switch-on-port-available. */
+ if (pa_safe_streq(pa_proplist_gets(port->card->proplist, PA_PROP_DEVICE_BUS), "bluetooth"))
+ return PA_HOOK_OK;
+
switch (port->available) {
case PA_AVAILABLE_YES:
switch_to_port(port);