Commit graph

67 commits

Author SHA1 Message Date
João Paulo Rechi Vita
32bd68bc31 bluetooth: Remove leftover references to the BlueZ 4/5 split
There is no need to mention a module argument is valid only when using
BlueZ 5 now that we don't support BlueZ 4 anymore.
2018-07-27 11:28:11 +03:00
Luiz Augusto von Dentz
3b1093c0ad bluetooth: Remove BlueZ 4 support
BlueZ 4 is no longer supported by BlueZ community for a long long time,
also by moving to BlueZ 5 it should make it even more clearer that
BlueZ 4 is no longer an option.
2018-06-21 06:24:36 +05:30
Arun Raghavan
d9624e0382 build-sys: Stop using symdef headers for modules
This removes the symdef header generation m4 magic in favour of a
simpler macro method, allowing us to skip one unnecessary build step
while moving to meson, and removing an 11 year old todo!
2017-12-12 12:58:52 +05:30
Colin Leroy
f0dfddead3 cli-command: don't exit on "module already loaded" errors
Some modules may only be loaded once, and trying to load them
twice from default.pa makes PulseAudio startup fail. While that could
be considered a user error, it's nicer to not be so strict. It's not
necessarily easy to figure what went wrong, if for example the user
plays with RAOP and adds module-raop-discover to default.pa, which first
works fine, but suddenly stops working when the user at some point
enables RAOP support in paprefs. Enabling RAOP in paprefs makes
module-gconf load the module too, so the module gets loaded twice.

This patch adds a way to differentiate module load errors, and
make cli-command ignore the error when the module is already
loaded.
2017-09-05 13:46:27 +03:00
Georg Chini
1c80af147d bluetooth: Make use of getsockopt() to determine MTU configurable
A recent patch changed the MTU size from the default value of 48 to the value
returned by getsockopt(). This breaks HSP for some setups. To circumvent the
problem, this patch introduces a boolean parameter "autodetect_mtu" for
module-bluetooth-discover, module-bluez5-discover and module-bluez5-device to
make this use of getsockopt() configurable.
2017-02-14 11:48:10 +02:00
Ondrej Holecek
5effc83479 update FSF addresses to FSF web page
FSF addresses used in PA sources are no longer valid and rpmlint
generates numerous warnings during packaging because of this.
This patch changes all FSF addresses to FSF web page according to
the GPL how-to: https://www.gnu.org/licenses/gpl-howto.en.html

Done automatically by sed-ing through sources.
2015-01-14 22:20:40 +02:00
David Henningsson
9ae85b1a29 bluetooth: Select headset backend through module argument
This patch adds a module argument "headset=ofono|native|auto" to
module-bluetooth-discover and module-bluez5-discover.

To make Arun's happy, the default is 'native' if compiled in, otherwise
'ofono'. 'Auto' will try to autoswitch depending on whether ofono is
running or not.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-11-14 11:44:33 +01:00
João Paulo Rechi Vita
9490a067bb bluetooth: Track discovery modules by index
Previously module-bluez5-discover and module-bluez4-discover were being
tracked using their pa_module pointer. But during daemon shutdown these
modules are unloaded before module-bluetooth-discover, leaving stale
pointers in module-bluetooth-discover's userdata. To avoid this problem
this commit makes module-bluetooth-discover keep track of
module-bluez5-discover and module-bluez4-discovery by their indexes.
2013-10-15 10:42:25 +03:00
João Paulo Rechi Vita
8753b8c147 bluetooth: Revive module-bluetooth-discover
Create a wrapper module called module-bluetooth-discover to avoid
breaking backward-compatibility of default.pa. This wrapper may
eventually be dropped altoghether with BlueZ 4 support.
2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
e414b5828b bluetooth: Rename bluetooth modules to BlueZ 4 2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
0589bed305 bluetooth: Update modules description and copyright
The current set of bluetooth modules only support up to BlueZ 4. Since
the BlueZ API when through a big change with the release of BlueZ 5 the
modules will be forked into a new set for BlueZ 5.

This commit also fixes the spelling of Bluetooth (it's a trademark which
should always be spelled with capital B) and the spelling of my name,
and also update the copyright note dates throughout the Bluetooth
modules.
2013-09-29 16:54:36 +03:00
Arun Raghavan
6825df8cec hashmap: Add the ability to free keys
Since the hashmap stores a pointer to the key provided at pa_hashmap_put()
time, it make sense to allow the hashmap to be given ownership of the key and
have it free it at pa_hashmap_remove/free time.

To do this cleanly, we now provide the key and value free functions at hashmap
creation time with a pa_hashmap_new_full. With this, we do away with the free
function that was provided at remove/free time for freeing the value.
2013-09-17 18:01:22 +05:30
Tanu Kaskinen
8872c238ba hashmap: Use pa_free_cb_t instead of pa_free2_cb_t
The previous patch removed module-gconf's dependency on the userdata
pointer of the free callback, and that was the only place where the
userdata pointer of pa_free2_cb_t was used, so now there's no need for
pa_free2_cb_t in pa_hashmap_free(). Using pa_free_cb_t instead allows
removing a significant amount of repetitive code.
2013-02-16 01:12:21 +02:00
Mikel Astiz
93e19c884b bluetooth: Use stdbool for pa_bool_t
Use lowercase true/false instead of TRUE/FALSE for pa_bool_t.
2013-01-11 21:44:36 +02:00
Tanu Kaskinen
baa62fb615 bluetooth: Remove pa_bluetooth_discovery_sync().
pa_bluetooth_discovery_sync() waited until all pending method calls
had completed. I don't understand what the benefit of that could be,
so I removed the function. We should avoid blocking as much as
possible, and the code that used pa_bluetooth_discovery_sync() didn't
look like it really needed to wait for anything.
2012-12-20 13:01:00 +02:00
Mikel Astiz
e425fd61b8 bluetooth: Extend discovery to support multiple hooks
Add the infrastructure to support several hooks inside
pa_bluetooth_discovery, while using hook names that describe more
accurately their purpose.
2012-12-19 12:31:48 +02:00
Tanu Kaskinen
ebf5f29bb3 bluetooth: Add helper pa_bluetooth_device_any_audio_connected()
The new helper function makes it easier to check whether any audio
profiles are connected. That information is needed by the discovery
module for deciding whether a new device module should be loaded. The
device module should use this information too to unload itself at the
right time, but that's currently not implemented.
2012-11-23 00:04:17 +02:00
Tanu Kaskinen
6545cc77f4 bluetooth: Ignore Device.Connected
The Device.Connected was only used for tracking whether a device module
should be loaded, but that information is already included in the
individual profile state properties. The property can therefore be
completely ignored without any loss in functionality.
2012-11-22 23:43:06 +02:00
Mikel Astiz
ea45f2c795 bluetooth: Self unload module-bluetooth-device
If the device has been removed, unload the module without depending on
module-bluetooth-discovery.
2012-10-22 18:51:19 +03:00
Tanu Kaskinen
1f1db97b65 bluetooth: Remove commented out code. 2012-09-06 15:59:34 +03:00
Luiz Augusto von Dentz
75df8714d7 bluetooth: Don't force any profile on discovery module
Let device module figure out the priority based on the state of the
profiles.

