Commit graph

2631 commits

Author SHA1 Message Date
Peter Meerwald
e74d4244a2 modules: Make use of new function pa_modargs_get_sample_rate()
by using pa_modargs_get_sample_rate() we avoid inconsistant validity
checking of the sample rate in various places

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-05 10:54:12 +02:00
Tanu Kaskinen
ce304d6208 Pass the profile object instead of the profile name to pa_card_set_profile()
When setting attribute foo, or in this case the card profile, in my
opinion the thing passed to the set_foo() function should be of the
type of foo, not a string identifier that can be used to search for
the actual foo in set_foo().

This is mostly a question of taste, but there's at least some small
benefit from passing the actual object: often the profile object is
already available when calling pa_card_set_profile(), so passing the
card name would cause unnecessary searching when pa_card_set_profile()
needs to look up the profile from the hashmap.
2013-11-29 07:25:13 +02:00
Tanu Kaskinen
bee86af3cc ucm: Add a FIXME comment about bad error handling 2013-11-29 07:21:37 +02:00
Tanu Kaskinen
d1fd31d50f idxset: Allow deep copying with pa_idxset_copy() 2013-11-29 07:14:39 +02:00
João Paulo Rechi Vita
b705e38a79 bluetooth: Fix crash in pa_bluetooth_discovery_get_device_by_address()
We need to check if the device information is valid first, so we don't
pass invalid strings to pa_streq().
2013-11-22 18:40:07 +02:00
João Paulo Rechi Vita
d8fb09b567 bluetooth: Check adapter address to set device_info_valid
If the adapter object has no address information the device information
should be marked as invalid.
2013-11-22 18:39:36 +02:00
Tanu Kaskinen
e9d760b555 bluetooth: Set device_info_valid to -1 when the device's adapter disappears
When parsing device properties, missing adapter will result in
device_info_valid being set to -1. It is then logical that if the
adapter goes missing at a later point, device_info_valid gets set to
-1 also in that situation.
2013-11-20 15:49:10 +02:00
Tanu Kaskinen
e2dea40f4a bluetooth: Remove device_remove_all()
The function did two things: set device_info_valid to -1 and called
device_free() for each device in the hashmap. Setting
device_info_valid to -1 was unnecessary. The main purpose of that was
to fire DEVICE_CONNECTION_CHANGED as a side effect, but that hook is
fired anyway in device_free(), as a side effect of removing all
transports. Calling device_free() can be delegated to pa_hashmap, when
freeing or emptying it.
2013-11-20 15:49:06 +02:00
Tanu Kaskinen
454ca62b23 bluetooth: Fire DEVICE_CONNECTION_CHANGED in set_device_info_valid()
Normally DEVICE_CONNECTION_CHANGED is fired when the first transport
becomes connected, but it may happen that the first transport becomes
connected already before the device properties have been received. In
that case the hook should be fired at the time the device properties
are received. This patch makes the hook to be fired at the right time.
2013-11-20 15:49:01 +02:00
Tanu Kaskinen
6633c1f9ff bluetooth: Don't mark device valid before it has an adapter
At this point this doesn't make any other practical difference than
making the code more logical, but in the next patch I'll fire the
DEVICE_CONNECTION_CHANGED hook in set_device_info_valid(), and at that
point it's important that the device isn't marked valid too early,
because otherwise external code would see "valid" devices that however
don't have the adapter set.
2013-11-20 15:48:56 +02:00
Tanu Kaskinen
f4f4c42fc6 bluetooth: Use a helper function for setting device_info_valid
The helper function doesn't yet bring much benefits in this form, but
I'll add more functionality later.
2013-11-20 15:48:53 +02:00
Tanu Kaskinen
12b7a600d8 bluetooth: Remove a redundant variable 2013-11-15 14:50:46 +02:00
Alexander Couzens
abfca5cb58 tunnel-new: add cookie module argument
When connecting to a remote server your local generated authentication
cookie is used. If remote server's cookie is different from your local
one you aren't allowed to connect. You can use the cookie argument
or define a wider acl in remote server configuration for
module-native-protocol.
2013-11-15 10:16:29 +02:00
David Henningsson
6dddee4214 alsa-mixer: Add internal surround speaker elements
These kcontrol names have started to show up lately, in
combination with surround internal speakers.

