Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Opus implementation with BLE (SDK 14.2)

Hi,

I'm currently working on an application that collects audio data and sends it to a central device via BLE. Since audio compression has great potential to reduce power consumption, I would like to implement opus (libopus 1.2.1) on the nRF DK 52 (nRF52832). I have a couple of questions regarding that.

After downloading libopus 1.2.1 I'm left with a folder structure, including different makefiles, sourcefiles, etc.

I have some questions regarding the actual implementation into Segger Embedded Studio.

1. Is there example code available for an implementation of Opus on a Nordic chip (using both BLE and opus)? (Smart Remote apparently, but I cannot find any example code)

2. What is a normal way to go about such an implementation? Should I precompile the library and then add it to the Nordic libraries? or can I add the whole folder structure to the Segger IDE and compile it in there?

3. If I'm not mistaken I have a separate makefile for Opus either way. Do I need to merge the makefiles from the BLE Nordic example and Opus or how can I go about this?

4. Very general question, what's the relation between the sdk_config file and the makefile?

By now it's probably clear that I do not have much experience in coding for embedded systems. Just tell me if you need more details or clarifications on some things.

Thanks for the help!

  • Hi,

    It is great to hear that you are interested in Nordic's Smart Remote reference design. Please find the answers to your questions below.

    1. Is there example code available for an implementation of Opus on a Nordic chip (using both BLE and opus)? (Smart Remote apparently, but I cannot find any example code)

    Smart remote can be configured to use OPUS as an audio codec and it sends audio over BLE. Note that nRFready Smart Remote 3 for nRF52 Series is a reference design and its code is not available within the SDK package. You can find more information on how to obtain the source code on the Smart Remote product page.

    2. What is a normal way to go about such an implementation? Should I precompile the library and then add it to the Nordic libraries? or can I add the whole folder structure to the Segger IDE and compile it in there?

    OPUS library is compiled within the Smart Remote project. You don't need to copy any OPUS related files as Smart Remote sources come with them included.

    If you are working on your own project, you will have to create your own design (i.e. which components are used and how they are integrated together).

    3. If I'm not mistaken I have a separate makefile for Opus either way. Do I need to merge the makefiles from the BLE Nordic example and Opus or how can I go about this?

    Smart Remote sources have project files prepared to be used with Keil and GCC. You don't need to compile OPUS out of Smart Remote tree as OPUS files will be compiled along with other sources. To have all Smart Remote features build in you will however have to obtain the AirMotion library (please refer to product documentation). This library is not needed for OPUS nor BLE so if you are interested in audio transmission only you will not need it.

    4. Very general question, what's the relation between the sdk_config file and the makefile?

    The sdk_config header file contains project configuration (i.e. set of options that define how project sources are built and which features are compiled in and with what properties). Makefile is a file that tells make (a tool) how to convert source code into binaries. The same sdk_config header file can be used for different project construction environments (e.g. GCC, Keil, IAR, SES, etc). Makefile is specific for make and describe dependencies between different files within a project.

    I hope this will help you to get started.

    Kind regards,

    Pawel

  • Thanks for the reply Pawel.

    Did I read correctly that I would have to purchase the nRF ready Smart Remote 3 (300$) in order to obtain the reference design?

    Unfortunately that would be a bit too much for my project budget.

    So to rephrase my questions:

    1. How do I get from the folder structure above to a project with BLE capabilities? Or asked differently: How do I integrate the opus codec in an existing BLE SDK project?

  • Hi,

    Yes, firmware and source code is available after purchase of the reference design.

    Going back to your question. That is a question on how you would like to have you project organized.

    Assuming that you have everything except the OPUS library, you will have to either:
    - modify the project files to tell tool to build OPUS sources together with your project, or
    - build the library out of your project tree (e.g. with make provided with OPUS) and later link your project against this library (again you will have to change project files to tell linker where the library is located).

    Changing project files depends on what tool you do use.

    Kind regards,

    Pawel

  • Thanks,

    Building externally seems to be the more straightforward solution for me.

    (e.g. with make provided with OPUS)

    Can you clarify on that? do I try to build this library in Segger ES inside a new project with the provided make files?

    Or outside Segger ES? in that case which tools do I need to build an application externally for an nRF 52832? (On Windows 10, Segger using gcc compiler, language standard gnu99)

    I assume I need to compile it with gcc somehow.

    Best,

    Nick

  • I would say pay the money nick7, it's well worth the time and effort saved! That said, the reference design code is built on SDK 12.2. So Pawel, how does one get a reference design built on the latest SDK... and before you say it, I disagree, it is NOT trivial to update.

Related