Note that most likely all profiles will be in PA_BT_AUDIO_STATE_CONNECTED
state so 'Off' will be the initial profile then it is up to the policy
module to switch to the most suitable profile.
2012-09-06 15:59:34 +03:00
Mikel Astiz
00cc8af995 bluetooth: Avoid duplicating profile argument twice
The module module-bluetooth-device should never be given parameter
'profile' twice, even if both HFGW and A2DP are playing. This patch
proposed to consider HFGW first.
2012-07-28 15:55:44 +03:00
Frédéric Dalleau
3f6aa03912 bluetooth: Fix Media Endpoint for HandsfreeGateway
This patch will add the necessary quirks so that pulseaudio can register
an endpoint on the /MediaEndpoint/HFPHS path. This endpoint is to be
used for HFP Handsfree profile.
2011-11-03 00:18:49 +05:30
Maarten Bosmans
dd9265ac78 Remove unnecessary #includes 2011-06-22 23:12:20 +01:00
Tanu Kaskinen
62e43f9181 bluetooth-discover: Remove remaining ifdef NOKIAs.
These were supposed to be removed already in 13849f153, but
at that time I missed the ifdefs in
module-bluetooth-discover.c.
2011-06-22 14:56:32 +01:00
João Paulo Rechi Vita
342e06498f bluetooth: add HFP Gateway support
Create the 'Handsfree Gateway' profile for bluetooth cards and add
filters for 'org.bluez.HandsfreeGateway' to the discover module so
module-bluetooth-device is loaded with the correct profile when a
Handsfree Gateway connects to bluetoothd (in this case bluetoothd
is acting as the headset).
2010-02-21 20:51:08 +01:00
Lennart Poettering
40c1ca76c4 bluetooth: don't set auto_connect flag when discovering bt devices 2009-10-04 13:00:51 +02:00
Lennart Poettering
63f3dc0bdc bluetooth: remove left-over debug line 2009-08-28 17:07:08 +02:00
João Paulo Rechi Vita
2772521698 bluetooth: add discover of bluetooth sources 2009-08-23 22:46:56 -03:00
Lennart Poettering
1390564227 Merge commit 'elmarco/bluetooth-fixes' 2009-03-30 20:34:49 +02:00
Marc-André Lureau
eb93e2537a dbus: split dbus-util into dbus-shared
modules: fix dbus-util include
pulse: get dbus at context connection
2009-03-30 20:56:55 +03:00
Marc-André Lureau
87fcb3d592 bluetooth: use new audio State properties 2009-03-27 22:59:57 +02:00
Marc-André Lureau
62a4e36f5d bluetooth: connected can be -1, check > 0 2009-03-27 20:43:42 +02:00
Lennart Poettering
cbbd98635a make sure the discovery module is only loaded once 2009-03-25 23:49:09 +01:00
Lennart Poettering
5b523d097c fix bad memory access when destroying m-b-d 2009-03-24 21:42:33 +01:00
Lennart Poettering
8d5b375f67 at a couple of #ifdef NOKIAs for now 2009-03-21 01:31:38 +01:00
Lennart Poettering
3aa39726db rework device discovery to share a single device list among all modules 2009-03-21 01:19:49 +01:00
Marc-André Lureau
df3f4eef2d bluetooth: load bluetooth device with connected profile 2009-03-19 17:33:33 +02:00
Colin Guthrie
86dee05aec Use LGPL 2.1 on all files previously using LGPL 2 2009-03-03 20:23:02 +00:00
Lennart Poettering
84666dbc88 properly free modargs object when init fails; don't abbreviate modargs in struct 2009-02-12 04:00:40 +01:00
Lennart Poettering
a371306710 tabs are evil 2009-02-12 03:57:59 +01:00
Marc-André Lureau
c8a240cddd bluetooth: SCO over PCM 2009-02-09 22:14:45 +02:00
Marc-André Lureau
539abc365f bluetooth: typo 2009-02-03 14:19:16 +02:00
Lennart Poettering
55e6331bed store the module index shifted by 1 to map PA_INVALID_INDEX to NULL 2009-02-02 00:25:02 +01:00
Lennart Poettering
a71fa021a3 temporary commit of lennarts new bt changes 2009-01-29 16:27:27 +01:00
Marc-André Lureau
12db687acf bluetooth: cold hsp/a2dp device detection 2009-01-28 01:29:19 +02:00
Marc-André Lureau
a6a1b42c87 bluetooth: hsp volume control 2009-01-28 01:29:19 +02:00
Lennart Poettering
86c6fd85f1 Don't store pointer to pa_module
pa_module pointers might become invalid at any time, so we use the
stable uin32_t index of the module for identifying or modules instead.
2008-12-17 21:19:53 +01:00
Luiz Augusto von Dentz
dcd498c5ad Fix bug walking on module list. 2008-12-17 21:06:46 +01:00
Lennart Poettering
60c2a82462 Merge commit 'vudentz/master' 2008-10-13 19:55:11 +02:00