build: Add zsh completion

This patch adds zsh completion for pulseaudio and all of the utilities.
Channel maps and properties are not yet completed.

This should make mostly pactl/pacmd more usefull for zsh users.
bluetooth: Fix potential assertion failure due to unaligned packet size

While reading from the SCO socket, there is no guarantee regarding the
resulting packet size. In some rare cases, it might not even match the
alignment expected in pa_source_post(), resulting in an assertion
failure inside pa_volume_memchunk():

I: [alsa-sink] module-loopback.c: Could not peek into queue
I: [alsa-sink] module-loopback.c: Could not peek into queue
I: [alsa-sink] module-loopback.c: Could not peek into queue
E: [bluetooth] sample-util.c: Assertion 'pa_frame_aligned(c->length, spec)' failed at pulsecore/sample-util.c:725, function pa_volume_memchunk(). Aborting.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffda98f700 (LWP 8058)]
0x00007ffff6177935 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install alsa-lib-1.0.26-1.fc17.x86_64 dbus-libs-1.4.10-7.fc17.x86_64 flac-1.2.1-9.fc17.x86_64 glibc-2.15-58.fc17.x86_64 gsm-1.0.13-6.fc17.x86_64 json-c-0.10-2.fc17.x86_64 libICE-1.0.8-1.fc17.x86_64 libSM-1.2.1-1.fc17.x86_64 libX11-1.5.0-2.fc17.x86_64 libXau-1.0.6-3.fc17.x86_64 libXext-1.3.1-1.fc17.x86_64 libXi-1.6.1-1.fc17.x86_64 libXtst-1.2.0-3.fc17.x86_64 libogg-1.3.0-1.fc17.x86_64 libsndfile-1.0.25-2.fc17.x86_64 libtool-ltdl-2.4.2-3.1.fc17.x86_64 libudev-182-3.fc17.x86_64 libuuid-2.21.2-3.fc17.x86_64 libvorbis-1.3.3-1.fc17.x86_64 libxcb-1.9-1.fc17.x86_64 speex-1.2-0.14.rc1.fc17.x86_64
.gitignore: Add pulse-daemon.log.

The file is created by test-daemon.sh.
build: Add bash completion

This patch adds bash completion for pulseaudio and all of the utilities.
Channel maps and properties are not yet completed.

This should make mostly pactl/pacmd more useful for bash users.

Thanks to Denis Kasak for the awk magic (fetching ports and profiles
from the card info).
build-sys: Install the bash completion script.
build-sys: Use dist_vapi_DATA instead of listing the files in EXTRA_DIST.
bluetooth: Propagate to property parsers if it is initial value

Add a parameter so that property parsing functions distinguish the
initial case from property changes received later.
bluetooth: Detect changes in constant properties

The D-Bus API should guarantee that some properties remain constant and
therefore treat changes in such properties as errors.
bluetooth: Fail if BlueZ tries to give duplicate device addresses.
reserve: Move get_name_owner() to the public rd_device API

The function is interesting for both rd_device and rd_monitor so make
it part of the rd_device public API to avoid duplicated code.

The decision to move the function to reserve.c is motivated by the fact
that other projects (i.e. jack) use reserve.c only. Therefore, adding a
reserve->reserve-monitor dependency should be avoided.
reserve: Fix leaking NameLost signals after release+acquire

The use of the pseudo-blocking D-Bus calls leads to the problem that
NameLost signals are received after the reply to ReleaseName().

The problem with this is that a later acquisition of the same audio
device can potentially receive the NameLost signal corresponding to
the previous instance, due to the fact that the signal hasn't been
popped from the D-Bus message queue.

The simplest approach to solve this problem is to poll the actual name
owner from the D-Bus daemon, in order to make sure that we did really
lose the name.

The proposal uses a blocking call to GetNameOwner to avoid incosistent
states in the internal APIs: it would otherwise be possible to have a
"busy" device before the reservation has been lost, in the unlikely
case if some other process acquires the name before we got the
confirmation that the NameLost was actually true.
bash-completion: Don't complete devices in the list commands

This fixes some wrong completion for the list commands for example:
    pactl list sinks _sink_name_
pactl: Add a command for setting the default sink/source.

This adds two new commands to pactl:
    set-default-sink
    set-default-source

This command has been part of the native protocol for a long time,
no reason not to expose it in pactl.
tests: Fix conversion typo in cpu-test

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
tests: Fix potential out-of-bound access violation in svolume cpu-test

nsamples should be forced to be a multiple of channels; do so correctly
and don't make nsamples larger than it actually is

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
remap_sse: More specific logging: SSE -> SSE2

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
tests: Test both, SSE and SSE2, sconv in cpu-test

SSE sconv was not tested before, only SSE2 was (on CPUs supporting both
instruction sets)

now both code path are tested on CPUs supporting both

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
tests: Add remap test code to cpu-test

v2 (comments by Paul Menzel):
* generate test samples from -1..1, -0x8000..0x7fff
* check all output samples (not just half of them)

the idea is to compare the output of the C (reference) implementation
against the output of the optimized code path; currently, there are MMX
and SSE implementation for the mono-to-stereo remapper for s16 and float
sample formats

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Cc: Paul Menzel <paulepanter@users.sourceforge.net>
tests: Fix function argument wrapping style in cpu-test.c.
sconv: Check for SSE flag before initializing code

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>