nRF5340 Audio: Unicast Client Discovery Fails with -12 When Connecting to Headset

Hi Nordic team,

I'm working with the nrf5340_audio source code from the nRF Connect SDK and have compiled the project as a gateway. When I try to connect to a headset, I'm seeing the following logs:

-- [00:01:11.738,037] <inf> main: Received Command: connect AC:BF:71:77:35:D2 
-- [00:01:11.738,067] <inf> main: MAC address AC:BF:71:77:35:D2 is valid.
-- [00:01:11.738,098] <inf> main: Attempting to connect to AC:BF:71:77:35:D2...
-- [00:01:11.738,098] <inf> bt_mgmt_scan: Scanning started...
-- [00:01:12.042,724] <inf> bt_mgmt_scan: Device found: AC:BF:71:77:35:D2 (public) (Type: Public, RSSI: -52 dBm)
-- [00:01:16.739,135] <inf> bt_mgmt_scan: Device is advertising with type: Public
-- [00:01:16.739,776] <inf> bt_mgmt: Connection initiated index : 0 
Sending UART Response: connect AC:BF:71:77:35:D2
-- [00:01:16.808,563] <inf> bt_mgmt: MTU exchanged: 23/23
-- [00:01:16.808,746] <inf> bt_mgmt: Connected: AC:BF:71:77:35:D2 (public) (index 0)
-- [00:01:16.808,776] <inf> main: Connection event. Num connections: 1
Sending UART Response: Success: Connected Successfully OKEY
-- [00:01:16.812,011] <inf> bt_mgmt: Security level: 1
-- [00:01:17.060,394] <inf> bt_mgmt: MTU exchanged: 247/65
-- [00:01:17.110,931] <inf> bt_mgmt: Pairing request from AC:BF:71:77:35:D2 (public)
-- [00:01:17.110,931] <inf> bt_mgmt: Initiator key distribution: 0x03
-- [00:01:17.110,931] <inf> bt_mgmt: Responder key distribution: 0x03
-- [00:01:17.920,410] <inf> bt_mgmt: Security changed: AC:BF:71:77:35:D2 (public) level 2
-- [00:01:17.920,440] <inf> main: Security changed
-- [00:01:17.972,747] <inf> bt_mgmt: Pairing complete with AC:BF:71:77:35:D2 (public) (Bonded: Yes)
Security level: 2
-- [00:01:17.980,590] <wrn> unicast_client: Got err: 0 from conn: 0x200047c8
-- [00:01:18.170,257] <inf> bt_vol_ctlr: VCS discover finished
-- [00:01:19.380,310] <wrn> unicast_client: More than one sink endpoint found, idx 0 is used by default
-- [00:01:19.580,261] <wrn> bt_bap_unicast_client: No space left to parse ASE
-- [00:01:19.580,261] <err> unicast_client: Discovery failed: -12

From what I understand, the -12 error is -ENOMEM (Not enough core ) , but I’m not sure why this is happening.

How can I resolve this issue?

Is it related to buffer size or too many ASEs from the headset?

Any suggestions would be appreciated.

Thanks!

 

Parents
  • Hi,

    Are you using an Audio DK for this? Is this the default nrf5340_audio application/sample? What NCS version are you using? 

    And is the headset another a DK, a custom board, or an actual headset supporting LE Audio?

    Regards,

    Elfving

  • Hi,
    Thanks for the response.

    Are you using an Audio DK for this? Is this the default nrf5340_audio application/sample? What NCS version are you using? 

    Yes, I am using the nRF5340 Audio DK and running the default nrf5340_audio sample application compiled in gateway mode. The NCS version I’m using is v2.9.0.

    And is the headset another a DK, a custom board, or an actual headset supporting LE Audio?

    As for the headset, I’m using an actual LE Audio headset (not a DK or custom board).as I need to test with different LE Audio headsets.


    Best regards,
    Yash

  • Are you sure you chose the audio sample from nordic, the one called nrf5340_audio? Not any of the ones from the zephyr folder?

    Regards,

    Elfving

  • Hi Elfving,

    Yes, I am absolutely sure that I’m using the nrf5340_audio sample from the Nordic SDK, not any of the samples from the Zephyr folder.

    Best regards
    Yash

  • Can you try adding these configurations and see if it helps? 

    CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT=20

    CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT=20

    And are you using an nrf5340 for this?

    Regards and have a good week-end,

    Elfving

  • Hi Elfving,

    Thanks for the suggestion!
    I tried adding the following configs as you suggested:

    CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT=20

    CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT=20

    However, after doing that, I now get the following error during runtime:

    -- [00:00:00.261,016] <inf> main: Starting BLE Client on nRF5340
    -- [00:00:00.272,033] <inf> board_version: Compatible board/HW version found: 1.1.0
    -- [00:00:00.496,948] <inf> bt_mgmt: Bluetooth initialized
    -- [00:00:00.499,145] <inf> bt_mgmt: Successfully registered all callbacks
    -- [00:00:00.500,152] <inf> bt_mgmt: Bluetooth started successfully.
    -- [00:00:00.502,349] <inf> bt_mgmt_adv: Advertising started
    -- [00:00:01.004,333] <inf> audio_usb: Ready for USB host to send/receive.
    -- [00:00:25.561,248] <inf> main: Received Command: connect AC:BF:21:51:25:40
    
    -- [00:00:25.561,309] <inf> main: MAC address AC:BF:21:51:25:40 is valid.
    
    -- [00:00:25.561,309] <inf> main: Attempting to connect to AC:BF:21:51:25:40
    
    -- [00:00:25.561,340] <inf> bt_mgmt_scan: Scanning started...
    -- [00:00:25.607,299] <inf> bt_mgmt_scan: Device found: AC:BF:21:51:25:40 (public) (Type: Public, RSSI: -61 dBm)
    
    -- [00:00:30.562,408] <inf> bt_mgmt_scan: Device is advertising with type: Public
    -- [00:00:30.563,049] <inf> bt_mgmt: Connection initiated index : 0 
                                                                         
    Sending UART Response: connect AC:BF:21:51:25:40
    UART TX Done
    -- [00:00:31.307,800] <inf> bt_mgmt: MTU exchanged: 23/23
    
    -- [00:00:31.308,013] <inf> bt_mgmt: Connected:  AC:BF:21:51:25:40 (public) (index 0)
    -- [00:00:31.308,044] <inf> main: Connection event. Num connections: 1
    -- [00:00:31.311,279] <inf> bt_mgmt: Security level: 1
    -- [00:00:31.710,021] <inf> bt_mgmt: MTU exchanged: 247/65
    -- [00:00:31.759,735] <inf> bt_mgmt: Pairing request from AC:BF:21:51:25:40 (public)
    -- [00:00:31.759,735] <inf> bt_mgmt: Initiator key distribution: 0x03
    -- [00:00:31.759,765] <inf> bt_mgmt: Responder key distribution: 0x03
    -- [00:00:32.599,578] <inf> bt_mgmt: Security changed: AC:BF:21:51:25:40 (public) level 2
    -- [00:00:32.599,609] <inf> main: Security changed
    -- [00:00:32.642,913] <inf> bt_mgmt: Pairing complete with AC:BF:21:51:25:40 (public) (Bonded: Yes)
    
    Security level: 2
    -- [00:00:32.651,123] <wrn> unicast_client: Got err: 0 from conn: 0x20004908
    -- [00:00:32.799,438] <inf> bt_vol_ctlr: VCS discover finished
    -- [00:00:33.649,291] <inf> unicast_client: location_cb : dir 1 loc 3
    
    -- [00:00:33.819,366] <inf> unicast_client: conn:AC:BF:21:51:25:40 (public), snk ctx 4039 src ctx 579
    -- [00:00:34.039,337] <inf> unicast_client: Sink #0: ep 0x20006114
    -- [00:00:34.139,343] <inf> unicast_client: Sink #1: ep 0x200061fc
    -- [00:00:34.229,339] <inf> unicast_client: Sink #2: ep 0x200062e4
    -- [00:00:34.329,345] <inf> unicast_client: Sink #3: ep 0x200063cc
    -- [00:00:34.659,271] <inf> unicast_client: Discovered 2 sink endpoint(s) for device 0
    
    -- [00:00:35.199,340] <inf> unicast_client: conn: AC:BF:21:51:25:40 (public), snk ctx 4039 src ctx 579
    -- [00:00:35.399,322] <inf> unicast_client: Source #0: ep 0x200064b4
    -- [00:00:35.519,348] <inf> unicast_client: Source #1: ep 0x2000659c
    -- [00:00:35.849,304] <inf> unicast_client: Discovered 2 source endpoint(s) for device 0
    -- [00:00:35.850,616] <wrn> bt_hci_core: opcode 0x2062 status 0x07 
    -- [00:00:35.850,616] <wrn> bt_iso: Unexpected response to hci_le_set_cig_params
    -- [00:00:35.850,646] <err> bt_bap_unicast_client: bt_iso_cig_create failed: -5
    -- [00:00:35.850,677] <err> unicast_client: Failed to create unicast group: -5
    -- [00:00:35.850,677] <err> unicast_client: Failed to start unicast sink audio: -22

    In my case, the headset exposes 4 sink endpoints and 2 source endpoints, which I assume might be contributing to this issue. It seems like the increased count is causing CIG creation to fail.

    Yes, I am using the nRF5340  for this setup.

    Let me know if there's a recommended way to handle multiple endpoints, or if I should try tuning the count values further.

    Appreciate your help !

    Best regards,
    Yash

