platform/upstream/pulseaudio.git
11 years agoalsa: Initialize ports before sinks/sources
David Henningsson [Tue, 16 Apr 2013 13:17:37 +0000 (15:17 +0200)]
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>
11 years agoi18n: Update Polish translation
Piotr Drąg [Tue, 16 Apr 2013 18:03:57 +0000 (20:03 +0200)]
i18n: Update Polish translation

11 years agopulsecore: Make run-from-build not readlink() on every call
Arun Raghavan [Sat, 20 Apr 2013 04:42:34 +0000 (10:12 +0530)]
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.

11 years agodaemon: Fix dlsearchpath while running from build tree
Arun Raghavan [Sat, 20 Apr 2013 04:20:38 +0000 (09:50 +0530)]
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.

11 years agorygel: Set DLNA profile on our MediaItems
Arun Raghavan [Fri, 19 Apr 2013 09:34:45 +0000 (15:04 +0530)]
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.

11 years agodoc: Explain PULSE_SERVER string in pulseaudio.1
Peter Meerwald [Fri, 12 Apr 2013 08:53:00 +0000 (10:53 +0200)]
doc: Explain PULSE_SERVER string in pulseaudio.1

first attempt to document the "server string"
See https://bugs.freedesktop.org/show_bug.cgi?id=62444

quite a bit is missing: [hostname], defaults

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
11 years agodoc: Document PULSE_COOKIE in pulseaudio.1
Peter Meerwald [Fri, 12 Apr 2013 09:27:54 +0000 (11:27 +0200)]
doc: Document PULSE_COOKIE in pulseaudio.1

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
11 years agoalsa-source: Fix log message
João Paulo Rechi Vita [Tue, 16 Apr 2013 22:26:27 +0000 (19:26 -0300)]
alsa-source: Fix log message

The log message when updating the source sample rate wrongly mentions
"Sink" instead of "Source". This was probably a copy and paste error.

11 years agodoc: Some more nitpicking in pulse/def.h doxygen documentation
Peter Meerwald [Wed, 10 Apr 2013 16:59:22 +0000 (18:59 +0200)]
doc: Some more nitpicking in pulse/def.h doxygen documentation

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agodoc: Mostly fixing up i.e. versus i.e.\ in doxygen documentation
Peter Meerwald [Wed, 10 Apr 2013 16:59:21 +0000 (18:59 +0200)]
doc: Mostly fixing up i.e. versus i.e.\ in doxygen documentation

same for e.g. versus e.g.\ and e.g. versus E.g.

this is ueber-nitpicking: will anybody ever notice?

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agoalsa-mixer: Change profile-sets directory to PA_SRCDIR
David Henningsson [Tue, 16 Apr 2013 12:44:05 +0000 (14:44 +0200)]
alsa-mixer: Change profile-sets directory to PA_SRCDIR

A recent patch changed the path files from PA_BUILDDIR to PA_SRCDIR.
Do the same to the profile-set files for consistency (and to fix
out of tree builds).

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoFix various typos in messages and comments
Yuri Chornoivan [Sat, 13 Apr 2013 18:32:57 +0000 (21:32 +0300)]
Fix various typos in messages and comments

11 years agoequalizer: Fix compiler warning due use of 'signal'
Arun Raghavan [Tue, 16 Apr 2013 06:08:23 +0000 (11:38 +0530)]
equalizer: Fix compiler warning due use of 'signal'

Changing uses of the symbol 'signal' as it redefines the signal-handling
libc function of the same name.

11 years agobuild-sys: Bump sonames v3.99.1
Arun Raghavan [Mon, 15 Apr 2013 18:03:13 +0000 (23:33 +0530)]
build-sys: Bump sonames

libpulse-simple changed this time as well (addition of hole-handling).

11 years agoalsa: Fix mixer path when running from build tree
Arun Raghavan [Sun, 14 Apr 2013 05:54:41 +0000 (11:24 +0530)]
alsa: Fix mixer path when running from build tree

The mixer paths are not available in ${builddir} - we need to look in
${srcdir}. This should fix running an in-tree build without make install
as well as alsa-mixer-path-test in make distcheck.

Since the most straightforward way to define PA_SRCDIR was in
Makefile.am, I'm moving PA_BUILDDIR there as well for consistency.

11 years agopulsecore: Don't conditionally inline pa_run_from_build_tree()
Arun Raghavan [Sun, 14 Apr 2013 05:02:26 +0000 (10:32 +0530)]
pulsecore: Don't conditionally inline pa_run_from_build_tree()

There's no good reason to assume an in-tree build will be debug-only.
This breaks alsa-mixer-path-test on make distcheck, for example.

11 years agoalsa-mixer: Add more jack detection for Headset mic path
David Henningsson [Fri, 12 Apr 2013 09:56:17 +0000 (11:56 +0200)]
alsa-mixer: Add more jack detection for Headset mic path

On some machines which has a headset jack, the headset mic does not have its own
jack detection. Then we can look at the headphone jack to get some indication:
We know that if the headphone is unplugged, so is the headset mic. The opposite
is not guaranteed since the user might have plugged in a headphone, not a headset.

