Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 0/1] bap: Use defer setup when syncing to a BIS source
@ 2023-09-11  6:16 Vlad Pruteanu
  2023-09-11  6:16 ` [PATCH BlueZ v2 1/1] " Vlad Pruteanu
  0 siblings, 1 reply; 5+ messages in thread
From: Vlad Pruteanu @ 2023-09-11  6:16 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: claudia.rosu, mihai-octavian.urzica, silviu.barbulescu,
	iulia.tanasescu, andrei.istodorescu, Vlad Pruteanu

This commit uses the newly added bt_io_bcast_accept function from
btio.c to implement the defer setup for the BIS sync process.
Now, information from the BIG Info advertising report can be
used when sending the BIG Create Sync command.

Vlad Pruteanu (1):
  bap: Use defer setup when syncing to a BIS source

 profiles/audio/bap.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH BlueZ v2 1/1] bap: Use defer setup when syncing to a BIS source
  2023-09-11  6:16 [PATCH BlueZ v2 0/1] bap: Use defer setup when syncing to a BIS source Vlad Pruteanu
@ 2023-09-11  6:16 ` Vlad Pruteanu
  2023-09-11  7:04   ` Ziyang Xuan (William)
  2023-09-11  7:40   ` bluez.test.bot
  0 siblings, 2 replies; 5+ messages in thread
From: Vlad Pruteanu @ 2023-09-11  6:16 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: claudia.rosu, mihai-octavian.urzica, silviu.barbulescu,
	iulia.tanasescu, andrei.istodorescu, Vlad Pruteanu

This commit uses the newly added bt_io_bcast_accept function from
btio.c to implement the defer setup for the BIS sync process.
Now, information from the BIG Info advertising report can be
used when sending the BIG Create Sync command.
---
 profiles/audio/bap.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index ee90426b9..8a2da24dd 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -840,6 +840,22 @@ drop:
 
 }
 
