Connect several nrf5340 DK Audio together

Hi,

We have 3 nrf5340 Audio DKs we want to connect together. One of the devices is connected as central and the two others are connected as peripheal. By know, the two peripheal-devices can stream audio, one at the time, to the central. We want the central to decide which board it has an audio connection with. If we reset the active peripheal-device, the other one connect automatically. We use the v.2.1.1 version.

Our problems are:

  • How can we use the buttons on the board to advertise (to create a ACL-link)? We want the central to store the advertising device in to a list of the type bt_addr_le_t.
  • How can the central-device choose between the different devices on the list?
  • Is there any good solutions to start and stop the audio stream, or some specific functions we can use?

We have tried to make a code from scratch in addition to tested some of the samples. A code from scratch makes it hard to create all the neccisary functions and include the right tings, and the samples are sometimes too hard to understand, or does not satisfy our problems. We are happy to hear some of your recommendations. 

-Asbjorn

  • Hi Asbjørn

    One of the developers made a demo which sounds quite close to what you are trying to implement:
    https://github.com/rick1082/sdk-nrf/tree/dual_gateway_bis_demo/applications/nrf5340_audio

    The demo consist of 2 BIS gateways sending out a stream, and one BIS headset that can select one of the streams by pressing button 4. 

    The demo will need some changes if you want to run connected streams instead (CIS). 

    It should be possible to run 2 ACL connections as well, allowing you to control the playback from the two gateways by sending a play command over the ACL connection. 

    Best regards
    Torbjørn

  • Thanks! 
    It seems like the demo can help us a little further. 

    The version NCS 1.9.99-dev1 is not available at the nRF Connect. Is there any way for downloading it? 

    And, in the demo, what is meant by building the "headset program" and the "gateway program" to the DKs? Shouldn't the whole code be uploaded to the DKs?

    -Asbjørn

  • Hi Asbjørn

    Which operating system are you using?

    It is possible to install NCS from the command line, using west. Then you can choose exactly which version to check out, you are not limited to only the official releases in the ToolChain Manager. 

    For more information about this please read this part of the documentation. 

    Asbjorn Bjorkkjar said:
    And, in the demo, what is meant by building the "headset program" and the "gateway program" to the DKs? Shouldn't the whole code be uploaded to the DKs?

    The audio application includes an application level configuration parameter called AUDIO_DEV, which is used to set the application in either a gateway or a headset mode. 

    Various parts of the audio application will check the value of this parameter to determine how the application should be configured. 

    In order to change this you can simply add a line to your prj.conf file, such as:

    CONFIG_AUDIO_DEV=1

    If you do a global search for "CONFIG_AUDIO_DEV" you can find all the parts of the code that uses this parameter. 

    Best regards
    Torbjørn

  • Thanks - it helped a lot!  (I use Windows 11)


    I am now trying to build the program from cmd prompt, and it seems like I am doing something wrong at the initializing of the parameters for core, build etc. 


    The following was tried out:

    C:\ncs\nordic_devzone\sdk-nrf-dual_gateway_bis_demo\applications\nrf5340_audio\tools\buildprog>python buildprog.py -c both -b debug -d both -p
    usage: buildprog.py [-h] [-r] [-p] [-c {app,net,both}] [--pristine] -b {release,debug} -d {headset,gateway,both} [-s [SEQUENTIAL_PROG]]
    buildprog.py: error: unrecognized arguments: -f

    How could this be written correct:

    options:
    -h, --help show this help message and exit
    -r, --only_reboot Only reboot, no building or programming
    -p, --program Will program and reboot nRF5340 Audio DK.
    -c {app,net,both}, --core {app,net,both}
    app, net, or both
    --pristine Will build cleanly
    -b {release,debug}, --build {release,debug}
    Release or debug
    -d {headset,gateway,both}, --device {headset,gateway,both}
    nRF5340 Audio on the application core can be built for either ordinary headset (earbuds/headphone..) use or gateway (USB dongle)
    -s [SEQUENTIAL_PROG], --sequential [SEQUENTIAL_PROG]
    Run nrfjprog sequentially instead of in parallel.

    I have also received this message:

    -- Configuring incomplete, errors occurred!
    ←[91mFATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' '-DWEST_PYTHON=C:\Python310\python.exe' '-BC:\ncs\nordic_devzone\sdk-nrf-dual_gateway_bis_demo\applications\nrf5340_audio\build\dev_headset\build_debug' '-SC:\ncs\nordic_devzone\sdk-nrf-dual_gateway_bis_demo\applications\nrf5340_audio' -GNinja
    ←[0mTraceback (most recent call last):


    File "C:\ncs\nordic_devzone\sdk-nrf-dual_gateway_bis_demo\applications\nrf5340_audio\tools\buildprog\buildprog.py", line 319, in <module>
    __main()
    File "C:\ncs\nordic_devzone\sdk-nrf-dual_gateway_bis_demo\applications\nrf5340_audio\tools\buildprog\buildprog.py", line 302, in __main
    __build_module(build_cfg)
    File "C:\ncs\nordic_devzone\sdk-nrf-dual_gateway_bis_demo\applications\nrf5340_audio\tools\buildprog\buildprog.py", line 130, in __build_module


    raise Exception("cmake error: " + str(ret_val))

    Do you have any suggestions?

    -Asbjørn

  • Hi Asbjørn

    How did you install the SDK? 
    The folder naming is a bit untraditional...

    To set up the nRF Connect SDK in the standard way, using the right repository and branch for this demo, you can run the following commands from an empty folder:

    west init -m https://github.com/rick1082/sdk-nrf/ --mr dual_gateway_bis_demo
    west update

    Also, when you run the buildprog command I believe you need to be in the nrf/applications/nrf5340_audio folder, rather than inside the tools/buildprog folder. Then the build command should look something like this:

    python tools/buildprog/buildprog.py -c both -b debug -d both

    Best regards
    Torbjørn

Related