Also, there exist multi-function jacks which support both Headphone, Mic in headphone jack
and Headset Mic. In this case the jack name will be "Headphone Mic", not "Headphone", so
we need to include this name too.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agosink, source: Send notifications when flags change
Tanu Kaskinen [Thu, 28 Mar 2013 15:30:16 +0000 (17:30 +0200)]
sink, source: Send notifications when flags change

The hooks aren't currently used, but for example, the D-Bus protocol
could use them if it implemented flag change signals.

11 years agosink, source: Really set the fixed latency in set_fixed_latency_within_thread(),...
Tanu Kaskinen [Thu, 28 Mar 2013 15:30:15 +0000 (17:30 +0200)]
sink, source: Really set the fixed latency in set_fixed_latency_within_thread(), always.

The old assumption seemed to be that if a sink or source has the
DYNAMIC_LATENCY flag set, it can never change, so the fixed latency
will always be zero. This assumption doesn't hold with filter sinks
and sources that are moved around.

This fixes a crash with two module-virtual-sink instances on top of
each other, when the bottom one is moved from a sink without dynamic
latency to a sink with dynamic latency. What happened was that first
the bottom virtual sink "updated" (due to this bug nothing was
actually updated) its fixed latency to match the master sink (zero
fixed latency), and then the top virtual sink updated its fixed
latency to match the master sink. The master sink was the bottom
virtual sink, whose fixed latency should have been set to zero, but it
was not, so the pa_sink_set_fixed_latency_within_thread() failed in
the assertion "latency == 0".

11 years agosink, source: Propagate flag changes to filters
Tanu Kaskinen [Thu, 28 Mar 2013 15:30:14 +0000 (17:30 +0200)]
sink, source: Propagate flag changes to filters

An example: let's say that there's an alsa sink and two filter sinks
on top of each other:

        alsa-sink <- filter1 <- filter2

With the old code, if filter1 gets moved to another sink, and the
new sink doesn't have the LATENCY and DYNAMIC_LATENCY flags set
(unlike alsa-sink), filter1's flags are updated fine in the moving()
callback, but filter2 is not notified at all about the flag changes.
With this patch, the flag changes are propagated to filter2 too.

11 years agoshm: Don't force the shm files to be read-only
Tanu Kaskinen [Tue, 9 Apr 2013 08:32:20 +0000 (11:32 +0300)]
shm: Don't force the shm files to be read-only

Forcing the shm file to be read-only makes shm_unlink() fail on OS X.
Thanks to Albert Zeyer for reporting the bug and investigating the
root cause.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=62988
11 years agopstream: Optimise write of smaller packages
David Henningsson [Fri, 5 Apr 2013 19:13:04 +0000 (21:13 +0200)]
pstream: Optimise write of smaller packages

During a stream, most packets sent are either memblocks (with SHM info),
or requests for more data. These are only slightly bigger than the
header.

This patch makes it possible to write these packages in one write
instead of two: a memcpy of just a few bytes is worth saving extra
syscalls for write and poll.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agomix: Mix the right number of streams
Tanu Kaskinen [Tue, 9 Apr 2013 11:52:54 +0000 (14:52 +0300)]
mix: Mix the right number of streams

Passing channels instead of nstreams to pa_mix_ch2_s16ne() caused that
only the first two streams got mixed.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=63093
11 years agosemaphore-osx: posix implementation based on named semaphores
Albert Zeyer [Tue, 2 Apr 2013 11:10:39 +0000 (13:10 +0200)]
semaphore-osx: posix implementation based on named semaphores

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=63014
11 years agosocket-server: Make the new channel low-delay, not the listening one
David Henningsson [Fri, 5 Apr 2013 14:48:21 +0000 (16:48 +0200)]
socket-server: Make the new channel low-delay, not the listening one

I don't know if it matters a lot, but most certainly it must be
the new channel that's supposed to be made low-delay, not the existing
listening socket, right?

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agopstream: Rename "do_something" function
David Henningsson [Fri, 5 Apr 2013 09:17:55 +0000 (11:17 +0200)]
pstream: Rename "do_something" function

Rename it to "do_pstream_read_write" that better describes what the
function does.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoalsa-mixer: Add "Headset Playback|Capture" element
David Henningsson [Mon, 25 Mar 2013 13:56:05 +0000 (14:56 +0100)]
alsa-mixer: Add "Headset Playback|Capture" element

Found on Logitech B530 USB Headset / kernel 3.8. Because we don't
have different path for headset and headphone today, just add
Headset to the existing headphone path.

BugLink: https://bugs.launchpad.net/bugs/1159687
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agodoc: Fix suggested dl-search-path in README
Peter Meerwald [Tue, 2 Apr 2013 12:59:07 +0000 (14:59 +0200)]
doc: Fix suggested dl-search-path in README

the README suggests to set the following dl-search-path: -p $(pwd)/src/.libs/

