]> code.delx.au - pulseaudio/log
pulseaudio
11 years agobuild: Add .gitignore files to EXTRA_DIST.
Tanu Kaskinen [Sat, 6 Oct 2012 12:05:08 +0000 (15:05 +0300)]
build: Add .gitignore files to EXTRA_DIST.

As a packager, I want to be able to do "git format-patch
v3.0..origin/master" and I want the generated patches to apply cleanly
against the 3.0 tarball. The patches don't currently apply cleanly if
there are any changes to the .gitignore files, because the .gitignore
files are not shipped in the tarball. This patch fixes that problem.

11 years agoman pulse-daemon.conf: Correct typoes
Wieland Hoffmann [Wed, 31 Oct 2012 17:50:24 +0000 (18:50 +0100)]
man pulse-daemon.conf: Correct typoes

11 years agobuild-sys: Document libpulsecommon vs. libpulse duplication
Arun Raghavan [Sat, 3 Nov 2012 10:50:10 +0000 (11:50 +0100)]
build-sys: Document libpulsecommon vs. libpulse duplication

11 years agoi18n: Fix POTFILES for poll changes
Arun Raghavan [Sat, 3 Nov 2012 09:52:35 +0000 (10:52 +0100)]
i18n: Fix POTFILES for poll changes

poll.c was moved to poll-posix.c and poll-win32.c was added for the
Windows port.

11 years agobuild-sys: Bump soname
Arun Raghavan [Sat, 3 Nov 2012 09:44:42 +0000 (10:44 +0100)]
build-sys: Bump soname

11 years agoRevert "core: adjust playing_for and underrun_for at rewind"
Arun Raghavan [Sat, 3 Nov 2012 09:29:20 +0000 (10:29 +0100)]
Revert "core: adjust playing_for and underrun_for at rewind"

This reverts commit 5bc6cadcb2e7255fd333ed88cc80b61a7673ddd9.

I wasn't meaning to push this out - just merged for review / testing.

11 years agocore: adjust playing_for and underrun_for at rewind
Uoti Urpala [Sat, 28 Jul 2012 20:51:46 +0000 (23:51 +0300)]
core: adjust playing_for and underrun_for at rewind

A rewind may erase data that sink_input counted in playing_for or
underrun_for earlier. Add code adjusting those values after a rewind.

One visible symptom of this bug was problems recovering from an
underrun. When a client calls pa_stream_write() with a large block of
memory, the function can split that into smaller pieces before sending
it to the server. When receiving new data for a stream that had
silence queued due to underrun, the server would do a rewind to
replace the queued-but-not-played silence with the new data. Because
of the bug, this rewind itself would not change underrun_for. It's
possible for multiple rewinds to be done without filling the sink
buffer in between (which is what would eventually reset underrun_for).
In this case, the server rapidly processing the split packets would
rewind the stream for _each_ of them (as underrun_for would stay set),
erasing valid audio as a result.

11 years agosvolume: Fix ARM alignment issues
Arun Raghavan [Tue, 30 Oct 2012 06:34:42 +0000 (12:04 +0530)]
svolume: Fix ARM alignment issues

As Peter Meerwald <p.meerwald@bct-electronic.com> discovered, our ARM
svolume code performance is quite terrible when the incoming samples are
not word-aligned. This can very easily be the case, since the
architecture only requires that the samples be 16-bit aligned, and we
might end up running the innermost loop after processing modulo-4
samples. The performance degradation was ~50x on a Cortex A9
(Pandaboard).

This reworks the svolume logic to first consume enough samples to make
sure the rest is word aligned, and reordering the processing to work
with 4 samples at a time first, and then finally deal with the
remainder.

With this, performance is comparable for arbitrary alignments (~3x
faster than the C code).

11 years agotests: Minor alignment adjustment fix for cpu-test
Arun Raghavan [Tue, 30 Oct 2012 14:58:24 +0000 (20:28 +0530)]
tests: Minor alignment adjustment fix for cpu-test

11 years agomatch: Use the SINK_INPUT_FIXATE hook instead of NEW.
Tanu Kaskinen [Thu, 27 Sep 2012 13:41:59 +0000 (16:41 +0300)]
match: Use the SINK_INPUT_FIXATE hook instead of NEW.

The callback relies on the sample spec being finalized, which is not
true with the NEW hook.

In case you're wondering about the "hook EARLY - 1, to match before
stream-restore" comment that was not changed even though the code that
the comment concerned was changed: the comment was apparently written
at a time when module-stream-restore used the NEW hook too, and later
stream-restore has been changed to use the FIXATE hook. So, the
comment was wrong/nonsensical before this patch. Since these two
modules now use the same hook again, the comment makes sense again.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=55135
11 years agocombine: Keep the timer active in the null mode only when running.
Tanu Kaskinen [Thu, 20 Sep 2012 06:42:18 +0000 (09:42 +0300)]
combine: Keep the timer active in the null mode only when running.

Previously thread_func() used PA_SINK_IS_OPENED() to check whether
some data should be rendered. process_render_null() used a different
check: it would return immediately if the sink was not in the RUNNING
state. This caused a busy loop when the sink was in the IDLE state,
because process_render_null() didn't update the timestamp, and
thread_func() still kept the timer active using the old timestamp.
pa_rtpoll_run() would return immediately because of the old timestamp.