BugLink: https://bugs.launchpad.net/bugs/1236965
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-11-01 21:27:29 +01:00
João Paulo Rechi Vita
078dc15944 console-kit: Remove logging of every message on the bus 2013-11-01 16:28:45 +02:00
Tanu Kaskinen
38b8c42b35 bluetooth: Fix variable constness
The string points to memory inside a DBusMessage, so we don't own the string.
2013-10-29 20:46:47 +02:00
Tanu Kaskinen
c922dce784 bluetooth: Remove adapter_remove_all()
The function was redundant, because all it did was call adapter_free()
for each adapter in the hashmap, and that can be delegated to
pa_hashmap when freeing or emptying it.
2013-10-29 20:44:14 +02: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
Jan Alexander Steffens (heftig)
f81e3e1d78 alsa: Fix crash when loading bare ALSA sink/source
module-alsa-{sink,source}.c call pa_alsa_{sink,source}_new with
mapping set to NULL. Guard against this, like the rest of the
function does.

module-alsa-card does not use NULL, so this went unnoticed so far.
2013-10-10 00:03:56 +05:30
Alexander Couzens
3fd2004603 tunnel-sink-new: Fix a possible crash
When the creation of u->thread fails, then pa_thread_mq_done() in
pa__done() will crash, because pa_thread_mq_init() was never called.
Allocating the thread_mq object separately, instead of embedding it
in the userdata struct, allows pa__done() to call pa_thread_mq_done()
only when necessary.
2013-10-04 14:30:26 +03:00
Alexander Couzens
0c3f3934f5 tunnel-sink-new: remove switch-default from state change callbacks
Using default sections for switch(state) in state change callbacks will prevent
useful compiler warnings for non-handled cases
2013-10-04 13:53:08 +03:00
David Henningsson
798525bf16 alsa-mixer: Drop all unused paths, not only unsupported paths
This is a cleaner solution, because it also removes paths that are
being removed because they are subsets of other paths.

Otherwise, the lingering paths could cause jack detection related
assertion failures.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=69676
Reported-and-tested-by: Kalev Lember <kalevlember@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-10-03 16:19:52 +02:00
Arun Raghavan
5a2fd6624d alsa-ucm: Fix bad rate check
Need to check the rate value for being > 0 not the return value of
pa_atou().
2013-09-30 15:16:56 +05:30
Arun Raghavan
24d2fa5415 alsa-ucm: Don't allow Playback/CaptureRate to be 0
This was a review comment on the original patch that I missed fixing.
2013-09-30 08:32:59 +05:30
Tanu Kaskinen
189708a597 bluetooth: Add a comment about messing with the IDLE suspend cause 2013-09-29 19:47:16 +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
dc4be17e07 bluetooth: Fail to load driver if discovery module is not loaded
For quite some time now the device driver module doesn't work well
without the discovery module, so for the BlueZ 5 support we'll prevent
the device driver module to be loaded if the discovery module is not
loaded.
2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
774c73309d bluetooth: Implement get_n_used() for module-bluez5-device 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
ef24f7f3aa bluetooth: Handle changes to BlueZ 5 transports state 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
8d303f0bd1 bluetooth: Process source messages for BlueZ 5 cards 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
05366fdc22 bluetooth: Process sink messages for BlueZ 5 cards 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
eb9813c833 bluetooth: Create I/O thread function for BlueZ 5 cards
Create the thread function, the render and push functions for A2DP, the
process message function for communication between the I/O thread and
the main thread, and other helper functions related to them.
2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
44462904df bluetooth: Set card profile for BlueZ 5 cards 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
d243fdd07b bluetooth: Start / stop I/O thread for BlueZ 5 cards 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
8d1decffd7 bluetooth: Create source for BlueZ 5 cards 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
0274032141 bluetooth: Create sink for BlueZ 5 cards 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
7e80678cc5 bluetooth: Initialize profiles for BlueZ 5 cards
Initialized the currently active profile, configure and acquire the
transport.
2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
a0ed6d7970 bluetooth: Create BlueZ 5 card profile for each audio UUID 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
5a9007338b bluetooth: Create BlueZ 5 card ports 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
501f5e2898 bluetooth: Create BlueZ 5 card 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
6ba1610b6f bluetooth: Unload module-bluez5-device on device's disconnection 2013-09-29 16:54:38 +03:00
João Paulo Rechi Vita
da61957602 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.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
384f4751eb bluetooth: Create module-bluez5-device 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
a5fdf965ed bluetooth: Track devices in module-bluez5-discover 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
e352da60a7 bluetooth: Handle PropertiesChanged for org.bluez.MediaTransport1 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
f65cafe64d bluetooth: Handle PropertiesChanged for org.bluez.Device1 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
82fd8cc845 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.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
89e97215c7 bluetooth: Parse BlueZ 5 device properties
This code is based on previous work by Mikel Astiz.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
877f0a7d54 bluetooth: Handle PropertiesChanged for org.bluez.Adapter1 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
a59177e666 bluetooth: Register endpoints with BlueZ 5 adapter 2013-09-29 16:54:37 +03:00