mbox series

[BlueZ,0/7] Add support for multiple BISes on the bcast source

Message ID 20240201152835.196617-1-silviu.barbulescu@nxp.com
Headers show
Series Add support for multiple BISes on the bcast source | expand

Message

Silviu Florian Barbulescu Feb. 1, 2024, 3:28 p.m. UTC
This patch adds support for multiple BISes in broadcast sources.

Example commands:
Create a local endpoint and an endpoint for BIS1:
endpoint.register 00001852-0000-1000-8000-00805f9b34fb 0x06
[/local/endpoint/ep0] Auto Accept (yes/no): y
[/local/endpoint/ep0] Max Transports (auto/value): a
[/local/endpoint/ep0] Locations: 0x03
[/local/endpoint/ep0] Supported Context (value): 0

Configure BIS1, create BIS1 transport and endpoint for BIS2:
endpoint.config /org/bluez/hci0/pac_bcast0 /local/endpoint/ep0 48_4_1
[/local/endpoint/ep0] BIG (auto/value): 0x01
[/local/endpoint/ep0] Enter channel location (value/no): 0x01
[/local/endpoint/ep0] Enter Metadata (value/no): n

Configure BIS2, create BIS2 transport and endpoint for BIS3:
endpoint.config /org/bluez/hci0/pac_bcast1 /local/endpoint/ep0 48_4_1
[/local/endpoint/ep0] BIG (auto/value): 0x01
[/local/endpoint/ep0] Enter channel location (value/no): 0x02
[/local/endpoint/ep0] Enter Metadata (value/no): n

For multiple BISes acquire must be called on all transports
before the BIG is created:
transport.acquire /org/bluez/hci0/pac_bcast0/fd0 
transport.acquire /org/bluez/hci0/pac_bcast1/fd1
.....
transport.release /org/bluez/hci0/pac_bcast0/fd0
transport.release /org/bluez/hci0/pac_bcast1/fd1

Silviu Florian Barbulescu (7):
  bap: Remove set lpac user data at bcast ep register
  shared/bap: Add support to create multiple streams for the same pac
  bap: Create a new endpoint to be available for the next BIS
    configuration
  bap: Split bap_state and bap_connecting in two functions
  shared/bap: Check the state of all the streams with the same BIG ID
  bap: Set the generated BASE on all setups from the same BIG
  shared/bap: Generate single BIS BASE for a configuration with BIG ID
    0xFF

 profiles/audio/bap.c | 239 ++++++++++++++++++++++++++++++++-----------
 src/shared/bap.c     |  67 ++++++++++--
 src/shared/bap.h     |   2 +
 3 files changed, 238 insertions(+), 70 deletions(-)


base-commit: a692cc44dc8735b9303f8893f784306b4d2654fe

Comments

Luiz Augusto von Dentz Feb. 1, 2024, 3:46 p.m. UTC | #1
Hi Silviu,

On Thu, Feb 1, 2024 at 10:28 AM Silviu Florian Barbulescu
<silviu.barbulescu@nxp.com> wrote:
>
> This patch adds support for multiple BISes in broadcast sources.
>
> Example commands:
> Create a local endpoint and an endpoint for BIS1:
> endpoint.register 00001852-0000-1000-8000-00805f9b34fb 0x06
> [/local/endpoint/ep0] Auto Accept (yes/no): y
> [/local/endpoint/ep0] Max Transports (auto/value): a
> [/local/endpoint/ep0] Locations: 0x03
> [/local/endpoint/ep0] Supported Context (value): 0
>
> Configure BIS1, create BIS1 transport and endpoint for BIS2:
> endpoint.config /org/bluez/hci0/pac_bcast0 /local/endpoint/ep0 48_4_1
> [/local/endpoint/ep0] BIG (auto/value): 0x01
> [/local/endpoint/ep0] Enter channel location (value/no): 0x01
> [/local/endpoint/ep0] Enter Metadata (value/no): n
>
> Configure BIS2, create BIS2 transport and endpoint for BIS3:
> endpoint.config /org/bluez/hci0/pac_bcast1 /local/endpoint/ep0 48_4_1
> [/local/endpoint/ep0] BIG (auto/value): 0x01
> [/local/endpoint/ep0] Enter channel location (value/no): 0x02
> [/local/endpoint/ep0] Enter Metadata (value/no): n
>
> For multiple BISes acquire must be called on all transports
> before the BIG is created:
> transport.acquire /org/bluez/hci0/pac_bcast0/fd0
> transport.acquire /org/bluez/hci0/pac_bcast1/fd1
> .....
> transport.release /org/bluez/hci0/pac_bcast0/fd0
> transport.release /org/bluez/hci0/pac_bcast1/fd1
>
> Silviu Florian Barbulescu (7):
>   bap: Remove set lpac user data at bcast ep register
>   shared/bap: Add support to create multiple streams for the same pac
>   bap: Create a new endpoint to be available for the next BIS
>     configuration
>   bap: Split bap_state and bap_connecting in two functions
>   shared/bap: Check the state of all the streams with the same BIG ID
>   bap: Set the generated BASE on all setups from the same BIG
>   shared/bap: Generate single BIS BASE for a configuration with BIG ID
>     0xFF
>
>  profiles/audio/bap.c | 239 ++++++++++++++++++++++++++++++++-----------
>  src/shared/bap.c     |  67 ++++++++++--
>  src/shared/bap.h     |   2 +
>  3 files changed, 238 insertions(+), 70 deletions(-)
>
>
> base-commit: a692cc44dc8735b9303f8893f784306b4d2654fe
> --
> 2.39.2

Not sure how you guys are testing these changes but currently I can't
get Broadcast Sink to work, and it crashes on the the cleanup:

https://gist.github.com/Vudentz/00a62914b0dc08261065cea65c0e04f0

So until we fix that I'm actually not merging new code on top, I'm
also considering moving the driver out of bap plugin and perhaps have
it as a standalone bcaa plugin since there have been quite a few
occasions where broadcast code has caused regressions on unicast.

Anyway Ive been working on the following fixes and I do appreciate
some feedback:

https://patchwork.kernel.org/project/bluetooth/patch/20240131173002.834951-1-luiz.dentz@gmail.com/
https://patchwork.kernel.org/project/bluetooth/list/?series=822175