device-type: Add pa_device_type_to_string()

This is needed by the tunnel manager. It feels a bit silly to
introduce new source files for just this function, but I couldn't
think of any other appropriate place. pa_device_type_t is defined
in pulse/def.h, and that's not an appropriate place for any
functions.

Change-Id: I6f969fe3acb934e8bb8fdfa5873a4d6d3fa6721c
tunnel-manager: New module for managing tunnels to remote servers

The initial use case for this module is to connect user PulseAudio
instances to the system instance via tunnel sinks and sources. This
is the so called "cascaded setup". The point of doing that is to allow
multiple users to access the same hardware simultaneously.

The module connects to zero or more remote servers and builds an
internal representation of all sinks and sources in those servers.
Currently the module doesn't actually load any tunnel sinks or
sources, because the tunnel sink and source code have to be first
modified a bit (the next patch does that).

The remote servers are configured in a separate configuration file
that is named tunnel-manager.conf. Currently only the server address
can be configured, but I expect more configuration options to be
implement in the future, such as options for defining the policy of
which remote devices to use. Here's an example of the configuration
file syntax:

    [RemoteServer foo]
    address = /run/pulse/native

    [RemoteServer bar]
    address = example.com

The bulk of the functionality is not in module-tunnel-manager.so, but
in libtunnel-manager.so, which will be used also by the tunnel sink
and source modules to access the information that the tunnel manager
has previously queried from the remote server.

Change-Id: I3d41936451572b6341cfb9717e07b355d8449490
tunnel-new: Read parameters from tunnel manager when available

This prepares for loading tunnel sink and source module instances from
the tunnel manager.

If the tunnel manager is available, and the tunnel manager has
sample spec and channel map information for the device, then let's use
that information when creating the sink or source so that the tunnel
will automatically match the parameters of the remote device. The
remote device's proplist is copied to the tunnel too.

Change-Id: I2755d6fc984d9014bc039924dd1d51ea5689c22c
tunnel-manager: Load tunnel sinks and sources

This makes the tunnel manager load tunnel sinks and sources for all
devices in the remote servers, except for monitor sources.

Change-Id: Ie3793dfc8a500b2ae7ec6b2b0a82e49793361f91
tunnel-manager: Make the tunnel enabling policy configurable

There's no real configurability yet, because only one condition is
supported. Support for more conditions will be added later.

The syntax of the configuration option pretends to conform to some
programming language, but there's no real parser for the language.
A proper parser may be implemented later, but for now the option
values are parsed simply by comparing to a list of predefined string
constants.

Change-Id: I57bbb0cd2b91691415be78f9732aef6b3bebde56
logind: Move the code that interfaces with logind to liblogind.so

This doesn't change the behaviour in any important way. The purpose of
this move is to provide access to logind from multiple modules without
needing to use the logind API from more than one place. Currently
there's only one module using liblogind.so, but module-tunnel-manager
will need seat tracking, so that will be another module that needs to
access logind.

Change-Id: I352193fef0d0b0601ea509af501af395786c6cf9
logind: Add seat tracking

This will be used by the tunnel manager to filter out devices in the
system instance that belong to some other user.

Change-Id: Ib1ba098014a485fef320a6ce4bc034973b607e9c
udev: Store the seat id in device proplists

When using PulseAudio in system mode, it may be interesting to know
which seats the devices are assigned to. This will be used in the
tunnel manager to filter out the devices that belong to other users.

Change-Id: Iad81513430d448bd5974e5b021293ed0976f426d
tunnel-manager: Implement a policy that enables tunnels based on the device seat

Change-Id: Ib4dd17936ff0f18f8cbf9b3e723a183a73f354af
packaging: Install the tunnel-manager and logind files

Change-Id: I0502677165496449db85569f985de1a317f781b1
systemd: Disable TCP socket activation for user instances

The TCP port can be listened by only one process, so if the system
instance listens it, then user instances can't listen. Or if there
are multiple users, only one can listen.

Since systemd uses an "all or nothing" approach, the unix socket
activation doesn't work either when the TCP socket fails. It's not
terribly important to have TCP socket activation (at least at this
point), so let's just drop it from user instances.

Change-Id: I6258ee9c7a5ae7de4dcee209440de2df7a779e1d
Add configuration for the "cascaded setup"

If cascaded.pa is installed, then hardware should be managed by the
system instance, and user instances should use the hardware via the
system instance.

Change-Id: I6879bbcb50e131941c75b8c91a11e098d07428e5
Add systemd service and socket files for the system mode

Change-Id: If3783b3a86108dd968911613f5f63693cb5161c6
packaging: Add the pulseaudio-cascaded-setup package

Change-Id: I1a1504ac2496af127557c5d45f64fef4c284cdc6