Reply
  • Hi Elfving,

    Thanks for the suggestion!
    I tried adding the following configs as you suggested:

    CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT=20

    CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT=20

    However, after doing that, I now get the following error during runtime:

    -- [00:00:00.261,016] <inf> main: Starting BLE Client on nRF5340
    -- [00:00:00.272,033] <inf> board_version: Compatible board/HW version found: 1.1.0
    -- [00:00:00.496,948] <inf> bt_mgmt: Bluetooth initialized
    -- [00:00:00.499,145] <inf> bt_mgmt: Successfully registered all callbacks
    -- [00:00:00.500,152] <inf> bt_mgmt: Bluetooth started successfully.
    -- [00:00:00.502,349] <inf> bt_mgmt_adv: Advertising started
    -- [00:00:01.004,333] <inf> audio_usb: Ready for USB host to send/receive.
    -- [00:00:25.561,248] <inf> main: Received Command: connect AC:BF:21:51:25:40
    
    -- [00:00:25.561,309] <inf> main: MAC address AC:BF:21:51:25:40 is valid.
    
    -- [00:00:25.561,309] <inf> main: Attempting to connect to AC:BF:21:51:25:40
    
    -- [00:00:25.561,340] <inf> bt_mgmt_scan: Scanning started...
    -- [00:00:25.607,299] <inf> bt_mgmt_scan: Device found: AC:BF:21:51:25:40 (public) (Type: Public, RSSI: -61 dBm)
    
    -- [00:00:30.562,408] <inf> bt_mgmt_scan: Device is advertising with type: Public
    -- [00:00:30.563,049] <inf> bt_mgmt: Connection initiated index : 0 
                                                                         
    Sending UART Response: connect AC:BF:21:51:25:40
    UART TX Done
    -- [00:00:31.307,800] <inf> bt_mgmt: MTU exchanged: 23/23
    
    -- [00:00:31.308,013] <inf> bt_mgmt: Connected:  AC:BF:21:51:25:40 (public) (index 0)
    -- [00:00:31.308,044] <inf> main: Connection event. Num connections: 1
    -- [00:00:31.311,279] <inf> bt_mgmt: Security level: 1
    -- [00:00:31.710,021] <inf> bt_mgmt: MTU exchanged: 247/65
    -- [00:00:31.759,735] <inf> bt_mgmt: Pairing request from AC:BF:21:51:25:40 (public)
    -- [00:00:31.759,735] <inf> bt_mgmt: Initiator key distribution: 0x03
    -- [00:00:31.759,765] <inf> bt_mgmt: Responder key distribution: 0x03
    -- [00:00:32.599,578] <inf> bt_mgmt: Security changed: AC:BF:21:51:25:40 (public) level 2
    -- [00:00:32.599,609] <inf> main: Security changed
    -- [00:00:32.642,913] <inf> bt_mgmt: Pairing complete with AC:BF:21:51:25:40 (public) (Bonded: Yes)
    
    Security level: 2
    -- [00:00:32.651,123] <wrn> unicast_client: Got err: 0 from conn: 0x20004908
    -- [00:00:32.799,438] <inf> bt_vol_ctlr: VCS discover finished
    -- [00:00:33.649,291] <inf> unicast_client: location_cb : dir 1 loc 3
    
    -- [00:00:33.819,366] <inf> unicast_client: conn:AC:BF:21:51:25:40 (public), snk ctx 4039 src ctx 579
    -- [00:00:34.039,337] <inf> unicast_client: Sink #0: ep 0x20006114
    -- [00:00:34.139,343] <inf> unicast_client: Sink #1: ep 0x200061fc
    -- [00:00:34.229,339] <inf> unicast_client: Sink #2: ep 0x200062e4
    -- [00:00:34.329,345] <inf> unicast_client: Sink #3: ep 0x200063cc
    -- [00:00:34.659,271] <inf> unicast_client: Discovered 2 sink endpoint(s) for device 0
    
    -- [00:00:35.199,340] <inf> unicast_client: conn: AC:BF:21:51:25:40 (public), snk ctx 4039 src ctx 579
    -- [00:00:35.399,322] <inf> unicast_client: Source #0: ep 0x200064b4
    -- [00:00:35.519,348] <inf> unicast_client: Source #1: ep 0x2000659c
    -- [00:00:35.849,304] <inf> unicast_client: Discovered 2 source endpoint(s) for device 0
    -- [00:00:35.850,616] <wrn> bt_hci_core: opcode 0x2062 status 0x07 
    -- [00:00:35.850,616] <wrn> bt_iso: Unexpected response to hci_le_set_cig_params
    -- [00:00:35.850,646] <err> bt_bap_unicast_client: bt_iso_cig_create failed: -5
    -- [00:00:35.850,677] <err> unicast_client: Failed to create unicast group: -5
    -- [00:00:35.850,677] <err> unicast_client: Failed to start unicast sink audio: -22

    In my case, the headset exposes 4 sink endpoints and 2 source endpoints, which I assume might be contributing to this issue. It seems like the increased count is causing CIG creation to fail.

    Yes, I am using the nRF5340  for this setup.

    Let me know if there's a recommended way to handle multiple endpoints, or if I should try tuning the count values further.

    Appreciate your help !

    Best regards,
    Yash

Children
No Data
Related