* [PATCH BlueZ] a2dp: start connecting sink profile before source
@ 2026-02-15 12:54 Pauli Virtanen
2026-02-15 14:16 ` [BlueZ] " bluez.test.bot
2026-02-16 8:16 ` [PATCH BlueZ] " Pauli Virtanen
0 siblings, 2 replies; 4+ messages in thread
From: Pauli Virtanen @ 2026-02-15 12:54 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Pauli Virtanen
Since cdcd845f87ee the order in which profiles with the same priority are
connected is the same order as btd_profile_register() is called, instead
of being the opposite order.
When initiating connections, we want to prefer a2dp-sink profile over
a2dp-source, as connecting both at the same time does not work
currently.
So swap the order of registration, to restore the previous behavior.
Fixes: https://github.com/bluez/bluez/issues/1898
---
profiles/audio/a2dp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index 7a37003a2..7216ed017 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -3796,8 +3796,8 @@ static struct btd_adapter_driver media_driver = {
static int a2dp_init(void)
{
btd_register_adapter_driver(&media_driver);
- btd_profile_register(&a2dp_source_profile);
btd_profile_register(&a2dp_sink_profile);
+ btd_profile_register(&a2dp_source_profile);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [BlueZ] a2dp: start connecting sink profile before source
2026-02-15 12:54 [PATCH BlueZ] a2dp: start connecting sink profile before source Pauli Virtanen
@ 2026-02-15 14:16 ` bluez.test.bot
2026-02-16 8:16 ` [PATCH BlueZ] " Pauli Virtanen
1 sibling, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2026-02-15 14:16 UTC (permalink / raw)
To: linux-bluetooth, pav
[-- 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=1054282
---Test result---
Test Summary:
CheckPatch PENDING 0.39 seconds
GitLint PENDING 0.40 seconds
BuildEll PASS 18.19 seconds
BluezMake PASS 633.13 seconds
MakeCheck PASS 18.43 seconds
MakeDistcheck PASS 222.94 seconds
CheckValgrind PASS 282.52 seconds
CheckSmatch PASS 318.41 seconds
bluezmakeextell PASS 169.93 seconds
IncrementalBuild PENDING 0.39 seconds
ScanBuild PASS 930.13 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] 4+ messages in thread
* Re: [PATCH BlueZ] a2dp: start connecting sink profile before source
2026-02-15 12:54 [PATCH BlueZ] a2dp: start connecting sink profile before source Pauli Virtanen
2026-02-15 14:16 ` [BlueZ] " bluez.test.bot
@ 2026-02-16 8:16 ` Pauli Virtanen
2026-02-16 14:42 ` Luiz Augusto von Dentz
1 sibling, 1 reply; 4+ messages in thread
From: Pauli Virtanen @ 2026-02-16 8:16 UTC (permalink / raw)
To: linux-bluetooth
su, 2026-02-15 kello 14:54 +0200, Pauli Virtanen kirjoitti:
> Since cdcd845f87ee the order in which profiles with the same priority are
> connected is the same order as btd_profile_register() is called, instead
> of being the opposite order.
>
> When initiating connections, we want to prefer a2dp-sink profile over
> a2dp-source, as connecting both at the same time does not work
> currently.
>
> So swap the order of registration, to restore the previous behavior.
Or maybe it's better to be more explicit, as in following -> v2
diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index 7a37003a2..1e6300657 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -3769,6 +3769,8 @@ static struct btd_profile a2dp_source_profile = {
.adapter_probe = a2dp_sink_server_probe,
.adapter_remove = a2dp_sink_server_remove,
+
+ .after_services = BTD_PROFILE_UUID_CB(NULL, A2DP_SINK_UUID),
};
static struct btd_profile a2dp_sink_profile = {
>
> Fixes: https://github.com/bluez/bluez/issues/1898
> ---
> profiles/audio/a2dp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
> index 7a37003a2..7216ed017 100644
> --- a/profiles/audio/a2dp.c
> +++ b/profiles/audio/a2dp.c
> @@ -3796,8 +3796,8 @@ static struct btd_adapter_driver media_driver = {
> static int a2dp_init(void)
> {
> btd_register_adapter_driver(&media_driver);
> - btd_profile_register(&a2dp_source_profile);
> btd_profile_register(&a2dp_sink_profile);
> + btd_profile_register(&a2dp_source_profile);
>
> return 0;
> }
--
Pauli Virtanen
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH BlueZ] a2dp: start connecting sink profile before source
2026-02-16 8:16 ` [PATCH BlueZ] " Pauli Virtanen
@ 2026-02-16 14:42 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2026-02-16 14:42 UTC (permalink / raw)
To: Pauli Virtanen; +Cc: linux-bluetooth
Hi Pauli,
On Mon, Feb 16, 2026 at 3:18 AM Pauli Virtanen <pav@iki.fi> wrote:
>
> su, 2026-02-15 kello 14:54 +0200, Pauli Virtanen kirjoitti:
> > Since cdcd845f87ee the order in which profiles with the same priority are
> > connected is the same order as btd_profile_register() is called, instead
> > of being the opposite order.
> >
> > When initiating connections, we want to prefer a2dp-sink profile over
> > a2dp-source, as connecting both at the same time does not work
> > currently.
> >
> > So swap the order of registration, to restore the previous behavior.
>
> Or maybe it's better to be more explicit, as in following -> v2
>
> diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
> index 7a37003a2..1e6300657 100644
> --- a/profiles/audio/a2dp.c
> +++ b/profiles/audio/a2dp.c
> @@ -3769,6 +3769,8 @@ static struct btd_profile a2dp_source_profile = {
>
> .adapter_probe = a2dp_sink_server_probe,
> .adapter_remove = a2dp_sink_server_remove,
> +
> + .after_services = BTD_PROFILE_UUID_CB(NULL, A2DP_SINK_UUID),
> };
+1, This might work better to prevent future changes to the order.
> static struct btd_profile a2dp_sink_profile = {
>
> >
> > Fixes: https://github.com/bluez/bluez/issues/1898
> > ---
> > profiles/audio/a2dp.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
> > index 7a37003a2..7216ed017 100644
> > --- a/profiles/audio/a2dp.c
> > +++ b/profiles/audio/a2dp.c
> > @@ -3796,8 +3796,8 @@ static struct btd_adapter_driver media_driver = {
> > static int a2dp_init(void)
> > {
> > btd_register_adapter_driver(&media_driver);
> > - btd_profile_register(&a2dp_source_profile);
> > btd_profile_register(&a2dp_sink_profile);
> > + btd_profile_register(&a2dp_source_profile);
> >
> > return 0;
> > }
>
> --
> Pauli Virtanen
>
>
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-02-16 14:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-15 12:54 [PATCH BlueZ] a2dp: start connecting sink profile before source Pauli Virtanen
2026-02-15 14:16 ` [BlueZ] " bluez.test.bot
2026-02-16 8:16 ` [PATCH BlueZ] " Pauli Virtanen
2026-02-16 14:42 ` Luiz Augusto von Dentz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox