Skip to content
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

LE Audio: CAP Initiator cannot handle any unexpected state changes #73083

Closed
Thalley opened this issue May 21, 2024 · 1 comment
Closed

LE Audio: CAP Initiator cannot handle any unexpected state changes #73083

Thalley opened this issue May 21, 2024 · 1 comment
Assignees
Labels
area: Bluetooth Audio area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@Thalley
Copy link
Collaborator

Thalley commented May 21, 2024

Describe the bug
The CAP initiator is very rigid in the way it works: It assumes that only the initiator is modifying the states, but if the unicast server e.g. modifies the metadata during the start procedure, i.e. it sends unexpected state changes (e.g. enabled -> enabled).

To Reproduce
Steps to reproduce the behavior:

  1. Modify tests/bsim/bluetooth/audio/src/cap_acceptor_test.c:unicast_stream_enabled_cb to do bt_bap_stream_metadata
  2. Build and run the CAP initiator unicast test
  3. See error

Expected behavior
Expect that the CAP initiator can at least handle trivial changes such as the metadata update. Other, actual, state changes are harder to handle.

Impact
Annoyance, as the procedure can likely be retried.

Logs and console output

d_00: @00:00:06.169867  Enabled stream 0x8245440
d_00: @00:00:06.170336  [00:00:06.170,318] <dbg> bt_bap_unicast_client: unicast_client_ep_notify: conn 0x8249ea0 ep 0x82501c0 len 9
d_00: @00:00:06.170336  [00:00:06.170,318] <dbg> bt_bap_unicast_client: unicast_client_ep_set_status: ep 0x82501c0 handle 0x0015 id 0x01 dir sink state enabling -> enabling
d_00: @00:00:06.170336  [00:00:06.170,318] <dbg> bt_bap_unicast_client: unicast_client_ep_enabling_state: dir sink cig 0x00 cis 0x00
d_00: @00:00:06.170336  [00:00:06.170,318] <dbg> bt_bap_unicast_client: unicast_client_ep_set_metadata: ep 0x82501c0 len 4 codec_cfg (nil)
d_00: @00:00:06.170336  Metadata updated stream 0x8245440
d_01: @00:00:06.199218  [00:00:06.199,188] <dbg> bt_ascs: ascs_cp_write: conn 0x8249ea0 attr 0x821fea8 buf 0x8268ea4 len 8 op Enable (0x03)
d_01: @00:00:06.199218  [00:00:06.199,188] <dbg> bt_ascs: ascs_enable: num_ases 1
d_01: @00:00:06.199218  [00:00:06.199,188] <dbg> bt_ascs: ase_enable: ase 0x824f968 meta->len 4
d_01: @00:00:06.199218  [00:00:06.199,188] <dbg> bt_ascs: ascs_parse_metadata: type 0x02 len 2
d_01: @00:00:06.199218  Enable: stream 0x8243b6c meta_len 4
d_01: @00:00:06.199218  [00:00:06.199,188] <dbg> bt_ascs: ascs_cp_rsp_add: id 0x03 code Success (0x00) reason None (0x00)
d_01: @00:00:06.199218  [00:00:06.199,188] <dbg> bt_ascs: ascs_ep_get_status: ep 0x824f96c id 0x03 state enabling
d_01: @00:00:06.199218  [00:00:06.199,188] <dbg> bt_ascs: ascs_ep_get_status_enable: dir source cig 0x00 cis 0x00
d_01: @00:00:06.199218  [00:00:06.199,188] <dbg> bt_ascs: state_transition_work_handler: ase 0x824f968 ep 0x824f96c id 0x03 qos-configured -> enabling
d_01: @00:00:06.199218  Enabled: stream 0x8243b6c (auto_start_sink_streams 1)
d_01: @00:00:06.199218  [00:00:06.199,188] <dbg> bt_bap_stream: bt_bap_stream_metadata: stream 0x8243b6c meta_len 142
d_01: @00:00:06.199218  Metadata: stream 0x8243b6c meta_len 142
d_01: @00:00:06.199218  [00:00:06.199,188] <dbg> bt_ascs: ascs_ep_get_status: ep 0x824f96c id 0x03 state enabling
d_01: @00:00:06.199218  [00:00:06.199,188] <dbg> bt_ascs: ascs_ep_get_status_enable: dir source cig 0x00 cis 0x00
d_01: @00:00:06.199218  [00:00:06.199,188] <dbg> bt_ascs: state_transition_work_handler: ase 0x824f968 ep 0x824f96c id 0x03 enabling -> enabling
d_00: @00:00:06.229400  [00:00:06.229,370] <dbg> bt_bap_unicast_client: unicast_client_cp_notify: conn 0x8249ea0 len 5
d_00: @00:00:06.229400  [00:00:06.229,370] <dbg> bt_bap_unicast_client: unicast_client_cp_notify: op Enable (0x03) id 0x03 code Success (0x00) reason None (0x00)
d_00: @00:00:06.229868  [00:00:06.229,858] <dbg> bt_bap_unicast_client: unicast_client_ep_notify: conn 0x8249ea0 ep 0x8250570 len 9
d_00: @00:00:06.229868  [00:00:06.229,858] <dbg> bt_bap_unicast_client: unicast_client_ep_set_status: ep 0x8250570 handle 0x001b id 0x03 dir source state qos-configured -> enabling
d_00: @00:00:06.229868  [00:00:06.229,858] <dbg> bt_bap_unicast_client: unicast_client_ep_enabling_state: dir source cig 0x00 cis 0x00
d_00: @00:00:06.229868  [00:00:06.229,858] <dbg> bt_bap_unicast_client: unicast_client_ep_set_metadata: ep 0x8250570 len 4 codec_cfg (nil)
d_00: @00:00:06.229868  [00:00:06.229,858] <dbg> bt_cap_initiator: bt_cap_initiator_enabled: Stream 0x82454a0 enabled (2/2 streams done)
d_00: @00:00:06.229868  The TESTCASE FAILED (test return code 2)
d_00: @00:00:06.229868 ERROR: (WEST_TOPDIR/zephyr/tests/bsim/bluetooth/audio/src/cap_initiator_unicast_test.c:217): Failed to start (failing conn 0x8249ea0): -74

Environment (please complete the following information):

  • Commit SHA or Version used: ec0e2d6

Additional context
N/A

@Thalley Thalley added bug The issue is a bug, or the PR is fixing a bug area: Bluetooth area: Bluetooth Audio labels May 21, 2024
@nashif nashif added the priority: medium Medium impact/importance bug label May 21, 2024
@Thalley
Copy link
Collaborator Author

Thalley commented May 24, 2024

Will be closed together with #72138

@Thalley Thalley closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Audio area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
Status: Done
Development

No branches or pull requests

2 participants