Add necessary apis to bluez transport.
Add A2DP(AVRCP) absolute volume support. Source volume can only update to adapter node but not from due to AG nodes don't have route.
Since A2DP/HSP/HFP volume is already percentage itself, it has been mapped to pulseaudio volume then converting to linear volume.
There won't be further battery level updates when RFCOMM connection is
down, so remove the battery then.
Fix minor things with canceling the provider registration.
Auto-connect all paired & trusted devices on startup.
Since devices that already connected or powering off would reject the connecting requests, it should be fine with this behavior.
Also reconnect remaining profiles if only partial profiles are connected.
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.
SCO transports have timer-delayed release, but they need to be released
immediately when changing profiles to close connections before switching
to A2DP.
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 will prevent to run the different backends concurrently.
The native backend will only register to BlueZ if neither oFono nor
hsphfpd are running. If one of them starts, the native backend will be
unregistered and the corresponding backend will register to its daemon.
Make queueing a codec switch work properly. When receiving the dbus
reply, it should move to latest one. Others should be discarded.
Previously, it instead hit an assert, if there were more than two
queued.
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.
Release the transport if it went idle, ensuring that the fd is closed,
and add safeguards we won't double-acquire/release it.
This can occur if the device pauses the playback. The transport may also
activate again later on, and in this case we need to reacquire a new fd.
Not closing the old fd causes problems in this case.
However, apparently the BlueZ Release() call fails if the transport is
idle. We just ignore the error and downgrade the error message; it might
not be safe to not call Release() because the idle property update is
async.
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.
We would like to have BT device codec capability checks beyond what's
possible based on A2DP caps.
Split SBC-XQ to a separate codec, and enable it in the device-dependent
check (although currently it just uses the config option).
For debugging, it may be useful to disable some of the codecs. Enable
configuring this in config file, to make it more convenient for users,
who may not know how to recompile/install pipewire.
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