-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Issue Fixes for Bap Broadcast Samples and Enable LC3 Codec For iMXRT1062 MCU #93091
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
base: main
Are you sure you want to change the base?
Issue Fixes for Bap Broadcast Samples and Enable LC3 Codec For iMXRT1062 MCU #93091
Conversation
@nirav-agrawal I think I need some more information here :) You are talking about synchronous evens and TX. I assume that the problem you are referring to here is that we are sending data in the callback that is triggered by the num_complete_packets event (the It also seems to be an issue specific for the controller you are using, as it works fine on a handful of other controllers, so there's some generic issue here that is being overlooked I think. Can you elaborate on how you found this issue, and why you'd need additional synchronous events? |
Hi @Thalley, thank you for your comment. The current issue I observed is with bap broadcast tests with multiple streams. In current Zephyr implementation, the synchronous buffer count is one, means there is no room for any synchronous events received back-to-back, from controller would drop the event due to processing current event. I am not sure if this issue would hit in other ACL connections or CIS connections. In particular bap broadcast use case, there is no ACK from remote and local controller has to raise NOCP event at either end of BIS events or BIG events.
Spec does not mandate about sending nocp for bap broadcast use case (no real ack from receiver but solely dependent on its irc/pto/vendor-specific-synchronisation etc and other parameters where controller has to keep the PDU buffered). I feel that the host stack should not have any such limitation to receive synchronous events where it has sent multiple SDUs (for bap broadcast) together but only keeping single instance to process such synchronous events. I am not sure if similar issue could be present in any other transmission apart from broadcast use cases. Regards, |
- adding kconfig for HCI synchronous cmds, or events responsble to manage host-controller credits to avoid discard complete event due to unavailability of synchronous buffer. - Issue was present while working with usecases like Broadcast-BAP where more than 1 stream (SDU per BIS) sent to controller over HCI and controller sends NOCP events for both streams at the end of BIG sync anchor. The gap between two consecutive events in same BIG is within few usec range causes HCI driver to drop successive event while processing current and if not freed. Signed-off-by: Nirav Agrawal <nirav.agrawal@nxp.com>
- Added i.MXRT1062 MCU to enable LC3 Codec as it supports FPU and used to evaluate BLE Audio applications using LC3 based payload. Signed-off-by: Nirav Agrawal <nirav.agrawal@nxp.com>
415b9a9
to
7913763
Compare
|
Thanks for the explanation @nirav-agrawal I'm still not 100% sure I understand the issue fully, but it seems like the controller is sending multiple NOCP events when a BIG terminates (e.g. if there 4 SDUs sent to the controller, the host would get 4 NOCP events back "at the same time"), and that's seemingly causing issues for your controller? I assume you are using a different controller than the Zephyr controller, as we don't see this issue with the Zephyr controller (or at least not that I am aware of). The reason why I mention ACL/CIS is that at least CIS can also send multiple SDUs, and thus would also get multiple NOCP events at the time of a disconnect. I'm not fully sure why the number of streams matter, as it should be the same amount of events whether you have 1 outstanding TX for 4 BIS, or 4 outstanding TX for a single BIS. Will also just cc @cvinayak and @alwa-nordic here |
Hi @Thalley, The issue happens during iso-streaming (not BIT terminate). if there are multiple BIS streams in single subgroup sending SDUs, and controller sends NOCP for each BIS in the same subgroup at the end of subgroup event, it causes an issue as Zephyr host only able to process one buffer and would drop others if current buffer process is not complete yet. This is not a controller issue, NOCP for broadcast SDUs can be sent within ISO interval after BIS subevent or at BIG event. There are some controllers which sent NOCP for broadcast SDU after BIS sub-event, but not all controllers may follow same rule. In CIS case, remote sends ACK (as per central peripheral), and based on ACK or flush-timeout, local controller updates host for NOCP. So, for MultiStream in CIS case, it would have separate CIS events where remote will ack (or FT) so controller will send NOCP to host for each stream with some time gaps (based on CIS event). Regards, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please send separate PRs for the sample and optimizations to Host subsystem.
NET_BUF_POOL_FIXED_DEFINE(sync_evt_pool, CONFIG_BT_BUF_EVT_SYNCHRONOUS_COUNT, SYNC_EVT_SIZE, 0, | ||
NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* Pool for RX HCI buffers that are always freed by `bt_recv`
* before it returns.
*
* A singleton buffer shall be sufficient for correct operation.
* The buffer count may be increased as an optimization to allow
* the HCI transport to fill buffers in parallel with `bt_recv`
* consuming them.
*/
Based on the comment in the implementation, and the fact that bt_recv
control flow has implicit event flow control; I do not agree that this PR fixes any bug. Increasing the buffer count is an optimization at the cost of increased RAM usage, as each buffer can be over "quarter of a kilobyte" in size!
HCI Number of Completed Packets event "can" accumulate the counts for multiple handles and be generated at a frequency at the implementations discretion.
bluetooth: host: add kconfig for synchronous buffer count
samples: bluetooth: bap_broadcast: enable LIBLC3 for NXP iMXRT Family