Protect the global metadata with a lock because we update this from
multiple clients. Avoid updating the metadata if it didn't change.
Add a simple lock to protect the session objects, they could be
accessed from the main thread or data thread. Use the simple lock
in methods that just read.
Use the new data loop invoke to make sure we sync the data update
with the data thread.
Stop the data loop when our position io is removed.
Don't use a special name for the replacement libraries but install
them into the modules directory by default. Add an option to install
them into another location.
This way, we don't need to set up symlinks in development, distros can
choose to install them where they want and/or we can use symlinks or
LD_LIBRARY path to select the replacement versions.
Keep track of the node active state, when both are active, we can
prepare (negotiate) the link.
After a link has been prepared we can activate it. When we deactivate
the link, we don't need to prepare again.
When a port loses buffers or format, set the link back to the
unprepared state.
This fixes the case where:
1) a node becomes inactive and goes to suspend, the link becomes
unprepared
2) the node becomes active again and need to be prepared again
Keep the first active node as the fallback node. We use this node
as the target when no oher active nodes exist.
Only assign the target node to active nodes.
When we assign an unassigned node, simply update the active followers
of the target, the state of the nodes and target itself will then
be taken care of later.
When registering nodes, only active nodes can influence the state of the
graph.
Update some comments
Add reason to why we recalculate the graph for debugging purposes
Only recalculate graph when something relevant changed.
Block recalc from being called recursively.
Keep track of when a link is prepared, this is when the link has
successfully negotiated a format and buffers.
Only follow prepared links when collecting nodes in the graph.
Set the state of the driver and its nodes based on how many active
nodes the driver has. We don't have to do state changes on the nodes
from the link anymore then and we can get rid of the counters.
Only set the io on the mixer ports when prepared because we might
need a special mixer element based on the format.
Remove passive links for now.
This fixes many cases where the graph would stall when linking/unlinking
ports in various combinations.
Fixes#221
Rename (the non-exported symbol) _unref_id -> _remove_id and make it
remove the id from the map of known ids. This way, the server can send
the remove_mem and reuse the id for new memory before all references
are gone. Fixes "invalid mem id X, expected Y" errors.