nRF5340 LE Audio CIS bidirectional TWS (NCS v2.5.0)

Hi, 

I'm considering bidirectional TWS in CIS.

In other words, I want the gateway to be able to output the microphone audio from the L and R headsets.

It seems that the nRF5340 Audio DK can only render either L or R due to the codec implemented, but our custom board implements a stereo output codec.

However, only audio from the L side can be played.

I am developing based on CIS's WALKIE-TALKIE.

I found a description in the le_audio_rx_data_handler function of le_audio_rx.c that allows only the Lch signal to pass.

When I changed AUDIO_CH_L to AUDIO_CH_R, the audio from the R side headset was now played, but the audio from the L side was no longer played.

I tried disabling all of this description, but only the audio from the L side is played, and the audio from the R side is not played.

How should I edit the code to mix and play both L and R audio?

The source for realizing this application seems to have been released, but it is difficult to use as a reference because the NCS version is old.

Regards, 

Gotoda

  • Hi, 

    Seems you want two microphones to one receiver.  If so, there is an unofficial https://github.com/rick1082/sdk-nrf/commits/dual_mic_sample/ for v2.4.2. You also could ping our FAE in JP to see the demo. 

    “Beware that this code/configuration is not fully tested or qualified and should be considered provided “as-is”. Please test it with your application and let me know if you find any issues.”

    Regards,
    Amanda H.

  • Hi, 

    Rather than implementing two microphones in one receiver, I would like the gateway to output microphone signals from two headset boards at the same time, as shown in the figure below.

    Is it possible to achieve this with code editing for nrf5340_audio?

    Regards, 

    Gotoda

  • This is exactly what the above demo code would like to achieve. 

  • I'm sorry it's taken some time to reply.

    I downloaded the project files you introduced, but the following build error occurs.

     *  Executing task: nRF Connect: Build: nrf5340_audio_DualMic/build (active) 
    
    Building nrf5340_audio_DualMic
    west build --build-dir c:/Works/nRF5/vscode/nrf5340_audio_DualMic/build c:/Works/nRF5/vscode/nrf5340_audio_DualMic
    
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/Works/nRF5/vscode/nrf5340_audio_DualMic
    -- CMake version: 3.20.5
    -- Cache files will be written to: C:/Works/nRF5/ncs/v2.5.0/zephyr/.cache
    -- Zephyr version: 3.4.99 (C:/Works/nRF5/ncs/v2.5.0/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: nrf5340_audio_dk_nrf5340_cpuapp
    -- Found host-tools: zephyr 0.16.1 (C:/Works/nRF5/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (C:/Works/nRF5/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/Works/nRF5/ncs/v2.5.0/zephyr/boards/arm/nrf5340_audio_dk_nrf5340/nrf5340_audio_dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: C:/Works/nRF5/vscode/nrf5340_audio_DualMic/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/Works/nRF5/vscode/nrf5340_audio_DualMic/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/Works/nRF5/vscode/nrf5340_audio_DualMic/build/zephyr/dts.cmake
    
    warning: BT_BACKGROUND_SCAN_INTERVAL (defined at
    C:/Works/nRF5/vscode/nrf5340_audio_DualMic\src/bluetooth\bt_management\scanning\Kconfig.defaults:9,
    C:/Works/nRF5/ncs/v2.5.0/zephyr/subsys/bluetooth/host/Kconfig:740,
    subsys/bluetooth\host/Kconfig:740) was assigned the value '25' but got the value ''. Check these
    unsatisfied dependencies: ((BT_OBSERVER && NRF5340_AUDIO) || (BT_OBSERVER && BT_HCI_HOST &&
    BT_RPC_STACK) || (BT_OBSERVER && BT_HCI_HOST && BT_HCI && BT)) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_BT_BACKGROUND_SCAN_INTERVAL and/or look up
    BT_BACKGROUND_SCAN_INTERVAL in the menuconfig/guiconfig interface. The Application Development
    Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
    might be helpful too.
    
    
    warning: BT_BACKGROUND_SCAN_WINDOW (defined at
    C:/Works/nRF5/vscode/nrf5340_audio_DualMic\src/bluetooth\bt_management\scanning\Kconfig.defaults:12,
    Parsing C:/Works/nRF5/vscode/nrf5340_audio_DualMic/Kconfig
    Loaded configuration 'C:/Works/nRF5/ncs/v2.5.0/zephyr/boards/arm/nrf5340_audio_dk_nrf5340/nrf5340_audio_dk_nrf5340_cpuapp_defconfig'
    Merged configuration 'C:/Works/nRF5/vscode/nrf5340_audio_DualMic/prj.conf'
    C:/Works/nRF5/ncs/v2.5.0/zephyr/subsys/bluetooth/host/Kconfig:744,
    subsys/bluetooth\host/Kconfig:744) was assigned the value '25' but got the value ''. Check these
    unsatisfied dependencies: ((BT_OBSERVER && NRF5340_AUDIO) || (BT_OBSERVER && BT_HCI_HOST &&
    BT_RPC_STACK) || (BT_OBSERVER && BT_HCI_HOST && BT_HCI && BT)) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_BT_BACKGROUND_SCAN_WINDOW and/or look up
    BT_BACKGROUND_SCAN_WINDOW in the menuconfig/guiconfig interface. The Application Development Primer,
    Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
    helpful too.
    
    
    warning: SHELL_VT100_COLORS (defined at subsys/shell/Kconfig:141) was assigned the value 'y' but got
    the value 'n'. Check these unsatisfied dependencies: SHELL_VT100_COMMANDS (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_SHELL_VT100_COLORS and/or look up
    SHELL_VT100_COLORS in the menuconfig/guiconfig interface. The Application Development Primer,
    Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
    helpful too.
    
    
    warning: Deprecated symbol NFCT_PINS_AS_GPIOS is enabled.
    
    
    warning: Experimental symbol NRF5340_AUDIO is enabled.
    
    
    warning: Experimental symbol BT_LL_ACS_NRF53 is enabled.
    
    
    warning: Experimental symbol BT_ISO_PERIPHERAL is enabled.
    
    
    warning: Experimental symbol BT_AUDIO is enabled.
    
    
    warning: Experimental symbol BT_BAP_UNICAST_SERVER is enabled.
    
    
    warning: Experimental symbol BT_VCP_VOL_REND is enabled.
    
    
    warning: Experimental symbol BT_CSIP_SET_MEMBER is enabled.
    
    
    warning: Experimental symbol BT_MCC is enabled.
    
    
    warning: Experimental symbol BT_CAP_ACCEPTOR is enabled.
    
    
    warning: ZBUS_RUNTIME_OBSERVERS_POOL_SIZE (defined at C:/Works/nRF5/vscode/nrf5340_audio_DualMic\Kconfig.defaults:53) defined without a type
    
    error: Aborting due to Kconfig warnings
    
    CMake Error at C:/Works/nRF5/ncs/v2.5.0/zephyr/cmake/modules/kconfig.cmake:348 (message):
      command failed with return code: 1
    Call Stack (most recent call first):
      C:/Works/nRF5/ncs/v2.5.0/nrf/cmake/modules/kconfig.cmake:29 (include)
      C:/Works/nRF5/ncs/v2.5.0/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
      C:/Works/nRF5/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      C:/Works/nRF5/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
      CMakeLists.txt:46 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    FATAL ERROR: command exited with status 1: 'C:\Works\nRF5\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/Works/nRF5/ncs/toolchains/c57af46cb7/opt/bin/python.exe '-Bc:\Works\nRF5\vscode\nrf5340_audio_DualMic\build' -GNinja '-Sc:\Works\nRF5\vscode\nrf5340_audio_DualMic'
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 
    

    How should I resolve this?

  • That sample is for v2.4.2. Could you build it with NCS v2.4.2?

Related