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.
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.
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.
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.
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>
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>
tests: make 'check' optional
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
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.
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.
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.
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.
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.
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.
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>
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.
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.
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.
tests: Minor cpu-test reorganisation

Make volume and conversion tests separate test cases.
core: Document ARM-optimised svolume code a bit