Commit graph

7162 commits

Author SHA1 Message Date
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
David Henningsson
19a7c6e49b rtp: Reset timestamp with correct size if not found
This fixes a compiler warning when building under Ubuntu.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-05-22 16:07:57 +02:00
David Henningsson
d396b76934 module-device-manager: Fix description restore
e->description is a pointer, not a fixed char array. Hence it
makes no sense to use strncmp.

This fixes a compiler warning when compiling under Ubuntu.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-05-22 16:07:57 +02:00
David Henningsson
de5eb70032 core-util: Add pa_safe_streq
Like pa_streq, but does not blow up on NULL pointers.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-05-22 16:07:57 +02:00
Arun Raghavan
ae9f6dc356 sink-input,source-output: Deal with FIX* flags and extended API
The sample spec fixup when FIX* flags are set was not being propagated
to the pa_format_info, causing the two to be out of sync when FIX* was
used.
2013-05-22 17:20:21 +05:30
Mikel Astiz
b156325c68 bluetooth: Fix missing port->profile association
Commit 17b3cb954b merged Bluetooth ports
into two ports (one for input, one for output) but the association
between ports and profiles was lost.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=64713
2013-05-21 14:46:38 +02:00
Mikel Astiz
305f8c7af1 bluetooth: Create ports before card profiles
Both operations are currently independent and their order can therefore
be swapped.
2013-05-21 14:46:31 +02:00
David Henningsson
c0a4f81123 sink-input/source-output: Don't set save_volume if volume is not writable
This fixes a later assertion failure in module-stream-restore.

Buglink: https://bugs.launchpad.net/bugs/896602
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-05-20 15:01:43 +02:00
Tanu Kaskinen
862b24c2e5 map-file: Remove pa_format_info_free2
The function doesn't exist anymore.
2013-05-20 10:56:42 +03:00
David Henningsson
ef2810e1be alsa-mixer: Add "Line Out Jack" to analog-output.conf
A stationary computer usually has headphone jack(s) and line out jacks.
In some cases analog-output.conf will be a subset of
analog-output-headphones.conf, causing line outs to be unusable (because
headphones are unplugged).

This late in the cycle, this was the safest way I could think of to try
to fix this for a particular computer. In later versions of PulseAudio
we could consider making a dedicated line out path instead, and have
proper jack detection there.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-05-17 15:48:02 +02:00
David Henningsson
0a9a1d7488 alsa: Fix crash when profile_set == NULL
Better check if the pointer is NULL before dereferencing it, instead of
after!

BugLink: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1159853
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-05-14 11:05:24 +02:00
David Henningsson
a9915752f8 po: Fix error in hungarian translation
The stray %s caused PulseAudio to crash.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-05-14 05:52:37 +02:00
Peter Meerwald
8bca464394 echo-cancel: Fix send/recv_counter in calc_diff()
send_counter/recv_counter relate to the bytes (play stream) passed
through the queue, hence the same sample spec must be used

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Acked-by: Stefan Huber <shuber@sthu.org>
2013-05-13 10:32:25 +05:30
Tanu Kaskinen
9e4229cfe0 alsa-mixer: Don't use the mono path in the analog-stereo mapping.
As far as I can see, having a mono path in a stereo mapping doesn't
make any sense. It also causes breakage: if the Master Mono mixer
element has two volume channels, the analog-output path gets removed
due to being a subset of analog-output-mono, and that in turn causes
the Master element getting muted. Users generally don't like that.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=54673
2013-05-08 16:35:13 +03:00
Peter Meerwald
592ba453e3 doc: Reword description of meta commands in pulse-cli-syntax.5
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-04-29 16:19:40 +02:00
Peter Meerwald
5701e83191 doc: Fix description how boolean values can be specified
"any word starting with the letters" parts; this does not hold
any longer with commit 0e29e7365907ffbe90df768a4dea277dba40d495
core-util: Don't accept random words in pa_parse_boolean()

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-04-29 16:19:26 +02:00
Peter Meerwald
e87fbc7e86 doc: Mention just one CLI language in default.pa.5
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-04-29 16:19:15 +02:00
Peter Meerwald
f1d19935b4 pstream: Fix case in log message
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-04-29 16:19:07 +02:00
Arun Raghavan
759c0bc6f9 build-sys: json-c changed everything :(
json-c 0.11 ships a pkg-config file with a different name, and changes
the name of its library as well.
2013-04-27 09:06:44 +05:30
David Henningsson
ca4942e89c alsa-mixer: Switch to Headphone when Headphone mic jack is plugged in
When a "Headphone Mic" jack becomes available, we do not know if
a headphone or a mic has been plugged in. Therefore, setting both
paths to "unknown" is, in theory, the correct thing to do.
However, in practice, people are more likely to plug in a headphone
rather than a mic. Therefore, allow autoswitch to the headphone port
when the jack is plugged in.

A more advanced implementation would consider what was plugged in last
time depending on what port was selected on the input side at that
time, and set availability accordingly. However, such an implementation
will have to wait (probably at least until we have our fancy routing
system implementation).

Buglink: https://bugs.launchpad.net/bugs/1169143
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-24 12:18:23 +02:00
David Henningsson
068a3ec9d4 alsa-mixer: Allow input fallback port for devices with no gain control
I recently came across a device without any ALSA-level mixer controls,
everything was physical knobs on the hardware.

This patch enables that device to get a port too ("Analog Input").

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-24 10:59:42 +02:00
David Henningsson
2553757922 alsa: Fix ELD access warning on shutdown
The hdmi_eld_changed callback is called by alsa-lib at shutdown.
In that case, just exit instead of trying to access something with
already closed handles.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-24 10:57:47 +02:00
David Henningsson
d389e7d37c default.pa: Load switch-on-port-available before udev-detect
We need to pick the right port as early as possible, before the
first volume is picked up. Hence this module needs to be loaded
before the sound card modules are loaded.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-24 07:56:01 +02:00
David Henningsson
fe73f47828 module-switch-on-port-available: Handle hotplugged cards
If a card is hot-plugged (which all cards will be when we load
this module before module-*-detect), make sure we don't start up
a sink with an unavailable port selected.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-24 07:32:48 +02:00
David Henningsson
0b83787d4e alsa: Initialize ports before sinks/sources
This way port availability has been filled in when we create the
sink, which will later enable us to pick the right port directly.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-24 07:31:29 +02:00
Piotr Drąg
3556c820ee i18n: Update Polish translation 2013-04-23 18:40:09 +03:00
Arun Raghavan
4c23720ef1 pulsecore: Make run-from-build not readlink() on every call
Since this is no longer only defined in debug builds, let's make sure
that there is no impact if this is indavertently called repeatedly at
startup.
2013-04-20 10:12:34 +05:30
Arun Raghavan
3d7bc637c4 daemon: Fix dlsearchpath while running from build tree
It appears that, libltdl will find the .la file in the builddir and
figure out where the real .so is.

This also requires .ifexists to be fixed up to correspondingly search in
<dlsearchpath>/.libs.
2013-04-20 10:04:32 +05:30
Arun Raghavan
4cd7e6df1d rygel: Set DLNA profile on our MediaItems
We know we always serve up LPCM, and exposing this via D-Bus lets Rygel
set the appropriate metadata while presenting the raw (i.e.
non-transcoded) stream to clients.
2013-04-20 09:09:01 +05:30