This is fixed by using the same check in both thread_func() and
process_render_null(). Since the checks are the same, it's actually
redundant to have the check in process_render_null(), so it is now an
assertion.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=54779
11 years agovirtual-surround-sink: Fix setting max_request and max_rewind.
Tanu Kaskinen [Wed, 22 Aug 2012 06:00:25 +0000 (09:00 +0300)]
virtual-surround-sink: Fix setting max_request and max_rewind.

The sink has different frame size than the sink input, so
the max_request and max_rewind values of the sink input need
to be converted when setting the sink max_request and
max_rewind values.

The conversion is already done correctly in
sink_input_update_max_request_cb() and
sink_input_update_max_rewind_cb().

11 years agoloopback: Don't fix the source output format/rate/channels.
Tanu Kaskinen [Tue, 14 Aug 2012 14:08:35 +0000 (17:08 +0300)]
loopback: Don't fix the source output format/rate/channels.

Once the sink input has been routed in pa_sink_input_new(),
the sample spec and channel map have already become fixed.
The sink input and source output must use the same stream
format, because the data is copied as-is.

11 years agoloopback: Use the real sample spec once it's known.
Tanu Kaskinen [Tue, 14 Aug 2012 14:08:34 +0000 (17:08 +0300)]
loopback: Use the real sample spec once it's known.

When module-loopback is loaded without arguments, the ss and
map variables are initialized with dummy values. This caused
a problem, because also pa_memblockq_new() was called with
the dummy values, making it work incorrectly. The base was
set to 1 instead of the real frame size, which in turn
caused alignment related crashes.

11 years agoresampler: Make sure that there are no overflows when multiplying potentially big...
Tanu Kaskinen [Mon, 9 Jul 2012 07:07:05 +0000 (10:07 +0300)]
resampler: Make sure that there are no overflows when multiplying potentially big numbers.

This fixes at least one crash that has been observed. The
multiplication in trivial_resample() overflowed when
resampling from 96 kHz to 48 kHz, causing an assertion
error:

Assertion 'o_index * fz < pa_memblock_get_length(output->memblock)' failed at pulsecore/resampler.c:1521, function trivial_resample(). Aborting.

Without the assertion, the memcpy() after the assertion
would have overwritten some random heap memory.

11 years agomemblockq: Fix the order of setting minreq and prebuf.
Tanu Kaskinen [Sat, 28 Apr 2012 15:54:11 +0000 (18:54 +0300)]
memblockq: Fix the order of setting minreq and prebuf.

11 years agocore-util: Don't error out on existing runtime directory.
Thomas Martitz [Tue, 30 Oct 2012 10:35:26 +0000 (11:35 +0100)]
core-util: Don't error out on existing runtime directory.

When compiling without HAVE_SYMLINK the runtime dir is a real directory,
which is attempted to be created. In the case it already exists we shouldn't
error out. The HAVE_SYMLINK-enabled code already does this.

11 years agocore: Proper poll() emulation to fix pacat and friends on Windows
Thomas Martitz [Tue, 30 Oct 2012 10:35:24 +0000 (11:35 +0100)]
core: Proper poll() emulation to fix pacat and friends on Windows

Currently, Windows versions of pacat and friends fail because the current
poll emulation is not sufficient (it only works for socket fds).

Luckily Gnulib has a much better emulation that seems to work good enough.
The implementation has been largely copied (except a few bug fix
regarding timeout handling, to be pushed upstream) and works on pipes
and files as well. The copy has been obtained through their gnulib-tool utility,
which gives a LGPLv2.1+ licensed file.

This fixes the "Assertion (!e->dead) failed" error coming and lets pacat
and friends stream happily to/from a server (I didn't actually test parec).

11 years agobuild-sys: Drop -Wvla from compiler flags
Arun Raghavan [Tue, 30 Oct 2012 06:08:01 +0000 (11:38 +0530)]
build-sys: Drop -Wvla from compiler flags

Since we mandate C99 support, not reason to keep this around.

11 years agotests: Fix a cpu-test debug message
Arun Raghavan [Tue, 30 Oct 2012 06:07:06 +0000 (11:37 +0530)]
tests: Fix a cpu-test debug message

We align at sample granularity and not byte granularity (which might
violate arch alignment requirements).

11 years agotests: Run svolume on different channel counts
Arun Raghavan [Tue, 30 Oct 2012 06:00:16 +0000 (11:30 +0530)]
tests: Run svolume on different channel counts

This adds checks to run svolume tests with 1, 2 and 3 channels (we don't
run Orc with 3 channels since only 1/2-ch are implemented there).

11 years agotests: Make cpu-test less verbose
Arun Raghavan [Tue, 30 Oct 2012 05:54:33 +0000 (11:24 +0530)]
tests: Make cpu-test less verbose

Drops the correctness debug output since we want to run this several
times, and the output becomes much more verbose than required.

11 years agotests: Run svolume test for various sample alignments
Arun Raghavan [Tue, 30 Oct 2012 04:00:32 +0000 (09:30 +0530)]
tests: Run svolume test for various sample alignments

Allows us to make sure that svolume works independently of sample
alignment, and that performance doesn't degrade based on this.

11 years agocore: Fix warning on non-win32 builds
Arun Raghavan [Mon, 29 Oct 2012 12:02:32 +0000 (17:32 +0530)]
core: Fix warning on non-win32 builds

11 years agobuild: Add a2dp-codecs.h to libbluetooth-util sources.
Tanu Kaskinen [Sat, 6 Oct 2012 11:43:07 +0000 (14:43 +0300)]
build: Add a2dp-codecs.h to libbluetooth-util sources.

11 years agotests: Minor cpu-test fixes for non-NEON builds
Arun Raghavan [Mon, 29 Oct 2012 09:10:00 +0000 (14:40 +0530)]
tests: Minor cpu-test fixes for non-NEON builds

The s16->float test is only run on ARM with NEOn at the moment, so we
don't define that code in other cases.

11 years agotests: Print average outer-loop iteration time in cpu-test
Arun Raghavan [Mon, 29 Oct 2012 07:56:25 +0000 (13:26 +0530)]
tests: Print average outer-loop iteration time in cpu-test

11 years agotests: Increase sconv cpu-test timeout
Arun Raghavan [Fri, 26 Oct 2012 11:15:32 +0000 (16:45 +0530)]
tests: Increase sconv cpu-test timeout

This takes longer on ARM CPUs, especially older ones.

11 years agotests: Allow off-by-one error in sconv test
Arun Raghavan [Fri, 26 Oct 2012 11:09:11 +0000 (16:39 +0530)]
tests: Allow off-by-one error in sconv test

With some optimised sconv implementations (read NEON), rounding
inaccuracy might lead to a difference of 1 with the reference
implementation. The inaccuracy is worth the performance gain.

Also increases floating-point accuracy while printing errors to make
errors easier to analyse.

11 years agosconv: Fix NEON sconv rounding code
Arun Raghavan [Fri, 26 Oct 2012 11:06:49 +0000 (16:36 +0530)]
sconv: Fix NEON sconv rounding code

Rounding with 0.5 causes us to always round up for any value of the form
x.5. IEEE754 specifies round-to-nearest-even as the behaviour in this
case. This might not always be possible with NEON code, but this change
gets us much closer to it.

11 years agotests: Implement test code for ARM NEON sconv s16_to_float
Peter Meerwald [Sat, 27 Oct 2012 12:59:43 +0000 (14:59 +0200)]
tests: Implement test code for ARM NEON sconv s16_to_float

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agotests: Fix test description in cpu-test
Peter Meerwald [Fri, 26 Oct 2012 11:04:47 +0000 (13:04 +0200)]
tests: Fix test description in cpu-test

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agocore: Add ARM NEON optimized sample conversion code
Peter Meerwald [Tue, 23 Oct 2012 15:54:57 +0000 (17:54 +0200)]
core: Add ARM NEON optimized sample conversion code

final:
* includes some minor style fixes and build-time changes to allow
  building a single binary for neon and non-neon systems
v4:
* fix for sample length < 4
v3:
* convert from intrinsics to inline assembly
v2:
* load and store data with vld1/vld1q and vst1/vst1q, resp., to work
  around alignment issues of compiler-generated vldmia instruction
* remove redundant check for NEON flags

Ubuntu/Linaro gcc 4.6.3
arm-linux-gnueabi-gcc -O2 -mcpu=cortex-a8 -mfloat-abi=softfp -mfpu=neon

runtime on beagle-xm:

D: [pulseaudio] sconv_neon.c: checking NEON sconv_s16le_from_float
I: [pulseaudio] sconv_neon.c: NEON: 3754 usec.
I: [pulseaudio] sconv_neon.c: ref: 58594 usec.
D: [pulseaudio] sconv_neon.c: checking NEON sconv_s16le_to_float
I: [pulseaudio] sconv_neon.c: NEON: 1831 usec.
I: [pulseaudio] sconv_neon.c: ref: 10528 usec.
I: [pulseaudio] sconv_neon.c: Initialising ARM NEON optimized conversions.

conversion may be off by one for some samples due to rounding issues

11 years agobuild-sys: Add volume code to libpulsecommon
Arun Raghavan [Fri, 26 Oct 2012 03:11:08 +0000 (08:41 +0530)]
build-sys: Add volume code to libpulsecommon

Commit dd31d652a ("utils: Adding a function to get volume from string")
uses pa_sw_volume_from_dB(), which is part of libpulse, in libpulsecore.
This breaks as-needed builds. We fix this by also building the volume
code in libpulsecommon.

11 years agocard: Store a pa_card pointer in pa_card_profile.
Tanu Kaskinen [Fri, 29 Jun 2012 15:04:55 +0000 (18:04 +0300)]
card: Store a pa_card pointer in pa_card_profile.

11 years agobluetooth: Add hook to announce late UUIDs
Mikel Astiz [Tue, 23 Oct 2012 14:41:59 +0000 (16:41 +0200)]
bluetooth: Add hook to announce late UUIDs

UUIDs might be announced at any time, so a hook is needed to notify any
interested module. In practice, the UUIDs are quite stable with the
exception of the pairing procedure, where the UUIDs are reported by
BlueZ as soon as they are discovered.

11 years agocard: Support adding ports dynamically
Mikel Astiz [Tue, 23 Oct 2012 14:41:56 +0000 (16:41 +0200)]
card: Support adding ports dynamically

Card profiles -specially the ones registered with pa_card_add_profile()-
might need to create new ports during the lifetime of the card.

11 years agocard: Support adding profiles dynamically
Mikel Astiz [Tue, 23 Oct 2012 14:41:55 +0000 (16:41 +0200)]
card: Support adding profiles dynamically

Some cards might need to add profiles during their lifetime, that is,
after the card has been created.

11 years agoutils: Adding a function to get volume from string
Flavio Ceolin [Wed, 24 Oct 2012 19:29:45 +0000 (17:29 -0200)]
utils: Adding a function to get volume from string

The allowed volume formats are dB, % or integer.
For example: 10% or 10db or 10.

11 years agotests: Run sconv tests with multiple alignments
Arun Raghavan [Wed, 24 Oct 2012 07:18:02 +0000 (12:48 +0530)]
tests: Run sconv tests with multiple alignments

This allows us to test the sconv code with the incoming samples at
various byte alignments. The test is also now split into correctness and
performance checks.

11 years agoalsa-mixer: Don't let "Mic Jack Mode" alone create a "Line In" path
David Henningsson [Tue, 16 Oct 2012 09:35:00 +0000 (11:35 +0200)]
alsa-mixer: Don't let "Mic Jack Mode" alone create a "Line In" path

The IDT/Sigmatel codec driver often creates a "Mic Jack Mode" for
every mic jack, so it can change functionality between Mic and Line In.

However, as the "Mic Jack" is the standard naming, our current solution
does not make the Line In port unavailable when nothing is plugged in.

This patch makes the "Line In" port not to be created just because there
is a "Mic Jack Mode" that could be set to "Line". This makes the behaviour
consistent with e g "Dock Mic Jack Mode", "Front Mic Jack Mode" etc, where
we don't create a "Dock Line" or "Dock Mic" port either.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agortp: Fix warning using pa_assert_not_reached()
Peter Meerwald [Tue, 23 Oct 2012 15:37:24 +0000 (17:37 +0200)]
rtp: Fix warning using pa_assert_not_reached()

  modules/rtp/module-rtp-recv.c:462:8: warning: 'r' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agovirtual-surround: Limit the number of hrir samples.
Niels Ole Salscheider [Fri, 5 Oct 2012 19:46:49 +0000 (21:46 +0200)]
virtual-surround: Limit the number of hrir samples.

v2: better log message

11 years agovirtual-surround: Add silence to hrir if necessary.
Niels Ole Salscheider [Fri, 5 Oct 2012 19:46:48 +0000 (21:46 +0200)]
virtual-surround: Add silence to hrir if necessary.

Otherwise, the hrir might be too short to get completely resampled

v2: take different sample rates into account

11 years agopulse: Fix for volume documentation
Flavio Ceolin [Thu, 9 Aug 2012 18:52:52 +0000 (15:52 -0300)]
pulse: Fix for volume documentation

Fixing the documentation for the function pa_cvolume_dec().

11 years agotests: Add a basic sanity test to sconv cpu-test
Arun Raghavan [Tue, 23 Oct 2012 12:59:27 +0000 (18:29 +0530)]
tests: Add a basic sanity test to sconv cpu-test

This seems redundant with the previous check in that function, but it
makes sure that the result of the speed comparison is what we think it
is.

11 years agotests: Reorganise cpu-test to reuse code
Arun Raghavan [Tue, 23 Oct 2012 12:56:39 +0000 (18:26 +0530)]
tests: Reorganise cpu-test to reuse code

This factors out the basic measurement code for each test into a
separate block so that each test can be broken down into a basic
correctness test, and a performance comparison with minimum effort.

11 years agotests: Factor out core sconv test code in cpu-test
Arun Raghavan [Tue, 23 Oct 2012 09:58:47 +0000 (15:28 +0530)]
tests: Factor out core sconv test code in cpu-test

This will let us add tests for non-SSE sconv tests.

11 years agotests: Add a copyright header to cpu-test
Arun Raghavan [Tue, 23 Oct 2012 09:58:26 +0000 (15:28 +0530)]
tests: Add a copyright header to cpu-test

11 years agortp: Fix rtp_port reading.
Tanu Kaskinen [Thu, 29 Mar 2012 13:03:59 +0000 (16:03 +0300)]
rtp: Fix rtp_port reading.

pa_atou() return value was not checked, and the cast of a
16-bit variable pointer to a 32-bit variable pointer could
corrupt cseq.

11 years agogccmacro: Disable printf-like format checking on mingw32 compilers.
Thomas Martitz [Tue, 23 Oct 2012 10:10:45 +0000 (12:10 +0200)]
gccmacro: Disable printf-like format checking on mingw32 compilers.

Am 23.10.2012 08:25, schrieb Arun Raghavan:
> On Tue, 2012-08-21 at 13:32 +0200, Thomas Martitz wrote:
>> Am 21.08.2012 08:51, schrieb Rémi Denis-Courmont:
>>> Le mardi 21 août 2012 00:50:34 Thomas Martitz, vous avez écrit :
>>>> There are tons of warnings, most of them because the function is not
>>>> recognized as printf-like.
>>> Removing checks looks very fishy.
>>>
>>> To use C99 and/or GNU format specifiers on MingW, you need to use the
>>> gnuprintf attribute instead of printf. With printf, the format string is
>>> validated according to the antiquated MSVC rules.
>>>
>> Interesting, I didn't know about gnuprintf. FWIW, what are those
>> antiquated MSVC rules? I assumed the return value which isn't int for
>> some affected functions?
> Is this one going to be respun?
>

Yes, here you go.

>From c5f15eec69bf95c9a1261e0d82abbd039156e75e Mon Sep 17 00:00:00 2001
From: Thomas Martitz <kuge@rockbox.org>
Date: Wed, 8 Aug 2012 17:38:04 +0200
Subject: [PATCH 1/3] gccmacro: Work around warnings due to printf redirection
 by libintl.

Libintl defines printf as libintl_printf, which breaks the format
attribue. Unfortunately the workaround around provided by libintl
is only enabled for cygwin, but not for mingw builds. Therefore
install the workaround manually.

11 years agobluetooth: Refactor code to create profile ports
Mikel Astiz [Mon, 22 Oct 2012 08:46:42 +0000 (10:46 +0200)]
bluetooth: Refactor code to create profile ports

Put the created ports in a hashmap, but not necessarily inside a struct
pa_card_new_data.

11 years agobluetooth: Refactor code to create card profiles
Mikel Astiz [Mon, 22 Oct 2012 08:46:41 +0000 (10:46 +0200)]
bluetooth: Refactor code to create card profiles

Use a helper function to create the card profiles, given an UUID.

11 years agoecho-cancel: Fix false warning in webrtc AEC.
Peter Meerwald [Mon, 22 Oct 2012 21:48:27 +0000 (23:48 +0200)]
echo-cancel: Fix false warning in webrtc AEC.

  CXX      libwebrtc_util_la-webrtc.lo
modules/echo-cancel/webrtc.cc: In function 'pa_bool_t pa_webrtc_ec_init(pa_core*, pa_echo_canceller*, pa_sample_spec*, pa_channel_map*, pa_sample_spec*, pa_channel_map*, uint32_t*, const char*)':
modules/echo-cancel/webrtc.cc:196:9: warning: 'rm' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agosvolume_arm: Fix a const warning.
Peter Meerwald [Mon, 22 Oct 2012 21:43:53 +0000 (23:43 +0200)]
svolume_arm: Fix a const warning.

  CC       libpulsecore_2.98_la-svolume_arm.lo
pulsecore/svolume_arm.c: In function 'pa_volume_s16ne_arm':
pulsecore/svolume_arm.c:50:8: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agocore: Slightly more helpful pa_cstrerror for unknown errors
Thomas Martitz [Mon, 20 Aug 2012 21:50:39 +0000 (23:50 +0200)]
core: Slightly more helpful pa_cstrerror for unknown errors

On Windows, strerror can actually return "Unknown Error"
(e.g. for large errnums). The code assumes the return value to be helpful.
Make it slightly more helpful by catching the message and appending the
errnum.

11 years agopacat: Replace read(), write() with pa_* equivalent.
Thomas Martitz [Mon, 20 Aug 2012 21:50:38 +0000 (23:50 +0200)]
pacat: Replace read(), write() with pa_* equivalent.

Calling pa_read() and pa_write() seems more appropriate since they deal better
with platform specific issues. This doesn't actually fix any open issue since
only stdio is affected but it seems more future proof.

11 years agocore: Transparently handle non-blocking sockets on Windows
Thomas Martitz [Mon, 20 Aug 2012 21:50:37 +0000 (23:50 +0200)]
core: Transparently handle non-blocking sockets on Windows

On Windows, fdsem.c:flush() fails because sockets are set to non-blocking
mode, since pa_read() returns -1 (and errno == EWOULDBLOCK). I guess pa_read()
is expected to block in this case so make it actually block by calling poll().

11 years agopacat: Enable binary mode on Windows.
Thomas Martitz [Mon, 20 Aug 2012 21:50:35 +0000 (23:50 +0200)]
pacat: Enable binary mode on Windows.

Without this reading from stdin will eventually end with EOF (if there happens
to be a newline sign in the stream), because read() returns 0.

This patch fixes raw data input and piping to pacat on Windows.

11 years agobluetooth: Hold device pointer while module loaded
Mikel Astiz [Mon, 22 Oct 2012 08:46:39 +0000 (10:46 +0200)]
bluetooth: Hold device pointer while module loaded

Instead of repeatedly asking the discovery API to find a device given
our device path, let's hold a pointer to the device and make sure we
remove the reference when the hook is fired reporting that the device
has been removed. This makes the code easier to follow and slightly
more efficient.

11 years agobluetooth: Self unload module-bluetooth-device
Mikel Astiz [Mon, 22 Oct 2012 08:46:38 +0000 (10:46 +0200)]
bluetooth: Self unload module-bluetooth-device

If the device has been removed, unload the module without depending on
module-bluetooth-discovery.

11 years agobluetooth: Add hook to tell device was removed
Mikel Astiz [Mon, 22 Oct 2012 08:46:37 +0000 (10:46 +0200)]
bluetooth: Add hook to tell device was removed

Add a hook to report that the device was removed, and thus references to
it should be released.

11 years agobluetooth: Remove const qualifier for device
Mikel Astiz [Mon, 22 Oct 2012 08:46:36 +0000 (10:46 +0200)]
bluetooth: Remove const qualifier for device

The internal API in bluetooth-util should not use the const qualifier
for operations involving a device object. After all, the structure
contains many pointers and thus the const qualifier provides no real
protection.

11 years agoalsa-sink/source: Warn for scheduling delays
David Henningsson [Mon, 22 Oct 2012 08:53:32 +0000 (10:53 +0200)]
alsa-sink/source: Warn for scheduling delays

Sometimes the kernel does not schedule us in due time, thus causing
an underrun. Adding a detection and a debug message will be a helpful
step in determining the cause of an underrun.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agodaemon: Fix redundant redeclaration warning
Peter Meerwald [Tue, 10 Jul 2012 12:44:03 +0000 (14:44 +0200)]
daemon: Fix redundant redeclaration warning

  CC     pulseaudio-dumpmodules.o
daemon/dumpmodules.c:93:27: warning: redundant redeclaration of ‘lt__PROGRAM__LTX_preloaded_symbols’ [-Wredundant-decls]
/usr/include/ltdl.h:106:36: note: previous declaration of ‘lt__PROGRAM__LTX_preloaded_symbols’ was here

the declaration is provided by ltld.h of libtool since version 2.4, require the 2.4 instead of 2.2

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agomodargs: New function: pa_modargs_get_value_double().
Flavio Ceolin [Tue, 9 Oct 2012 18:16:29 +0000 (15:16 -0300)]
modargs: New function: pa_modargs_get_value_double().

11 years agobluetooth: Hold transport pointer while profile set
Mikel Astiz [Fri, 19 Oct 2012 08:11:28 +0000 (10:11 +0200)]
bluetooth: Hold transport pointer while profile set

Instead of repeatedly asking the discovery API to find a transport given
our transport path, let's hold a pointer to the transport and make sure
we remove the reference when the hook is fired reporting that the
transport has been removed. This makes the code easier to follow and
slightly more efficient.

11 years agobluetooth: Set to off instead of failing module load
Mikel Astiz [Fri, 19 Oct 2012 08:11:27 +0000 (10:11 +0200)]
bluetooth: Set to off instead of failing module load

If the profile setup fails during module load, the fallback should be
setting the profile to off, exactly as it is done in card_set_profile().

11 years agobluetooth: Set to off if transport removed
Mikel Astiz [Fri, 19 Oct 2012 08:11:26 +0000 (10:11 +0200)]
bluetooth: Set to off if transport removed

The recently added hook can be used to detect that the transport being
used has been removed. In this case, the profile needs to be set to off.

Additionally, the change fixes a significant problem: without this
transition, the transport could be destroyed while the hook slots (i.e.
nrec_changed_slot) were still set. This led to a double free of these
objects in stop_thread().

11 years agobluetooth: Add hook to tell transport was removed
Mikel Astiz [Fri, 19 Oct 2012 08:11:25 +0000 (10:11 +0200)]
bluetooth: Add hook to tell transport was removed

Add a hook to report that the transport was removed from D-Bus, and thus
references to it should be released.

11 years agobluetooth: Remove const qualifier for transports
Mikel Astiz [Fri, 19 Oct 2012 08:11:24 +0000 (10:11 +0200)]
bluetooth: Remove const qualifier for transports

The internal API in bluetooth-util should not use the const qualifier
for operations modifying the transport object. This is specially useful
in order to use the available hooks.

11 years agobluetooth: Check return value of start_thread()
Mikel Astiz [Fri, 19 Oct 2012 08:11:23 +0000 (10:11 +0200)]
bluetooth: Check return value of start_thread()

The function can return an error, so in that case the profile change
should fail.

11 years agobluetooth: Check return value of init_profile()
Mikel Astiz [Fri, 19 Oct 2012 08:11:22 +0000 (10:11 +0200)]
bluetooth: Check return value of init_profile()

If profile could not be successfully initialized, the card should be
set to PROFILE_OFF automatically. If sinks or sources exist, they need
to be destroyed, therefore stop_thread() is called.

11 years agobluetooth: Use assertions when setting off profile
Mikel Astiz [Fri, 19 Oct 2012 08:11:21 +0000 (10:11 +0200)]
bluetooth: Use assertions when setting off profile

Setting the card profile to off cannot fail, therefore assertions can be
used when calling pa_card_set_profile().

11 years agocore: Fix a litte-endian bug in ARM svolume code
Arun Raghavan [Thu, 18 Oct 2012 05:13:17 +0000 (10:43 +0530)]
core: Fix a litte-endian bug in ARM svolume code

The old code seems to be written for big-endian code.

11 years agocore: Document ARM-optimised svolume code a bit
Arun Raghavan [Thu, 18 Oct 2012 05:12:48 +0000 (10:42 +0530)]
core: Document ARM-optimised svolume code a bit

11 years agotests: Minor cpu-test reorganisation
Arun Raghavan [Fri, 19 Oct 2012 13:13:17 +0000 (18:43 +0530)]
tests: Minor cpu-test reorganisation

Make volume and conversion tests separate test cases.

11 years agotests: Factor out ARM svolume test into cpu-test
Arun Raghavan [Tue, 16 Oct 2012 06:53:19 +0000 (12:23 +0530)]
tests: Factor out ARM svolume test into cpu-test

This allows us to run the testing code separately from the PulseAudio
daemon, which makes developing / regression testing this code a lot
easier.

11 years agocore: Separate ARM CPU detection from initialisation
Arun Raghavan [Tue, 16 Oct 2012 06:30:19 +0000 (12:00 +0530)]
core: Separate ARM CPU detection from initialisation

This separate the ARM CPU feature detection code from the initialisation
so that we can reuse it in tests, like we did for x86 a while back.

11 years agobluetooth: Remove stream moving code
Mikel Astiz [Thu, 18 Oct 2012 08:27:15 +0000 (10:27 +0200)]
bluetooth: Remove stream moving code

Remove stream moving policies from module-bluetooth-device. It is not
clear if such policies are needed at all and in case yes, they should be
implemented in module-bluetooth-policy.

11 years agocli: Output asterisk when default sink/source is found
David Henningsson [Tue, 16 Oct 2012 14:05:52 +0000 (16:05 +0200)]
cli: Output asterisk when default sink/source is found

These days we don't set core->default_sink/source as soon as somebody
asks for it. To retain consistent behaviour (i e the asterisk),
we need to call pa_namereg_get_default_sink/source.

Reported-by: Daniel Manrique <daniel.manrique@canonical.com>
Reported-by: Brendan Donegan <brendan.donegan@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agobluetooth: Unlink sink-sources in stop_thread()
Mikel Astiz [Fri, 28 Sep 2012 15:45:31 +0000 (17:45 +0200)]
bluetooth: Unlink sink-sources in stop_thread()

Avoid duplicated code by moving the unlinking of sinks and sources to
stop_thread(). After all, they need to be unlinked when the thread is
stopped.

11 years agobluetooth: Release transport in stop_thread()
Mikel Astiz [Fri, 28 Sep 2012 15:45:30 +0000 (17:45 +0200)]
bluetooth: Release transport in stop_thread()

Avoid duplicated code by releasing the transport inside stop_thread(),
along with the rest of the thread-related cleanup.

11 years agobluetooth: Don't find device if set profile is off
Mikel Astiz [Fri, 28 Sep 2012 15:45:29 +0000 (17:45 +0200)]
bluetooth: Don't find device if set profile is off

If the card is being set to off profile, it is not necessary to check
if the device exists. This could potentially happen during shutdown,
immediately before the module is unloaded.

11 years agobluetooth: Fix potential assertion failure
Mikel Astiz [Fri, 28 Sep 2012 15:45:28 +0000 (17:45 +0200)]
bluetooth: Fix potential assertion failure

It might happen that a PropertyChanged signal is received but the
corresponding card profile has not been created, leading to an assertion
failure in filter_cb() due to inexistent ports. This can happen if BlueZ
misbehaves, or also if the UUIDs are reported later on (i.e. during
pairing discovery). In any case, the signal should just be ignored.

11 years agobluetooth: Trivial function rename
Mikel Astiz [Fri, 28 Sep 2012 15:45:27 +0000 (17:45 +0200)]
bluetooth: Trivial function rename

Former setup_bt() was just setting up the transport, so it's easier to
follow if the function name makes this more explicit.

11 years agobluetooth: Ignore Device.DisconnectRequested
Mikel Astiz [Fri, 28 Sep 2012 15:45:26 +0000 (17:45 +0200)]
bluetooth: Ignore Device.DisconnectRequested

Handling the signal DisconnectRequested should be unnecessary since the
profile-specific interfaces will be later disconnected, leading to
module unload.

Additionally, the signal is problematic: if an interface (i.e.
A2DP AudioSource) is playing at the time DisconnectRequested is
signaled, the following sequence can occur:

1. AudioSource is playing
2. DisconnectRequested is received
3. Module is unloaded due to DisconnectRequested
4. AudioSource state changes from playing to connected
5. module-bluetooth-discover loads the module
6. AudioSource state changes from connected to disconnected

Therefore the module is unnecessarily loaded, to be unloaded immediately
afterwards. This can easily be reproduced if a device is unpaired while
the audio is streaming.

The simplest solution to this consists of removing step 3, by just
ignoring the DisconnectRequested signal. This reverts commit
8169a6a6c921215c1353e8a34fccbdc4e2e20440.

11 years agobluetooth: Remove ipc.[ch] files in the bluetooth module
Chan-yeol Park [Wed, 1 Aug 2012 05:18:20 +0000 (14:18 +0900)]
bluetooth: Remove ipc.[ch] files in the bluetooth module

These files are remove in the bluez project.
In case of definitions in the ipc files
we could use defintions in the a2dp-codecs.h

11 years agotests: make 'check' optional
Deng Zhengrong [Mon, 13 Aug 2012 07:34:05 +0000 (15:34 +0800)]
tests: make 'check' optional

11 years agoalsa-mixer: Remove analog-output-lfe-on-mono
David Henningsson [Thu, 4 Oct 2012 11:32:35 +0000 (13:32 +0200)]
alsa-mixer: Remove analog-output-lfe-on-mono

Upstreamed from Debian: "Although in principle Ac '97 hardware has a
separate mono LFE pin nothing seems to use it. To make matters worse
it does confuse PulseAudio's port selection slightly which causes
audio in virtualbox not to work out of the box."

Credit: Sjoerd Simons <sjoerd@debian.org>
Credit: Martin-Éric Racine <martin-eric.racine@iki.fi>
BugLink: https://bugs.launchpad.net/bugs/1016969
BugLink: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673847
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoalsa-mixer: Cache failure to open inputs/output mappings
David Henningsson [Mon, 1 Oct 2012 13:37:21 +0000 (15:37 +0200)]
alsa-mixer: Cache failure to open inputs/output mappings

I was hoping this would improve bootup speed, but it doesn't seem
to do so here, at least not much. But at least it reduces the logs
a little.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agogit-version-gen: Honor GIT_DESCRIBE_FOR_BUILD environment variable
Colin Walters [Tue, 25 Sep 2012 23:26:18 +0000 (19:26 -0400)]
git-version-gen: Honor GIT_DESCRIBE_FOR_BUILD environment variable

The GNOME-OSTree build system currently creates chroots and bind
mounts to the source tree outside the root; this means that we can't
necessarily run git inside the root, because in the case of git
submodules, the .git repository will point to outside root.

Also, error out fatally if we fail to determine the version; it
makes no sense to put UNKNOWN in e.g. the pkg-config files
since this will just cause errors later on.

11 years agobluetooth: Add port availability transition policies
Mikel Astiz [Fri, 31 Aug 2012 10:51:13 +0000 (12:51 +0200)]
bluetooth: Add port availability transition policies

Handle availability changes in Bluetooth ports inside
module-bluetooth-policy. The implemented behavior is similar to how
module-switch-on-port-available behaves, but the conditions are more
relaxed and thus more profile changes are triggered.

11 years agobluetooth: Let suspend-on-idle request audio in headset
Mikel Astiz [Fri, 31 Aug 2012 10:51:12 +0000 (12:51 +0200)]
bluetooth: Let suspend-on-idle request audio in headset

When PA is doing gateway role, let module-suspend-on-idle resume the
audio stream automatically. This will work until the user (or the remote
side, which we also consider user-initiated) suspend the stream
manually.

11 years agobluetooth: Do not switch to HFGW automatically
Mikel Astiz [Fri, 31 Aug 2012 10:51:08 +0000 (12:51 +0200)]
bluetooth: Do not switch to HFGW automatically

Card profile hfgw should be no different from the rest, and thus no
internal policy inside module-bluetooth-device should decide to switch
to its profile automatically.

This should be handled by policy modules.

11 years agobluetooth: Release transport when not available
Mikel Astiz [Fri, 31 Aug 2012 10:51:07 +0000 (12:51 +0200)]
bluetooth: Release transport when not available

Handle the Playing->Connected transition gracefully by releasing the
transport and setting the sink and sources as suspended. This is
necessary since the IO thread might not encounter a HUP always.

11 years agobluetooth: Acquire transport when becomes available
Mikel Astiz [Fri, 31 Aug 2012 10:51:06 +0000 (12:51 +0200)]
bluetooth: Acquire transport when becomes available

Try to acquire the transport as soon as the audio stream is started,
along with the availability flag update.

11 years agobluetooth: Do not acquire transport during profile change
Mikel Astiz [Fri, 31 Aug 2012 10:51:05 +0000 (12:51 +0200)]
bluetooth: Do not acquire transport during profile change

Until today, setting the card to some profile resulted in a transport
acquisition, leading to audio stream setup. This is generally not very
interesting and even undesireable for HFGW use-cases, where the
Gateway role (the remote end) would typically request the SCO link.

Nevertheless, there is no safe way to implement such check without race
conditions, since the BlueZ's state can change between the state report
and the call to Acquire(). The chances for this to reproduce are quite
low though, since interface state changes are relatively slow.

This race condition requires that BlueZ's API is extended in order to
perform the operation atomically, which has already been discussed and
ack-ed in the BlueZ mailing list.

Note that this patch does not introduce a new race condition, since it
already existed before (the PropertyChanged->Acquire race condition,
affecting HFGW use-cases). It is just more explicit now.

11 years agobluetooth: Set profile even if transport not acquired
Mikel Astiz [Fri, 31 Aug 2012 10:51:04 +0000 (12:51 +0200)]
bluetooth: Set profile even if transport not acquired

If the acquisition of the transport fails, the profile should still be
set. In this case the audio is not actually streaming, so the sink and
source will be created but left suspended.

If the transport needs to be acquired later, for example because the
user wants to route the audio the remote device, the suspend flag should
have to be changed.

11 years agobluetooth: Support port availability flag
Mikel Astiz [Fri, 31 Aug 2012 10:51:02 +0000 (12:51 +0200)]
bluetooth: Support port availability flag

Use the port availability flag to expose whether a certain profile is
connected and whether it's doing actual audio streaming.

The proposed mapping is the following:
- Profile disconnected: port is unavailable
- Profile is connected (but not streaming/playing): availability unknown
- Profile is streaming/playing: port is available

The availability-unknown is specially interesting: it involves that if
the sink/source exists (corresponding card profile set), it is currently
in suspended state.

For example, for SCO cases (HFGW or HSP), this means the SCO is down. A
policy module would typically not change this, unless someone is really
trying to use the sink/source. This situation would be nicely handled by
module-suspend-on-idle, which would automatically connect SCO.

On the other hand, if the user wants to control the status of the SCO,
it will still be possible by resuming the sink or source (suspend=0).
This works out-of-the-box since most UIs would show to the user ports
whose availability is unknown.