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,

    1) Unfortunately, you would need to buy a smart remote to be able to download the source code. Other than the smart remote, I have not found any other example code for Opus on a Nordic chip.

    2) I am slightly unsure about this. My guess is that both would work, but I would add the necessary files to the Segger IDE & compile from there.

    3) From my understanding, the whole idea of make files is to keep the source file(s) up to date. It seems it is good practice to have one makefile in each directory that keeps the components inside that directory up to date. So in your case, if you have multiple directories, you might want to have one makefile per directory & have a top level make file (see link).

    4) I have explained briefly what the makefile does in 3. See this link for more details. The sdk_config file essentially changes the static settings of an application built on top of the nrf5 sdk (see link).

    If I were you, I would take a look at the Thingy FW, as the Thingy:52 device does audio streaming from a smartphone to the Thingy:52 device & vice versa. It uses different audio codecs than OPUS.

    Kind Regards,

    Bjørn Kvaale

  • Hi,

    I actually agree with you - it is not trivial to update. Still it depends much on which components you do use.

    I suggest waiting for the next version of the Smart Remote which will be released in couple of weeks. It is based on SDK 14.2.

    Kind regards,

    Pawel

  • Hi,

    I am not familiar with Segger but most such tools use their proprietary project files. I expect it should be possible to import Makefile based project. I don't know if it is automated though.

    In general as long as toolchains are compatible (use the same ABI and the same format for object files) you should be able to compile library with one tool and link it later with the other.

    If, as you say, SES is using GCC than you can use make pointing to the same GCC that SES uses. Usually this is done by specifying CROSS_COMPILE env variable but it really depends on how Makefile was written (please refer to OPUS documentation where I expect it is explained).

    There are Windows ports of GNU tools and you can install one of them if you want to obtain make and build library directly from Makefile.

    My personal suggestion is to use Linux when you create your projects using GNU tools (make, GCC, etc). It is much easier this way and build is done faster too.

    Kind regards,

    Pawel

  • That's good news. Is there any way I can be notified when that goes live?

  • Hi Bjorn

    Thanks for your answer.

    but I would add the necessary files to the Segger IDE & compile from there.

    What exactly do you mean by that? Maybe I'm still not clear on the definition of a library. Do I not need to make opus into a library before using it? How else is opus going to know on which platform it is running?

    Sorry for all the questions, by now I'm just very confused on the relation between operating systems, compilers and makefiles.

    Best,

    Nick

Related