Integrate NUS into BLE Audio code

Hi,

I'm working with nRF5340 Audio DK.

I'm able to successfully run the audio example in BIS mode (with gateway and headset devices), and also to run the Peripheral UART Bluetooth example separately on my DK.

My goal is to open another BT connection, in parallel to the audio broadcast on my gateway device, to which I can connect with the nRF Toolbox App.

Is it possible? If so, which BT controller should be used? How should proj.conf should look like? What other configurations are required?

I've noticed that the UART example code uses adv.c for advertising, while the audio example code uses bt_mgmt.c.

Thank you,

Dekel

  • Hello Dekel,

    Thanks for the good news! 

    Dekel said:
    1. Regarding the automatic ACL connection that the gateway establishes - is it name-based? does it mean that it will try to connect to all units with the name "Nordic_UART_Service"?

    Yes, it corresponds with REMOTE_DEVICE_NAME_PEER.

    Dekel said:
    2. How can I test the other direction of messaging? Namely, sending data from the gateway to the peripheral over ACL?
    3. In order to integrate the ACL into the BLE Audio system, it's necessary for the headset units to be able to serve as preipherals. Is this implementation easier now that we have your implementation on gateway side?
    4. Following my previous question, I'll share that in order to achieve the goal of our project, a full solution of this would be to be able to configure the gateway unit both as central and peripheral in terms of ACL connection (for connection with a smartphone app). Is it achieveable? What will it require?

    The screen shot I shared below was about sending data from the gateway(ACL central) to the peripherals. If you want to send the other way, it's already implemented. Once data is transmitted from any peripheral, you will see it in ble_data_received.

    I simply tried and confirmed it works as intended like this. :)

    [P.S] you don't need to use the option,-ctlr="SDC" any more because it's default option since NCS 2.6.0.

    //Brian

  • Hi Brian,

    If you want to send the other way, it's already implemented

    I can see that on my devices, similar to the screenshot you've shared.Thumbsup tone2

    [P.S] you don't need to use the option,-ctlr="SDC" any more because it's default option since NCS 2.6.0.

    Good to know Slight smile

    3. In order to integrate the ACL into the BLE Audio system, it's necessary for the headset units to be able to serve as preipherals. Is this implementation easier now that we have your implementation on gateway side?
    4. Following my previous question, I'll share that in order to achieve the goal of our project, a full solution of this would be to be able to configure the gateway unit both as central and peripheral in terms of ACL connection (for connection with a smartphone app). Is it achieveable? What will it require?

    I would truely appreciate your help with these topics, they're crucial to our project's progress.

    Thank you,

    Dekel

  • Hi Dekel,

    I came across the following repository through a DevZone post (I am unable to find the original post through a simple google search)

    https://github.com/nrfconnect/sdk-nrf/compare/v2.3-branch...rick1082:sdk-nrf:audio_with_nus_example?diff=split&w=

    This combines the audio example with NUS example with minimal changes. You will still have to play around with the settings like `CONFIG_BT_BUF_ACL_RX_SIZE`, `CONFIG_BT_BUF_ACL_TX_SIZE`, `CONFIG_BT_AUDIO_BITRATE_UNICAST_SINK` based on your requirements. You can refer to samples like ble-throughput to understand what each of these configs do. 

    This was written based on nrf SDK v2.3.0, and I was able to get it to work with the latest v2.6.0 SDK. I am able to communicate simultaneously transfer data over ACL while playing/receiving audio between two Audio DKs.

  • Thanks for the good news, Dekel!

    Now that it seems to be fixed, please close this case. You can create new case any time if you faced another issue. :)

  • Hi Brian,

    It's actually not completely fixed.

    We've figured out that it will be easier if the broadcaster side, which is in peripheral role in terms of audio, will also be the peripheral in terms of ACL connection. Meaning, we'd like it to advertise both audio stream and ACL connection for commands.

    I was able to take the code you've supplied and apply it on the headset side. Namely, I have now a headset which is also able to connect through ACL as central (in parallel to audio stream receival) and communicate through NUS.

    I would appreciate your help with the broadcast side implementation.

    I tried it myself and I'm on the brink of success, but calling bt_le_ext_adv_create() twice (once for audio and once for ACL) fails with EIO (I/O error). It's unclear to me why it happens.

    I came across the following repository through a DevZone post (I am unable to find the original post through a simple google search)

    Thank you for that! I took a look on it, but since it relates to CIS while my project is BIS, it's difficult for me to understand the necessary modifications.

Related