SCO transports have timer-delayed release, but they need to be released
immediately when changing profiles to close connections before switching
to A2DP.
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.
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.
This may avoid infinite loops if parameters are being set based on events
sent by parameter changes. It's also what alsa-acp devices do, so bluez5
should follow.
Not all devices report their A2DP delay. In those cases, use a fallback
value of 150ms by default.
Make the delay adjustable with a SPA_Prop, and expose it as a part of
the route. Implement the corresponding parts in media-session.
Set initial device profile according to what's connected at startup,
rather than having media-session try to set it to A2DP (and fail, if the
profile was not connected, resulting to startup in null profile).
This avoids making a codec switch at device startup (we'll stay with
what BlueZ autoconnected us to, usually the previously used codec).
default-route wants to have SPA_PARAM_ROUTE_devices and
card.profile.devices before it will restore routes. Add these
also for bluez5-devices.
Fixes restoring volumes on Bluetooth profile change.
BlueZ may connect transports long after DEVICE_PROFILE_TRANSPORT_SEC has
passed on already existing devices. When this occurs, the bluez5
pipewire device should notify that the profile enumeration has changed.
Ignore these events during A2DP codec switch, and handle any changes
when the switch completes.
Set form factor, name routes based on form factor.
Improve profile names
Make card and node names like pulseaudio, with bt address in them.
Fill in port type in the route info.
Fixes#544
Implement routes on the device. This makes it possible for the
session manager to restore the device volumes.
Use validate_config to get the negotiated channels for the route
volumes.
Use the same code to enumerate the profiles and the current profile,
this makes sure we have all info in the Profile param as well and
don't need to do a lookup in the EnumProfile.
This is more in line with wayland and it allows us to create new
interfaces in modules without having to add anything to the type
enum. It also removes some lookups to map type_id to readable
name in debug.
Define a set of standard factory names and document what they
contain. This makes it possible to change the implementation by
mapping the factory-name to a different shared library.
Pass a factory_name in the object_info of monitor and device.
Restructure the factory name to mean something functionaly. With
the factory to library mapping this then means that the implementation
of certain factories can be configured in the config file.
The interface struct has the type,version and methods of the
interface.
Make spa interfaces extend from spa_interface and make a
separate structure for the methods.
Pass a generic void* as the first argument of methods, like
we don in PipeWire.
Bundle the methods + implementation in a versioned inteface
and use that to invoke methods. This way we can do version
checks on the methods.
Make resource and proxy interfaces that we can can call. We
can then make the core interfaces independent on proxy/resource and
hide them in the lower layers.
Add add_listener method to methods of core interfaces, just
like SPA.
Actually compile the codec config and declare the config as extern
or else it's just all 0.
Only acquire the transport when ACTIVE.
Implement transport state_change signal and acquire the transport
when going to pending/active.
Try to acquire the transport before we expose the device if we
can.
Force device expose when we get the device ServicesResolved=1 property
update.
Free transport when the rfcomm is closed.
Implement various DBus signals to detect dynamic property updates.