-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Bluetooth: Controller: Fix missing ISO Receiver address capture #95348
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: Controller: Fix missing ISO Receiver address capture #95348
Conversation
27eaa22
to
7d36bdb
Compare
7d36bdb
to
e314b28
Compare
Fix the jitter considered in the PDU reception in the subevents of ISO Sync Receiver to not exceed such that the reception is scheduled late (causing assertion). Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix missing ISO Receiver access address capture that caused ISO PDU reception error. Missing access address capture for subsequent subevent when prior subevent did not have an anchor point sync prevent proper drift compensation hence causing ISO PDU reception error for the entire BIG event. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
e314b28
to
ff7e93a
Compare
|
|
||
LL_ASSERT(hcto > jitter_us); | ||
|
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.
Funny; was about to suggest this in my last review, but noticed that it wasn't there before either, so I didn't :) Glad to see it added
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.
Well, I noticed that a newly added assert was caught in CI for high number of subevents which I had to convert to if-then-else; hence, decided to add a assert here as well.
Do not hesitate to leave a comment, your reviews help think differently, and hence better solutions.
That said, I do not like the calculations here for the jitter, it is always calculating for nse
i.e. from the first subevent; ideally, current jitter should be from the last sync-ed subevent.
The problem to solve, active clock is permitted a +/-2 us jitter which means over the duration of the subevents, a subevent can jitter by +/- 2 us multiplied by current subevent count nse
when none of the previous subevent where received (anchor point sync).
I will comeback and solve it some other day, for now, bsim is happy; my other changes does expose too little jitter or drift causing assertion... fix for that another day.
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.
Consider creating a GH issue for the above so you don't forget it ;)
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.
Not going to forget it, listed (updated with the above problem statement now) in #82399
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.
Pull Request Overview
This PR fixes ISO Receiver functionality by ensuring proper access address capture and correcting jitter calculations in Bluetooth Low Energy controller code. The fix addresses ISO PDU reception errors that occurred when previous subevents lacked anchor point synchronization.
Key changes:
- Add access address capture for subsequent subevents when no prior anchor point sync exists
- Refactor jitter calculation logic to prevent reception scheduling delays and assertions
- Remove RANGE_DELAY_US from jitter calculations to improve timing accuracy
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
jitter_max_us = (EVENT_IFS_US - overhead_us) >> 1; | ||
jitter_max_us -= RANGE_DELAY_US + HAL_RADIO_TMR_START_DELAY_US; | ||
jitter_max_us = (jitter_max_us * nse) / (lll->num_bis * lll->nse); |
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.
The expression can be simplified to jitter_max_us = jitter_max_us / lll->num_bis
since nse
appears in both numerator and denominator and cancels out.
jitter_max_us = (jitter_max_us * nse) / (lll->num_bis * lll->nse); | |
jitter_max_us = jitter_max_us / lll->num_bis; |
Copilot uses AI. Check for mistakes.
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.
No, nse and lll->nse are different values.
overhead_us = radio_rx_chain_delay_get(lll->phy, PHY_FLAGS_S8); | ||
overhead_us += addr_us_get(lll->phy); | ||
overhead_us += radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8); | ||
overhead_us += (EVENT_CLOCK_JITTER_US << 1); | ||
|
||
LL_ASSERT(EVENT_IFS_US > overhead_us); |
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.
[nitpick] Consider adding descriptive error messages to these assertions to help with debugging when they fail. For example: LL_ASSERT_MSG(EVENT_IFS_US > overhead_us, \"IFS time insufficient for overhead\");
LL_ASSERT(EVENT_IFS_US > overhead_us); | |
LL_ASSERT_MSG(EVENT_IFS_US > overhead_us, "IFS time insufficient for overhead"); |
Copilot uses AI. Check for mistakes.
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.
Do not want a message.
Fix missing ISO Receiver access address capture that caused ISO PDU reception error. Missing access address capture for subsequent subevent when prior subevent did not have an anchor point sync prevent proper drift compensation hence causing ISO PDU reception error for the entire BIG event.
Fix the jitter considered in the PDU reception in the subevents of ISO Sync Receiver to not exceed such that the reception is scheduled late (causing assertion).
Fixes #90097.
Overnight testing between
bap_broadcast_source
on nrf52833dk andbap_broadcast_sink
on nrf54l15dk: