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.
device-restore: When restoring volume, print the restored volume to the log.
build: Add PROTOCOL to EXTRA_DIST.

It's useful documentation, no reason to leave it out of the tarball.
resampler: Fix crash if 'auto' resampler chooses ffmpeg with variable rate

To reproduce, add resampler-method = ffmpeg in daemon.conf
then start PA, and load module-loopback

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb2f1db40 (LWP 23047)]
0x00000000 in ?? ()
(gdb) bt
0  0x00000000 in ?? ()
1  0xb7c463cb in pa_resampler_set_input_rate (r=0x80e9438, rate=44011) at pulsecore/resampler.c:365
2  0xb7c6321d in pa_sink_input_process_msg (o=0x80e87a0, code=3, userdata=0xabeb, offset=0, chunk=0x0)
    at pulsecore/sink-input.c:1833
3  0xb7e9840b in sink_input_process_msg_cb (obj=0x80e87a0, code=3, data=0xabeb, offset=0, chunk=0x0)
        at modules/module-loopback.c:538
4  0xb7c2709b in pa_asyncmsgq_dispatch (object=0x80e87a0, code=3, userdata=0xabeb, offset=0, memchunk=0xb2f1d17c)
        at pulsecore/asyncmsgq.c:322
5  0xb7c4c6e3 in asyncmsgq_read_work (i=0x80dd580) at pulsecore/rtpoll.c:564
6  0xb7c4b34a in pa_rtpoll_run (p=0x80fb7e0, wait_op=true) at pulsecore/rtpoll.c:238
7  0xb7dd90af in thread_func (userdata=0x80afe88) at modules/alsa/alsa-sink.c:1785
8  0xb7bf3291 in internal_thread_func (userdata=0x8095d08) at pulsecore/thread-posix.c:83
9  0xb7ab9d4c in start_thread (arg=0xb2f1db40) at pthread_create.c:308
10 0xb79f3ace in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
build: fix Mac OS X configure process

The original header file doesn't exist on Lion (10.7.4).
alsa: Drop verbosity on UCM message

We don't need to log an error-level message for missing UCM config.
Revert "tests: modify alsa-time-test to use 'check' framework"

This reverts commit 1569601864af375c3788fbce429b6773bd48072e.

Rethinking this, it makes more sense to not add this to the check
framework. This is mostly useful for exposing ALSA driver issues, and
it's handy to be able to build this as a standalone executable.
alsa: get avail, delay, timestamps in a single kernel call

Refactor code to fetch avail, delay and timestamp values
in a single call to snd_pcm_status().
The information reported is exactly the same as before,
however it is extracted in a more atomic manner to
improve timer-based scheduling.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
introspect: Minor documentation fix

s/pa_latency_info/pa_timing_info
pulse: Fix hole handling in pa_stream_peek().

Previously, if there was a hole in a recording stream,
pa_stream_peek() would crash. Holes could be handled silently inside
pa_stream_peek() by generating silence (wouldn't work for compressed
streams, though) or by skipping any holes. However, I think it's
better to let the caller decide how the holes should be handled, so
in case of holes, pa_stream_peek() will return NULL data pointer and
the length of the hole in the nbytes argument.

This change is technically an interface break, because previously the
documentation didn't mention the possibility of holes that need
special handling. However, since holes caused crashing anyway in the
past, it's not a regression if applications keep misbehaving due to
not handing holes properly.

Some words about when holes can appear in recording streams: I think
it would be reasonable behavior if overruns due to the application
reading data too slowly would cause holes. Currently that's not the
case - overruns will just cause audio to be skipped. But the point is
that this might change some day. I'm not sure how holes can occur
with the current code, but as the linked bug shows, they can happen.
It's most likely due to recording from a monitor source where the
thing being monitored has holes in its playback stream.

BugLink: http://bugs.launchpad.net/bugs/1058200
alsa-mixer: Add a few more machines to internal mic whitelist

Based on feedback in the bug below (comments 128, 129, 131).

BugLink: https://bugs.launchpad.net/bugs/946232
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
build-sys: Correct bluez support error if sbc is missing
man: Correction for how sample rate switching is disabled

Setting to 0 in the parser causes daemon startup to fail.
alsa-mixer: Add "CLFE" and "Bass Speaker" names

These are sometimes being used in the HDA driver and we should
support them.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
mainloop: Change wakeup_requested type from pa_bool_t to pa_atomic_t.

The variable is accessed from multiple threads, so it should
be atomic.
mainloop: Don't care about the mainloop state variable when waking up the mainloop.

If the mainloop is just about to enter polling, but m->state
is not POLLING yet when some other thread calls
pa_mainloop_wakeup(), the mainloop will not be woken up.
It's safe to write to the wakeup pipe at any time, so let's
just remove the check.
alsa-mixer: Prefer "Digital Input Source:Digital Mic 1"

...over "Digital Input Source:Analog Input". It makes life a little
easier for users of Dell xps m1330.

Just an old Ubuntu delta I never upstreamed until now.
The patch was originally written by Daniel T Chen <crimsun@ubuntu.com>.

BugLink: https://bugs.launchpad.net/bugs/453966
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
sink, source: Prevent unnecessary rate update attempts

We don't need to try a rate update if the desired sample rate is the
same as the one the sink or source is already using.
sink: Process rewind requests also when suspended.

When a rewind is requested on a sink input, the request parameters are
stored in the pa_sink_input struct. The parameters are reset during
rewind processing, and if the sink decides to ignore the rewind
request due to being suspended, stale parameters are left in
pa_sink_input. It's particularly problematic if the rewrite_bytes
parameter is left at -1, because that will prevent all future rewind
processing on that sink input. So, in order to avoid stale parameters,
every rewind request needs to be processed, even if the sink is
suspended.

Reported-by: Uoti Urpala
modules: Micro-optimisation for rewind_requested paths

Since some devices can be chatty with regards to how often they return
from poll(), this adds a PA_UNLIKELY() to all the the rewind_requested
checks in our sink modules to make the general case (no rewind was
requested) the fast path.