LC3 initialization causes a restart

Hi,

    I tried porting LC3 to my own 5340 project with reference to the SDK(nrf5340_audio_nrf5340_audio_dk_0.4.0), but I had a restart problem when initializing LC3  

    

static void lc3_encoder_configure(void)
{
    int ret;
    printk("lc3_encoder_configure init");
    sw_codec_lc3_init(NULL, NULL, LC3_FRAME_SIZE_US);

	ret = sw_codec_lc3_enc_init(PCM_SAMPLE_RATE, PCM_BIT_DEPTH,LC3_FRAME_SIZE_US, LC3_BITRATE, 
				    SW_CODEC_MONO, &pcm_bytes_req_enc);
	exit_if(ret,"lc3_enc_init did not return zero");


}

sw_codec_lc3_init(NULL, NULL, LC3_FRAME_SIZE_US);   The NULL argument passed in here causes memory to be allocated dynamically during initialization,I strongly suspect the reboot has something to do with it.
I'd like to ask you:
   Q1: Differences between malloc and k_malloc in Zephyr systems(LC3 uses malloc)? Can the malloc region fall within the defined CONFIG_HEAP_MEM_POOL_SIZE  ?
   Q2: Can the space of k_malloc in thread A be freed by K_FREE in thread B  ?
Parents
  • Hello,

    reference to the SDK(nrf5340_audio_nrf5340_audio_dk_0.4.0)

    The Audio SDK module is now available in the nRF Connect SDK, through the newly released v1.9.99-dev1 tag, and as such the previous v0.4.0 firmware is now deprecated. I would strongly recommend that you switch to using the NCS version of the Audio SDK module before you continue your development, in order to benefit from all the newest improvements and features.

    I tried porting LC3 to my own 5340 project with reference to the SDK

    Could you clarify whether this means that you are trying to get the Audio application working on your custom nRF5340 based hardware, or if you are trying to port the application to an nRF5340 DK?

    Best regards,
    Karl

    • Thank you very much. I'm going to download the latest NCS;

    • Could you clarify whether this means that you are trying to get the Audio application working on your custom nRF5340 based hardware, or if you are trying to port the application to an nRF5340 DK?
    • I am trying to get the LC3 codec application working on my custom nRF5340 based hardware
  • GinoWang said:
    Thank you very much.

    No problem at all, I am happy to help! :)

    GinoWang said:
    I'm going to download the latest NCS;

    Please note that you will have to get the v1.9.99-dev1 tag from the nrfconnect repository directly, which is not available in the Toolchain Manager. If you have already got the v1.9.1 version downloaded through the toolchain manager you can get the devtag set up by following the steps in the 'Get the nRF Connect SDK Code' section of the Getting started documentation. Make sure to complete all the 5 steps, and to change the 'v1.9.1' with 'v1.9.99-dev1' in the example command shown for step 3.

    Please do not hesitate to let me know if you should encounter any issues with getting the v1.9.99-dev1 tag up and running!

    GinoWang said:
    I am trying to get the LC3 codec application working on my custom nRF5340 based hardware

    Thank you for clarifying, this is helpful for me to know.
    Let me know if you encounter any issues or questions with this once you have moved to working with the devtag.

    Best regards,
    Karl

  • Hi Karl,

        I was able to run LC3(from nrf5340_audio_nrf5340_audio_dk_0.4.0) encoder&decoder successfully using an older version of the proprietary code, So I stopped downloading the latest Le Audio SDK.

        The current latest private code has an initialization LC3 restart problem,Can you teach me some ways to locate the problem.

    By the way, Please answer the Q1&Q2 in the title.

  • Hello again,

    Thank you for the extreme patience with this.

    GinoWang said:

        I was able to run LC3(from nrf5340_audio_nrf5340_audio_dk_0.4.0) encoder&decoder successfully using an older version of the proprietary code, So I stopped downloading the latest Le Audio SDK.

    I must strongly recommend that you switch to the NCS version if possible. The v0.4.0 is deprecated, and will not receive any further updates with improvements and new features, while the NCS version will.
    Unless you have very strong reasons not to, please reconsider upgrading to the NCS version.

    GinoWang said:
    The current latest private code has an initialization LC3 restart problem,Can you teach me some ways to locate the problem.

    What does the log say, when it attempts to initialize the LC3? How does the board behave when this happens? Please elaborate as much as possible, so that I may better understand the situation.

    GinoWang said:
    By the way, Please answer the Q1&Q2 in the title.

    Apologies, I must have overlooked these questions.

    Q1: These are two different heaps, correct.
    You can read more about the system heap here, and the LC3s heap usage here.

    Q2: Yes

    Best regards,
    Karl

Reply
  • Hello again,

    Thank you for the extreme patience with this.

    GinoWang said:

        I was able to run LC3(from nrf5340_audio_nrf5340_audio_dk_0.4.0) encoder&decoder successfully using an older version of the proprietary code, So I stopped downloading the latest Le Audio SDK.

    I must strongly recommend that you switch to the NCS version if possible. The v0.4.0 is deprecated, and will not receive any further updates with improvements and new features, while the NCS version will.
    Unless you have very strong reasons not to, please reconsider upgrading to the NCS version.

    GinoWang said:
    The current latest private code has an initialization LC3 restart problem,Can you teach me some ways to locate the problem.

    What does the log say, when it attempts to initialize the LC3? How does the board behave when this happens? Please elaborate as much as possible, so that I may better understand the situation.

    GinoWang said:
    By the way, Please answer the Q1&Q2 in the title.

    Apologies, I must have overlooked these questions.

    Q1: These are two different heaps, correct.
    You can read more about the system heap here, and the LC3s heap usage here.

    Q2: Yes

    Best regards,
    Karl

Children
No Data
Related