alsa-mixer: Add special profiles for some laptops missing speaker and/or internal mic

Several laptops have speaker ports, and/or internal mic ports, but we have
no way of detecting that. So we make the port(s) always show up for these
devices.

BugLink: https://bugs.launchpad.net/bugs/946232
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
alsa-mixer: Add Phantom Jack support

For kernel 3.6, "phantom jack" kctls have been added. They serve as
a marker that a particular port exist. They were made so we can detect
that there actually are speakers and internal mic on a laptop, even if
there are no other indications (volume controls etc).

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
alsa-mixer: Always turn "Inverted Internal Mic" off

Some devices have inverted right channel, so when you add left and right,
the result is silence, or very faint sound. In recent kernels (3.5,
perhaps also 3.4) these are starting to be marked with a special
"Inverted Internal Mic" capture switch.

While we might want to add some reverse summing mechanism in the
future, for now, we just turn the thing off to avoid the problem of
recording silence.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
alsa-mixer: Add "Front Headphone" jack

Many desktops have headphone on the front and line outs on the back.
Sometimes this means that the headphone is labelled "Front Headphone Jack",
but the volume controls are only "Headphone Playback Volume", i e,
without the "Front" prefix.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
alsa-mixer: Document "state.plugged" and "state.unplugged"

Put explanation of state.plugged and state.unplugged in
analog-output.conf.common.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
add a new log target that enables to create new log file if it exists
core-util: Fix permissions handling while creating directories

This makes updating of permissions on existing directories optional with
pa_make_secure_dir() and pa_make_secure_parent_dir(). This makes sure
that the recursive directory creation doesn't end up modifying existing
directories, and also fixes a problem where creating an auth cookie
(specifically ~/.esd_auth) would end up modifying permissions on ~.
Thanks to Frédéric Danis for reporting this.
alsa-mixer: Add "Front Headphone Jack" (fixup)

I forgot half of the front headphone patch, i e, to hide the
speaker output when the front headphone is connected. Thanks to
Shih-Yuan Lee for noticing.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Revert "role-cork: Fix a minor leak"

This reverts commit 51c8d5a477d36f0646243a092994036b3781e9c1.

As David points out, this was incorrect.
role-cork: Fix incorrect check at deinitialisation time
Revert "Revert "role-cork: Fix a minor leak""

This reverts commit a2c4bf22e0813d529f153c01d7421345a792f3bc.

As Tanu points out, I'm stupid. The pa_xstrdup(n) was unnecessary
because pa_split() allocates a new string for us.
role-cork: Fix another minor leak

Credit to David for finding this one.
loopback: Enable routing on loopback streams

At module-loopback load, if no sink is given, the default sink is used. If the
stream has a media.role property, the property cannot be used because a the
source or sink is forced to default. Both module-intended-roles and
module-device-manager are affected. The same apply to sources.

With this patch, if sink or source is missing, routing modules can be used.
bluetooth: module-bluetooth-policy initial commit

This is a basic module for enabling loopback as soon as a new bluetooth A2DP
source is created. The module is given a source and a media role using command
line. This allows module-intended-roles or module-device-manager to choose a
target sink for the stream.
card-restore: Add the ability to save and restore the latency offset.

module-card-restore now saves the latency offsets.

This change includes a entry version bump.

The entry now consists of a port count and a port name and offset for
every port that belongs to the relevant card.
card-restore: Handle reading NULL profile name from the database.

It's assumed in a couple of places that entry_read()
initializes entry->profile to a non-NULL string. This patch
makes those assumptions hold.

Tested-by: Mikel Astiz <mikel.astiz.oss@gmail.com>
memblock: Fix typos.
alsa-mixer: Implement a new path option: "mute-during-activation".
alsa: move pa_alsa_setting_select close to pa_alsa_path_select

Move pa_alsa_setting_select call just after the pa_alsa_path_select in
[sink | source]_set_port_cb functions as there is no dependency to volume
calculations that are done between these two calls. Idea here is to make
possible to merge these two functions since they are called together from
other places too.
alsa: Merge pa_alsa_setting_select with pa_alsa_path_select

As these functions are called together and are related, we might merge
them and call setting_select from pa_alsa_path_select by passing
optional pa_alsa_setting argument.

Make also the setting_select static as it is not called outside of
alsa-mixer.c after this change.

[Additional note from Tanu Kaskinen: this change improves the
mute-during-activation feature, because now the mixer changes related
to selecting the setting happen while the hw is muted.]