A node.target property of -1 also means to follow the default
sink/source. The ALSA plugin might use this to select the
target node and would otherwise not move to the new default sink.
Only start the driver node after we have added ourselves to the
driver node or else we might start too soon, before there is anything
to schedule and we cause driver underruns.
Only activate the links when the node is added to a driver. Otherwise
the driver will expect us to decrement the activation counters for the
links but that won't happen because the node will not be processed
yet.
Instead we activate the links that were not activated yet when the
node is activated.
This improves scheduling for newly added links and nodes.
When we were busy with the graph recalculation and something changed,
restart the graph state change to get the new change applied.
For example, when we start a node and it has a max-quantum set, we
need to restart our calculation with the new quantum limits.
Use the manager sync method to wait until all pending queries are
finished. It is the manager that will query the new parameters so
we need to wait until that completes.
See #868
Trigger a roundtrip before we send the reply to the client for many
methods like set_volume/set_mute etc.
this ensure that we get the updated information from the server before
we reply so that a subsequent query returns the up-to-data information.
Fixes#868
SCO transports have timer-delayed release, but they need to be released
immediately when changing profiles to close connections before switching
to A2DP.
When the quantum is changed, the error between the current and
expected buffer levels needs to be corrected with the quantum
difference.
For example, say we are running with a 1024 quantum and the quantum
is changed to 8192, when we wake up the filled level might be
1016 vs expected 8192, 1024 - 8192 = -7168. The real error for the
timeout was 1016 - 8192 - (-7168) = -8.
When we start or after an xrun, we need fill the buffer with one
period + headroom of samples, not period*2. This is because after
start we set our timeout immediately and expect there to be
period + headroom samples in the buffer.
With period*2 we take one period longer to start and we also feed
one period of error in the dll, which causes it to wobble for no
good reason.
Every time a new operation is started, schedule a rescan. This
ensures that there are no more pending actions before the policy
module scans the nodes.
This has the effect that all devices and nodes are up to data and
ready to be used by policy-node.
Fixes#789
Move the profile switching from default-route to the default-profile
module. This makes more sense and it also allows us to restore the
saved profile when it becomes available.
Make default-profile always check if the saved profile can be restored
before attempting to switch to the best profile.
Default-route now just monitors profile changes and restores the
routes associated with it.
See #466
Mark bluez5 routes always available in EnumRoute, because there's always
a device connected.
Fixes default-route resetting profiles back, when they are manually
changed.
If the default sink or source is set as the target, just don't save
the new target so that it follows the new default.
This is a workaround for gnome-control-center first setting the
default source/sink and then setting the targets on all
stream-restore database entries to the new default. Setting an
explicit target will pin the stream to that sink/source forever,
which is then making pavucontrol default source/sink toggle
fail.
See #676
In COMMAND_SET_DEFAULT_SINK/SOURCE, set our default source and sink
immediately instead of waiting for the metadata update. This makes
it possible to check for the new default sink immediately in other
modules.
This does not work as intended, because we no longer do a codec switch
on device connect. It should be done in a different way, but since it's
not used for anything right now, can as well remove it.
Don't just store the id in the metadata but a JSON object with
the node name. This makes it possible to easily introspect the
metadata and also extend the metadata with more fields later.
Instead of matching the metadata id to the global ids we now
have to match it against the name.
The session manager might be configured without metadata support
so check this before attempting to use the metadata. It's not
really a problem because the default sink/source can only be
changed with the pulseaudio API, which activates metadata.
The prefix was used to filter the properties when loading and
saving but since the conversion to the core provided functions, this
feature is not longer available.
It's not exactly a problem, we could implement the filtering ourselves
afterwards but there is little point because we just ignore the unknown
items and never write invalid items.
The branch should be taken if errno is neither EAGAIN,
nor EWOULDBLOCK.
Previously,
if (errno != EAGAIN || errno != EWOULDBLOCK)
would be taken for all values of errno if EAGAIN != EWOULDBLOCK.
(Except for the ones that are filtered out before.)
Fix that by changing `||` to `&&`.