mbox series

[RFC,BlueZ,0/9] BAP stream reconfiguration

Message ID cover.1740844616.git.pav@iki.fi
Headers show
Series BAP stream reconfiguration | expand

Message

Pauli Virtanen March 1, 2025, 3:57 p.m. UTC
Proposed DBus API extension is:

- org.bluez.MediaEndpoint.ClearConfiguration(transport_path):

  Destroy stream associated with transport

- org.bluez.MediaEndpoint.ClearConfiguration(remote_endpoint_path):

  Destroy all streams associated with endpoint

- org.bluez.MediaEndpoint.SelectProperties(remote_endpoint_path):

  Destroy streams of endpoint, and re-run same unicast configuration as
  on initial connect, which invokes SelectProperties() callbacks on
  sound server and it can return new configuration it wants.

For future:

- org.bluez.MediaEndpoint.SetConfiguration(...):

  I think how this already works for broadcast is good: one call creates
  one new stream. Unicast should be changed to work exactly the same
  way.

  This allows for more detailed control of the configuration than
  SelectProperties(), and sound server can use it if it wants to deal
  with the different ASE configurations by itself.

- We will need to figure out how to handle devices rejecting ASE
  configurations on Config Codec or Enable.

  Whose responsibility is it to try a different configuration, if the
  current configuration is rejected by device?

  Example: Sony Linkbuds S has 48kHz sink & 48kHz source PACs.  However,
  it does not support the duplx configuration with both 48kHz sink and
  48kHz source ASE -- it rejects that in Enable.  It does support 32 kHz
  sink + 32kHz source duplex configuration.  AFAICS it is not possible
  to know which combinations of sinks & sources are possible, except
  trying them one by one. How do we handle this?

Unicast works with this Pipewire branch (can reconfigure to
sink/source/duplex):
https://gitlab.freedesktop.org/pvir/pipewire/-/tree/bap-codec-switch-select

(With device sets, each device needs to be switched separately.  Some
more work is needed to make reconfiguration while CIG is active to work
correctly, sound server must release transports before reconfiguring.)

Broadcast has not been tested at all.

Pauli Virtanen (9):
  org.bluez.MediaEndpoint: removing BAP streams with ClearConfiguration
  org.bluez.MediaEndpoint: add client role SelectProperties
  bap: add and use chainable future abstraction
  bap: use futures for select operation
  shared/bap: bap_abort_stream_req() should cancel also current req
  shared/bap: make sure ucast client stream is destroyed after releasing
  bap: support removing streams with ClearConfiguration()
  bap: do not try QoS before links are updated & io created
  bap: implement client role SelectProperties()

 doc/org.bluez.MediaEndpoint.rst |  27 ++
 profiles/audio/bap.c            | 533 ++++++++++++++++++++++++++------
 profiles/audio/transport.c      |  17 +
 profiles/audio/transport.h      |   1 +
 src/shared/bap.c                |  39 ++-
 5 files changed, 522 insertions(+), 95 deletions(-)