Skip to content

Create transports for matching BISes

Andrei Istodorescu linux-bluetooth 4 versions – Applied

Status from this message: This series was applied to bluetooth/bluez.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest6 patches 1 replyApplied
  2. v42 patches 2 repliesSuperseded
  3. v32 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches1 replySuperseded

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/6shared/bap: Update stream management to avoid PACssrc/shared/bap.c+6 -571 reply
2/6shared/bap: Add function to check the validity of a BISsrc/shared/bap.c src/shared/bap.h+28 -00 replies
3/6bap: Update BIS managementprofiles/audio/bap.c+226 -940 replies
4/6shared/bap: Remove not needed functionsrc/shared/bap.c src/shared/bap.h+15 -730 replies
5/6shared/bap: Return the local PAC when matching a BISsrc/shared/bap.c+5 -20 replies
6/6shared/bap: Add stream ops for get_location, get_dir and get_statesrc/shared/bap.c+107 -520 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH BlueZ v5 0/6] Create transports for matching BISes

This patch refactors the flow for the BAP Broadcast Sink. After observing the BASE information, streams and transports will be generated for each BIS that matches local PAC capabilities. Because endpoints are not available any more, local PAC (which contain local registered capabilities) has a new list of setups. Each setup is generated based on the matching BIS observed.
Then, the setup is used to configure a stream which then generates a MediaTransport.
The transport is in the TRANSPORT_STATE_IDLE state until someone acquires it. The "Acquire" procedure results in creating the IO using BIG Create Sync. The successful reply of it causes the transport to be advanced in TRANSPORT_STATE_ACTIVE state.

bluetoothctl log with two transports being created and acquired:
endpoint.register 00001851-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: 3
[/local/endpoint/ep0] Supported Context (value): 3 Capabilities:
03 01 ff 00 02 02 03 02 03 03 05 04 1a 00 f0 00 ................
Metadata:
[bluetooth]# Endpoint /local/endpoint/ep0 registered

scan le

[bluetooth]# SetDiscoveryFilter success
[bluetooth]# hci7 type 6 discovering on
[bluetooth]# Discovery started
[bluetooth]# [CHG] Controller 00:60:37:A6:AE:22 Discovering: yes [bluetooth]# [NEW] Device 07:34:BB:4B:6F:C3 07-34-BB-4B-6F-C3 [bluetooth]# hci7 07:34:BB:4B:6F:C3 type LE Random connected eir_len 0 [bluetooth]# [NEW] Transport /org/bluez/hci7/dev_07_34_BB_4B_6F_C3/bis1/ fd0
[bluetooth]# Endpoint: SetConfiguration
[bluetooth]# Transport /org/bluez/hci7/dev_07_34_BB_4B_6F_C3/bis1/fd0
[bluetooth]# Properties.Device: /org/bluez/hci7/dev_07_34_BB_4B_6F_C3
[bluetooth]# Auto Accepting...
[bluetooth]# [NEW] Transport /org/bluez/hci7/dev_07_34_BB_4B_6F_C3/bis2/ fd1
[bluetooth]# Endpoint: SetConfiguration
[bluetooth]# Transport /org/bluez/hci7/dev_07_34_BB_4B_6F_C3/bis2/fd1
[bluetooth]# Properties.Device: /org/bluez/hci7/dev_07_34_BB_4B_6F_C3
[bluetooth]# Auto Accepting...
[CHG] Device 07:34:BB:4B:6F:C3 Connected: yes

[07-34-BB-4B-6F-C3]# transport.acquire /org/bluez/hci7/ dev_07_34_BB_4B_6F_C3/bis1/fd0
auto acquiring...
Transport /org/bluez/hci7/dev_07_34_BB_4B_6F_C3/bis1/fd0 acquiring [07-34-BB-4B-6F-C3]# hci7 07:34:BB:4B:6F:C3 type LE Random connected eir_len 0
[07-34-BB-4B-6F-C3]# hci7 07:34:BB:4B:6F:C3 type LE Random connected eir_len 0
[07-34-BB-4B-6F-C3]# Transport /org/bluez/hci7/dev_07_34_BB_4B_6F_C3/ bis1/fd0 acquiring complete
[07-34-BB-4B-6F-C3]# Acquire successful: fd 8 MTU 40:0 [07-34-BB-4B-6F-C3]# [CHG] Transport /org/bluez/hci7/ dev_07_34_BB_4B_6F_C3/bis1/fd0 State: active
hci7 type 6 discovering offm[seq 0] recv: 0 bytes # 1
hci7 type 6 discovering on9m[seq 146] recv: 0 bytes # 7
hci7 type 6 discovering offm[seq 149] recv: 0 bytes # 50
hci7 type 6 discovering on
[seq 2446] recv: 0 bytes #transport.release /org/bluez/hci7/ dev_07_34_BB_4B_6F_C3/bis1/fd0
[07-34-BB-4B-6F-C3]# [CHG] Transport /org/bluez/hci7/dev_07_34_BB_4B_6F_C3 /bis1/fd0 State: idle
[07-34-BB-4B-6F-C3]# Release successful

[07-34-BB-4B-6F-C3]# transport.acquire /org/bluez/hci7/ dev_07_34_BB_4B_6F_C3/bis2/fd1
auto acquiring...
Transport /org/bluez/hci7/dev_07_34_BB_4B_6F_C3/bis2/fd1 acquiring [07-34-BB-4B-6F-C3]# hci7 07:34:BB:4B:6F:C3 type LE Random connected eir_len 0
[07-34-BB-4B-6F-C3]# hci7 07:34:BB:4B:6F:C3 type LE Random connected eir_len 0
[07-34-BB-4B-6F-C3]# Transport /org/bluez/hci7/dev_07_34_BB_4B_6F_C3/bis2 /fd1 acquiring complete
[07-34-BB-4B-6F-C3]# Acquire successful: fd 9 MTU 40:0 [07-34-BB-4B-6F-C3]# [CHG] Transport /org/bluez/hci7/dev_07_34_BB_4B_6F_C3 /bis2/fd1 State: active
hci7 type 6 discovering off
hci7 type 6 discovering on
[seq 1330] recv: 0 bytes #transport.release /org/bluez/hci7/ dev_07_34_BB_4B_6F_C3/bis2/fd1
[07-34-BB-4B-6F-C3]# 1;39m[seq 1331] recv: 0 bytes #Transport fd
disconnected
[07-34-BB-4B-6F-C3]# [CHG] Transport /org/bluez/hci7/dev_07_34_BB_4B_6F_C3 /bis2/fd1 State: idle
[07-34-BB-4B-6F-C3]# Release successful

The difference from v2 patch is that match_data is not initialized any more, to overcome scan-build warning:
warning: Value stored to 'match_data' during its initialization is never read struct bt_ltv_match match_data = {0}.

Andrei Istodorescu (6):
shared/bap: Update stream management to avoid PACs shared/bap: Add function to check the validity of a BIS
bap: Update BIS management
shared/bap: Remove not needed function
shared/bap: Return the local PAC when matching a BIS shared/bap: Add stream ops for get_location, get_dir and get_state

 profiles/audio/bap.c | 320 ++++++++++++++++++++++++++++++-------------
 src/shared/bap.c     | 290 ++++++++++++++++++---------------------
 src/shared/bap.h     |   5 +-
 3 files changed, 362 insertions(+), 253 deletions(-)

base-commit: d9de306a28fecd711d3d2f88bf778f98f2772424

Signature · 1 line
2.40.1