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.
Make a2dp clock advance at the correct rate.
Revert back to accumulating to a single buffer before sending it out.
What it did previously seemed hard to get to work properly with e.g.
aptx which produces block of varying sizes on decoding.
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.
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.
Remove wrong adjustment to the write timeout with mSBC.
The time between writes should be the 7.5ms at which we encode, which is
correct even when the frames get fragmented to incommensurate tx packets
(on USB BT adapters).
Fixes sound on RTL8176B. This adapter has large reported write_mtu, so
the wrong delay affected it.
This waits for codec negotiation completion, i.e. on `SLC` completion if
codec negotiation is not supported or on `AT+BCS` reception if codec
negotiation is supported, before creating the `spa_bt_transport`
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.