-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Bluetooth: Audio: race hazard bt_audio_discover() callback vs unicast_client_ase_cp_discover() #54139
Comments
Adding a |
@Chris-StJohn-Bose please follow the bug reporting template when reporting bugs :) In any case, this is actually a known issue (but haven't really been an issue reported before), and is actually fixed by my commit a5f435f in #53484. Perhaps I should pull that commit out and see if I can get it through separately. |
Moved the commit to a separate PR to get it in ASAP: #54283 |
Note sure about the priority:low as this is currently preventing streaming to a 3rd party receiver that doesn't automatically notify on CCC write, but it's being dealt with so the priority is fairly irrelevant. |
It's something that has been in the code for more than 2 years and haven't seen any reports about it until now, so arguably it isn't that big of an issue. Aside from that, it would be quite trivial for an application to add a small waiting period between the discover callback and the next procedure. Finally, until #53484 is merged, none of the notifications does anything besides being logged |
bt_audio_discover()
has a callback when an ASE is discovered on a remote deviceunicast_client_ase_cp_discover()
asynchronously subscribes to notifications of ASE state changesThere's no way of the application knowing when
unicast_client_ase_cp_discover()
has completed so that it is safe to callbt_audio_stream_config()
This causes occasional race hazards when stream configuration occurs before state changes are notified.
I'm working on a PR to resolve this, probably calling the discovery callback after notifications have been enabled.
Relevant lines in mainline:
https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/audio/unicast_client.c#L1882
https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/audio/unicast_client.c#L1799
The text was updated successfully, but these errors were encountered: