Commit graph

2631 commits

Author SHA1 Message Date
João Paulo Rechi Vita
42dccb6b37 bluetooth: Parse BlueZ 5 adapter properties 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
f1d8958fb6 bluetooth: Parse BlueZ 5 D-Bus interfaces
Parse the arguments of the InterfacesAdded signal and the
GetManagedObjects() reply.

This code is based on previous work by Mikel Astiz.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
878eccb680 bluetooth: Handle InterfacesAdded and InterfacesRemoved
This code is based on previous work by Mikel Astiz.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
1e58120a5c bluetooth: Create a function to remove only one adapter object 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
b8edddddd3 bluetooth: Get managed objects
Get objects from the BlueZ 5 object manager. This code is based on
previous work by Mikel Astiz.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
d186d0f105 bluetooth: Add utility function to send D-Bus messages with reply 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
63108c5cc8 bluetooth: Implement org.bluez.MediaEndpoint1.ClearConfiguration() 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
2594909338 bluetooth: Implement org.bluez.MediaEndpoint1.SelectConfiguration() 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
449d6cb1e2 bluetooth: Implement org.bluez.MediaEndpoint1.SetConfiguration() 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
aff6fa79ba bluetooth: Register MediaEndpoint1 objects with D-Bus 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
e78e7e698c bluetooth: Create pa_bluetooth_transport for BlueZ 5 support
Create the pa_bluetooth_transport structure to store information about
the bluetooth transport and utility functions to manipulate this
structure. The acquire() and release() operations are function pointers
in the pa_bluetooth_transport structure to make possible for different
transport backends to provide different implementations of these
operations. Thre is also a userdata field for the transport backend
provide data for the acquire/release functions.

This commit also creates a new function
pa_bluetooth_device_any_transport_connected() to check if there is any
audio connection between the host and a remote device.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
c3efb24aa7 bluetooth: Remove all devices and adapters when org.bluez goes away 2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
9be71b5838 bluetooth: Create pa_bluetooth_device for BlueZ 5 support
Create a structure pa_bluetooth_device to store information about the
bluetooth device and utility functions to manipulate this structure.
2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
546da17cbe bluetooth: Create pa_bluetooth_adapter for BlueZ 5 support 2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
19a23cef10 bluetooth: Create infrastrucure for bluetooth hooks
Create a pa_bluetooth_hook enum type and API to get pa_hooks from the
opaque pa_bluetooth_discovery struct.
2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
dcc28a23f9 bluetooth: Track org.bluez for BlueZ 5 2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
0103cd1379 bluetooth: Create pa_bluetooth_discovery for BlueZ 5
pa_bluetooth_discovery is the struct that holds information about known
Bluetooth audio devices and other information about the Bluetooth stack.

This commit also creates bluez5-util.[ch], which will hold a lot of
utility functions to help with the BlueZ 5 support.
2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
c706792df7 bluetooth: Create stub for module-bluez5-discover 2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
4f972aa993 bluetooth: Remove module-bluetooth-proximity
module-bluetooth-proximity has not worked for quite a while, since it
uses pre-BlueZ4 APIs. Nobody complained since then, which is a good
indication that it doesn't have much users. Even the original commit
message refers to it more as a toy than as something of great use: "add
new fun module that automatically mutes your audio devices when you
leave with your bluetooth phone, and unmutes when you come back"

Removing it we completely remove the dependency on libbluetooth.
2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
e647e74f32 bluetooth: Prefix BlueZ 4 card profiles enum with PA_BLUEZ4_
Also typedef the enum as pa_bluez4_profile_t.
2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
75922e4667 bluetooth: Register BlueZ 4 endpoints in a separate object path
We need diferent object paths for BlueZ 4 and BlueZ 5 endpoints to avoid
crashing the daemon in the case both modules are loaded in parallel.
2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
0f84fef04d bluetooth: Name BlueZ 4 symbols accordingly
We need diferent symbol prefixing for the current BlueZ 4 support and
the new BlueZ 5 support which is about to enter the codebase, to avoid
symbol clashing and crashing the daemon in the case both modules are
loaded at the same time.

