diff options
Diffstat (limited to 'src/modules/bluetooth')
-rw-r--r-- | src/modules/bluetooth/bluetooth-util.c | 6 | ||||
-rw-r--r-- | src/modules/bluetooth/bluetooth-util.h | 2 | ||||
-rw-r--r-- | src/modules/bluetooth/ipc.h | 3 | ||||
-rw-r--r-- | src/modules/bluetooth/module-bluetooth-device.c | 25 | ||||
-rw-r--r-- | src/modules/bluetooth/module-bluetooth-discover.c | 2 | ||||
-rw-r--r-- | src/modules/bluetooth/module-bluetooth-proximity.c | 2 |
6 files changed, 23 insertions, 17 deletions
diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c index 7855c2ef..dfd3a306 100644 --- a/src/modules/bluetooth/bluetooth-util.c +++ b/src/modules/bluetooth/bluetooth-util.c @@ -5,7 +5,7 @@ PulseAudio is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2 of the + published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. PulseAudio is distributed in the hope that it will be useful, but @@ -811,8 +811,8 @@ const char*pa_bluetooth_get_form_factor(uint32_t class) { [1] = "headset", [2] = "hands-free", [4] = "microphone", - [5] = "external-speakers", - [6] = "headphones", + [5] = "speaker", + [6] = "headphone", [7] = "portable", [8] = "car", [10] = "hifi" diff --git a/src/modules/bluetooth/bluetooth-util.h b/src/modules/bluetooth/bluetooth-util.h index 2c3ec649..0364c972 100644 --- a/src/modules/bluetooth/bluetooth-util.h +++ b/src/modules/bluetooth/bluetooth-util.h @@ -8,7 +8,7 @@ PulseAudio is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2 of the + published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. PulseAudio is distributed in the hope that it will be useful, but diff --git a/src/modules/bluetooth/ipc.h b/src/modules/bluetooth/ipc.h index 4203150b..f030acfa 100644 --- a/src/modules/bluetooth/ipc.h +++ b/src/modules/bluetooth/ipc.h @@ -160,7 +160,8 @@ struct bt_get_capabilities_req { #define BT_HFP_CODEC_PCM 0x00 -#define BT_PCM_FLAG_NREC 1 +#define BT_PCM_FLAG_NREC 0x01 +#define BT_PCM_FLAG_PCM_ROUTING 0x02 typedef struct { uint8_t transport; diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c index b2fb1db1..495bc82f 100644 --- a/src/modules/bluetooth/module-bluetooth-device.c +++ b/src/modules/bluetooth/module-bluetooth-device.c @@ -5,7 +5,7 @@ PulseAudio is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2 of the + published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. PulseAudio is distributed in the hope that it will be useful, but @@ -921,7 +921,7 @@ static int hsp_process_push(struct userdata *u) { if (l < 0 && errno == EINTR) continue; else { - pa_log_error("Failed to read data from SCO socket: %s", ret < 0 ? pa_cstrerror(errno) : "EOF"); + pa_log_error("Failed to read data from SCO socket: %s", l < 0 ? pa_cstrerror(errno) : "EOF"); ret = -1; break; } @@ -1363,7 +1363,7 @@ static void sco_over_pcm_state_update(struct userdata *u) { if (PA_SINK_IS_OPENED(pa_sink_get_state(u->hsp.sco_sink)) || PA_SOURCE_IS_OPENED(pa_source_get_state(u->hsp.sco_source))) { - if (u->service_fd > 0) + if (u->service_fd >= 0) return; pa_log_debug("Resuming SCO over PCM"); @@ -1372,7 +1372,7 @@ static void sco_over_pcm_state_update(struct userdata *u) { } else { - if (u->service_fd <= 0) + if (u->service_fd < 0) return; pa_log_debug("Closing SCO over PCM"); @@ -1559,6 +1559,7 @@ static int setup_bt(struct userdata *u) { static int init_profile(struct userdata *u) { int r = 0; pa_assert(u); + pa_assert(u->profile != PROFILE_OFF); if (setup_bt(u) < 0) return -1; @@ -1688,7 +1689,9 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) { u->sample_spec = u->requested_sample_spec; init_bt(u); - init_profile(u); + + if (u->profile != PROFILE_OFF) + init_profile(u); if (u->sink || u->source) start_thread(u); @@ -1728,7 +1731,7 @@ static int add_card(struct userdata *u, const char * default_profile) { pa_proplist_sets(data.proplist, PA_PROP_DEVICE_STRING, u->device->address); pa_proplist_sets(data.proplist, PA_PROP_DEVICE_API, "bluez"); pa_proplist_sets(data.proplist, PA_PROP_DEVICE_CLASS, "sound"); - pa_proplist_sets(data.proplist, PA_PROP_DEVICE_CONNECTOR, "bluetooth"); + pa_proplist_sets(data.proplist, PA_PROP_DEVICE_BUS, "bluetooth"); if ((ff = pa_bluetooth_get_form_factor(u->device->class))) pa_proplist_sets(data.proplist, PA_PROP_DEVICE_FORM_FACTOR, ff); pa_proplist_sets(data.proplist, "bluez.path", u->device->path); @@ -1909,8 +1912,9 @@ int pa__init(pa_module* m) { if (init_bt(u) < 0) goto fail; - if (init_profile(u) < 0) - goto fail; + if (u->profile != PROFILE_OFF) + if (init_profile(u) < 0) + goto fail; /* if (u->path) { */ /* DBusError err; */ @@ -1948,8 +1952,9 @@ int pa__init(pa_module* m) { /* } */ /* } */ - if (start_thread(u) < 0) - goto fail; + if (u->sink || u->source) + if (start_thread(u) < 0) + goto fail; return 0; diff --git a/src/modules/bluetooth/module-bluetooth-discover.c b/src/modules/bluetooth/module-bluetooth-discover.c index e9740749..521a9127 100644 --- a/src/modules/bluetooth/module-bluetooth-discover.c +++ b/src/modules/bluetooth/module-bluetooth-discover.c @@ -5,7 +5,7 @@ PulseAudio is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2 of the + published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. PulseAudio is distributed in the hope that it will be useful, but diff --git a/src/modules/bluetooth/module-bluetooth-proximity.c b/src/modules/bluetooth/module-bluetooth-proximity.c index f30d39fe..a3b525ee 100644 --- a/src/modules/bluetooth/module-bluetooth-proximity.c +++ b/src/modules/bluetooth/module-bluetooth-proximity.c @@ -5,7 +5,7 @@ PulseAudio is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2 of the License, + by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. PulseAudio is distributed in the hope that it will be useful, but |