diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c index 430574429..5fcba90c8 100644 --- a/src/modules/bluetooth/module-bluez5-device.c +++ b/src/modules/bluetooth/module-bluez5-device.c @@ -1341,6 +1341,8 @@ static int setup_transport(struct userdata *u) { return -1; /* We need to fail here until the interactions with module-suspend-on-idle and alike get improved */ } + pa_assert_se(pa_card_set_profile(u->card, pa_hashmap_get(u->card->profiles, pa_bluetooth_profile_to_string(t->profile)), false) >= 0); + return transport_config(u); } @@ -2092,6 +2094,11 @@ static int set_profile_cb(pa_card *c, pa_card_profile *new_profile) { p = *(pa_bluetooth_profile_t *)PA_CARD_PROFILE_DATA(new_profile); + if (p == u->profile) { + pa_log_debug("Profile %s already selected", pa_bluetooth_profile_to_string(p)); + return 0; + } + stop_thread(u); if (p != PA_BLUETOOTH_PROFILE_OFF) {