Make a signal in media-session to signal dbus disconnect.
Get the DBusConnection when we need it in alsa and access-portal.
Remove device reservation if dbus disconnects and try again later
when needed.
See #1099
Handle the error from rd_device_reserve and when something is wrong,
disable device reservation and pretend we got the device.
This should work around the problem of the dbus connection being
closed and the device reservation callback never being called.
See #1099
SPA_MEMBER is misleading, all we're doing here is pointer+offset and a
type-casting the result. Rename to SPA_PTROFF which is more expressive (and
has the same number of characters so we don't need to re-indent).
When deciding on the number of channels to use for the node,
ignore parsing the sample rate. This makes it possible to activate the
node with a missing rate property, like when the node can do all
possible rates.
Move the icon we get from bluez to a separate property, it is not
a good icon to show.
Copy form factor from device to node properties.
Set device.bus in the device properties and copy it to the node
properties.
Use form factor and bus to make a nice icon-name for the node and
device.
Fixes#1064
When current user is no longer active on the seat, unregister the bluez
handler. This disconnects all bluez devices.
When the user becomes active on a seat, start bluez monitor again.
This will also reconnect devices.
Mark a node as busy linking while we call _create_links. The
_create_links method does a roundtrip and this might cause the node
to be destroyed. Set a flag when we notice this and avoid accessing
the destroyed object.
Return the result from sm_media_session_create_links() as the
result of link_nodes. This is > 0 when something was linked, < 0
on error and 0 when no ports are available. We should be able to
use this result later to handle errors.
When a node does not have routes, treat it like a stream and use
the restore-stream logic to restore the volumes.
Rework some of the logic a little. Don't save empty strings. Wait
for param updates to save/restore values.
This makes volume restore work on virtual sinks/sources and
sinks/sources without any routes.
See #729
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.
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
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.