N: [lt-pulseaudio] daemon-conf.c: Detected that we are run from the build tree, fixing search path.
E: [lt-pulseaudio] ltdl-bind-now.c: Failed to open module /redacted/pulseaudio/src/.libs/.libs/module-device-restore.so: /home/pmeerw/src/pulseaudio/src/.libs/.libs/module-device-restore.so: cannot open shared object file: No such file or directory

the last part seems superfluous, so -p $(pwd)/src/

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agoalsa: skip eld initialization if hctl_handle is NULL
Maarten Lankhorst [Tue, 2 Apr 2013 09:27:38 +0000 (11:27 +0200)]
alsa: skip eld initialization if hctl_handle is NULL

Due to a misconfiguration on my side my hdmi card didn't load with
snd-hda-codec-hdmi but through the fallback mechanism. Pulseaudio
would crash during early because hctl_handle was null, so skip
init_eld_ctls when hctl_handle is null to prevent a crash.

Thanks to David Henningsson for helping me find the underlying issue.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
11 years agosystemd-login: Remove unused variable session.
poljar (Damir Jelić) [Fri, 29 Mar 2013 11:49:42 +0000 (12:49 +0100)]
systemd-login: Remove unused variable session.

11 years agoconsole-kit, systemd-login: Check for logind, not for systemd
Martin Pitt [Thu, 21 Mar 2013 13:17:33 +0000 (14:17 +0100)]
console-kit, systemd-login: Check for logind, not for systemd

It is possible to build systemd without logind, in which case sd_booted() wo
succeed. Check for /run/systemd/seats to test for logind instead, as
recommended by systemd upstream.

For details, see:
<https://mail.gnome.org/archives/desktop-devel-list/2013-March/msg00092.html

Drop the now unnecessary linking against libsystemd-daemon, and stop linking
the consolekit module to any systemd library.

https://bugs.freedesktop.org/show_bug.cgi?id=62593

11 years agoremap: fix check when to apply specialized code path
Peter Meerwald [Thu, 28 Mar 2013 13:46:49 +0000 (14:46 +0100)]
remap: fix check when to apply specialized code path

the specialized code path just duplicate samples, so are only
applicable if the volume in map_table is == 1.0 (or == 0x10000);
don't use them for volumes >= 1.0

compare the integer version of the volume stored in map_table;
comparing floats is ugly (als leads to compiler warnings)

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agosink: Fix flag name typo
Tanu Kaskinen [Thu, 28 Mar 2013 15:15:00 +0000 (17:15 +0200)]
sink: Fix flag name typo

11 years agoresample: Switch to speex-float-1 by default
Arun Raghavan [Mon, 19 Nov 2012 09:38:34 +0000 (15:08 +0530)]
resample: Switch to speex-float-1 by default

This consumes less power, has low (no?) perceivable difference, and
allows the default configuration to work out of the box on low-end
systems (such as netbooks).

11 years agoalsa-mixer: It's valid to have zero elements in a path
David Henningsson [Mon, 25 Mar 2013 12:47:08 +0000 (13:47 +0100)]
alsa-mixer: It's valid to have zero elements in a path

It's valid for a path to have zero elements, e g if it contains
a single jack only. Earlier, this would cause an assertion failure
in pa_path_condense.

Also convert pa_bool_t to bool.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoRevert "card: Support adding ports dynamically"
Mikel Astiz [Thu, 7 Mar 2013 10:32:24 +0000 (11:32 +0100)]
Revert "card: Support adding ports dynamically"

This reverts commit a9c3f2fb0fc1a1ee0072aac6425ad7311a2a5888.

It has been recently agreed that ports should somehow have some physical
meaning, leading to the port merge in module-bluetooth-device.

With this assumption in mind, it is very unlikely that a card would
add or remove ports dynamically. Therefore, the core can be simplified
by removing the support for this.

The revert affects the code added to module-card-restore in commit
a1a0ad1af209e58c136ac1c884aa5d14672a7144, which can now be partially
removed.

Conflicts:
src/pulsecore/card.c
src/pulsecore/core.h

11 years agobuild-sys: Use AM_CPPFLAGS instead of AM_CFLAGS for preprocessor arguments
Javier Jardón [Sat, 23 Mar 2013 18:26:09 +0000 (18:26 +0000)]
build-sys: Use AM_CPPFLAGS instead of AM_CFLAGS for preprocessor arguments

As the automake documentation says:

AM_CPPFLAGS: The contents of this variable are passed to every compilation
that invokes the C preprocessor; it is a list of arguments to the preprocessor.
For instance, -I and -D options should be listed here

AM_CFLAGS: This is the variable the Makefile.am author can use to pass in
additional C compiler flags.

http://www.gnu.org/software/automake/manual/html_node/Program-Variables.html

11 years agoclient API: Document buffer_attr.maxlength
David Henningsson [Mon, 25 Mar 2013 08:20:16 +0000 (09:20 +0100)]
client API: Document buffer_attr.maxlength

Let's officially support that people use maxlength to put an upper
bound on playback latency.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoprotocol-native: Lower default minreq in low-latency scenarios
David Henningsson [Mon, 25 Mar 2013 08:20:15 +0000 (09:20 +0100)]
protocol-native: Lower default minreq in low-latency scenarios

If minreq is not explicitly specified, it was always initialized to
20 ms (DEFAULT_PROCESS_MSEC). However when the total latency is not
much higher than 20 ms, this is way too high. Instead use
tlength/4 as a measure: this will give a decent sink_usec in all
modes (both traditional, adjust latency and early request modes).

This greatly improves PulseAudio's ability to ask for data in time
in low-latency scenarios.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoprotocol-native: Ensure tlength is not set higher than maxlength
David Henningsson [Mon, 25 Mar 2013 08:20:14 +0000 (09:20 +0100)]
protocol-native: Ensure tlength is not set higher than maxlength

Tlength should never be set higher than maxlength. While this is
corrected by memblockq later, we still need a correct tlength for
the subsequent calculations.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years ago.gitignore: Add alsa-mixer-path-test
Tanu Kaskinen [Mon, 25 Mar 2013 13:42:16 +0000 (15:42 +0200)]
.gitignore: Add alsa-mixer-path-test

11 years agoprotocol-native: Fix some debug output
Arun Raghavan [Mon, 26 Nov 2012 06:42:05 +0000 (12:12 +0530)]
protocol-native: Fix some debug output

s->buffer_attr_req is what we want to be printing from since that holds
the actualy requested buffer attributes.

11 years agoalsa: Minor debug log addition
Arun Raghavan [Thu, 22 Nov 2012 04:30:07 +0000 (10:00 +0530)]
alsa: Minor debug log addition

It's helpful to know what kind of scheduling latency we're expecting in
that debug log.

11 years agostream: Make it easier to enable debug output
Arun Raghavan [Thu, 22 Nov 2012 04:28:08 +0000 (09:58 +0530)]
stream: Make it easier to enable debug output

This is only useful while hacking on PulseAudio.

11 years agocore: Fix up some debug logging
Arun Raghavan [Thu, 22 Nov 2012 03:01:59 +0000 (08:31 +0530)]
core: Fix up some debug logging

Replaces some debugging-only pa_log() calls with pa_log_debug() so we
only get spammed while debugging if we want to be.

11 years agortp: Introduce source IP configuration
Robin H. Johnson [Sat, 17 Nov 2012 23:31:18 +0000 (23:31 +0000)]
rtp: Introduce source IP configuration

On a multi-homed system, the user may wish RTP to be used only on
specific interfaces. The default binding of 0.0.0.0 for the source
address causes SAP multicast on all interfaces, which is not ideal.

Introduce a new module argument, that allows selection of the source IP,
and thus interface.

(changes in v2: s/srcip/source_ip)

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
11 years agortp: rename modarg destination to destination_ip
Robin H. Johnson [Sat, 17 Nov 2012 23:31:17 +0000 (23:31 +0000)]
rtp: rename modarg destination to destination_ip

The module argument 'source' already has special meaning as the
pa_source, however, the argument 'destination' expects an IP address.

Prior to introducing a source IP modarg for the source IP address,
rename the 'destination' argument to 'destination_ip'. Include
compatibility support for old RTP users so they don't need to change
their module usage immediately.

(changes in v2: minor formatting fixes, s/dstip/destination_ip)

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
11 years agortp: Cleanup variable naming.
Robin H. Johnson [Sat, 17 Nov 2012 23:31:16 +0000 (23:31 +0000)]
rtp: Cleanup variable naming.

Before introducing new functionality, clarify the variable names

dest -> dst_addr
sa[46] -> dst_sa[46]
sap_sa[46] -> dst_sap_sa[46]

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
11 years agotests: Minor alsa-time-test improvments
Arun Raghavan [Thu, 8 Nov 2012 09:24:51 +0000 (14:54 +0530)]
tests: Minor alsa-time-test improvments

Tries to get RT privs and prints elapsed time and a periodic header to
make grokking the output easier.

11 years agotests: Add tests for alsa-mixer paths
David Henningsson [Fri, 22 Mar 2013 14:22:26 +0000 (15:22 +0100)]
tests: Add tests for alsa-mixer paths

It checks all files in the mixer/paths directory and checks
 - that the file can be parsed without errors
 - that the file is actually shipped in the makefile

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoalsa-mixer: Support more phantom jacks
David Henningsson [Thu, 21 Mar 2013 18:28:49 +0000 (19:28 +0100)]
alsa-mixer: Support more phantom jacks

It's fairly uncommon, but it happens that jack detection is enabled
for some reason, e g hardware design. In that case, we cannot use
jack detection, but we can still use the hint to pick up that there
is a path.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoalsa-mixer: Add path for Headset Microphone
David Henningsson [Thu, 14 Mar 2013 08:14:34 +0000 (09:14 +0100)]
alsa-mixer: Add path for Headset Microphone

In kernel 3.10, some devices will have the "Headset Microphone" name
to indicate that the mic is part of a mic + headphone combo, i e, a headset.

