nRF5340 AUDIO ,AUDIO FRAME DURATION

My project base on NCS V2.2.0.BIS mode,gateway

My "AUDIO FRAME DURATION" is 10ms.But my audio source is not i2s or usb.

My audio come from uart,1M bit/s.It will take 2-3ms.

and Lc3 encode take 5-6 ms.then time is not enough.

Can I modify this:AUDIO_FRAME_DURATION_US(I tried ,but failed),or an I reduce LC3 encode time.

any advice will be helpful.

Parents Reply Children
  • Hello again, 

    Here is the initial answers from our audio team:

    No, the audio frame duration is highly related with
    • The synchronization and drift compensation mechanism in audio_datapath module
    • The frame size setting for LC3 ENC/DEC
    • I2S sampling number
    And it is very strange that the customer needs 5~6ms for encoding the data.
    There way to reduce the LC3 encoded time is to low down the bitrate.
    But it is still hard to understand what would the customer want to achieve, seems the audio is not from I2S but from UART.
    In addition: The audio frame duration is set by the LE Audio standards. It is not user adjustable. (It is possible to choose other codecs and other frame sizes, but that is a proprietary extension and out side the specs. For a qualifiable solution, the standardized frame size must be supported.)
    Would it be possible for you to share more details of what you are trying to achieve? Our audio team would like to assist, however, more details are needed.
    Kind regards,
    Øyvind
  • Hello,

    huniu said:
    Can I low down the i2s bitrate to 44.1K?

    We currently do not have support for 44.1 kHz sampling frequency, no.
    Is there a particular reason why you would like to use 44.1kHz instead of 48?

    Please also see the question from my colleague Øyvind about elaborating on your requirements and constraints so that we may better be able to help you.

    Best regards,
    Karl

  • 1.Yes,My audio from uart.

    2.LC3 encode need 6ms,I invert IO in "encoder_thread",it takes about 6ms.Then I have no time do my own work,such as another encode.

    3.My codec only suport 44.1K,So I need 44.1K.

  • Thank you for elaborating.

    huniu said:
    2.LC3 encode need 6ms,I invert IO in "encoder_thread",it takes about 6ms.Then I have no time do my own work,such as another encode.

    I am not sure that I understand what you mean when you say 'I invert IO in 'encoder_thread'', could you clarify?
    The rule of thumb is that using the provided LC3 implementation it will require roughly 30% of the CPU time to encode a 96 kbps stream (at 48 kHz sampling), and roughly 15% to decode the same stream. So, if you are only encoding 1 or 2 streams you should still have ample time to do your own application work.

    huniu said:
    3.My codec only suport 44.1K,So I need 44.1K.

    To be specific, is this a hardware codec you are referring to, or a software codec (like the LC3, or an equivalent)?
    In case of the latter please note that you must have the LC3 as the primary codec on your device if you intend to qualify as a LE Audio product (you are allowed to have proprietary secondary codecs in addition to the LC3, of course).

    Best regards,
    Karl

Related