Skip to content

Scan delegator keeps reporting bad code to broadcast assistant after BIG is synchronized #88461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mefromac opened this issue Apr 10, 2025 · 1 comment · Fixed by #88891
Closed
Assignees
Labels
area: Bluetooth Audio area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@mefromac
Copy link

Describe the bug
When using a co-located broadcast scan delegator and broadcast sink
and the receive state encrypt state is BT_BAP_BIG_ENC_STATE_BAD_CODE,
even after bt_bap_broacast_sink_sync is called again with a correct broadcast_code,
the encrypt state stays in BT_BAP_BIG_ENC_STATE_BAD_CODE,
causing the assistant to show a broadcast prompt to the user.

To Reproduce

  1. Add source and set bis sync request bits
  2. when receive state encrypt state goes to BT_BAP_BIG_ENC_STATE_BCODE_REQ, set a wrong broadcast_code
  3. call bt_bap_broacast_sink_sync with wrong code
  4. when receive state encrypt state goes to BT_BAP_BIG_ENC_STATE_BAD_CODE, set the correct broadcast_code
  5. call bt_bap_broacast_sink_sync with correct code

Expected behavior
encrypt state goes to BT_BAP_BIG_ENC_STATE_DEC;

Impact
Bad user experience as for example a phone with auracast will keep showing me a broadcast code prompt after I use a wrong code once

Logs and console output

Environment (please complete the following information):

  • Can be reproduced in BabbleSim simulation

Additional context
Can be fixed with this change:

--- a/subsys/bluetooth/audio/bap_broadcast_sink.c
+++ b/subsys/bluetooth/audio/bap_broadcast_sink.c
@@ -122,7 +122,8 @@ static void update_recv_state_big_synced(const struct bt_bap_broadcast_sink *sin
                subgroup_param->bis_sync = sink_subgroup->bis_indexes & sink->indexes_bitfield;
        }
 
-       if (recv_state->encrypt_state == BT_BAP_BIG_ENC_STATE_BCODE_REQ) {
+       if (recv_state->encrypt_state == BT_BAP_BIG_ENC_STATE_BCODE_REQ ||
+        recv_state->encrypt_state == BT_BAP_BIG_ENC_STATE_BAD_CODE) {
                mod_src_param.encrypt_state = BT_BAP_BIG_ENC_STATE_DEC;
        } else {
                mod_src_param.encrypt_state = recv_state->encrypt_state;
@mefromac mefromac added the bug The issue is a bug, or the PR is fixing a bug label Apr 10, 2025
Copy link

Hi @mefromac! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Audio area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants