Commit graph

7090 commits

Author SHA1 Message Date
Arun Raghavan
5ae5dee75e zeroconf: Make Avahi usage in m-z-publish async
This pushes all avahi-client code to a threaded mainloop from the PA
mainloop context. We need to do this because avahi-client makes blocking
D-Bus calls, and we don't want to block the mainloop for that long.

The only exception to this now that I don't see a workaround for is
during module unload time. However, this shouldn't be a huge problem
since in most cases, this will only happen at server shutdown time.

The bulk of the change is partitioning the data so that PA core objects
only (well, mostly) get accessed in the PA mainloop and Avahi calls
happen only in the Avahi threaded mainloop.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=58758
2013-06-04 00:38:43 +05:30
Arun Raghavan
8d129977ca mainloop: Add API to set thread name for threaded mainloop 2013-06-04 00:38:43 +05:30
Arun Raghavan
1b0136be44 pulsecore: Fix assert in pa_msgobject creation
Allows for creation of derived types that don't have any other fields.
2013-06-04 00:38:43 +05:30
poljar (Damir Jelić)
126a80f3b9 shell-completion: Add list-cards to the pacmd completion.
The list-cards command was missing for both of the shell completions.
This fixes it.
2013-06-04 00:38:43 +05:30
Peter Meerwald
b0ee51e19e rescue-streams: Fix wording of module description
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-06-04 00:38:43 +05:30
Peter Meerwald
73b816d6ac intended-roles: Fix typo in module description
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-06-04 00:38:43 +05:30
Peter Meerwald
83c3cf0a65 pactl: Use colon to separate priority in profiles output
for example:
  Profiles:
	input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority. 60)
	output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority. 6000)

it should be "priority: xxx", not "priority. xxx"

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-06-04 00:38:43 +05:30
Mitchell Fang
2dcf052e13 thread-mainloop: Fix bug in example code
Checking the operation state caused a deadlock, because the state
won't change before my_drain_callback() returns, and it doesn't
return before my_drain_stream_func() calls
pa_threaded_mainloop_accept().
2013-06-04 00:38:43 +05:30
Peter Meerwald
9c11749258 cli: Fix plural in caption of source-outputs list
$ pacmd list-source-outputs
>>> 4 source outputs(s) available.

outputs(s) makes no sense

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-06-04 00:38:42 +05:30
Mikel Astiz
0e4c16e120 bluetooth: Support transport auto-release
With BlueZ 5, if the remote device suspends the audio, the transport
state will change to "idle" and the endpoint is not required to release
the transport, since this could introduce race conditions. Therefore,
ignore the call to pa_bluetooth_transport_release() if the transport is
not acquired any more.
2013-06-04 00:38:42 +05:30
Mikel Astiz
9615def4b9 bluetooth: Update to new BlueZ 5 transport acquire/release API
The new D-Bus API doesn't support access rights, which weren't used by
PulseAudio anyway, but it does solve a race condition: now optional
acquires can be implemented by bluetooth-util atomically using the D-Bus
TryAcquire() method.
2013-06-04 00:38:42 +05:30
Mikel Astiz
6fdf2b05b8 bluetooth: Support media transport's State property
BlueZ 5 exposes a 'State' property in the media transport interface.
With regard to PA, this replaces the profile-specific interfaces, since
they were being used to know if the audio was streaming or not.
2013-06-04 00:38:42 +05:30
Mikel Astiz
2f79fb580a bluetooth: Parse media transport's properties
Add the code to parse the properties of the media transport object when
a PropertiesChanged signal is received.

Note that the transport might have an owner other than BlueZ, and thus
the property changes would be emitted from arbitrary senders. For
performance reasons, the installed match considers the interface name
where the property has changed.

It could be possible to install and remove the D-Bus matches dynamically
when a new owner is registered/unregistered, but filtering based on the
interface name seems good enough already.
2013-06-04 00:38:42 +05:30
Mikel Astiz
235611a7d1 bluetooth: Support Properties.PropertiesChanged signal
Install matches for signal Properties.PropertiesChanged and process the
properties corresponding to the tracked devices.
2013-06-04 00:38:42 +05:30
Mikel Astiz
114edb0696 bluetooth: Support ObjectManager interface add/remove
Install matches for signals ObjectManager.InterfacesAdded and
ObjectManager.InterfacesRemoved, and process the devices that are
registered and unregistered dynamically.
2013-06-04 00:38:42 +05:30
Arun Raghavan
ab37be46f6 core: Add an "internal" suspend cause
This lets us suspend devices from within the core for short periods
without having to overload one of the existing suspend causes.

https://bugs.freedesktop.org/show_bug.cgi?id=64118
2013-06-04 00:38:42 +05:30
Nikolay Amiantov
8cc4e7786f pactl: Flush stdout buffer when printing subscribe events.
"pactl subscribe" is running continuously, and without flushing its output is
not usable for "process-on-arrival" per-line tasks, such as grepping. This
patch should fix this. For example, now:
pactl subscribe | grep 'server'
should print only server events as they arrive.
2013-06-04 00:38:41 +05:30
Mikel Astiz
cfb96b2530 bluetooth: BlueZ 5 interface rename to org.bluez.MediaTransport1
Use the new interface name if BlueZ 5 has been detected.
2013-06-04 00:38:41 +05:30
Mikel Astiz
61e8fd8854 bluetooth: BlueZ 5 interface rename to org.bluez.Media1
Use the new interface name if BlueZ 5 has been detected.
2013-06-04 00:38:41 +05:30
Mikel Astiz
d22ea7ff76 bluetooth: BlueZ 5 interface rename to org.bluez.MediaEndpoint1
Use the new interface name if BlueZ 5 has been detected.
2013-06-04 00:38:41 +05:30
Tanu Kaskinen
d9ed42c40f bluetooth: Fix error checking style 2013-06-04 00:38:41 +05:30
Mikel Astiz
c4bd51a345 bluetooth: Parse the tree returned by ObjectManager
Parse the result of ObjectManager.GetManagedObjects(), which includes
all objects registered, their interfaces and the corresponding
properties per interface.
2013-06-04 00:38:41 +05:30
Mikel Astiz
2247b18739 bluetooth: Detect BlueZ 5
Check the existence of ObjectManager to detect the version of the
running daemon. If the interface exists, it should be BlueZ 5.
2013-06-04 00:38:41 +05:30
Tanu Kaskinen
aacac20e76 module: Assign the index before calling init()
Any code that runs inside the init() callback sees an invalid module
index. Sometimes init() does things that cause hooks to be fired. This
means that any code that uses hooks may see an invalid module index.
Fix this by assigning the module index before init() is called.

There are no known issues in the upstream code base where an invalid
module index would be used, but an out-of-tree module
(module-murphy-ivi) had a problem with this.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=63923
2013-06-04 00:38:41 +05:30
João Paulo Rechi Vita
6cc974844e bluetooth: Remove the 'bluez.name' property
The 'Name' property of the Device interface became optional in BlueZ 5
and may not be present anymore (that happens when testing against the
PTS 4.7.0), so it's better not to expose it to clients so they don't
rely on its existence.
2013-06-04 00:38:41 +05:30
João Paulo Rechi Vita
5b48062f94 bluetooth: Use 'Alias' value as the device description
The 'Alias' property should be preffered over the 'Name' property,
according to the BlueZ API documentation.
2013-06-04 00:38:40 +05:30
João Paulo Rechi Vita
6e73c05cbc bluetooth: Add 'bluez.alias' property 2013-06-04 00:38:40 +05:30
Peter Meerwald
fee5a29e33 .gitignore: Ignore src/*.gcno files created when building with --enable-gcov
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-06-04 00:38:40 +05:30
poljar (Damir Jelić)
f8101279bb switch-on-port-available: Silence gcc warning.
This silences this gcc warning:
module-switch-on-port-available.c:111:12: warning:
    'good' may be used uninitialized in this function
2013-06-04 00:38:40 +05:30
Ismo Puustinen
55571f8999 module: initialize module index to invalid value.
m->init() was called while m->index was uninitialized, which was bad
style.
2013-06-04 00:38:40 +05:30
Peter Meerwald
8336078afa fdsem: Remember pa_write() type in pa_fdsem_post()
pa_write() knows two types of operation:
calling send() and calling write()

there is a flag (a pointer to an int) passed to pa_write()
which can remember which write type was successful

if the pointer is NULL or the int is 0, send() is tried first,
with a fallback to write() if send() resulted in ENOTSOCK

pa_fdsem_post() calls pa_write() with a NULL pointer;
unfortunately (at least with HAVE_SYS_EVENTFD_H #define'd) send()
always fails here and write() is called -- causing an extra syscall
quite frequently

strace:
send(17, "\1\0\0\0\0\0\0\0", 8, MSG_NOSIGNAL) = -1 ENOTSOCK (Socket operation on non-socket)
write(17, "\1\0\0\0\0\0\0\0", 8) = 8

the patch adds a write_type field to pa_fdsem to the successful
pa_write() type can be remembered and unnecessary send() calls are
avoided

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-06-04 00:38:40 +05:30
Tanu Kaskinen
5237bab36e pasuspender: Resume before exiting in case of SIGINT or fork() failure.
Pressing Ctrl-C in a terminal while pasuspender is running
causes the sinks and sources to stay suspended after
pasuspender has exited, which is very annoying. This patch
fixes that problem, and also a similar problem with fork()
failures.
2013-06-04 00:38:40 +05:30
Tanu Kaskinen
a7567b78e3 alsa: Don't use pa_strna() for port names
The name variable is never NULL, so there's no point in using
pa_strna().
2013-06-04 00:38:40 +05:30
Tanu Kaskinen
1fd79c4439 core-util: Don't accept random words in pa_parse_boolean()
The old code accepted any word that started with "y", "Y",
"n", "N", "t", "T", "f" or "F". Fix this by having
a whitelist of full strings instead of checking just the
first letter.
2013-06-04 00:38:40 +05:30
Peter Meerwald
0af05213be build: make ARM NEON check in configure.ac more strict
the check for NEON so far only checked if -mfpu=neon is understood by the compiler,
however, this is not enough:

(i) #include <arm_neon.h> should be checked
(ii) -mfpu=neon must be passed before CFLAGS because eventually the per-library CFLAGS
for NEON code in src/Makefile.am are passed to the compiler before the global CFLAGS

in case the build environment passes CFLAGS to configure and we try to set conflicting
CFLAGS option, the former take precedence; CFLAGS cannot be overridden

this does not fix
http://lists.freedesktop.org/archives/pulseaudio-discuss/2012-December/015570.html
but at least makes the build fail in configure (and not while compiling stuff)
and gives better diagnostics

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-06-04 00:38:39 +05:30
poljar (Damir Jelić)
80b0e285a5 device-port: Introduce pa_device_port_new_data
Port creation is now slightly different. It is now similar to how
other objects are created (e.g. sinks/sources/cards).

This should become more useful in the future when we move more stuff to
the ports.

Functionally nothing has changed.
2013-06-04 00:38:39 +05:30
Tanu Kaskinen
23f88ecb84 .gitignore: Update m4/ ignore list 2013-06-04 00:38:39 +05:30
Javier Jardón
b2a0a1575d build-sys: Use upstream gettext instead glib one 2013-06-04 00:38:39 +05:30
João Paulo Rechi Vita
3086d01dd7 bluetooth: Improve code and log readability
This commit makes the code cleaner, avoiding unnecessary line breaks. It
also changes the debug message elements order, to make it look more
natural ("path, interface, member" instead of "interface, path,
member").
2013-06-04 00:38:39 +05:30
João Paulo Rechi Vita
3ef024831c bluetooth: Remove unnecessary braces 2013-06-04 00:38:39 +05:30
Tanu Kaskinen
0bbef56976 device-port: Make it impossible to have dual-direction ports 2013-06-04 00:38:39 +05:30
Tanu Kaskinen
5ceb184e3e alsa-mixer: Remove the "name" option from the "General" section of path configuration files
This means that the path names will always correspond to the
path configuration file names, so they will automatically be
unique (in the scope of one card).
2013-06-04 00:38:39 +05:30
Tanu Kaskinen
3c1ca6d4b8 alsa-mixer: Introduce "description-key" option for paths
Previously the path description was looked up based on the
path name only. Since there can be multiple paths that use
the same description, it had to be possible to have multiple
paths with the same name.

Having the same name with multiple paths makes identifying
the paths more complex than necessary, so the plan is to
make it impossible to have paths with the same name. This
patch prepares for that by retaining the possibility to
still have the same description with multiple paths. Instead
of the path name, the path description is looked up by using
the "path description key" if it is set (path name is still
used as a fallback lookup key).
2013-06-04 00:38:39 +05:30
Tanu Kaskinen
66aeea7f72 switch-on-port-available: Fix error reporting style 2013-06-04 00:38:38 +05:30
Tanu Kaskinen
d4d319820d switch-on-port-available: Remove a redundant function argument 2013-06-04 00:38:38 +05:30
Tanu Kaskinen
7560314f36 switch-on-port-available: Prepare for dual-direction ports going away
As an extra, I broke try_to_switch_profile() into smaller
functions, because the two levels of loops with continue
statements inside both were a bit hard to follow.
2013-06-04 00:38:38 +05:30
Arun Raghavan
6b08d75c94 build-sys: Bump soname 2013-06-04 00:13:42 +05:30
Arun Raghavan
d78d0053b5 Add a NEWS file
Short version based on Tanu's longer notes posted on list (and now on
the wiki, linked from this file.
2013-06-04 00:08:14 +05:30
Vadim Troshchinskiy
a0032eb7f9 osx: Fix latency querying
get_latency_us() used an uninitialized variable, and an incorrect
scope for some of the AudioObjectGetPropertyData() calls. As a result,
audio would randomly not work at all.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=65122
2013-05-29 14:08:23 +03:00
Arun Raghavan
dbe7bd6677 build-sys: Bump soname
We dropped pa_format_info_free2 as an exposed symbol, but this was never
exposed via headers, so not counting this as ABI change.
2013-05-23 08:35:15 +05:30