lc3 implementation

Hi,

    I am using nrf54l15 ,here I have bare i2s code for reading data from mics and ble code for notifying that data but here I am planning to use lc3 codec to compress data and send over BLE .Can you guide me how can i use library of lc3 to encode .I found library in ncs location and do I need to compress each channel data separately ? Can you sugges any example how can i implement to bare i2s code .And i gone through Audio sample but couldn't able to find implementation for i2s as i have only one 5340 board but i need for nrf54l15 .

Parents
  • Hello,

    Just so you're aware of it, currently there's no support for LC3 and LE Audio on the nRF54L15, and there most likely will not be due to the SoC not having an Audio PLL which is mandatory for synchronisation. It may change in the future, but I give no guarantee that it will do that.

    But if you're only aiming to set up an I2S for the nRF54L15, here's a test sample that shows how the I2S driver works, which should work for the nRF54L15DK as well https://github.com/nrfconnect/sdk-zephyr/tree/main/tests/drivers/i2s/i2s_api 

    Within /boards there's overlays for the nrf54l15dk/nrf54l15/cpuapp build target

    Kind regards,
    Andreas

  • HELLO,

               I already worked with  I2s and able to get data from mic but I need to compress data using lc3 codec and notify it over BLE,as i am using 16k sampling of 2 channel(64KB) as for longer distance I am loosing data  .And using that we decode it on application side and use that data for plotting purpose ,so here sink will be application not any headset or audio thing.In this case how can I  use lc3 codec library which available in nrfxlib folder ?will that work without compressing two channels separately ?as I read somewhere we should compress each channel separately. Can I use that library for encoding?Is this correct way ? Do nrf54l15 should support lc3 ?It's not the thing like we can use lc3 library ,it will work?

Reply
  • HELLO,

               I already worked with  I2s and able to get data from mic but I need to compress data using lc3 codec and notify it over BLE,as i am using 16k sampling of 2 channel(64KB) as for longer distance I am loosing data  .And using that we decode it on application side and use that data for plotting purpose ,so here sink will be application not any headset or audio thing.In this case how can I  use lc3 codec library which available in nrfxlib folder ?will that work without compressing two channels separately ?as I read somewhere we should compress each channel separately. Can I use that library for encoding?Is this correct way ? Do nrf54l15 should support lc3 ?It's not the thing like we can use lc3 library ,it will work?

