* RE: [BlueZ,v2] bap: Fix not setting SID for broadcast receiver
2025-04-11 19:56 [PATCH BlueZ v2] " Luiz Augusto von Dentz
@ 2025-04-11 21:35 ` bluez.test.bot
0 siblings, 0 replies; 10+ messages in thread
From: bluez.test.bot @ 2025-04-11 21:35 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=952626
---Test result---
Test Summary:
CheckPatch PENDING 0.19 seconds
GitLint PENDING 0.20 seconds
BuildEll PASS 20.42 seconds
BluezMake PASS 2682.13 seconds
MakeCheck PASS 20.42 seconds
MakeDistcheck PASS 197.76 seconds
CheckValgrind PASS 274.01 seconds
CheckSmatch PASS 303.52 seconds
bluezmakeextell PASS 127.62 seconds
IncrementalBuild PENDING 0.32 seconds
ScanBuild PASS 896.94 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH BlueZ v1 1/7] bap: Fix not setting SID for broadcast receiver
@ 2025-04-15 21:48 Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v1 2/7] btdev: Check for valid SID on BT_HCI_CMD_LE_PA_CREATE_SYNC Luiz Augusto von Dentz
` (6 more replies)
0 siblings, 7 replies; 10+ messages in thread
From: Luiz Augusto von Dentz @ 2025-04-15 21:48 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
SID most be set otherwise 0x00 is assume which may not be what the
broadcast source is using over the air. but since we don't have access
to the SID of the advertisement in userspace mark de SID as invalid
(0xff) so the kernel fill it up while scanning when creating the PA
sync.
---
profiles/audio/bap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index fd9b751cc1bf..24763666ce96 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -2813,6 +2813,7 @@ static void bap_detached(struct bt_bap *bap, void *user_data)
static int pa_sync(struct bap_data *data)
{
GError *err = NULL;
+ uint8_t sid = 0xff;
if (data->listen_io) {
DBG("Already probed");
@@ -2833,6 +2834,7 @@ static int pa_sync(struct bap_data *data)
btd_device_get_bdaddr_type(data->device),
BT_IO_OPT_MODE, BT_IO_MODE_ISO,
BT_IO_OPT_QOS, &bap_sink_pa_qos,
+ BT_IO_OPT_ISO_BC_SID, sid,
BT_IO_OPT_INVALID);
if (!data->listen_io) {
error("%s", err->message);
--
2.49.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH BlueZ v1 2/7] btdev: Check for valid SID on BT_HCI_CMD_LE_PA_CREATE_SYNC
2025-04-15 21:48 [PATCH BlueZ v1 1/7] bap: Fix not setting SID for broadcast receiver Luiz Augusto von Dentz
@ 2025-04-15 21:48 ` Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v1 3/7] btdev: Fix not matching SID on le_pa_sync_estabilished Luiz Augusto von Dentz
` (5 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Luiz Augusto von Dentz @ 2025-04-15 21:48 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
emulator/btdev.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/emulator/btdev.c b/emulator/btdev.c
index 7e4cb9393593..a1c82ae306d7 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -5728,6 +5728,12 @@ static int cmd_pa_create_sync(struct btdev *dev, const void *data, uint8_t len)
uint8_t status = BT_HCI_ERR_SUCCESS;
struct le_per_adv *per_adv;
+ if (cmd->sid > 0x0f) {
+ cmd_status(dev, BT_HCI_ERR_INVALID_PARAMETERS,
+ BT_HCI_CMD_LE_PA_CREATE_SYNC);
+ return 0;
+ }
+
/* Create new train */
per_adv = le_per_adv_new(dev, cmd->addr_type, cmd->addr);
if (!per_adv)
--
2.49.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH BlueZ v1 3/7] btdev: Fix not matching SID on le_pa_sync_estabilished
2025-04-15 21:48 [PATCH BlueZ v1 1/7] bap: Fix not setting SID for broadcast receiver Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v1 2/7] btdev: Check for valid SID on BT_HCI_CMD_LE_PA_CREATE_SYNC Luiz Augusto von Dentz
@ 2025-04-15 21:48 ` Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v1 4/7] iso-tester: Add test for SID=0xff Luiz Augusto von Dentz
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Luiz Augusto von Dentz @ 2025-04-15 21:48 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
In order to estabilish a PA sync the advertising SID must match:
7.8.67. LE Periodic Advertising Create Sync command:
'The Advertising_SID parameter, if used, specifies the value that shall match
the Advertising SID subfield in the ADI field of the received advertisement
for it to be used to synchronize.'
---
emulator/btdev.c | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/emulator/btdev.c b/emulator/btdev.c
index a1c82ae306d7..76bae5ea1ab3 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -105,12 +105,14 @@ struct le_ext_adv {
uint8_t scan_data_len;
unsigned int broadcast_id;
unsigned int timeout_id;
+ uint8_t sid;
};
struct le_per_adv {
struct btdev *dev;
uint8_t addr_type;
uint8_t addr[6];
+ uint8_t sid;
uint16_t sync_handle;
};
@@ -4923,6 +4925,7 @@ static int cmd_set_ext_adv_params(struct btdev *dev, const void *data,
ext_adv->direct_addr_type = cmd->peer_addr_type;
memcpy(ext_adv->direct_addr, cmd->peer_addr, 6);
ext_adv->filter_policy = cmd->filter_policy;
+ ext_adv->sid = cmd->sid;
rsp.status = BT_HCI_ERR_SUCCESS;
rsp.tx_power = 0;
@@ -5019,6 +5022,7 @@ static void send_ext_adv(struct btdev *btdev, const struct btdev *remote,
/* Right now we dont care about phy in adv report */
meta_event.lear.primary_phy = 0x01;
meta_event.lear.secondary_phy = 0x01;
+ meta_event.lear.sid = ext_adv->sid;
/* Scan or advertising response */
if (is_scan_rsp) {
@@ -5420,17 +5424,32 @@ static bool match_dev(const void *data, const void *match_data)
per_adv->addr_type);
}
+static bool match_sid(const void *data, const void *match_data)
+{
+ const struct le_ext_adv *ext_adv = data;
+ uint8_t sid = PTR_TO_UINT(match_data);
+
+ return ext_adv->sid == sid;
+}
+
static void le_pa_sync_estabilished(struct btdev *dev, struct btdev *remote,
uint8_t status)
{
struct bt_hci_evt_le_per_sync_established ev;
struct le_per_adv *per_adv;
+ struct le_ext_adv *ext_adv;
uint16_t sync_handle = SYNC_HANDLE;
per_adv = queue_find(dev->le_per_adv, match_dev, remote);
if (!per_adv)
return;
+ /* Match SID */
+ ext_adv = queue_find(remote->le_ext_adv, match_sid,
+ UINT_TO_PTR(per_adv->sid));
+ if (!ext_adv)
+ return;
+
memset(&ev, 0, sizeof(ev));
ev.status = status;
@@ -5701,8 +5720,8 @@ static int cmd_ext_create_conn_complete(struct btdev *dev, const void *data,
return 0;
}
-static struct le_per_adv *le_per_adv_new(struct btdev *btdev,
- uint8_t addr_type, const uint8_t *addr)
+static struct le_per_adv *le_per_adv_new(struct btdev *btdev, uint8_t addr_type,
+ const uint8_t *addr, uint8_t sid)
{
struct le_per_adv *per_adv;
@@ -5711,6 +5730,7 @@ static struct le_per_adv *le_per_adv_new(struct btdev *btdev,
per_adv->dev = btdev;
per_adv->addr_type = addr_type;
memcpy(per_adv->addr, addr, 6);
+ per_adv->sid = sid;
per_adv->sync_handle = INV_HANDLE;
/* Add to queue */
@@ -5735,7 +5755,7 @@ static int cmd_pa_create_sync(struct btdev *dev, const void *data, uint8_t len)
}
/* Create new train */
- per_adv = le_per_adv_new(dev, cmd->addr_type, cmd->addr);
+ per_adv = le_per_adv_new(dev, cmd->addr_type, cmd->addr, cmd->sid);
if (!per_adv)
status = BT_HCI_ERR_MEM_CAPACITY_EXCEEDED;
--
2.49.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH BlueZ v1 4/7] iso-tester: Add test for SID=0xff
2025-04-15 21:48 [PATCH BlueZ v1 1/7] bap: Fix not setting SID for broadcast receiver Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v1 2/7] btdev: Check for valid SID on BT_HCI_CMD_LE_PA_CREATE_SYNC Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v1 3/7] btdev: Fix not matching SID on le_pa_sync_estabilished Luiz Augusto von Dentz
@ 2025-04-15 21:48 ` Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v1 5/7] iso-tester: Test getpeername return SID Luiz Augusto von Dentz
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Luiz Augusto von Dentz @ 2025-04-15 21:48 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds the following test which is used to verify that when
application sets bc_sid to 0xff the kernel will attempt to scan for a
valid SID before attempting to create the PA sync:
ISO Broadcaster Receiver SID 0xff
---
tools/iso-tester.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/tools/iso-tester.c b/tools/iso-tester.c
index 350775fddc96..b362647461c3 100644
--- a/tools/iso-tester.c
+++ b/tools/iso-tester.c
@@ -495,6 +495,7 @@ struct iso_client_data {
uint8_t pkt_status;
const uint8_t *base;
size_t base_len;
+ uint8_t sid;
bool listen_bind;
bool pa_bind;
bool big;
@@ -1419,6 +1420,16 @@ static const struct iso_client_data bcast_16_2_1_recv2 = {
.big = true,
};
+static const struct iso_client_data bcast_16_2_1_recv_sid = {
+ .qos = QOS_IN_16_2_1,
+ .expect_err = 0,
+ .recv = &send_16_2_1,
+ .bcast = true,
+ .server = true,
+ .big = true,
+ .sid = 0xff,
+};
+
static const struct iso_client_data bcast_enc_16_2_1_recv = {
.qos = QOS_IN_ENC_16_2_1,
.expect_err = 0,
@@ -2843,6 +2854,7 @@ static int listen_iso_sock(struct test_data *data, uint8_t num)
bacpy(&addr->iso_bc->bc_bdaddr, (void *) dst);
addr->iso_bc->bc_bdaddr_type = BDADDR_LE_PUBLIC;
+ addr->iso_bc->bc_sid = isodata->sid;
if (!isodata->defer || isodata->listen_bind) {
addr->iso_bc->bc_num_bis = 1;
@@ -3817,6 +3829,10 @@ int main(int argc, char *argv[])
test_iso("ISO Broadcaster Receiver - Success", &bcast_16_2_1_recv,
setup_powered,
test_bcast_recv);
+ test_iso("ISO Broadcaster Receiver SID 0xff - Success",
+ &bcast_16_2_1_recv_sid,
+ setup_powered,
+ test_bcast_recv);
test_iso2("ISO Broadcaster Receiver2 - Success", &bcast_16_2_1_recv2,
setup_powered,
test_bcast_recv2);
--
2.49.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH BlueZ v1 5/7] iso-tester: Test getpeername return SID
2025-04-15 21:48 [PATCH BlueZ v1 1/7] bap: Fix not setting SID for broadcast receiver Luiz Augusto von Dentz
` (2 preceding siblings ...)
2025-04-15 21:48 ` [PATCH BlueZ v1 4/7] iso-tester: Add test for SID=0xff Luiz Augusto von Dentz
@ 2025-04-15 21:48 ` Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v1 6/7] btio: Add support to BT_IO_OPT_ISO_BC_SID to bt_io_get Luiz Augusto von Dentz
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Luiz Augusto von Dentz @ 2025-04-15 21:48 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
If test is not setting a valid SID (0xff) use getpeername to validate
the SID gets updated.
---
tools/iso-tester.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/tools/iso-tester.c b/tools/iso-tester.c
index b362647461c3..63f6951e3d0a 100644
--- a/tools/iso-tester.c
+++ b/tools/iso-tester.c
@@ -2575,6 +2575,40 @@ static gboolean iso_connect(GIOChannel *io, GIOCondition cond,
}
}
+ if (isodata->sid == 0xff) {
+ struct {
+ struct sockaddr_iso iso;
+ struct sockaddr_iso_bc bc;
+ } addr;
+ socklen_t olen;
+
+ olen = sizeof(addr);
+
+ memset(&addr, 0, olen);
+ if (getpeername(sk, (void *)&addr, &olen) < 0) {
+ tester_warn("getpeername: %s (%d)",
+ strerror(errno), errno);
+ data->step = 0;
+ tester_test_failed();
+ return FALSE;
+ }
+
+ if (olen != sizeof(addr)) {
+ tester_warn("getpeername: olen %d != %zu sizeof(addr)",
+ olen, sizeof(addr));
+ data->step = 0;
+ tester_test_failed();
+ return FALSE;
+ }
+
+ if (addr.bc.bc_sid > 0x0f) {
+ tester_warn("Invalid SID: %d", addr.bc.bc_sid);
+ data->step = 0;
+ tester_test_failed();
+ return FALSE;
+ }
+ }
+
len = sizeof(sk_err);
if (getsockopt(sk, SOL_SOCKET, SO_ERROR, &sk_err, &len) < 0)
--
2.49.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH BlueZ v1 6/7] btio: Add support to BT_IO_OPT_ISO_BC_SID to bt_io_get
2025-04-15 21:48 [PATCH BlueZ v1 1/7] bap: Fix not setting SID for broadcast receiver Luiz Augusto von Dentz
` (3 preceding siblings ...)
2025-04-15 21:48 ` [PATCH BlueZ v1 5/7] iso-tester: Test getpeername return SID Luiz Augusto von Dentz
@ 2025-04-15 21:48 ` Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v1 7/7] bap: Add support for using SID for broadcast receiver Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v2] bap: Fix not setting " Luiz Augusto von Dentz
6 siblings, 0 replies; 10+ messages in thread
From: Luiz Augusto von Dentz @ 2025-04-15 21:48 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds support for reading BT_IO_OPT_ISO_BC_SID using bt_io_get
---
btio/btio.c | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/btio/btio.c b/btio/btio.c
index 7ea17c7754e4..14f2b700e383 100644
--- a/btio/btio.c
+++ b/btio/btio.c
@@ -1649,6 +1649,27 @@ static gboolean sco_get(int sock, GError **err, BtIOOption opt1, va_list args)
return TRUE;
}
+static bool get_bc_sid(int sock, uint8_t *sid, GError **err)
+{
+ struct {
+ struct sockaddr_iso iso;
+ struct sockaddr_iso_bc bc;
+ } addr;
+ socklen_t olen;
+
+ olen = sizeof(addr);
+ memset(&addr, 0, olen);
+ if (getpeername(sock, (void *)&addr, &olen) < 0 ||
+ olen != sizeof(addr)) {
+ ERROR_FAILED(err, "getpeername", errno);
+ return false;
+ }
+
+ *sid = addr.iso.iso_bc->bc_sid;
+
+ return true;
+}
+
static gboolean iso_get(int sock, GError **err, BtIOOption opt1, va_list args)
{
BtIOOption opt = opt1;
@@ -1657,6 +1678,7 @@ static gboolean iso_get(int sock, GError **err, BtIOOption opt1, va_list args)
struct bt_iso_base base;
socklen_t len;
uint32_t phy;
+ uint8_t bc_sid;
len = sizeof(qos);
memset(&qos, 0, len);
@@ -1721,6 +1743,12 @@ static gboolean iso_get(int sock, GError **err, BtIOOption opt1, va_list args)
case BT_IO_OPT_BASE:
*(va_arg(args, struct bt_iso_base *)) = base;
break;
+ case BT_IO_OPT_ISO_BC_SID:
+ if (!get_bc_sid(sock, &bc_sid, err))
+ return FALSE;
+
+ *(va_arg(args, uint8_t *)) = bc_sid;
+ break;
case BT_IO_OPT_HANDLE:
case BT_IO_OPT_CLASS:
case BT_IO_OPT_DEFER_TIMEOUT:
@@ -1736,7 +1764,6 @@ static gboolean iso_get(int sock, GError **err, BtIOOption opt1, va_list args)
case BT_IO_OPT_FLUSHABLE:
case BT_IO_OPT_PRIORITY:
case BT_IO_OPT_VOICE:
- case BT_IO_OPT_ISO_BC_SID:
case BT_IO_OPT_ISO_BC_NUM_BIS:
case BT_IO_OPT_ISO_BC_BIS:
case BT_IO_OPT_INVALID:
--
2.49.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH BlueZ v1 7/7] bap: Add support for using SID for broadcast receiver
2025-04-15 21:48 [PATCH BlueZ v1 1/7] bap: Fix not setting SID for broadcast receiver Luiz Augusto von Dentz
` (4 preceding siblings ...)
2025-04-15 21:48 ` [PATCH BlueZ v1 6/7] btio: Add support to BT_IO_OPT_ISO_BC_SID to bt_io_get Luiz Augusto von Dentz
@ 2025-04-15 21:48 ` Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v2] bap: Fix not setting " Luiz Augusto von Dentz
6 siblings, 0 replies; 10+ messages in thread
From: Luiz Augusto von Dentz @ 2025-04-15 21:48 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Broadcast receiver needs to set the SID of the advertisement, for now
that is done by using 0xff which indicates to the kernel to perform to
discover what is the actual SID in use over the air.
---
profiles/audio/bap.c | 30 +++++++++++++++++-------------
profiles/audio/bass.c | 19 ++++++++++++-------
src/shared/bap.c | 11 ++++++-----
src/shared/bap.h | 13 +++++++------
4 files changed, 42 insertions(+), 31 deletions(-)
diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index 24763666ce96..88d17058592b 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -74,6 +74,7 @@ struct bap_setup {
unsigned int io_id;
bool recreate;
bool cig_active;
+ uint8_t sid;
struct iovec *caps;
struct iovec *metadata;
unsigned int id;
@@ -1053,8 +1054,9 @@ static void iso_bcast_confirm_cb(GIOChannel *io, GError *err, void *user_data)
}
static void create_stream_for_bis(struct bap_data *bap_data,
- struct bt_bap_pac *lpac, struct bt_bap_qos *qos,
- struct iovec *caps, struct iovec *meta, char *path)
+ struct bt_bap_pac *lpac, uint8_t sid,
+ struct bt_bap_qos *qos, struct iovec *caps,
+ struct iovec *meta, char *path)
{
struct bap_setup *setup;
@@ -1072,6 +1074,7 @@ static void create_stream_for_bis(struct bap_data *bap_data,
setup->stream = bt_bap_stream_new(bap_data->bap,
lpac, NULL, &setup->qos, caps);
+ setup->sid = sid;
bt_bap_stream_set_user_data(setup->stream, path);
bt_bap_stream_config(setup->stream, &setup->qos,
caps, NULL, NULL);
@@ -1079,29 +1082,27 @@ static void create_stream_for_bis(struct bap_data *bap_data,
NULL, NULL);
}
-static void bis_handler(uint8_t bis, uint8_t sgrp, struct iovec *caps,
- struct iovec *meta, struct bt_bap_qos *qos, void *user_data)
+static void bis_handler(uint8_t sid, uint8_t bis, uint8_t sgrp,
+ struct iovec *caps, struct iovec *meta,
+ struct bt_bap_qos *qos, void *user_data)
{
struct bap_data *data = user_data;
struct bt_bap_pac *lpac;
char *path;
- bt_bap_bis_probe(data->bap, bis, sgrp, caps, meta, qos);
+ bt_bap_bis_probe(data->bap, sid, bis, sgrp, caps, meta, qos);
/* Check if this BIS matches any local PAC */
- bt_bap_verify_bis(data->bap, bis,
- caps, &lpac);
+ bt_bap_verify_bis(data->bap, bis, caps, &lpac);
if (!lpac)
return;
- if (asprintf(&path, "%s/bis%d",
- device_get_path(data->device),
- bis) < 0)
+ if (asprintf(&path, "%s/sid%d/bis%d", device_get_path(data->device),
+ sid, bis) < 0)
return;
- create_stream_for_bis(data, lpac, qos,
- caps, meta, path);
+ create_stream_for_bis(data, lpac, sid, qos, caps, meta, path);
}
static gboolean big_info_report_cb(GIOChannel *io, GIOCondition cond,
@@ -1113,12 +1114,14 @@ static gboolean big_info_report_cb(GIOChannel *io, GIOCondition cond,
struct bt_iso_qos qos;
struct iovec iov;
struct bt_bap_qos bap_qos = {0};
+ uint8_t sid;
DBG("BIG Info received");
bt_io_get(io, &err,
BT_IO_OPT_BASE, &base,
BT_IO_OPT_QOS, &qos,
+ BT_IO_OPT_ISO_BC_SID, &sid,
BT_IO_OPT_INVALID);
if (err) {
error("%s", err->message);
@@ -1147,7 +1150,7 @@ static gboolean big_info_report_cb(GIOChannel *io, GIOCondition cond,
/* Create BAP QoS structure */
bt_bap_iso_qos_to_bap_qos(&qos, &bap_qos);
- bt_bap_parse_base(&iov, &bap_qos, bap_debug, bis_handler, data);
+ bt_bap_parse_base(sid, &iov, &bap_qos, bap_debug, bis_handler, data);
util_iov_free(bap_qos.bcast.bcode, 1);
@@ -2941,6 +2944,7 @@ static void pa_and_big_sync(struct bap_setup *setup)
btd_device_get_bdaddr_type(bap_data->device),
BT_IO_OPT_MODE, BT_IO_MODE_ISO,
BT_IO_OPT_QOS, &bap_sink_pa_qos,
+ BT_IO_OPT_ISO_BC_SID, setup->sid,
BT_IO_OPT_INVALID);
if (!bap_data->listen_io) {
error("%s", err->message);
diff --git a/profiles/audio/bass.c b/profiles/audio/bass.c
index c36f432776b5..46ac0f4894e2 100644
--- a/profiles/audio/bass.c
+++ b/profiles/audio/bass.c
@@ -141,8 +141,9 @@ static struct bass_data *bass_data_new(struct btd_device *device);
static void bass_data_add(struct bass_data *data);
static void bass_data_remove(struct bass_data *data);
-static void bis_probe(uint8_t bis, uint8_t sgrp, struct iovec *caps,
- struct iovec *meta, struct bt_bap_qos *qos, void *user_data);
+static void bis_probe(uint8_t sid, uint8_t bis, uint8_t sgrp,
+ struct iovec *caps, struct iovec *meta,
+ struct bt_bap_qos *qos, void *user_data);
static void bis_remove(struct bt_bap *bap, void *user_data);
@@ -482,8 +483,9 @@ static void bass_add_bis(struct bass_setup *setup)
setup_configure_stream(setup);
}
-static void bis_handler(uint8_t bis, uint8_t sgrp, struct iovec *caps,
- struct iovec *meta, struct bt_bap_qos *qos, void *user_data)
+static void bis_handler(uint8_t sid, uint8_t bis, uint8_t sgrp,
+ struct iovec *caps, struct iovec *meta,
+ struct bt_bap_qos *qos, void *user_data)
{
struct bass_delegator *dg = user_data;
struct bt_bap_pac *lpac;
@@ -526,12 +528,14 @@ static gboolean big_info_cb(GIOChannel *io, GIOCondition cond,
struct bt_iso_qos qos;
struct iovec iov;
struct bt_bap_qos bap_qos = {0};
+ uint8_t sid;
dg->io_id = 0;
bt_io_get(io, &err,
BT_IO_OPT_BASE, &base,
BT_IO_OPT_QOS, &qos,
+ BT_IO_OPT_ISO_BC_SID, &sid,
BT_IO_OPT_INVALID);
if (err) {
error("%s", err->message);
@@ -545,7 +549,7 @@ static gboolean big_info_cb(GIOChannel *io, GIOCondition cond,
/* Create BAP QoS structure */
bt_bap_iso_qos_to_bap_qos(&qos, &bap_qos);
- bt_bap_parse_base(&iov, &bap_qos, bass_debug, bis_handler, dg);
+ bt_bap_parse_base(sid, &iov, &bap_qos, bass_debug, bis_handler, dg);
util_iov_free(bap_qos.bcast.bcode, 1);
@@ -1107,8 +1111,9 @@ static struct bass_assistant *assistant_new(struct btd_adapter *adapter,
return assistant;
}
-static void bis_probe(uint8_t bis, uint8_t sgrp, struct iovec *caps,
- struct iovec *meta, struct bt_bap_qos *qos, void *user_data)
+static void bis_probe(uint8_t sid, uint8_t bis, uint8_t sgrp,
+ struct iovec *caps, struct iovec *meta,
+ struct bt_bap_qos *qos, void *user_data)
{
struct btd_device *device = user_data;
const struct queue_entry *entry;
diff --git a/src/shared/bap.c b/src/shared/bap.c
index 3758aa0000b0..3a11cb0820ec 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -5721,8 +5721,9 @@ bool bt_bap_bis_cb_unregister(struct bt_bap *bap, unsigned int id)
return false;
}
-void bt_bap_bis_probe(struct bt_bap *bap, uint8_t bis, uint8_t sgrp,
- struct iovec *caps, struct iovec *meta, struct bt_bap_qos *qos)
+void bt_bap_bis_probe(struct bt_bap *bap, uint8_t sid, uint8_t bis,
+ uint8_t sgrp, struct iovec *caps, struct iovec *meta,
+ struct bt_bap_qos *qos)
{
const struct queue_entry *entry;
@@ -5737,7 +5738,7 @@ void bt_bap_bis_probe(struct bt_bap *bap, uint8_t bis, uint8_t sgrp,
entry = entry->next;
if (cb->probe)
- cb->probe(bis, sgrp, caps, meta, qos, cb->data);
+ cb->probe(sid, bis, sgrp, caps, meta, qos, cb->data);
}
bt_bap_unref(bap);
@@ -7341,7 +7342,7 @@ void bt_bap_verify_bis(struct bt_bap *bap, uint8_t bis_index,
}
-bool bt_bap_parse_base(struct iovec *iov,
+bool bt_bap_parse_base(uint8_t sid, struct iovec *iov,
struct bt_bap_qos *qos,
util_debug_func_t func,
bt_bap_bis_func_t handler,
@@ -7452,7 +7453,7 @@ bool bt_bap_parse_base(struct iovec *iov,
if (!bis_cc)
continue;
- handler(bis_index, idx, bis_cc, &meta,
+ handler(sid, bis_index, idx, bis_cc, &meta,
qos, user_data);
util_iov_free(bis_cc, 1);
diff --git a/src/shared/bap.h b/src/shared/bap.h
index dfd16998071b..d10581428e79 100644
--- a/src/shared/bap.h
+++ b/src/shared/bap.h
@@ -40,9 +40,9 @@ typedef void (*bt_bap_stream_func_t)(struct bt_bap_stream *stream,
void *user_data);
typedef void (*bt_bap_func_t)(struct bt_bap *bap, void *user_data);
-typedef void (*bt_bap_bis_func_t)(uint8_t bis, uint8_t sgrp,
- struct iovec *caps, struct iovec *meta,
- struct bt_bap_qos *qos, void *user_data);
+typedef void (*bt_bap_bis_func_t)(uint8_t sid, uint8_t bis, uint8_t sgrp,
+ struct iovec *caps, struct iovec *meta,
+ struct bt_bap_qos *qos, void *user_data);
typedef void (*bt_bap_bcode_reply_t)(void *user_data, int err);
@@ -271,7 +271,7 @@ void bt_bap_verify_bis(struct bt_bap *bap, uint8_t bis_index,
struct iovec *caps,
struct bt_bap_pac **lpac);
-bool bt_bap_parse_base(struct iovec *base,
+bool bt_bap_parse_base(uint8_t sid, struct iovec *base,
struct bt_bap_qos *qos,
util_debug_func_t func,
bt_bap_bis_func_t handler,
@@ -284,8 +284,9 @@ unsigned int bt_bap_bis_cb_register(struct bt_bap *bap,
bt_bap_destroy_func_t destroy);
bool bt_bap_bis_cb_unregister(struct bt_bap *bap, unsigned int id);
-void bt_bap_bis_probe(struct bt_bap *bap, uint8_t bis, uint8_t sgrp,
- struct iovec *caps, struct iovec *meta, struct bt_bap_qos *qos);
+void bt_bap_bis_probe(struct bt_bap *bap, uint8_t sid, uint8_t bis,
+ uint8_t sgrp, struct iovec *caps, struct iovec *meta,
+ struct bt_bap_qos *qos);
void bt_bap_bis_remove(struct bt_bap *bap);
void bt_bap_req_bcode(struct bt_bap_stream *stream,
--
2.49.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH BlueZ v2] bap: Fix not setting SID for broadcast receiver
2025-04-15 21:48 [PATCH BlueZ v1 1/7] bap: Fix not setting SID for broadcast receiver Luiz Augusto von Dentz
` (5 preceding siblings ...)
2025-04-15 21:48 ` [PATCH BlueZ v1 7/7] bap: Add support for using SID for broadcast receiver Luiz Augusto von Dentz
@ 2025-04-15 21:48 ` Luiz Augusto von Dentz
2025-04-15 23:34 ` [BlueZ,v2] " bluez.test.bot
6 siblings, 1 reply; 10+ messages in thread
From: Luiz Augusto von Dentz @ 2025-04-15 21:48 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
SID most be set otherwise 0x00 is assume which may not be what the
broadcast source is using over the air. but since we don't have access
to the SID of the advertisement in userspace mark de SID as invalid
(0xff) so the kernel fill it up while scanning when creating the PA
sync.
---
profiles/audio/bap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index fd9b751cc1bf..24763666ce96 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -2813,6 +2813,7 @@ static void bap_detached(struct bt_bap *bap, void *user_data)
static int pa_sync(struct bap_data *data)
{
GError *err = NULL;
+ uint8_t sid = 0xff;
if (data->listen_io) {
DBG("Already probed");
@@ -2833,6 +2834,7 @@ static int pa_sync(struct bap_data *data)
btd_device_get_bdaddr_type(data->device),
BT_IO_OPT_MODE, BT_IO_MODE_ISO,
BT_IO_OPT_QOS, &bap_sink_pa_qos,
+ BT_IO_OPT_ISO_BC_SID, sid,
BT_IO_OPT_INVALID);
if (!data->listen_io) {
error("%s", err->message);
--
2.49.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* RE: [BlueZ,v2] bap: Fix not setting SID for broadcast receiver
2025-04-15 21:48 ` [PATCH BlueZ v2] bap: Fix not setting " Luiz Augusto von Dentz
@ 2025-04-15 23:34 ` bluez.test.bot
0 siblings, 0 replies; 10+ messages in thread
From: bluez.test.bot @ 2025-04-15 23:34 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=953730
---Test result---
Test Summary:
CheckPatch PENDING 0.19 seconds
GitLint PENDING 0.19 seconds
BuildEll PASS 20.60 seconds
BluezMake PASS 2662.10 seconds
MakeCheck PASS 25.83 seconds
MakeDistcheck PASS 200.51 seconds
CheckValgrind PASS 296.96 seconds
CheckSmatch PASS 304.88 seconds
bluezmakeextell PASS 129.58 seconds
IncrementalBuild PENDING 0.24 seconds
ScanBuild PASS 933.16 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-04-15 23:34 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-15 21:48 [PATCH BlueZ v1 1/7] bap: Fix not setting SID for broadcast receiver Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v1 2/7] btdev: Check for valid SID on BT_HCI_CMD_LE_PA_CREATE_SYNC Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v1 3/7] btdev: Fix not matching SID on le_pa_sync_estabilished Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v1 4/7] iso-tester: Add test for SID=0xff Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v1 5/7] iso-tester: Test getpeername return SID Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v1 6/7] btio: Add support to BT_IO_OPT_ISO_BC_SID to bt_io_get Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v1 7/7] bap: Add support for using SID for broadcast receiver Luiz Augusto von Dentz
2025-04-15 21:48 ` [PATCH BlueZ v2] bap: Fix not setting " Luiz Augusto von Dentz
2025-04-15 23:34 ` [BlueZ,v2] " bluez.test.bot
-- strict thread matches above, loose matches on Subject: below --
2025-04-11 19:56 [PATCH BlueZ v2] " Luiz Augusto von Dentz
2025-04-11 21:35 ` [BlueZ,v2] " bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox