Implement switching HFP codecs in bluez5-devices, currently only for
backend-native.
Codecs are exposed via profiles similarly as for A2DP.
Some hardware appears to not properly reply to the +BCS message. Catch
these cases with a timeout, in which case we fall back to previously
existing transports.
libpulse assumes in introspect.c:fill_card_port_info that port profile
array size <= card profile array size, and may crash otherwise.
Enforce this in fill_card_info. It can happen, if EnumRoute and
EnumProfile info is not in sync.
Initial Props value are parsed from device settings, further changes are triggered by 'set_param' on a2dp node.
Codec can then use props to tweak its transcoder.
Add media.name so that restore-stream can store this stream.
Remove node.driver because the stream is slaved to the connected ALSA device.
Remove pause-on-idle in all cases, as this is now configurable from
the config file.
This profile is meant to be used with audio gateways, such as mobile
phones, making pipewire act as a headset. It activates all 3 "dynamic"
nodes (all of which are "Stream/*/Audio"), allowing both A2DP source
and HSP/HFP AG to be available at the same time. Ultimately, the remote
device (the AG), is the one that decides which profile to use and pipewire
just creates/destroys the appropriate stream nodes dynamically.
To make things less confusing, the HFP/HSP profile is now only available
if the remote device is a Head Unit and the A2DP profile is only available
if the remote device has an A2DP Sink.
If the device has both A2DP Source & A2DP Sink (not sure if this is a real world
possibility, but just in case...), the A2DP profile allows using them both,
while the AG profile will only allow the source.
In addition, to keep things less complex, the routes are now only used for
device nodes (the "Audio/*" ones). A2DP source and HSP/HFP AG never have a route.
Restoring their props should be possible to be handled by the restore-stream
module.
When a new node is configured, check if existing streams might need to
be moved to it.
This fixes the case where a stream has a target node set to some
bluetooth device and it starts playing to the default device because
the bluetooth device is not connected. When the BT device is then
connected and configured, the stream is moved to the new BT device.
Incoming connections only happen when the remote end is an AG.
Advertising the state allows the device to dynamically create nodes
for such connections.
errno should be set to the positive errno value.
This does not cause problems except for the pulse-server where the
errno value is negated and returned as an error result.
Make info parsing a bit easier to read by assigning the key and
value to temporary variables.
Improve the parsing of channelmap using json parser to make it
support more cases.
Add a unit test for channelmap parsing options.
Typically a source stops the connection when it has nothing to play
and this causes the transport to become "idle" and our A2DP source
also stops. However, the node is still present and "running" (if linked),
which causes the graph to underrun as it receives no data from this node.
This patch dynamically creates and destroys the a2dp source node depending
on the transport state. So, when the transport is idle, there is no node
in the graph at all.
A sink can be set as a default source, which means that the default
source is the monitor ports of the sink.
Move the direction check for later so that we can first check if we
are dealing with a potential default sink/source for the given
direction. If we found a default sink/source, we don't need to do
the direction check anymore.
This makes it possible to set a sink as a configured default source
and have policy-node take this into account when defining the
default.source metadata.
See #715, #908
Add new context config clock.power-of-two-quantum to make it possible to
not round quantum to closest lower power of two. This makes it possible
to match the quantum of a source node with the quantum of a client
node.
Allows monitors (eg. bluez5) free any sm_objects they hold in
session_destroy. In session_shutdown, destroy such objects before the
event, and free them only afterward.
Fixes double-free in bluez monitor.
WE can only delay the start for drivers that are driving. Remote
nodes are driving themselves but are not drivers so they need to
start early.
See #879
A node starts out as passive but becomes non-passive when there
is a non-passive link to an active node. If there is a link to
an inactive node, the node remains passive.
This fixes suspend of drivers in all cases.
Fixes#898