11 years agoUpdate Ukrainian translation.
Yuri Chornoivan [Sat, 23 Mar 2013 14:33:43 +0000 (16:33 +0200)]
Update Ukrainian translation.

11 years agoRevert "conf-parser: Remove redundant feof() call"
Tanu Kaskinen [Sat, 23 Mar 2013 06:38:43 +0000 (08:38 +0200)]
Revert "conf-parser: Remove redundant feof() call"

This reverts commit 6733caf114d0d759590459745c864aa9518d133d.

Apparently, the EOF bit gets set only after there has been an attempt
to read more data than the file contains, so just reading the last
byte isn't sufficient.

11 years agoconf-parser: Remove redundant feof() call
Tanu Kaskinen [Sat, 30 Jun 2012 09:58:40 +0000 (12:58 +0300)]
conf-parser: Remove redundant feof() call

fgets() returns NULL in case there's an error or f is at EOF. The
while condition just checked that f is not at EOF, therefore an error
must have happened.

11 years agoloopback: Flush asyncmsgq from the right context
Tanu Kaskinen [Thu, 14 Mar 2013 20:07:14 +0000 (22:07 +0200)]
loopback: Flush asyncmsgq from the right context

u->asyncmsg is accessed from two IO threads. teardown() shouldn't
flush the queue from the main thread while both IO threads are still
potentially using the queue. This patch fixes that error by flushing
the queue from the sink input thread when the sink input is being
unlinked.

Flushing the queue in teardown() caused this assertion in
pa_asyncmsgq_get() to crash sometimes: pa_assert(!a->current)

11 years agofilter-apply: Fix segfault with moving streams
Tanu Kaskinen [Thu, 14 Mar 2013 20:07:13 +0000 (22:07 +0200)]
filter-apply: Fix segfault with moving streams

process() may be called with a stream that doesn't have its sink/source set.
This can happen if the proplist change callback is called when the stream is
moving.

11 years agoloopback: Fix segfault in may_move_to() callbacks
Tanu Kaskinen [Thu, 14 Mar 2013 20:07:12 +0000 (22:07 +0200)]
loopback: Fix segfault in may_move_to() callbacks

The sink input may_move_to() callbacks can be called while the source
output is not connected to any source (i.e. is currently moving too),
and vice versa.

Thanks to Frédéric Dalleau for reporting this bug.

11 years agosink-input: Make sure the process_underrun callback is cleared
David Henningsson [Thu, 21 Mar 2013 17:25:09 +0000 (18:25 +0100)]
sink-input: Make sure the process_underrun callback is cleared

Otherwise sink unlinking could cause a segfault.

Reported-by: heftig
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agopacat: Fix mode detection for parecord
Tanu Kaskinen [Thu, 21 Mar 2013 10:33:04 +0000 (12:33 +0200)]
pacat: Fix mode detection for parecord

Due to the missing "else", parecord was interpreted as parec, causing
the raw flag to be set when it shouldn't have been set.

11 years agotests: Move ipacl-tests to TESTS_norun
David Henningsson [Tue, 19 Mar 2013 15:36:16 +0000 (16:36 +0100)]
tests: Move ipacl-tests to TESTS_norun

ipacl-test fails if there is no SSH server running on your machine.
Since it is not a PulseAudio error not to have an SSH server running,
this test should not be run as part of the "make check" test suite.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agocore, alsa: Better drain reporting
David Henningsson [Fri, 1 Mar 2013 10:51:54 +0000 (11:51 +0100)]
core, alsa: Better drain reporting

Previously, a drain request was acknowledged up to two hw buffers
too late, causing unnecessary delays.

This implements a new chain of events called process_underrun
which triggers exactly when the sink input has finished playing,
so the drain can be acknowledged quicker.

It could later be improved to give better underrun reporting to
clients too.

Tested-by: Dmitri Paduchikh <dpaduchikh@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agozsh-completion: Fix pacat completion.
poljar (Damir Jelić) [Sun, 17 Mar 2013 21:06:41 +0000 (22:06 +0100)]
zsh-completion: Fix pacat completion.

pacat --format needs = (--format=).
Also pacat should complete files firstly and command line arguments
secondly.

11 years agozsh-completion: Add support for the new pactl commands.
poljar (Damir Jelić) [Sun, 17 Mar 2013 21:06:40 +0000 (22:06 +0100)]
zsh-completion: Add support for the new pactl commands.

This adds support for set-(sink|source)-default completion and adds
toggle to the supported arguments for the mute command.

11 years agozsh-completion: Add support for remote servers.
poljar (Damir Jelić) [Sun, 17 Mar 2013 21:06:39 +0000 (22:06 +0100)]
zsh-completion: Add support for remote servers.

This patch adds support for completion of remote PulseAudio server
arguments it also suppresses error messages when unable to connect to
PulseAudio (only for the completion function).

11 years agoalsa: Add configuration for NI Traktor Audio 2
Tanu Kaskinen [Thu, 14 Mar 2013 12:04:41 +0000 (14:04 +0200)]
alsa: Add configuration for NI Traktor Audio 2