This commit replaces all pa_bluetooth_ and pa_bt_ (for consistency)
prefixes with pa_bluez4_, for both lower-case and upper-case, what was
done with the following sed commands:

 $ sed -i s/pa_bluetooth_/pa_bluez4_/g src/modules/bluetooth/*bluez4*
 $ sed -i s/PA_BLUETOOTH_/PA_BLUEZ4_/g src/modules/bluetooth/*bluez4*
 $ sed -i s/pa_bt_/pa_bluez4_/g src/modules/bluetooth/*bluez4*
 $ sed -i s/PA_BT_/PA_BLUEZ4_/g src/modules/bluetooth/*bluez4*
2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
438094baa4 bluetooth: Rename shared struct to make it BlueZ 4 specific 2013-09-29 16:54:36 +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
João Paulo Rechi Vita
09b6c36944 Revert "bluetooth: Detect BlueZ 5"
This reverts commit 2247b18739.

This is part of the reversion of BlueZ 5 support so it can be added back
in a separate set of modules. This makes the code easier to maintain and
decrease PulseAudio's binary size.
2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
f3fadfa07f Revert "bluetooth: Parse the tree returned by ObjectManager"
This reverts commit c4bd51a345.

This is part of the reversion of BlueZ 5 support so it can be added back
in a separate set of modules. This makes the code easier to maintain and
decrease PulseAudio's binary size.
2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
35ded8dfe5 Revert "bluetooth: Fix error checking style"
This reverts commit d9ed42c40f.

This is part of the reversion of BlueZ 5 support so it can be added back
in a separate set of modules. This makes the code easier to maintain and
decrease PulseAudio's binary size.
2013-09-29 16:54:35 +03:00
João Paulo Rechi Vita
ccace933f2 Revert "bluetooth: BlueZ 5 interface rename to org.bluez.MediaEndpoint1"
This reverts commit d22ea7ff76.

This is part of the reversion of BlueZ 5 support so it can be added back
in a separate set of modules. This makes the code easier to maintain and
decrease PulseAudio's binary size.
2013-09-29 16:54:35 +03:00
João Paulo Rechi Vita
bf46379bb6 Revert "bluetooth: BlueZ 5 interface rename to org.bluez.Media1"
This reverts commit 61e8fd8854.

This is part of the reversion of BlueZ 5 support so it can be added back
in a separate set of modules. This makes the code easier to maintain and
decrease PulseAudio's binary size.
2013-09-29 16:54:35 +03:00
João Paulo Rechi Vita
38cc2ecbe6 Revert "bluetooth: BlueZ 5 interface rename to org.bluez.MediaTransport1"
This reverts commit cfb96b2530.

This is part of the reversion of BlueZ 5 support so it can be added back
in a separate set of modules. This makes the code easier to maintain and
decrease PulseAudio's binary size.
2013-09-29 16:54:35 +03:00
João Paulo Rechi Vita
4f294bcf56 Revert "bluetooth: Support ObjectManager interface add/remove"
This reverts commit 114edb0696.

This is part of the reversion of BlueZ 5 support so it can be added back
in a separate set of modules. This makes the code easier to maintain and
decrease PulseAudio's binary size.
2013-09-29 16:54:35 +03:00
João Paulo Rechi Vita
2edc3581b5 Revert "bluetooth: Support Properties.PropertiesChanged signal"
This reverts commit 235611a7d1.

This is part of the reversion of BlueZ 5 support so it can be added back
in a separate set of modules. This makes the code easier to maintain and
decrease PulseAudio's binary size.
2013-09-29 16:54:35 +03:00
João Paulo Rechi Vita
133f59e86e Revert "bluetooth: Parse media transport's properties"
This reverts commit 2f79fb580a.

This is part of the reversion of BlueZ 5 support so it can be added back
in a separate set of modules. This makes the code easier to maintain and
decrease PulseAudio's binary size.
2013-09-29 16:54:35 +03:00
João Paulo Rechi Vita
93c3f55215 Revert "bluetooth: Support media transport's State property"
This reverts commit 6fdf2b05b8.

This is part of the reversion of BlueZ 5 support so it can be added back
in a separate set of modules. This makes the code easier to maintain and
decrease PulseAudio's binary size.
2013-09-29 16:54:35 +03:00
João Paulo Rechi Vita
44ca651220 Revert "bluetooth: Update to new BlueZ 5 transport acquire/release API"
This reverts commit 9615def4b9.

This is part of the reversion of BlueZ 5 support so it can be added back
in a separate set of modules. This makes the code easier to maintain and
decrease PulseAudio's binary size.
2013-09-29 16:54:35 +03:00
João Paulo Rechi Vita
9882f2d4fd Revert "bluetooth: Support transport auto-release"
This reverts commit 0e4c16e120.

This is part of the reversion of BlueZ 5 support so it can be added back
in a separate set of modules. This makes the code easier to maintain and
decrease PulseAudio's binary size.
2013-09-29 16:54:35 +03:00
David Henningsson
a89ca82e68 alsa: Turn one assertion into two
According to coding style, one should have one assertion per line
and not combine assertions.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-09-23 09:53:41 +02:00
Arun Raghavan
3a3581758f alsa-ucm: Make combination port names deterministic
At the moment, port names combined from multiple devices are generated
based on the order that the devices are specified in config. This makes
programmatic use of thsee ports a bit painful, so let's make them be
combined in alphabetical order.
2013-09-17 18:50:01 +05:30
Arun Raghavan
4d638b5ffd alsa-ucm: Use playback/capture rate specification from UCM
Add new PlaybackRate/CaptureRate values for UCM that can be used to
specify custom rates for devices. This value can either be set on the
verb, which makes it apply to all devices, or on the device to override
the verb setting.
2013-09-17 18:32:48 +05:30
Arun Raghavan
6a6ee8fd22 alsa: Allow sample spec override in mappings
This allows mappings to override some or all of the sample_spec used to
open the ALSA device. The intention, to start with, is to use this for
devices in UCM that need to be opened at a specific rate (like modem
devices). This can be extended to allow overrides in profile-sets as
well.
2013-09-17 18:31:03 +05:30
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
Pierre Ossman
23c39bb540 module-tunnel: automatically find the PulseAudio server
Make the PulseAudio tunnel behave the same way as a client
when it comes to figuring out how to connect to the current
PulseAudio daemon. This can be useful if you start a second
PulseAudio instance for e.g. network access.
2013-09-13 16:44:15 +03:00
Tanu Kaskinen
943275d2fd suspend-on-idle: Allow disabling suspending for specific devices
Sometimes it would be nice to disable module-suspend-on-idle for
specific devices. For me the use case is to keep a HDMI sink running
all the time to avoid loss of audio when starting to play a stream to
the device (the HDMI receiver eats a bit from the beginning of the
stream when the device is opened). This is arguably a hacky solution
to the problem, but on the other hand, I think it's very sensible to
interpret negative timeout in the module-suspend-on-idle.timeout
property as disabling the suspending altogher. This is also how the
exit-idle-time configuration option behaves (negative value disables
automatic exiting).

I moved the property parsing from the timer restart function to the
function that creates the device_info objects, because if the timeout
is negative, we don't need to create the device_info object at all.
2013-09-13 10:53:30 +03:00
Alexander Couzens
8a2ea2834c tunnel-source-new: counterpart to module-tunnel-sink-new
The old tunnel module duplicates functionality that is in libpulse,
due to implementing the native protocol, and the protocol code in
the old tunnel module tends to get broken every now and then, because
people forget to update the tunnel module protocol implementation
when changing the native protocol. module-tunnel-source-new avoids this
problem by using libpulse to communicate with the remote server.
2013-09-13 10:18:15 +03:00
poljar (Damir Jelić)
b8bf331b39 card-restore: Watch for profiles added after card creation.
This patch adds the ability to restore profiles if they are added after
card creation.

Adding profiles after card creation mainly happens for bluetooth cards.

Buglink: https://bugs.freedesktop.org/show_bug.cgi?id=65349
2013-09-08 10:47:50 +03:00
Tanu Kaskinen
441a5a422c sink, source: Fix error reporting style for rate updates 2013-08-27 15:34:33 +03:00
Alexander Couzens
df0a9e12d8 tunnel-sink-new: add a rewrite of module-tunnel using libpulse
The old tunnel module duplicates functionality that is in libpulse,
due to implementing the native protocol, and the protocol code in
the old tunnel module tends to get broken every now and then, because
people forget to update the tunnel module protocol implementation
when changing the native protocol. module-tunnel-sink-new avoids this
problem by using libpulse to communicate with the remote server.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2013-08-21 16:37:38 +03:00
Arun Raghavan
bc7aaff377 alsa: Trivial whitespace deletion 2013-08-08 11:55:13 +05:30
David Henningsson
e6051cdf8d alsa-mixer: Prefer moving "Capture" before moving boosts
Some HD-audio codecs (at least ALC269VB and ALC283) become quite noisy on
high Mic Boost levels. So e g, if there is a "Mic Boost" and a "Capture"
control, both ranging from 0 dB to +30 dB, you get better quality if
"Mic Boost" is 0 dB and "Capture" is +30 dB, than the other way around.

By changing the order in the configuration files, this patch makes us prefer
leaving "Mic Boost" low and "Capture" high if the user selects a medium gain.

(This is based on limited experience, and there is no guarantee that there are
no sound cards that work the other way around, and therefore this patch could
potentially regress quality on those machines. Hopefully those are fewer, so
this is what we should default to.)

BugLink: https://bugs.launchpad.net/1085402
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-08-02 15:17:04 +02:00