Children
  • Ah, I misunderstood your query. 

    Kashyap23 said:
    And using that we decode it on application side and use that data for plotting purpose ,so here sink will be application not any headset or audio thing.In this case how can I  use lc3 codec library which available in nrfxlib folder

    Yes, you should be able to use LC3 with nRF54L15. The lack of a PLL will cause issues with synchronization, and poorer user experience for headset applications, but as you mention your application will be a sink/gateway.

    Kashyap23 said:
    will that work without compressing two channels separately ?as I read somewhere we should compress each channel separately

    Yes, that should work, but unfortunately, as of now we don't have ny samples/demos showcasing specifically how to do this and no docs either other than for the nRF5340 audio application https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/applications/nrf5340_audio/index.html 

    I guess a similar approach can be followed and abstracted for the 54L15 with the exception of synchronisation for headset/true wireless purposes.

    Kind regards,
    Andreas 

  • I assume sample uses default usb audio but here i will be getting PCM data from mic with i2s .Can you guide me on that .And now I have been trying to buid audio application using python script by choosing as a gateway device but I couldn't build that,I am getting following error.

    c11941@VT-11941l:~/nrf_ble_samples/nrf5340_audio/tools/buildprog$ python3 buildprog.py -c both -b debug -d gateway -p
    +------------+----------+---------+--------------+---------------------+---------------------+
    |    snr     | snr conn |  device | only reboot  | core app programmed | core net programmed |
    +------------+----------+---------+--------------+---------------------+---------------------+
    |    1000    |  False   | headset | Not selected |     Not selected    |     Not selected    |
    | 1050196183 |   True   | gateway | Not selected |       Selected      |       Selected      |
    |    1000    |  False   | headset | Not selected |     Not selected    |     Not selected    |
    +------------+----------+---------+--------------+---------------------+---------------------+
    Invoking build step
    Net core uses precompiled hex or child image
    Run: west build /home/c11941/nrf_ble_samples/nrf5340_audio -b nrf5340_audio_dk/nrf5340/cpuapp --sysbuild -d /home/c11941/nrf_ble_samples/nrf5340_audio/build/dev_gateway/build_debug -DCONFIG_AUDIO_DEV=2
    usage: west [-h] [-z ZEPHYR_BASE] [-v] [-q] [-V] <command> ...
    west: unknown command "build"; do you need to run this inside a workspace?
    Traceback (most recent call last):
      File "/home/c11941/nrf_ble_samples/nrf5340_audio/tools/buildprog/buildprog.py", line 418, in <module>
        __main()
      File "/home/c11941/nrf_ble_samples/nrf5340_audio/tools/buildprog/buildprog.py", line 401, in __main
        __build_module(build_cfg, options)
      File "/home/c11941/nrf_ble_samples/nrf5340_audio/tools/buildprog/buildprog.py", line 176, in __build_module
        raise Exception("cmake error: " + str(ret_val))
    Exception: cmake error: 256

  • The issue seems to be related to you running it from a setup that does not have access to west, nrfutil and the other dependencies from the SDK.

    Could you either open a terminal profile within the VS Code extension and build from there 

    or follow the steps to set up a terminal with the manual steps from the installation guide https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/installation/install_ncs.html#install-ncs 

    Kind regards,
    Andreas

  • Hello,

             I have followed same thing now I got following error.I am using sdk v2.9 and toolchain v2.8

    c11941@VT-11941l:~/nrf_ble_samples/nrf5340_audio$ python3 /home/c11941/nrf_ble_samples/nrf5340_audio/tools/buildprog/buildprog.py -c both -b debug -d gateway -p
    +------------+----------+---------+--------------+---------------------+---------------------+
    |    snr     | snr conn |  device | only reboot  | core app programmed | core net programmed |
    +------------+----------+---------+--------------+---------------------+---------------------+
    |    1000    |  False   | headset | Not selected |     Not selected    |     Not selected    |
    | 1050196183 |   True   | gateway | Not selected |       Selected      |       Selected      |
    |    1000    |  False   | headset | Not selected |     Not selected    |     Not selected    |
    +------------+----------+---------+--------------+---------------------+---------------------+
    Invoking build step
    Net core uses precompiled hex or child image
    Run: west build /home/c11941/nrf_ble_samples/nrf5340_audio -b nrf5340_audio_dk/nrf5340/cpuapp --sysbuild -d /home/c11941/nrf_ble_samples/nrf5340_audio/build/dev_gateway/build_debug 
    /usr/bin/env: ‘python3.9’: No such file or directory
    FATAL ERROR: command exited with status 127: /home/c11941/ncs/toolchains/b81a7cd864/usr/local/bin/cmake --build /home/c11941/nrf_ble_samples/nrf5340_audio/build/dev_gateway/build_debug
    Traceback (most recent call last):
      File "/home/c11941/nrf_ble_samples/nrf5340_audio/tools/buildprog/buildprog.py", line 418, in <module>
        __main()
      File "/home/c11941/nrf_ble_samples/nrf5340_audio/tools/buildprog/buildprog.py", line 401, in __main
        __build_module(build_cfg, options)
      File "/home/c11941/nrf_ble_samples/nrf5340_audio/tools/buildprog/buildprog.py", line 176, in __build_module
        raise Exception("cmake error: " + str(ret_val))
    Exception: cmake error: 32512
            

  • To add on,If i tried to solve python error ,I got following error

    Invoking build step
    Net core uses precompiled hex or child image
    Run: west build /home/c11941/nrf_ble_samples/nrf5340_audio -b nrf5340_audio_dk/nrf5340/cpuapp --sysbuild -d /home/c11941/nrf_ble_samples/nrf5340_audio/build/dev_gateway/build_debug 
    ninja: error: loading 'build.ninja': No such file or directory
    FATAL ERROR: command exited with status 1: /home/c11941/ncs/toolchains/b81a7cd864/usr/local/bin/cmake --build /home/c11941/nrf_ble_samples/nrf5340_audio/build/dev_gateway/build_debug
    Traceback (most recent call last):
      File "/home/c11941/nrf_ble_samples/nrf5340_audio/tools/buildprog/buildprog.py", line 418, in <module>
        __main()
      File "/home/c11941/nrf_ble_samples/nrf5340_audio/tools/buildprog/buildprog.py", line 401, in __main
        __build_module(build_cfg, options)
      File "/home/c11941/nrf_ble_samples/nrf5340_audio/tools/buildprog/buildprog.py", line 176, in __build_module
        raise Exception("cmake error: " + str(ret_val))
    Exception: cmake error: 256

Related