Mostly written by Jaroslav Janukevic.

11 years agoport to gtk+-3.0
Marc-Antoine Perennou [Fri, 1 Jun 2012 09:17:16 +0000 (11:17 +0200)]
port to gtk+-3.0

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
11 years agopulse: Document the operation state behavior on context disconnection.
Tanu Kaskinen [Sat, 12 Jan 2013 16:35:41 +0000 (18:35 +0200)]
pulse: Document the operation state behavior on context disconnection.

11 years agoladspa: Use volume sharing.
Tanu Kaskinen [Sun, 20 Jan 2013 22:48:08 +0000 (00:48 +0200)]
ladspa: Use volume sharing.

The previous volume handling could cause ear damage: by default the
ladspa sink volume was 100%, and with flat volumes that would cause
the master sink volume to jump to 100% too.

11 years agoudev: Add tsched_buffer_size module argument
Tanu Kaskinen [Sat, 16 Feb 2013 15:29:58 +0000 (17:29 +0200)]
udev: Add tsched_buffer_size module argument

This makes it easier to configure the buffer size.

11 years agoman: Remove reference to the .verbose CLI command
Tanu Kaskinen [Wed, 13 Mar 2013 11:19:22 +0000 (13:19 +0200)]
man: Remove reference to the .verbose CLI command

The .verbose metacommand was removed in commit
73eabece3365c1bb47bf6b009682219c4492fda5 (in 2004!).

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=62270
11 years agoBump the native protocol version
Akihiro Tsukada [Sun, 24 Feb 2013 16:01:05 +0000 (01:01 +0900)]
Bump the native protocol version

The previous AAC pass-through patch (commit: 53807e4a) introduced
a new encoding format type: PA_ENCODING_MPEG2_AAC_IEC61937,
which is mostly used in pa_format_info, but forgot to increment the
protocol version number. The version needs to be incremented, because
clients need some way of checking whether the server supports the new
encoding.

11 years agoltdl-bind-now: Log an error in case of failures
Tanu Kaskinen [Tue, 12 Mar 2013 17:05:58 +0000 (19:05 +0200)]
ltdl-bind-now: Log an error in case of failures

11 years agomodule: Don't use lt_dlerror(), it's useless
Tanu Kaskinen [Tue, 12 Mar 2013 17:05:15 +0000 (19:05 +0200)]
module: Don't use lt_dlerror(), it's useless

11 years agobluetooth: Never allow microphone output ports
David Henningsson [Fri, 8 Mar 2013 17:23:41 +0000 (18:23 +0100)]
bluetooth: Never allow microphone output ports

If we find a microphone output port, it is probably something else
than a microphone. Therefore label it "Bluetooth output" instead of
"Microphone".

Same goes for Headphones and Speakers, but in the other direction.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agobluetooth: Use form factor to set port name and description
Mikel Astiz [Thu, 7 Mar 2013 10:32:23 +0000 (11:32 +0100)]
bluetooth: Use form factor to set port name and description

Use the information provided by the form factor to decide which name and
description should be used during port creation.

11 years agobluetooth: Add specific form factor for phones
Mikel Astiz [Thu, 7 Mar 2013 10:32:22 +0000 (11:32 +0100)]
bluetooth: Add specific form factor for phones

When a phone is paired, use PA_BT_FORM_FACTOR_PHONE to properly specify
its form factor.

11 years agobluetooth: Use enum to represent form factors
Mikel Astiz [Thu, 7 Mar 2013 10:32:21 +0000 (11:32 +0100)]
bluetooth: Use enum to represent form factors

Avoid using strings only to represent form factors in the bluetooth-util
API and instead use a new dedicated enum type: pa_bt_form_factor_t.

11 years agomodules: Remove obsolete may_move_to callbacks
Stefan Huber [Wed, 6 Mar 2013 09:35:37 +0000 (10:35 +0100)]
modules: Remove obsolete may_move_to callbacks

Some modules have source_output_may_move_to_cb() and
sink_input_may_move_to_cb() implemented that duplicate the default behavior.
Remove them.

11 years agomodules: remove obsolete comment on PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND
Stefan Huber [Tue, 5 Mar 2013 17:09:18 +0000 (18:09 +0100)]
modules: remove obsolete comment on PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND

11 years agovirtual-source: remove redundant checks and callbacks
Stefan Huber [Tue, 5 Mar 2013 17:09:17 +0000 (18:09 +0100)]
virtual-source: remove redundant checks and callbacks

- do not check pa_xnew0()'s return value
- remove redundant source_output_process_msg_cb()

11 years agomodules: add module-remap-source
Stefan Huber [Tue, 5 Mar 2013 17:09:15 +0000 (18:09 +0100)]
modules: add module-remap-source

11 years agodefault.pa: Load module-jackdbus-detect with channels=2 by default
David Henningsson [Fri, 1 Mar 2013 12:01:33 +0000 (13:01 +0100)]
default.pa: Load module-jackdbus-detect with channels=2 by default

