nrf5340 audio:LE audio Stream stopped.INSUFFICIENT_RESOURCES

We have an nrf5340 audio application, and there were no problems with the previous development.
But when I want to extend the CIS function, especially when enabling bidirectional transmission, an error occurs, but I cannot determine the reason.
00> HL [00:11:23.514,648] <inf> cis_gateway: Stream 0x20003744 stopped. Reason 13
00> HL [00:11:23.514,648] <wrn> cis_gateway: Unknown stream
00> HL [00:11:23.514,678] <inf> cis_gateway: Stream 0x20003524 stopped. Reason 13
00> HL [00:11:23.515,625] <wrn> cis_gateway: Unknown stream

Reason 13 is BT_HCI_ERR_INSUFFICIENT_RESOURCES.
What causes this error? If bidirectional transmission is not started, it works normally.
What I want to know most is what causes this error.

Thanks,

Reskyllr

  • Hi,

    Support for bidirectional streams to or from 2 headsets was added in NCS v2.3.0. Have you selected CONFIG_STREAM_BIDIRECTIONAL=y in your project configuration?

    Could you please provide information on what you try to achieve?

    Best regards,
    Dejan

  • Hi dejans,

    Yes, I added CONFIG_STREAM_BIDIRECTIONAL=y, I want to use CIS intercom functionality, but that's not my main goal.
    I want to know what causes BT_HCI_ERR_INSUFFICIENT_RESOURCES.
    Because there is another situation where the same error occurs:
    I expanded the SDU size to 240 (used to transmit stereo sound) in BIS mode, and everything worked fine.
    When I want to do the same work in CIS mode, Stream stop: Reason 13(BT_HCI_ERR_INSUFFICIENT_RESOURCES) appears.
    If you restore the SDU size to 120 (mono transmission), it works normally.
    But when adding CONFIG_STREAM_BIDIRECTIONAL=y, the same error (BT_HCI_ERR_INSUFFICIENT_RESOURCES) occurred again.

    You don't need to understand it, I just want to know the cause of this error and how to fix it.
    Thanks,
    Reskyllr

  • Hi Reskyllr,

    I have spoken to our developers. They have tested CONFIG_STREAM_BIDIRECTIONAL=y in prj.conf in the main branch and it seemed to be working without issues. Regarding SDU, it is not possible to put SDU to the value of 240 for bidirectional communication due to scheduling issues in a current version of the controller. The maximum size of SDU in each direction that is tested and expected to be working is 80.

    Best regards,
    Dejan

  • Hi,dejans

    I understand your statement.
    In addition to SDU, it seems to be related to CONFIG_BT_AUDIO_RETRANSMITS.
    When CIS SDU = 120, CONFIG_BT_AUDIO_RETRANSMITS=2, it works normally. CONFIG_BT_AUDIO_RETRANSMITS=4, BT_HCI_ERR_INSUFFICIENT_RESOURCES appears.
    What is the conversion relationship between them? Do you mean that the two-way SDU needs to be limited to less than 80? Does it mean that the total SDU cannot exceed 160?

  • When I tried to change the bitrate from 96000 -> 48000 (SDU 120 -> 60), there was a problem of direct disconnection after connection. The log is as follows. I just changed the 4 parameters (CONFIG_LC3_BITRATE, CONFIG_BT_AUDIO_BITRATE_UNICAST_SINK, CONFIG_BT_AUDIO_BITRATE_UNICAST_SRC, CONFIG_BT_AUDIO_BITRATE_ BROADCAST_SRC) from 96000 is modified to 48000
    The log is as follows:

    00> HL [00:00:02.862,548] <dbg> cis_gateway: le_audio_play_pause_cb: Play/pause cb, state: 1
    00> HL [00:00:02.862,548] <dbg> cis_gateway: ep_state_check: Endpoint is NULL
    00> HL [00:00:02.862,548] <dbg> cis_gateway: ep_state_check: Endpoint is NULL
    00> HL [00:03:10.986,694] <inf> cis_gateway: [BLE] start_scan
    00> HL [00:03:10.986,694] <inf> cis_gateway: Scanning successfully started
    00> HL [00:03:11.055,389] <inf> cis_gateway: Device found FSC-BT631D-LE-76DC
    00> HL [00:03:11.086,242] <inf> cis_gateway: Connected: 5F:55:C7:4F:47:64 (random)
    00> HL [00:03:11.086,669] <dbg> cis_gateway: connected_cb: TX power set to 0 dBm for connection 0x20004990
    00> HL [00:03:11.696,350] <dbg> cis_gateway: security_changed_cb: Security changed: level 2
    00> HL [00:03:12.334,136] <inf> cis_gateway: [BLE] start_scan
    00> HL [00:03:12.334,838] <inf> cis_gateway: Scanning successfully started
    00> HL [00:03:12.774,322] <dbg> cis_gateway: available_contexts_cb: conn: 5F:55:C7:4F:47:64 (random), snk ctx 5 src ctx 0
    00> 
    00> HL [00:03:13.414,184] <dbg> cis_gateway: discover_sink_cb: Sink discover complete: err 0
    00> HL [00:03:13.414,215] <dbg> bt_bap_stream: bt_bap_stream_config: conn 0x20004990 stream 0x20002edc, ep 0x20030814 codec 0x200007a8 codec id 0x06 codec cid 0x0000 codec vid 0x0000
    00> HL [00:03:13.414,245] <dbg> bt_bap_stream: bt_bap_stream_attach: conn 0x20004990 stream 0x20002edc ep 0x20030814 codec 0x200007a8
    00> HL [00:03:13.495,605] <inf> cis_gateway: LEFT sink stream configured
    00> HL [00:03:13.495,605] <dbg> cis_gateway: stream_configured_cb: Set LEFT headset, connection 0x2000331c, stream 0x20002edc
    00> HL [00:03:13.495,635] <dbg> bt_bap_stream: bt_bap_stream_qos: conn 0x20004990 group 0x20030b94
    00> HL [00:03:13.495,635] <dbg> bt_bap_stream: bt_bap_stream_verify_qos: Latency 20 higher than preferred max 10
    00> HL [00:03:13.574,310] <inf> cis_gateway: Set LEFT to PD: 10000
    00> HL [00:03:13.574,310] <dbg> bt_bap_stream: bt_bap_stream_enable: stream 0x20002edc
    00> HL [00:03:13.574,371] <inf> cis_gateway: Enable stream 0x20002edc
    00> HL [00:03:13.614,593] <dbg> cis_gateway: stream_enabled_cb: Stream enabled: 0x20002edc
    00> HL [00:03:13.614,624] <dbg> cis_gateway: stream_enabled_cb: k_msg_put: ch: 0, dir: 1, retries 0
    00> HL [00:03:13.614,898] <dbg> cis_gateway: work_stream_start: k_msg_get: ch: 0, dir: 1, retries 0
    00> HL [00:03:13.614,898] <dbg> bt_bap_stream: bt_bap_stream_start: stream 0x20002edc ep 0x20030814
    00> HL [00:03:13.899,902] <inf> bt_iso: hci_le_cis_established
    00> HL [00:03:13.899,932] <dbg> bt_iso: hci_le_cis_established: status 0 handle 2
    00> HL [00:03:13.899,932] <dbg> bt_iso: hci_le_cis_established: iso_chan 0x2003040c tx 0x2003047c rx 0x20030444
    00> HL [00:03:13.899,963] <dbg> bt_iso: bt_iso_connected: 0x20004f00
    00> HL [00:03:14.890,075] <dbg> bt_iso: bt_iso_disconnected: 0x20004f00
    00> HL [00:03:14.890,075] <dbg> bt_iso: bt_iso_chan_disconnected: 0x2003040c, reason 0x13
    00> HL [00:03:14.890,075] <dbg> bt_iso: bt_iso_cleanup_acl: 0x20004f00
    00> HL [00:03:14.890,136] <dbg> bt_iso: bt_iso_remove_data_path: 0x20004f00
    00> HL [00:03:14.890,441] <wrn> bt_hci_core: opcode 0x206f status 0x0c
    00> HL [00:03:14.890,930] <wrn> bt_hci_core: opcode 0x206f status 0x12
    00> HL [00:03:14.890,930] <inf> cis_gateway: Stream 0x20002edc stopped. Reason 19
    00> HL [00:03:14.890,960] <dbg> cis_gateway: ep_state_check: Endpoint is NULL
    00> HL [00:03:14.891,235] <inf> streamctrl: LE audio evt not_streaming
    00> HL [00:03:14.893,127] <dbg> bt_bap_stream: bt_bap_stream_reset: stream 0x20002edc
    00> HL [00:03:14.893,127] <dbg> bt_bap_stream: bt_bap_stream_detach: stream 0x20002edc
    00> HL [00:03:14.893,157] <dbg> bt_bap_stream: bt_bap_stream_disconnect: stream 0x20002edc iso (nil)
    00> HL [00:03:14.893,157] <dbg> cis_gateway: stream_released_cb: Audio Stream 0x20002edc released
    00> HL [00:03:14.893,157] <dbg> cis_gateway: ep_state_check: Endpoint is NULL
    00> HL [00:03:14.893,371] <inf> cis_gateway: Disconnected: 5F:55:C7:4F:47:64 (random) (reason 0x08)
    00> HL [00:03:14.893,432] <inf> cis_gateway: [BLE] start_scan
    00> HL [00:03:14.893,463] <inf> cis_gateway: Scanning successfully started
    00> HL [00:03:14.893,951] <inf> streamctrl: LE audio evt not_streaming
    00> HL [00:03:14.907,257] <inf> cis_gateway: Device found FSC-BT631D-LE-76DC

    Any advice to offer?

    Thanks,

    Reskyllr

Related