Skip to content

Conversation

@Thalley
Copy link
Contributor

@Thalley Thalley commented Jul 5, 2024

Add callbacks that affect the entire broadcast groups

fixes #75252

@Thalley Thalley force-pushed the bap_broadcast_callbacks branch from bec6658 to 1f4d967 Compare July 5, 2024 13:10
@Thalley Thalley changed the title LE Audio: BAP broadcast callbacks LE Audio: broadcast callbacks Jul 5, 2024
@Thalley Thalley force-pushed the bap_broadcast_callbacks branch 3 times, most recently from af68d36 to a8a8b47 Compare July 5, 2024 18:44
@Thalley Thalley marked this pull request as ready for review July 5, 2024 20:20
@Thalley Thalley added this to the v4.0.0 milestone Jul 5, 2024
@Thalley
Copy link
Contributor Author

Thalley commented Jul 7, 2024

There is dependencies in the commits, but this PR can split into multiple smaller ones if requested by reviewers

kruithofa
kruithofa previously approved these changes Jul 9, 2024
@Thalley
Copy link
Contributor Author

Thalley commented Sep 18, 2024

Converted to draft until CI issue is fixed

@Thalley Thalley force-pushed the bap_broadcast_callbacks branch 6 times, most recently from 21db00c to 171c4a8 Compare September 19, 2024 10:56
@Thalley
Copy link
Contributor Author

Thalley commented Sep 19, 2024

Confirmed to be a controller issue:

This is the valgrind report on the segfault:

d_00: @00:00:26.415894  Stopping broadcast sink 0x853f9e0
d_00: @00:00:26.415894  [00:00:26.415,893] <err> bt_bap_broadcast_sink: bt_bap_broadcast_sink_stop: sink->big 0x853f9e0 0x850a420
==148372== Thread 8:
==148372== Jump to the invalid address stated on the next line
==148372==    at 0x0: ???
==148372==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==148372== 
==148372== 
==148372== Process terminating with default action of signal 11 (SIGSEGV)
==148372==  Bad permissions for mapped region at address 0x0
==148372==    at 0x0: ???
==148372==

The callstack is:

0x0	
isoal_rx_append_to_sdu() at subsys/bluetooth/controller/ll_sw/isoal.c:696 0x8354543	
isoal_rx_unframed_consume() at subsys/bluetooth/controller/ll_sw/isoal.c:954 0x8355530	
isoal_rx_pdu_recombine() at subsys/bluetooth/controller/ll_sw/isoal.c:1,422 0x8356b37	
encode_node() at subsys/bluetooth/controller/hci/hci_driver.c:511 0x83014fa	
process_node() at subsys/bluetooth/controller/hci/hci_driver.c:575 0x830163a	
recv_thread() at subsys/bluetooth/controller/hci/hci_driver.c:721 0x830193a	

@Thalley Thalley force-pushed the bap_broadcast_callbacks branch 2 times, most recently from 381721f to b14a38a Compare September 24, 2024 16:15
@Thalley Thalley force-pushed the bap_broadcast_callbacks branch from b14a38a to f6922a8 Compare October 4, 2024 16:31
@Thalley Thalley force-pushed the bap_broadcast_callbacks branch from f6922a8 to 6e5787d Compare October 18, 2024 07:46
@Thalley Thalley removed this from the v4.0.0 milestone Oct 24, 2024
@Thalley Thalley force-pushed the bap_broadcast_callbacks branch from 6e5787d to c482fae Compare November 5, 2024 20:15
@Thalley
Copy link
Contributor Author

Thalley commented Nov 6, 2024

Confirmed to be a controller issue:

This is the valgrind report on the segfault:

d_00: @00:00:26.415894  Stopping broadcast sink 0x853f9e0
d_00: @00:00:26.415894  [00:00:26.415,893] <err> bt_bap_broadcast_sink: bt_bap_broadcast_sink_stop: sink->big 0x853f9e0 0x850a420
==148372== Thread 8:
==148372== Jump to the invalid address stated on the next line
==148372==    at 0x0: ???
==148372==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==148372== 
==148372== 
==148372== Process terminating with default action of signal 11 (SIGSEGV)
==148372==  Bad permissions for mapped region at address 0x0
==148372==    at 0x0: ???
==148372==

The callstack is:

0x0	
isoal_rx_append_to_sdu() at subsys/bluetooth/controller/ll_sw/isoal.c:696 0x8354543	
isoal_rx_unframed_consume() at subsys/bluetooth/controller/ll_sw/isoal.c:954 0x8355530	
isoal_rx_pdu_recombine() at subsys/bluetooth/controller/ll_sw/isoal.c:1,422 0x8356b37	
encode_node() at subsys/bluetooth/controller/hci/hci_driver.c:511 0x83014fa	
process_node() at subsys/bluetooth/controller/hci/hci_driver.c:575 0x830163a	
recv_thread() at subsys/bluetooth/controller/hci/hci_driver.c:721 0x830193a	

Just a reminder @cvinayak - Not sure if we ever created a GH issue for this

@Thalley Thalley force-pushed the bap_broadcast_callbacks branch 2 times, most recently from 3508472 to e01e545 Compare November 22, 2024 20:44
@Thalley Thalley marked this pull request as ready for review November 22, 2024 22:56
@Thalley Thalley force-pushed the bap_broadcast_callbacks branch from e01e545 to cd9b71f Compare November 28, 2024 10:29
Add callbacks that is called for the entire BIG.
The BIG state is from an HCI perspective a single state change
that we previously only propagated as a state change for each
channel.

However it may be simpler for applications and higher layers
to use BIG changes to trigger their behavior.

Signed-off-by: Emil Gydesen <[email protected]>
These callbacks are trigger for changes that affect the entire
broadcast source, such as the BIG started and terminated events.

Signed-off-by: Emil Gydesen <[email protected]>
These callbacks are trigger for changes that affect the entire
broadcast source, such as the BIG started and terminated events.

Signed-off-by: Emil Gydesen <[email protected]>
These callbacks are trigger for changes that affect the entire
broadcast sink, such as the BIG synced and terminated events.

Signed-off-by: Emil Gydesen <[email protected]>
Use the broadcast source callbacks to set the semaphores
rather than the stream callbacks, as the broadcast source callbacks
are better for that as they are called when all streams are ready.

Signed-off-by: Emil Gydesen <[email protected]>
Use the broadcast sink callbacks to set the semaphores
rather than the stream callbacks, as the broadcast sink callbacks
are better for that as they are called when all streams are ready.

Signed-off-by: Emil Gydesen <[email protected]>
@Thalley Thalley force-pushed the bap_broadcast_callbacks branch from cd9b71f to 1810815 Compare December 5, 2024 14:20
Copy link
Contributor

@pin-zephyr pin-zephyr left a comment

Choose a reason for hiding this comment

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

LGTM

@kartben kartben merged commit 13c42bd into zephyrproject-rtos:main Dec 6, 2024
26 checks passed
@Thalley Thalley deleted the bap_broadcast_callbacks branch December 6, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Bluetooth Audio area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth ISO Bluetooth LE Isochronous Channels area: Bluetooth area: Samples Samples

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Bluetooth: BAP: Add broadcast sink/source callback structs

5 participants