+static void iso_pa_sync_confirm_cb(GIOChannel *io, void *user_data)
+{
+	GError *err = NULL;
+
+	if (!bt_io_bcast_accept(io, iso_bcast_confirm_cb,
+				user_data, NULL, &err)) {
+		error("bt_io_bcast_accept: %s", err->message);
+		g_error_free(err);
+		goto drop;
+	}
+	return;
+
+drop:
+	g_io_channel_shutdown(io, TRUE, NULL);
+}
+
 static bool match_data_bap_data(const void *data, const void *match_data)
 {
 	const struct bap_data *bdata = data;
@@ -1587,7 +1603,7 @@ static void bap_listen_io_broadcast(struct bap_data *data, struct bap_ep *ep,
 	if (bt_bap_stream_get_io(stream) || data->listen_io)
 		return;
 
-	io = bt_io_listen(iso_bcast_confirm_cb, NULL, ep->data, NULL, &err,
+	io = bt_io_listen(NULL, iso_pa_sync_confirm_cb, ep->data, NULL, &err,
 			BT_IO_OPT_SOURCE_BDADDR,
 			btd_adapter_get_address(ep->data->adapter),
 			BT_IO_OPT_DEST_BDADDR,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH BlueZ v2 1/1] bap: Use defer setup when syncing to a BIS source
  2023-09-11  6:16 ` [PATCH BlueZ v2 1/1] " Vlad Pruteanu
@ 2023-09-11  7:04   ` Ziyang Xuan (William)
  2023-09-11  8:39     ` Vlad Pruteanu
  2023-09-11  7:40   ` bluez.test.bot
  1 sibling, 1 reply; 5+ messages in thread
From: Ziyang Xuan (William) @ 2023-09-11  7:04 UTC (permalink / raw)
  To: Vlad Pruteanu, linux-bluetooth
  Cc: claudia.rosu, mihai-octavian.urzica, silviu.barbulescu,
	iulia.tanasescu, andrei.istodorescu

> This commit uses the newly added bt_io_bcast_accept function from
> btio.c to implement the defer setup for the BIS sync process.
> Now, information from the BIG Info advertising report can be
> used when sending the BIG Create Sync command.
> ---
>  profiles/audio/bap.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
> index ee90426b9..8a2da24dd 100644
> --- a/profiles/audio/bap.c
> +++ b/profiles/audio/bap.c
> @@ -840,6 +840,22 @@ drop:
>  
>  }
>  
> +static void iso_pa_sync_confirm_cb(GIOChannel *io, void *user_data)
> +{
> +	GError *err = NULL;
> +
> +	if (!bt_io_bcast_accept(io, iso_bcast_confirm_cb,
> +				user_data, NULL, &err)) {
> +		error("bt_io_bcast_accept: %s", err->message);
> +		g_error_free(err);
> +		goto drop;
> +	}
> +	return;
> +
> +drop:
> +	g_io_channel_shutdown(io, TRUE, NULL);
> +}
Maybe we do not need goto. It's can be more concise as following:

static void iso_pa_sync_confirm_cb(GIOChannel *io, void *user_data)
{
	GError *err = NULL;

	if (!bt_io_bcast_accept(io, iso_bcast_confirm_cb,
				user_data, NULL, &err)) {
		error("bt_io_bcast_accept: %s", err->message);
		g_error_free(err);
		g_io_channel_shutdown(io, TRUE, NULL);
	}
}

or

static void iso_pa_sync_confirm_cb(GIOChannel *io, void *user_data)
{
	GError *err = NULL;

	if (bt_io_bcast_accept(io, iso_bcast_confirm_cb,
				user_data, NULL, &err)) {
		return;
	}

	error("bt_io_bcast_accept: %s", err->message);
	g_error_free(err);
	g_io_channel_shutdown(io, TRUE, NULL);
}


William Xuan
> +
>  static bool match_data_bap_data(const void *data, const void *match_data)
>  {
>  	const struct bap_data *bdata = data;
> @@ -1587,7 +1603,7 @@ static void bap_listen_io_broadcast(struct bap_data *data, struct bap_ep *ep,
>  	if (bt_bap_stream_get_io(stream) || data->listen_io)
>  		return;
>  
> -	io = bt_io_listen(iso_bcast_confirm_cb, NULL, ep->data, NULL, &err,
> +	io = bt_io_listen(NULL, iso_pa_sync_confirm_cb, ep->data, NULL, &err,
>  			BT_IO_OPT_SOURCE_BDADDR,
>  			btd_adapter_get_address(ep->data->adapter),
>  			BT_IO_OPT_DEST_BDADDR,
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: bap: Use defer setup when syncing to a BIS source
  2023-09-11  6:16 ` [PATCH BlueZ v2 1/1] " Vlad Pruteanu
  2023-09-11  7:04   ` Ziyang Xuan (William)
@ 2023-09-11  7:40   ` bluez.test.bot
  1 sibling, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2023-09-11  7:40 UTC (permalink / raw)
  To: linux-bluetooth, vlad.pruteanu

[-- Attachment #1: Type: text/plain, Size: 947 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=782813

---Test result---

Test Summary:
CheckPatch                    PASS      0.57 seconds
GitLint                       PASS      0.36 seconds
BuildEll                      PASS      28.20 seconds
BluezMake                     PASS      934.65 seconds
MakeCheck                     PASS      12.39 seconds
MakeDistcheck                 PASS      162.65 seconds
CheckValgrind                 PASS      264.44 seconds
CheckSmatch                   PASS      356.71 seconds
bluezmakeextell               PASS      108.14 seconds
IncrementalBuild              PASS      765.23 seconds
ScanBuild                     PASS      1121.72 seconds



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH BlueZ v2 1/1] bap: Use defer setup when syncing to a BIS source
  2023-09-11  7:04   ` Ziyang Xuan (William)
@ 2023-09-11  8:39     ` Vlad Pruteanu
  0 siblings, 0 replies; 5+ messages in thread
From: Vlad Pruteanu @ 2023-09-11  8:39 UTC (permalink / raw)
  To: william.xuanziyang
  Cc: andrei.istodorescu, claudia.rosu, iulia.tanasescu,
	linux-bluetooth, mihai-octavian.urzica, silviu.barbulescu,
	vlad.pruteanu

Hi William,

> -----Original Message-----
> From: Ziyang Xuan (William) <william.xuanziyang@huawei.com>
> Sent: Monday, September 11, 2023 10:05 AM
> To: Vlad Pruteanu <vlad.pruteanu@nxp.com>; linux-bluetooth@vger.kernel.org
> Cc: Claudia Cristina Draghicescu <claudia.rosu@nxp.com>; Mihai-Octavian
> Urzica <mihai-octavian.urzica@nxp.com>; Silviu Florian Barbulescu
> <silviu.barbulescu@nxp.com>; Iulia Tanasescu <iulia.tanasescu@nxp.com>;
> Andrei Istodorescu <andrei.istodorescu@nxp.com>
> Subject: [EXT] Re: [PATCH BlueZ v2 1/1] bap: Use defer setup when syncing to a
> BIS source
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report this
> email' button
> 
> 
> > This commit uses the newly added bt_io_bcast_accept function from
> > btio.c to implement the defer setup for the BIS sync process.
> > Now, information from the BIG Info advertising report can be used when
> > sending the BIG Create Sync command.
> > ---
> >  profiles/audio/bap.c | 18 +++++++++++++++++-
> >  1 file changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index
> > ee90426b9..8a2da24dd 100644
> > --- a/profiles/audio/bap.c
> > +++ b/profiles/audio/bap.c
> > @@ -840,6 +840,22 @@ drop:
> >
> >  }
> >
> > +static void iso_pa_sync_confirm_cb(GIOChannel *io, void *user_data) {
> > +     GError *err = NULL;
> > +
> > +     if (!bt_io_bcast_accept(io, iso_bcast_confirm_cb,
> > +                             user_data, NULL, &err)) {
> > +             error("bt_io_bcast_accept: %s", err->message);
> > +             g_error_free(err);
> > +             goto drop;
> > +     }
> > +     return;
> > +
> > +drop:
> > +     g_io_channel_shutdown(io, TRUE, NULL); }
> Maybe we do not need goto. It's can be more concise as following:
> 
> static void iso_pa_sync_confirm_cb(GIOChannel *io, void *user_data) {
>         GError *err = NULL;
> 
>         if (!bt_io_bcast_accept(io, iso_bcast_confirm_cb,
>                                 user_data, NULL, &err)) {
>                 error("bt_io_bcast_accept: %s", err->message);
>                 g_error_free(err);
>                 g_io_channel_shutdown(io, TRUE, NULL);
>         }
> }
> 
> or
> 
> static void iso_pa_sync_confirm_cb(GIOChannel *io, void *user_data) {
>         GError *err = NULL;
> 
>         if (bt_io_bcast_accept(io, iso_bcast_confirm_cb,
>                                 user_data, NULL, &err)) {
>                 return;
>         }
> 
>         error("bt_io_bcast_accept: %s", err->message);
>         g_error_free(err);
>         g_io_channel_shutdown(io, TRUE, NULL); }
> 
> 
> William Xuan

You're right, I'll update the patch using the first option. Thanks for the input!

> > +
> >  static bool match_data_bap_data(const void *data, const void
> > *match_data)  {
> >       const struct bap_data *bdata = data; @@ -1587,7 +1603,7 @@
> > static void bap_listen_io_broadcast(struct bap_data *data, struct bap_ep *ep,
> >       if (bt_bap_stream_get_io(stream) || data->listen_io)
> >               return;
> >
> > -     io = bt_io_listen(iso_bcast_confirm_cb, NULL, ep->data, NULL, &err,
> > +     io = bt_io_listen(NULL, iso_pa_sync_confirm_cb, ep->data, NULL,
> > + &err,
> >                       BT_IO_OPT_SOURCE_BDADDR,
> >                       btd_adapter_get_address(ep->data->adapter),
> >                       BT_IO_OPT_DEST_BDADDR,
> >


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-09-11 21:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-11  6:16 [PATCH BlueZ v2 0/1] bap: Use defer setup when syncing to a BIS source Vlad Pruteanu
2023-09-11  6:16 ` [PATCH BlueZ v2 1/1] " Vlad Pruteanu
2023-09-11  7:04   ` Ziyang Xuan (William)
2023-09-11  8:39     ` Vlad Pruteanu
2023-09-11  7:40   ` 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