There was a recent thread on Linux Audio Users mailinglist about
whether to do so or not, and it looks like most people would prefer
having a stereo default (but even better would have been a
module-jack-card where you can easily set channels/profiles on the fly).

Reference:
http://lists.linuxaudio.org/pipermail/linux-audio-user/2013-February/091068.html

Reported-by: Kaj Ailomaa <zequence@mousike.me>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoformat: Add #defines for enum values
Tanu Kaskinen [Fri, 22 Feb 2013 12:25:36 +0000 (14:25 +0200)]
format: Add #defines for enum values

11 years agoalsa-card: Make ELD monitor name a port property
David Henningsson [Tue, 19 Feb 2013 12:25:49 +0000 (13:25 +0100)]
alsa-card: Make ELD monitor name a port property

If there is a proper monitor name, we expose this as a device.product.name
property on the port. This can be useful for UIs who might want to show
this name.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoalsa-mixer: Add possibility to configure ELD device
David Henningsson [Tue, 19 Feb 2013 12:25:48 +0000 (13:25 +0100)]
alsa-mixer: Add possibility to configure ELD device

The alsa mixer kcontrol has "device index" 3, 7, 8, and 9.
We need to configure this properly.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoalsa-util: Add a function to read ELD info
David Henningsson [Tue, 19 Feb 2013 12:25:47 +0000 (13:25 +0100)]
alsa-util: Add a function to read ELD info

Currently, this function only reads the monitor name, but could
be extended to read e g supported formats as well.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agocard: Set initial profile availability state
Mikel Astiz [Tue, 19 Feb 2013 17:26:03 +0000 (18:26 +0100)]
card: Set initial profile availability state

Commit afd33da56a0b174c43ca44bce21b8ef0efaca1fa introduces this new
flag but the default initial value is missing, considering that
pa_xmalloc is used to allocate the memory.

11 years agobluetooth: Fix assertion failure if BlueZ crashes during GetProperties
Mikel Astiz [Tue, 19 Feb 2013 15:12:50 +0000 (16:12 +0100)]
bluetooth: Fix assertion failure if BlueZ crashes during GetProperties

If BlueZ crashes exactly while PulseAudio waits for the GetProperties reply, the
device has already been removed from the hashmap and therefore an assertion
failure is experienced.

The solution consists of ignoring the reply in these cases.

The problem can be observed in the following traces:

D: [pulseaudio] bluetooth-util.c: Bluetooth daemon appeared.
D: [pulseaudio] bluetooth-util.c: dbus: interface=org.bluez.Manager, path=/, member=AdapterAdded
D: [pulseaudio] bluetooth-util.c: Adapter /org/bluez/497/hci1 created
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPAG on adapter /org/bluez/497/hci1.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPHS on adapter /org/bluez/497/hci1.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSource on adapter /org/bluez/497/hci1.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSink on adapter /org/bluez/497/hci1.
D: [pulseaudio] bluetooth-util.c: dbus: interface=org.bluez.Adapter, path=/org/bluez/497/hci1, member=DeviceCreated
D: [pulseaudio] bluetooth-util.c: Device /org/bluez/497/hci1/dev_90_84_0D_B2_C7_04 created
D: [pulseaudio] bluetooth-util.c: dbus: interface=org.freedesktop.DBus, path=/org/freedesktop/DBus, member=NameOwnerChanged
D: [pulseaudio] bluetooth-util.c: Bluetooth daemon disappeared.
E: [pulseaudio] bluetooth-util.c: Assertion 'p->call_data == d' failed at modules/bluetooth/bluetooth-util.c:685, function get_properties_reply(). Aborting.

11 years agobluetooth: Fix possible adapter duplicates
Mikel Astiz [Sun, 17 Feb 2013 09:04:16 +0000 (10:04 +0100)]
bluetooth: Fix possible adapter duplicates

The D-Bus signal AdapterAdded can be received during our call to
GetProperties(), before the reply is received. In this case, the adapter
will be listed twice and thus the endpoint registration will fail with
"AlreadyExists" as follows:

D: [pulseaudio] bluetooth-util.c: dbus: interface=org.bluez.Manager, path=/, member=AdapterAdded
D: [pulseaudio] bluetooth-util.c: Adapter /org/bluez/21220/hci0 created
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPAG on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPHS on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSource on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSink on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPAG on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPHS on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSource on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSink on adapter /org/bluez/21220/hci0.
E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists
E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists
E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists
E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists

11 years agoecho-cancel: Enable different sample specs for rec and out stream
Stefan Huber [Mon, 18 Feb 2013 15:31:03 +0000 (16:31 +0100)]
echo-cancel: Enable different sample specs for rec and out stream

Enable advanced AEC methods to use different specs (i.e., number of
channels) for rec and out stream. A typical application is beam forming
resp. multi-channel AEC, which takes multiple record channels to produce
an echo-canceled output stream.
This commit alters the EC API as follows: the EC's init() used to get
source and sink's sample spec/channel map. The new interface renamed
source to rec and sink to play and additionally passes sample spec and
channel map of the out stream. The new parameter names of init()
{rec,play,out}_{ss,map} are more intuitive and also resemble to the
parameter names known from run(). Both rec_{ss,map} and out_{ss,map} are
initialized as we knew it from source_{ss,map} before being passed to
init(). The previous EC implementations only require trivial changes,
i.e., setting rec_{ss,map} to out_{ss,map} at the end of init() in case
that out_{ss,map} is modified in init().

11 years agobluetooth: Merge all ports into "bluetooth-input" and "bluetooth-output"
Mikel Astiz [Mon, 18 Feb 2013 08:10:35 +0000 (09:10 +0100)]
bluetooth: Merge all ports into "bluetooth-input" and "bluetooth-output"

The card profile availability flag already provides all the necessary
information and therefore all Bluetooth ports can be merged, leaving
the two generic ones only: "bluetooth-input" and "bluetooth-output". The
availability of these port now represents whether the device is
streaming audio, with the following mapping:
- PA_AVAILABLE_UNKNOWN: some profile connected but not streaming
- PA_AVAILABLE_NO: no profiles connected
- PA_AVAILABLE_YES: some profile streaming (regardless of which)

Each port's flag represents the profiles with the corresponding I/O
capabilities (pa_direction_t).

11 years agobluetooth: Use profile availability to auto-switch profiles
Mikel Astiz [Mon, 18 Feb 2013 08:10:34 +0000 (09:10 +0100)]
bluetooth: Use profile availability to auto-switch profiles

Use the card profile availability flag instead of port availability in
order to automatically switch profiles, for example when a paired phone
starts streaming A2DP audio.

11 years agobluetooth: Expose card profile availability
Mikel Astiz [Mon, 18 Feb 2013 08:10:33 +0000 (09:10 +0100)]
bluetooth: Expose card profile availability

Use the transport's state to not only update the ports availability, but
also to update the card profile availability flag. The interpretation is
as follows:
- PA_AVAILABLE_UNKNOWN: BT profile is connected but no audio streaming
- PA_AVAILABLE_NO: BT profile disconnected
- PA_AVAILABLE_YES: BT profile connected and audio streaming

11 years agocli: Show card profile availability status
Mikel Astiz [Mon, 18 Feb 2013 08:10:32 +0000 (09:10 +0100)]
cli: Show card profile availability status

Expose the newly added card profile availability in pacmd.

11 years agocard: Add card profile availability
Mikel Astiz [Mon, 18 Feb 2013 08:10:31 +0000 (09:10 +0100)]
card: Add card profile availability

Some cards are capable to announce if a specific profile is available or
not, effectively predicting whether a profile switch would fail or would
likely succeed. This can for example be useful for a UI that would gray
out any unavailable profile.

In addition, this information can be useful for internal modules
implementing automatic profile-switching policies, such as
module-switch-on-port-available or module-bluetooth-policy.

In particular, this information is essential when a port is associated
to multiple card profiles and therefore the port availability flag does
not provide enough information. The port "bluetooth-output" falls into
this category, for example, since it doesn't distinguish HSP/HFP from
A2DP.

11 years agocore: Internally deprecate pa_port_available_t to use pa_available_t
Mikel Astiz [Mon, 18 Feb 2013 15:13:24 +0000 (16:13 +0100)]
core: Internally deprecate pa_port_available_t to use pa_available_t

Generalize the availability flag in order to be used beyond the scope of
ports.

However, pa_port_availability_t is left unchanged to avoid modifying the
protocol and the client API. This should be replaced by pa_available_t
after a validation phase of this new generic enum type.

11 years agoecho-cancel: Do not bypass EC implementation when play stream is empty
Stefan Huber [Mon, 18 Feb 2013 13:02:31 +0000 (14:02 +0100)]
echo-cancel: Do not bypass EC implementation when play stream is empty

When the play stream from the EC sink has not enough data available then
the EC implementation is currently bypassed by directly forwarding the
record bytes to the EC source. Since EC implementations maintain their
own buffers and cause certain latencies, a bypass leads to glitches as
the out stream stream jumps forth and back in time. Furthermore, some
EC implementations may also apply noise reduction or other sound
enhancing techniques, which are therefore bypassed, too.

Fix this by passing silence bytes to the EC implementation if the play
stream runs empty. Hence, this patch keeps the EC implementation running
even if the play stream has no data available.

11 years agoecho-cancel-test: When fopen() fails tell which file failed
Stefan Huber [Mon, 11 Feb 2013 09:56:46 +0000 (10:56 +0100)]
echo-cancel-test: When fopen() fails tell which file failed

11 years agoecho-cancel-test: Pass aec_args with module args
Stefan Huber [Mon, 11 Feb 2013 09:56:45 +0000 (10:56 +0100)]
echo-cancel-test: Pass aec_args with module args

The echo canceller module can pass arguments to the EC implementation
via the module parameter aec_args. However, the echo-cancel-test passes
EC arguments via a separate argv[] option, which is inconsistent. Fix
this.