diff mbox series

[BlueZ,bluez] bass: Clear the temporary flag of the BIS source device

Message ID 20250402-bass-v1-1-3e753841faa5@amlogic.com
State New
Headers show
Series [BlueZ,bluez] bass: Clear the temporary flag of the BIS source device | expand

Commit Message

Yang Li via B4 Relay April 2, 2025, 7:32 a.m. UTC
From: Yang Li <yang.li@amlogic.com>

When BIG sync succeeds, remove the temporary timer. Otherwise,
the device will timeout and be removed, triggering the automatic
termination of BIG.

issue: https://github.com/bluez/bluez/issues/1144

Signed-off-by: Yang Li <yang.li@amlogic.com>
---
 profiles/audio/bass.c | 3 +++
 1 file changed, 3 insertions(+)


---
base-commit: 6d20a300642f312290af0bc9869a0e1b416c58dc
change-id: 20250402-bass-66200bb7eba1

Best regards,

Comments

bluez.test.bot@gmail.com April 2, 2025, 8:30 a.m. UTC | #1
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=949188

---Test result---

Test Summary:
CheckPatch                    PENDING   0.21 seconds
GitLint                       PENDING   0.19 seconds
BuildEll                      PASS      20.61 seconds
BluezMake                     PASS      1437.28 seconds
MakeCheck                     PASS      13.58 seconds
MakeDistcheck                 PASS      158.20 seconds
CheckValgrind                 PASS      213.87 seconds
CheckSmatch                   PASS      286.08 seconds
bluezmakeextell               PASS      107.94 seconds
IncrementalBuild              PENDING   0.29 seconds
ScanBuild                     PASS      861.42 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
Luiz Augusto von Dentz April 2, 2025, 2:34 p.m. UTC | #2
Hi Yang,

On Wed, Apr 2, 2025 at 3:33 AM Yang Li via B4 Relay
<devnull+yang.li.amlogic.com@kernel.org> wrote:
>
> From: Yang Li <yang.li@amlogic.com>
>
> When BIG sync succeeds, remove the temporary timer. Otherwise,
> the device will timeout and be removed, triggering the automatic
> termination of BIG.
>
> issue: https://github.com/bluez/bluez/issues/1144
>
> Signed-off-by: Yang Li <yang.li@amlogic.com>
> ---
>  profiles/audio/bass.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/profiles/audio/bass.c b/profiles/audio/bass.c
> index c36f43277..99f1decce 100644
> --- a/profiles/audio/bass.c
> +++ b/profiles/audio/bass.c
> @@ -565,6 +565,9 @@ static void confirm_cb(GIOChannel *io, void *user_data)
>         g_io_channel_ref(io);
>         dg->io = io;
>
> +       /* Clear temporary flag*/
> +       btd_device_set_temporary(dg->device, false);

This is not quite right, we shall not persist the broadcasters, as
they are likely not pairable/bondable, that said the device shall be
marked as connected which would prevent them to be removed. That said
we should be handling if the service is marked as connected:

static bool device_disappeared(gpointer user_data)
{
    struct btd_device *dev = user_data;

    /* If there are services connected restart the timer to give more time
     * for the service to either complete the connection or disconnect.
     */
    if (device_service_connected(dev))
        return TRUE;

And it looks like that is done in iso_bcast_confirm_cb in bap plugin
which calls btd_service_connecting_complete.


>         /* Update Broadcast Receive State characteristic value and notify
>          * peers.
>          */
>
> ---
> base-commit: 6d20a300642f312290af0bc9869a0e1b416c58dc
> change-id: 20250402-bass-66200bb7eba1
>
> Best regards,
> --
> Yang Li <yang.li@amlogic.com>
>
>
>
Yang Li April 3, 2025, 3:33 a.m. UTC | #3
Hi Luiz

> [ EXTERNAL EMAIL ]
>
> Hi Yang,
>
> On Wed, Apr 2, 2025 at 3:33 AM Yang Li via B4 Relay
> <devnull+yang.li.amlogic.com@kernel.org> wrote:
>> From: Yang Li <yang.li@amlogic.com>
>>
>> When BIG sync succeeds, remove the temporary timer. Otherwise,
>> the device will timeout and be removed, triggering the automatic
>> termination of BIG.
>>
>> issue: https://github.com/bluez/bluez/issues/1144
>>
>> Signed-off-by: Yang Li <yang.li@amlogic.com>
>> ---
>>   profiles/audio/bass.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/profiles/audio/bass.c b/profiles/audio/bass.c
>> index c36f43277..99f1decce 100644
>> --- a/profiles/audio/bass.c
>> +++ b/profiles/audio/bass.c
>> @@ -565,6 +565,9 @@ static void confirm_cb(GIOChannel *io, void *user_data)
>>          g_io_channel_ref(io);
>>          dg->io = io;
>>
>> +       /* Clear temporary flag*/
>> +       btd_device_set_temporary(dg->device, false);
> This is not quite right, we shall not persist the broadcasters, as
> they are likely not pairable/bondable, that said the device shall be
> marked as connected which would prevent them to be removed. That said
> we should be handling if the service is marked as connected:
>
> static bool device_disappeared(gpointer user_data)
> {
>      struct btd_device *dev = user_data;
>
>      /* If there are services connected restart the timer to give more time
>       * for the service to either complete the connection or disconnect.
>       */
>      if (device_service_connected(dev))
>          return TRUE;
>
> And it looks like that is done in iso_bcast_confirm_cb in bap plugin
> which calls btd_service_connecting_complete.
>
I tested it with a K70 phone as Assistant and another Android device as 
BIS Source. After the Assistant added the BIS source information, the 
iso_bcast_confirm_cb function was not called, but the 
connect_cb(profiles/audio/bass.c) function was executed. In my next 
patch, I will add btd_service_connecting_complete to the connect_cb 
function.
>>          /* Update Broadcast Receive State characteristic value and notify
>>           * peers.
>>           */
>>
>> ---
>> base-commit: 6d20a300642f312290af0bc9869a0e1b416c58dc
>> change-id: 20250402-bass-66200bb7eba1
>>
>> Best regards,
>> --
>> Yang Li <yang.li@amlogic.com>
>>
>>
>>
>
> --
> Luiz Augusto von Dentz
bluez.test.bot@gmail.com April 24, 2025, 5 p.m. UTC | #4
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=949188

---Test result---

Test Summary:
CheckPatch                    PENDING   0.37 seconds
GitLint                       PENDING   0.42 seconds
BuildEll                      PASS      20.65 seconds
BluezMake                     PASS      2636.26 seconds
MakeCheck                     PASS      20.25 seconds
MakeDistcheck                 PASS      198.39 seconds
CheckValgrind                 PASS      277.29 seconds
CheckSmatch                   PASS      304.45 seconds
bluezmakeextell               PASS      128.04 seconds
IncrementalBuild              PENDING   0.34 seconds
ScanBuild                     PASS      901.60 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
diff mbox series

Patch

diff --git a/profiles/audio/bass.c b/profiles/audio/bass.c
index c36f43277..99f1decce 100644
--- a/profiles/audio/bass.c
+++ b/profiles/audio/bass.c
@@ -565,6 +565,9 @@  static void confirm_cb(GIOChannel *io, void *user_data)
 	g_io_channel_ref(io);
 	dg->io = io;
 
+	/* Clear temporary flag*/
+	btd_device_set_temporary(dg->device, false);
+
 	/* Update Broadcast Receive State characteristic value and notify
 	 * peers.
 	 */