This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to play 52840+broadvoice?

I have a BLE device with a MIC, which collects voice data and coded to BroadVoice 32k.

So I want to design a central to get this voice data.

What I think is use 52840 and external I2S decoder to do it. 

I have some concerns:

1.Is there any example how to play broadvoice codec with 52840?

2.Does 52840 have enough capability to do the decode thing?

Thanks.

Parents Reply Children
  • Hi

    To my knowledge this code has never been tested in NCS, so possibly there is some configuration that is not set up correctly for the dynamic memory allocation to work. 

    Do you know if this is the first time malloc() is called in your project, or could this have been run multiple times?

    Do you know which standard library is used? Do you have NEWLIB enabled?

    Best regards
    Torbjørn

  • Hello,

    thanks for reply,

    yes,even do malloc(3210) first time ,it return NULL;

    when add [CONFIG_NEWLIB_LIBC=y] to prj.conf

    it runing fine!  

    but each time bv32_encode takes ten times more time  than bv32_decode,this result is the same in SDK17.0.2.

    i do't  konw why.

     

    thanks

    Best regards

  • Hi

    Good to hear that enabling newlib fixed your issue Slight smile

    Please note that in NCS you should use k_malloc() instead of malloc(), sorry for not specifying this earlier. 

    It is quite common for encoding to be a heavier task than decoding, most audio and video codecs work this way. 

    In many applications you only encode once to store a compressed file, and then run the decoder every time you open the file, which means that it is more important to optimize the decoder algorithm than the encoder algorithm. 

    In audio applications you typically have more resources (processing power, energy) available in the device that produces the audio, compared to the one that plays it back, which also makes it sensible to speed up the decoder operation at the cost of the encoding. 

    Best regards
    Torbjørn

  • Hi,

    thanks for reply,

    when i add the line to Pro.conf

    CONFIG_NEWLIB_LIBC=y

    it work well,

      

    thanks

    Best regards

Related