Skip to content

Conversation

@cvinayak
Copy link
Contributor

@cvinayak cvinayak commented Sep 27, 2024

Separate Tx/Rx frame spacing.

Blocked by defines in #79584

@cvinayak
Copy link
Contributor Author

@Thalley any idea what happened in the bsim nrf5340 testing of unicast client in this PR?

@Thalley
Copy link
Contributor

Thalley commented Sep 27, 2024

@Thalley any idea what happened in the bsim nrf5340 testing of unicast client in this PR?

Looks like one device gets a segmentation fault which triggers a CIS disconnect. The client, attempting to send, does not get the callback that the stream is stopped until after a few TX attempts it seems

@cvinayak
Copy link
Contributor Author

@Thalley any idea what happened in the bsim nrf5340 testing of unicast client in this PR?

Looks like one device gets a segmentation fault which triggers a CIS disconnect. The client, attempting to send, does not get the callback that the stream is stopped until after a few TX attempts it seems

ok... it does not say which, app core or net core crashes... will try running at desk to determine the cause.

@cvinayak
Copy link
Contributor Author

@Thalley any idea what happened in the bsim nrf5340 testing of unicast client in this PR?

Looks like one device gets a segmentation fault which triggers a CIS disconnect. The client, attempting to send, does not get the callback that the stream is stopped until after a few TX attempts it seems

ok... it does not say which, app core or net core crashes... will try running at desk to determine the cause.

The segmentation fault is due to having net_buf_alloc() call (which is no more has the blocking behavior) in the audio_timer_timeout() system work queue work in the samples/bluetooth/bap_unicast_server/src/main.c .

@Thalley The audio samples will need to be ported to gracefully handle net_buf_alloc() returning NULL if being called inside system work queue...

@Thalley
Copy link
Contributor

Thalley commented Sep 30, 2024

@Thalley any idea what happened in the bsim nrf5340 testing of unicast client in this PR?

Looks like one device gets a segmentation fault which triggers a CIS disconnect. The client, attempting to send, does not get the callback that the stream is stopped until after a few TX attempts it seems

ok... it does not say which, app core or net core crashes... will try running at desk to determine the cause.

The segmentation fault is due to having net_buf_alloc() call (which is no more has the blocking behavior) in the audio_timer_timeout() system work queue work in the samples/bluetooth/bap_unicast_server/src/main.c .

@Thalley The audio samples will need to be ported to gracefully handle net_buf_alloc() returning NULL if being called inside system work queue...

Huh, weird, thought I had fixed all the K_FOREVER in the samples's workqueue callbacks. Will fix today

@Thalley
Copy link
Contributor

Thalley commented Sep 30, 2024

@cvinayak #79187 should fix the remaining samples.

@cvinayak cvinayak force-pushed the github_frame_spacing branch 3 times, most recently from d19fabd to f49c8c9 Compare October 9, 2024 03:46
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 0 right here? Shouldn't it be 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 is valid value and here it represents a 500 us unit. A minimum meaningful 1 byte data PDU (120us), hence 394 (120 + 120 + 154 tIFS) could in theory be a connection interval, hence not ruling out 500 us unit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, 0 means 500us sounds weird to me :D If ms isn't possible to use, then perhaps these macros should be in us instead? It sounds weird that an interval of 0 is not in fact 0.

Comment on lines +212 to +217
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this looks kind of odd. I guess it makes sense to send a notification every 1ms when testing with 1ms conn interval, but why are we sending every 1 second if not? What if the interval is 10ms, shouldn't we send every 10ms then? What if the connection interval is 4 seconds?

Shouldn't we just ignore the Kconfig values and just always sleep for the current connection interval?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original (probably the very first) bsim test simulated a peripheral HR service where the notification were 1 second apart. Do not want to change the existing test behavior in this PR.

Only the verification that the number of notifications received in the 3 seconds of simulation has been updated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not want to change the existing test behavior in this PR.

We can create a PR modifying the behavior to use the connection interval first, and then you wouldn't need this change at all ;)

@cvinayak cvinayak force-pushed the github_frame_spacing branch 2 times, most recently from b594237 to 8c6b473 Compare October 11, 2024 08:06
@cvinayak cvinayak force-pushed the github_frame_spacing branch 2 times, most recently from 6dad110 to e7aebe2 Compare October 18, 2024 12:18
Minor updates and correction to code comments.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Add defines for radio timer capture and compare indices used
in the nRF Radio HAL implementation.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Add radio timer ISR usage support.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Introduce deferred ACL Tx packet transmission setup by radio,
so that an enqueued ACL Data packet can be transmitted with
the shortest latency.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Added test to verify deferred ACL Tx transmission setup,
such that GATT discovery completes with least latency and
GATT notifications can be received earliest after connection
establishment.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Separate Tx/Rx frame spacing.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 ms connection interval support.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Test 1ms connection interval support.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
@cvinayak cvinayak force-pushed the github_frame_spacing branch from e7aebe2 to a279993 Compare October 18, 2024 14:31
Copy link
Contributor

@Thalley Thalley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As usual, my reviews for the controller does not verify the correctness of the implementation as I don't know all the details, but CI is passing and the changes look OK to me

Comment on lines 186 to 191
/* Event interframe timings */
#define EVENT_IFS_US 150
/* Event interframe timings, default */
#define EVENT_IFS_DEFAULT_US EVENT_IFS_US
/* Standard allows 2 us timing uncertainty inside the event */
#define EVENT_IFS_MAX_US (EVENT_IFS_US + EVENT_CLOCK_JITTER_US)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of the duplicated #define?

If we intend to keep it, should that be used for EVENT_IFS_MAX_US since that refers to a "standard"?

Will these 2 ever be different?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there is inconsistent use of EVENT_IFS_US, EVENT_IFS_MAX_US, + 4, - 4andEVENT_CLOCK_JITTER_US` .... this needs clean, but out side the scope of this PR.

@cvinayak cvinayak added this to the v4.0.0 milestone Oct 24, 2024
@fabiobaltieri fabiobaltieri merged commit af0aeb3 into zephyrproject-rtos:main Oct 24, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants