loopback: Cork sink-input if source is suspended

During initialization, the approach avoids having a needless short
period of corked state in case the source is suspended, by always
creating the sink-input corked and uncorking it immediately afterwards
when the source is not suspended.
loopback: Cork source-output if sink is suspended

During initialization, the approach avoids having a needless short
period of corked state in case the sink is suspended, by always creating
the source-output corked and uncorking it immediately afterwards when
the sink is not suspended.
loopback: Disable adjust timer when suspended

Stop the rate adjustment timer when no audio is flowing.
stream: Allow record streams to start muted

This check was valid before we introduced per-source-output volumes, so
dropping it now. Thanks to Alban Browaeys <prahal@yahoo.com> for
catching this.
alsa-mixer: Add "iec958-stereo-input" to well known path names

Interestingly, the name is properly matched even though there
is no paths/iec958-stereo-input.conf file.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
flist: Increase default list size to 256

Nowadays, we are using more hashmaps and other things, than we did
before. Therefore, I often get the "flist is full (don't worry)"
message. This change should avoid that message. I was unable to find
any significance in increase of memory footprint from this change.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
i18n: Add Indonesian translation.
equalizer: Don't cleanup u->sink in sink_input_kill_cb yet

Previously, sink_input_kill_cb would cleanup u->sink an then unload the
module. However, during module unload, both save_state and dbus_done
tried to use u->sink, causing a segfault or assertion failure.

The segfault is easy to reproduce: Load module-equalizer-sink and then
press ctrl-C to terminate pulseaudio.

This commit removes the u->sink cleanup in sink_input_kill_cb, since
u->sink will be cleaned up by the module's pa__done as well (after it
has been used).

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
bluetooth: Remove return value of bt_transport_config()

The function bt_transport_config() never fails so the code can be
simplified by just removing the return value.
bluetooth: Remove return value of setup_stream()

The function setup_stream() never fails so the code can be simplified by
just removing the return value.
bluetooth: Refactor parsing of signal PropertyChanged

Wrap the code parsing the PropertyChanged signal into a helper function
that will return the new state of the interface.
bluetooth: Refactor code to helper function

Make code more readable by introducing the helper function
bt_transport_is_acquired(). This also adds assertions to check whether
the internal state is consistent.
bluetooth: Fix wrongly set "phone" role for HFGW

The HFGW source should be consistent with the sink by not setting the
"phone" intended role.

Even though setting this role seems to make sense strictly speaking, the
rest of the codebase doesn't handle this well. Therefore, the audio
coming from a Bluetooth phone can be routed back to the same device.
bluetooth: Fix using garbage memory

module-bluetooth-policy should set the allocated memory to zero, in
order to handle failure cases properly.
bluetooth: Fix check if transport exists before acquire

The transport might have disapeared exactly before acquiring, so we
should avoid an assertion failure, in this case inside the function
pa_bluetooth_discovery_get_by_path().
sink, source: Support creating suspended sinks and sources

The initial state of a sink or source might not necessarily be IDLE,
because sometimes it might be suspended from the very beginning.
bluetooth: Provide dummy set_port callbacks

There should be one port per sink/source so a dummy set_port callback
will be enough.

Adding this callback avoid the "operation not implemented" error
message and additionally makes the module work nicely with
module-switch-on-port-available.
bluetooth: Config MTU transport after acquire

The configuration of the transport that depends on the MTU should be
performed every time the transport has been acquired, since the
parameters depend on what the Media API provides. This requires to
update the parameters of the sinks and sources as well.

This patch moves this code into a new function that will be called
when the stream is starting (setup_stream), from the IO thread.

This makes the code more robust, since the existing multiple calls to
bt_transport_acquire() do not rely on setup_bt() being able to acquire
the transport.
bluetooth: Support port availability flag

Use the port availability flag to expose whether a certain profile is
connected and whether it's doing actual audio streaming.

The proposed mapping is the following:
- Profile disconnected: port is unavailable
- Profile is connected (but not streaming/playing): availability unknown
- Profile is streaming/playing: port is available

The availability-unknown is specially interesting: it involves that if
the sink/source exists (corresponding card profile set), it is currently
in suspended state.

For example, for SCO cases (HFGW or HSP), this means the SCO is down. A
policy module would typically not change this, unless someone is really
trying to use the sink/source. This situation would be nicely handled by
module-suspend-on-idle, which would automatically connect SCO.

On the other hand, if the user wants to control the status of the SCO,
it will still be possible by resuming the sink or source (suspend=0).
This works out-of-the-box since most UIs would show to the user ports
whose availability is unknown.
bluetooth: Set profile even if transport not acquired

If the acquisition of the transport fails, the profile should still be
set. In this case the audio is not actually streaming, so the sink and
source will be created but left suspended.

If the transport needs to be acquired later, for example because the
user wants to route the audio the remote device, the suspend flag should
have to be changed.