sd card on nrf5340 audio dk

I have ncs version 2.6.0

i have two nrf5340 audio dks

i used nrf5340_audio dk sample.

Configured on dk as gateway that takes input fotm microphone used on the audio dk and sends the audio using BIS streams.

This audio is received on another audio dk which i configured as headset. i can listen to the audio using an earphone on this dk.

Now, i want to save the audio received on the headset dk using the sd card on the dk. 

I followed Link. But i am not able to build this sample.

Kindly help out with a possible workaround to save the BLE audio data received on audio dk.

  • Also, i found that in \v2.6.0\nrf\applications\nrf5340_audio\src\modules there are functions for sd card but how to use them in a way that they can save BLE data.

  • Hi,

    Could you provide full build log which shows the error?

    Bretley said:
    Also, i found that in \v2.6.0\nrf\applications\nrf5340_audio\src\modules there are functions for sd card but how to use them in a way that they can save BLE data.

    Which functions do you refer to?

    Best regards,
    Dejan


  • Communication Lab 22@DESKTOP-0AQ27MM MINGW64 /
    $ cd C:

    Communication Lab 22@DESKTOP-0AQ27MM MINGW64 /c
    $ cd ncssem

    Communication Lab 22@DESKTOP-0AQ27MM MINGW64 /c/ncssem
    $ cd v2.4.0

    Communication Lab 22@DESKTOP-0AQ27MM MINGW64 /c/ncssem/v2.4.0
    $ cd nrf

    Communication Lab 22@DESKTOP-0AQ27MM MINGW64 /c/ncssem/v2.4.0/nrf ((v2.4.0))
    $ cd applications

    Communication Lab 22@DESKTOP-0AQ27MM MINGW64 /c/ncssem/v2.4.0/nrf/applications ((v2.4.0))
    $ cd ncs-le-audio-sd-card-playback-master

    Communication Lab 22@DESKTOP-0AQ27MM MINGW64 /c/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master ((v2.4.0))
    $ cd tools

    Communication Lab 22@DESKTOP-0AQ27MM MINGW64 /c/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master/tools ((v2.4.0))
    $ cd buildprog

    Communication Lab 22@DESKTOP-0AQ27MM MINGW64 /c/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master/tools/buildprog ((v2.4.0))
    $ python buildprog.py -c app -b debug -d both
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master
    -- CMake version: 3.20.5
    -- Using NCS Toolchain 2.6.20240304.889616714482 for building. (C:/NCSsemi/toolchains/cf2149caf2/cmake)
    -- Found Python3: C:/NCSsemi/toolchains/cf2149caf2/opt/bin/python.exe (found suitable exact version "3.9.13") found components: Interpreter
    -- Cache files will be written to: C:/ncssem/v2.4.0/zephyr/.cache
    -- Zephyr version: 3.3.99 (C:/ncssem/v2.4.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.7.1")
    -- Board: nrf5340_audio_dk_nrf5340_cpuapp
    -- Found host-tools: zephyr 0.16.5 (C:/NCSsemi/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (C:/NCSsemi/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found Dtc: C:/NCSsemi/toolchains/cf2149caf2/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncssem/v2.4.0/zephyr/boards/arm/nrf5340_audio_dk_nrf5340/nrf5340_audio_dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master/build/dev_headset/build_debug/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master/build/dev_headset/build_debug/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master/build/dev_headset/build_debug/zephyr/dts.cmake

    warning: Experimental symbol NRF5340_AUDIO is enabled.


    warning: Experimental symbol BT_AUDIO is enabled.


    warning: Experimental symbol BT_MCC is enabled.


    warning: BT_AUDIO_UNICAST_SERVER (defined at C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master\src/bluetooth\Kconfig.defaults:78) defined without a type

    warning: BT_VCS (defined at C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master\src/bluetooth\Kconfig.defaults:101) defined without a type

    warning: BT_AUDIO_UNICAST_CLIENT (defined at C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master\src/bluetooth\Kconfig.defaults:134) defined without a type

    warning: BT_AUDIO_UNICAST_CLIENT_GROUP_STREAM_COUNT (defined at C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master\src/bluetooth\Kconfig.defaults:150) defined without a type

    warning: BT_AUDIO_UNICAST_CLIENT_ASE_SNK_COUNT (defined at C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master\src/bluetooth\Kconfig.defaults:153) defined without a type

    warning: BT_AUDIO_UNICAST_CLIENT_ASE_SRC_COUNT (defined at C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master\src/bluetooth\Kconfig.defaults:157) defined without a type

    warning: BT_VCS_CLIENT (defined at C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master\src/bluetooth\Kconfig.defaults:161) defined without a type

    warning: BT_AUDIO_BROADCAST_SINK (defined at C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master\src/bluetooth\Kconfig.defaults:209) defined without a type

    warning: BT_AUDIO_BROADCAST_SNK_STREAM_COUNT (defined at C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master\src/bluetooth\Kconfig.defaults:212) defined without a type

    warning: BT_AUDIO_BROADCAST_SOURCE (defined at C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master\src/bluetooth\Kconfig.defaults:232) defined without a type

    warning: BT_AUDIO_BROADCAST_SRC_STREAM_COUNT (defined at C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master\src/bluetooth\Kconfig.defaults:238) defined without a type

    error: Aborting due to Kconfig warnings

    Parsing C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master/Kconfig
    Loaded configuration 'C:/ncssem/v2.4.0/zephyr/boards/arm/nrf5340_audio_dk_nrf5340/nrf5340_audio_dk_nrf5340_cpuapp_defconfig'
    Merged configuration 'C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master/prj.conf'
    Merged configuration 'C:/ncssem/v2.4.0/nrf/applications/ncs-le-audio-sd-card-playback-master/build/dev_headset/build_debug/zephyr/misc/generated/extra_kconfig_options.conf'
    CMake Error at C:/ncssem/v2.4.0/zephyr/cmake/modules/kconfig.cmake:339 (message):
    command failed with return code: 1
    Call Stack (most recent call first):
    C:/ncssem/v2.4.0/nrf/cmake/modules/kconfig.cmake:29 (include)
    C:/ncssem/v2.4.0/zephyr/cmake/modules/zephyr_default.cmake:115 (include)
    C:/ncssem/v2.4.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    C:/ncssem/v2.4.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:42 (find_package)


    -- Configuring incomplete, errors occurred!
    FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' '-DWEST_PYTHON=C:\Users\Communication Lab 22\AppData\Local\Programs\Python\Python311\python.exe' '-BC:\ncssem\v2.4.0\nrf\applications\ncs-le-audio-sd-card-playback-master\build\dev_headset\build_debug' -GNinja -DBOARD=nrf5340_audio_dk_nrf5340_cpuapp -DCONFIG_AUDIO_DEV=1 '-SC:\ncssem\v2.4.0\nrf\applications\ncs-le-audio-sd-card-playback-master'
    No programmer/debugger connected to PC
    No snrs connected
    +------------+----------+---------+--------------+---------------------+---------------------+
    | snr | snr conn | device | only reboot | core app programmed | core net programmed |
    +------------+----------+---------+--------------+---------------------+---------------------+
    | 1000 | False | headset | Not selected | Selected TBD | Not selected |
    | 1050133272 | False | gateway | Not selected | Selected TBD | Not selected |
    | 1000 | False | headset | Not selected | Selected TBD | Not selected |
    +------------+----------+---------+--------------+---------------------+---------------------+
    Invoking build step
    Run: west build C:\ncssem\v2.4.0\nrf\applications\ncs-le-audio-sd-card-playback-master -b nrf5340_audio_dk_nrf5340_cpuapp -d C:\ncssem\v2.4.0\nrf\applications\ncs-le-audio-sd-card-playback-master\build\dev_headset\build_debug -DCONFIG_AUDIO_DEV=1
    Traceback (most recent call last):
    File "C:\ncssem\v2.4.0\nrf\applications\ncs-le-audio-sd-card-playback-master\tools\buildprog\buildprog.py", line 394, in <module>
    __main()
    File "C:\ncssem\v2.4.0\nrf\applications\ncs-le-audio-sd-card-playback-master\tools\buildprog\buildprog.py", line 377, in __main
    __build_module(build_cfg, options)
    File "C:\ncssem\v2.4.0\nrf\applications\ncs-le-audio-sd-card-playback-master\tools\buildprog\buildprog.py", line 146, in __build_module
    raise Exception("cmake error: " + str(ret_val))
    Exception: cmake error: 1

  • Also, 

    C:\NCSsemi\v2.6.0\nrf\applications\nrf5340_audio\src\modules\sd_card.c and sd_card_playback.c exists.

    Our concern :

    Kindly help out with a possible workaround to save the audio data received on audio dk in the sd card.

  • Hi,

    You could try to write LC3 directly to the flash or decode it to WAV first and store it using the API found in the src/modules/sd_card.c. 

    Best regards,
    Dejan

Related