João Paulo Rechi Vita [Tue, 24 Sep 2013 22:45:41 +0000 (19:45 -0300)]
bluetooth: Get BlueZ 5 device object
Get the remote device information stored in pa_bluetooth_discovery. This
also creates the mandatory parameter 'path' for module-bluez5-device,
which is used to inform the object path of the remote device in BlueZ on
the module load.
João Paulo Rechi Vita [Tue, 24 Sep 2013 22:45:36 +0000 (19:45 -0300)]
bluetooth: Protect from a misbehaving bluetoothd
bluetoothd always send the GetManagedObjects() reply messages with the
objects array argument following an in-depth order starting from the
root. That means parents will always be known at the time their children
objects are parsed, if clients parse the objects in the same order they
appear in the array, as we do in PulseAudio.
This commit tries to protect PulseAudio in the case bluetoothd changes
that behavior for some reason. It hasn't been tested, since this
situation never occurs.
João Paulo Rechi Vita [Tue, 24 Sep 2013 22:45:22 +0000 (19:45 -0300)]
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.
João Paulo Rechi Vita [Fri, 16 Aug 2013 12:30:41 +0000 (09:30 -0300)]
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.
João Paulo Rechi Vita [Tue, 13 Aug 2013 04:53:54 +0000 (01:53 -0300)]
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*
João Paulo Rechi Vita [Tue, 13 Aug 2013 04:53:51 +0000 (01:53 -0300)]
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
resampler: Revert to auto if the rates are equal and copy is chosen
This patch fixes a small mistake where we actually log that we are
reverting to the auto resampler if we can't use the 'copy' resampler but
never do the revert.
This would lead to a crash if the user chooses the 'copy' resampler and
then tries to play something that needs to be resampled.
build-sys: Silence warning about missing AC_LANG_SOURCE call in acx_libwrap.m4
This updates the acx_libwrap.m4 macro for autoconf 2.68 and fixes
warnings like:
configure.ac:471: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
Arun Raghavan [Wed, 21 Aug 2013 09:28:06 +0000 (14:58 +0530)]
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.
Arun Raghavan [Wed, 7 Aug 2013 17:26:58 +0000 (22:56 +0530)]
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.
Arun Raghavan [Wed, 7 Aug 2013 12:56:26 +0000 (18:26 +0530)]
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.
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.
Pierre Ossman [Thu, 11 Jul 2013 11:57:41 +0000 (13:57 +0200)]
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.
Tanu Kaskinen [Thu, 29 Aug 2013 14:36:53 +0000 (17:36 +0300)]
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.
Alexander Couzens [Thu, 12 Sep 2013 12:01:51 +0000 (14:01 +0200)]
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.
Tanu Kaskinen [Wed, 28 Aug 2013 11:11:54 +0000 (14:11 +0300)]
resampler: Never return zero for max block size
With very low input sample rates the memory pool max block size may
not be big enough, in which case we should return the size of one
frame. Returning zero caused crashing.
Alexander Couzens [Tue, 27 Aug 2013 01:18:35 +0000 (03:18 +0200)]
context: add pa_context_load_cookie_from_file()
There is no function to load the authentication cookie for a context.
You can only set environment variables. This patch adds
pa_context_load_cookie_from_file().
Tanu Kaskinen [Fri, 9 Aug 2013 06:39:49 +0000 (09:39 +0300)]
source: When updating a monitor source's rate, update the sink rate too
If the sink rate is not updated, then the monitor source will appear
to have a different rate than the sink, but in reality there's never
any resampling done when moving data from the sink to the monitor
source, so it's a lie that the monitor source has a different rate.
The result of lying is that clients that capture from the monitor
source will have streams that run too fast or slow.
Tanu Kaskinen [Fri, 9 Aug 2013 04:45:26 +0000 (07:45 +0300)]
source: Fix monitor source rate changing
When a sink changes its sample rate, also the monitor source rate
needs to be changed. In order to determine whether a source supports
rate changing, the code checks if the update_rate() callback is set,
but monitor sources don't have that callback set, so the old code
always failed to change the monitor source rate.
This patch fixes the monitor source rate changing by handling monitor
sources as a special case in pa_source_update_rate(): if the source is
a monitor source, then the update_rate() callback is not required.
This adds asserts to check if the implementation has an update rate
function defined for the unlikely event that some implementation forgets
to assign a update rate function we can simply bail.
It is expected from the resampling implementations to have such a
function even if the state of the resampler is completely reset.
Resampler: Don't use the peaks resampler for upsampling
This patch fixes this assertion:
Assertion 'r->i_ss.rate >= r->o_ss.rate' failed at ../../src/pulsecore/resampler.c:1744, function peaks_init(). Aborting.
Tanu Kaskinen [Wed, 14 Aug 2013 13:54:28 +0000 (16:54 +0300)]
source-output: Get the correct source for "direct_on_input" streams
If a capture stream captures from a single sink input (so the capture
stream is a so called "direct on input" stream), then it needs to
connect to the monitor source of the sink to which the sink input is
connected. Previously the correct source was not figured out
automatically, causing the capture stream creation to fail.
Alexander Couzens [Wed, 21 Aug 2013 11:58:19 +0000 (13:58 +0200)]
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.
The Bash shell completion for pacat --device combines the name of the
last sink and the name of the first source. This patch fixes that by
adding a whitespace separator in the list of devices.
Arun Raghavan [Sat, 3 Aug 2013 06:09:17 +0000 (11:39 +0530)]
sink-input: Don't assert when removing non-existent volume factor
This makes it easier for users of this API to add/updated a volume
factor by doing a _remove_volume_factor() followed by an
add_volume_factor(), rather than having to either remember whether this
is the first set operation or have an API to query whether a factor has
already been set.